Exemplo n.º 1
0
 public void ShowAtoms()
 {
     if (UIData.atomtype == UIData.AtomType.noatom)
     {
         UIData.atomtype   = previous_AtomType;
         previous_AtomType = UIData.AtomType.noatom;
         DisplayMolecule.ShowAtoms();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Switch the protein representation to Hyperball. Used in switch mode (LOD).
 /// </summary>
 public void ToNotParticle()
 {
     if (UIData.atomtype != UIData.AtomType.particleball && UIData.atomtype != previous_AtomType)
     {
         previous_AtomType = UIData.atomtype;
         previous_BondType = UIData.bondtype;
     }
     DisplayMolecule.ToNotParticle(previous_AtomType, previous_BondType);
 }
Exemplo n.º 3
0
 public void HideAtoms()
 {
     if (UIData.atomtype != UIData.AtomType.noatom)
     {
         Debug.Log("Hiding all atoms now.");
         DisplayMolecule.HideAtoms();
         previous_AtomType = UIData.atomtype;
         UIData.atomtype   = UIData.AtomType.noatom;
     }
 }
Exemplo n.º 4
0
    public void Display()
    {
        DisplayMolecule.Display();
        DisplayMolecule.DisplayFieldLine();
//		Deta=MoleculeModel.target;
        isControl = true;

        GUIMoleculeController.InitMoleculeParameters();
        SetCenter(0);
    }
Exemplo n.º 5
0
 /// <summary>
 /// Switch the protein representation to Particle. Used in switch mode (LOD).
 /// </summary>
 public void ToParticle()
 {
     if (UIData.atomtype != UIData.AtomType.particleball)
     {
         previous_AtomType = UIData.atomtype;
         previous_BondType = UIData.bondtype;
     }
     DisplayMolecule.ToParticle();
     // Debug.Log("ToParticle()");
 }
Exemplo n.º 6
0
    void OnGUI()
    {
        GUI.skin = mySkin;

        if (!fontInitialized)
        {
            Rectangles.SetFontSize();
            fontInitialized = true;
        }

        if (GUIMoleculeController.m_fileBrowser != null)
        {
            GUIMoleculeController.m_fileBrowser.OnGUI();
        }



        if (gUIDisplay.m_fileBrowser != null)
        {
            GUIMoleculeController.FileBrowser_show = true;
            gUIDisplay.m_fileBrowser.OnGUI();
        }
        else
        {
            GUIMoleculeController.FileBrowser_show = false;
        }

        UIData.EnableUpdate = false;
        if ((!UIData.hiddenUI) && (!UIData.hiddenUIbutFPS))
        {
            gUIDisplay.Display();
        }

        if ((!UIData.hiddenUI) && (UIData.hiddenUIbutFPS))
        {
            GUIMoleculeController.toggle_INFOS = true;
        }

        if (!UIData.hiddenUI)
        {
            if (GUIMoleculeController.showPanelsMenu)
            {
                GUIMoleculeController.SetPanels();
            }
        }

        if (!UIData.hiddenUI)
        {
            if (GUIMoleculeController.showResiduesMenu)
            {
                GUIMoleculeController.SetResidues();
            }
        }

        if (!UIData.hiddenUI)
        {
            if (GUIMoleculeController.showAtomsExtendedMenu)
            {
                GUIMoleculeController.SetAtomsExtended();
            }
        }

        if (!UIData.hiddenUI)
        {
            if (GUIMoleculeController.showChainsMenu)
            {
                GUIMoleculeController.SetChains();
            }
        }

        if (UIData.changeStructure)
        {
            DisplayMolecule.ResetDisplay();
            UIData.changeStructure        = false;
            UIData.isParticlesInitialized = false;
        }

        if (UIData.isclear)
        {
            DisplayMolecule.DestroyFieldLine();
            DisplayMolecule.DestroyObject();
            DisplayMolecule.DestroyRingBlending();
            DisplayMolecule.DestroySugarRibbons();
            DisplayMolecule.DestroyOxySpheres();
            DisplayMolecule.DestroyBondObject();
            DisplayMolecule.DestroySurfaces();
            DisplayMolecule.DestroyElectIso();
            DisplayMolecule.ClearMemory();

            // ----- Clearing all variables -----
            UIData.isCubeLoaded                = false;
            UIData.isSphereLoaded              = false;
            UIData.isHBallLoaded               = false;
            LoadTypeGUI.buildSurfaceDone       = false;
            LoadTypeGUI.surfaceTextureDone     = false;
            LoadTypeGUI.toggle_RING_BLENDING   = false;
            LoadTypeGUI.toggle_NA_HIDE         = false;
            LoadTypeGUI.toggle_TWISTER         = false;
            LoadTypeGUI.toggle_HIDE_HYDROGEN   = false;
            LoadTypeGUI.toggle_OXYGEN          = false;
            LoadTypeGUI.ColorationModeBond     = 0;
            LoadTypeGUI.ColorationModeRing     = 0;
            UIData.isParticlesInitialized      = false;
            GUIMoleculeController.globalRadius = 1.0f;
            UIData.secondarystruct             = false;
            UIData.atomtype = UIData.AtomType.noatom;
            UIData.bondtype = UIData.BondType.nobond;
            MoleculeModel.existingName.Clear();
            MoleculeModel.existingRes.Clear();
            MoleculeModel.existingChain.Clear();
//			id="";
            //T.T test debug
            Molecule.Model.MoleculeModel.atomsLocalScaleList.Clear();
            RequestPDB.isDone = false;

            UIData.isclear = false;
            Debug.Log("UIData.isclear");
        }

        if (UIData.resetDisplay && UIData.isCubeToSphere)
        {
            DisplayMolecule.CubeToSphere();
            Debug.Log("UIData :: resetDisplay && iscubetoSphere");
        }

        if (UIData.resetDisplay && UIData.isSphereToCube)
        {
            DisplayMolecule.SphereToCube();
            Debug.Log("UIData :: reset display && is spheretocube");
        }

        if (UIData.resetBondDisplay)
        {
            DisplayMolecule.ResetBondDisplay();
            Debug.Log("UIData :: reset bonddisplay ");
        }

        if (UIData.isOpenFile)
        {
            StartCoroutine(loadLoadFile());
        }

        if (UIData.backGroundIs)
        {
            LocCamera.GetComponent <Skybox>().enabled = true;
        }
        else
        {
            LocCamera.GetComponent <Skybox>().enabled = false;
        }

        UIData.EnableUpdate = true;

        if (UIData.interactive && UIData.resetInteractive)
        {
            DisplayMolecule.AddAllPhysics();
            UIData.resetInteractive = false;
        }
        else if (!UIData.interactive && UIData.resetInteractive)
        {
            DisplayMolecule.DeleteAllPhysics();
            UIData.resetInteractive = false;
        }

        if (UIData.meshcombine)
        {
            DisplayMolecule.AddCombineMesh();
            UIData.resetMeshcombine = false;
        }
        else if (!UIData.meshcombine)
        {
            DisplayMolecule.DeleteCombineMesh();
            UIData.resetMeshcombine = false;
        }

        /*if (requestPDB.Loading) {
         * GUI.Label(new Rect(100, 15, 200, 30), "", "bj");
         * GUI.Label(new Rect(100,15, requestPDB.progress * 200, 30), "", "qj");
         * }*/

//		if(GUI.tooltip != "")GUI.Label ( new Rect(180,Screen.height-35,Screen.width-360,20), GUI.tooltip);
//		if(MoleculeModel.newtooltip != "")GUI.Label ( new Rect(180,Screen.height-35,Screen.width-360,20), MoleculeModel.newtooltip);
        if (GUI.tooltip != "")
        {
            GUI.Box(new Rect(180, Screen.height - 55, 450, 25), GUI.tooltip);
        }
        if (MoleculeModel.newtooltip != "")
        {
            GUI.Box(new Rect(180, Screen.height - 55, 450, 25), MoleculeModel.newtooltip);
        }
    }