示例#1
0
 public DiagnosticLine(Point startPoint, Point endPoint, BondLineStyle style, string colour = "000000")
 {
     Start  = startPoint;
     End    = endPoint;
     Style  = style;
     Colour = colour;
 }
示例#2
0
 public BondLine(BondLineStyle style, Point startPoint, Point endPoint, Bond bond)
 {
     Style  = style;
     _start = startPoint;
     _end   = endPoint;
     Bond   = bond;
 }
示例#3
0
        public static void ResetBondDisplay()
        {
            UIData.resetBondDisplay = false;

            DestroyBondObject();
            if (UIData.bondtype == UIData.BondType.cube || UIData.bondtype == UIData.BondType.hyperstick || UIData.bondtype == UIData.BondType.bbhyperstick)
            {
                IBondStyle displayBond = new BondCubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.line)
            {
                IBondStyle displayBond = new BondLineStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.tubestick)
            {
                IBondStyle displayBond = new BondTubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.particlestick)
            {
                IBondStyle displayBond = new BondParticleStyle();
                displayBond.DisplayBonds();
            }
//			else if(UIData.bondtype==UIData.BondType.nobond) {}
            CreatBondGameObjectArray();

            if (UIData.bondtype == UIData.BondType.cube || UIData.bondtype == UIData.BondType.hyperstick || UIData.bondtype == UIData.BondType.bbhyperstick)
            {
                GameObject   hbManagerObj = GameObject.FindGameObjectWithTag("HBallManager");
                HBallManager hbManager    = hbManagerObj.GetComponent <HBallManager>();
                hbManager.findBonds();
            }
        }
示例#4
0
 public BondLine(Point startPoint, Point endPoint, BondLineStyle type, string parent)
 {
     _start      = startPoint;
     _end        = endPoint;
     BoundingBox = new Rect(startPoint, endPoint);
     Type        = type;
     Parent      = parent;
 }
示例#5
0
        public static void ResetDisplay()
        {
            DestroyObject();

            IAtomStyle displayAtom;

            // In case we changed the color of the atoms,
            // we destroy the "permanent" particles and create new ones with the new colors
            if (UIData.isConfirm || UIData.changeStructure)
            {
//				DestroyParticles();
                displayAtom = new AtomCubeStyle();
                displayAtom.DisplayAtoms(UIData.atomtype, true);
//				displayAtom.DisplayAtoms(UIData.AtomType.particleball,true);
            }
            displayAtom = new AtomCubeStyle();

            displayAtom.DisplayAtoms(UIData.atomtype);
            Debug.Log(UIData.atomtype);

            // This fixes a nasty bug that made carbon alpha chains/entire molecules disappear when switching between the two in sphere mode
            if (UIData.atomtype == UIData.AtomType.sphere)
            {
                UIData.isCubeToSphere = true;
                UIData.isSphereToCube = false;
            }
            else if (UIData.atomtype == UIData.AtomType.cube)
            {
                UIData.isCubeToSphere = false;
                UIData.isSphereToCube = true;
            }

            if (UIData.bondtype == UIData.BondType.cube || UIData.bondtype == UIData.BondType.hyperstick || UIData.bondtype == UIData.BondType.bbhyperstick)
            {
                IBondStyle displayBond = new BondCubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.line)
            {
                IBondStyle displayBond = new BondLineStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.tubestick)
            {
                IBondStyle displayBond = new BondTubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.particlestick)
            {
                IBondStyle displayBond = new BondParticleStyle();
                displayBond.DisplayBonds();
            }
            CreatGameObjectArray();
        }
示例#6
0
 public BondLine(Point startPoint, Point endPoint, BondLineStyle type, string parentBond, string parentMolecule, string startAtomId, string endAtomId)
 {
     _start         = startPoint;
     _end           = endPoint;
     BoundingBox    = new Rect(startPoint, endPoint);
     Type           = type;
     ParentBond     = parentBond;
     ParentMolecule = parentMolecule;
     StartAtomId    = startAtomId;
     EndAtomId      = endAtomId;
 }
示例#7
0
        public BondLine(BondLineStyle style, Bond bond)
        {
            Style = style;
            Bond  = bond;

            if (bond != null)
            {
                Start = bond.StartAtom.Position;
                End   = bond.EndAtom.Position;
            }
        }
示例#8
0
        public static void Display()
        {
//			UIData.EnableUpdate=false;
            IAtomStyle displayAtom;

            if (UIData.isSphereToCube)
            {
                displayAtom = new AtomCubeStyle();
                Debug.Log("DisplayMolecule.Display(): New atom cube style");
            }

            else
            {
                displayAtom = new AtomSphereStyle();
                Debug.Log("DisplayMolecule.Display(): New atom sphere style");
            }
            Debug.Log("DisplayAtoms here DisplayAtoms here DisplayAtoms here DisplayAtoms here");
            displayAtom.DisplayAtoms(UIData.atomtype);
            if (UIData.bondtype == UIData.BondType.cube || UIData.bondtype == UIData.BondType.hyperstick || UIData.bondtype == UIData.BondType.bbhyperstick)
            {
                IBondStyle displayBond = new BondCubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.line)
            {
                IBondStyle displayBond = new BondLineStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.tubestick)
            {
                IBondStyle displayBond = new BondTubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.particlestick)
            {
                IBondStyle displayBond = new BondParticleStyle();
                displayBond.DisplayBonds();
            }
            CreatGameObjectArray();
            CheckResidues();

            if (GUIMoleculeController.HYPERBALLSDEFAULT)
            {
                GUIMoleculeController.toggle_NA_HBALLSMOOTH = !GUIMoleculeController.toggle_NA_HBALLSMOOTH;
                UIData.hballsmoothmode = GUIMoleculeController.toggle_NA_HBALLSMOOTH;
            }

            UIData.hasMoleculeDisplay = true;
//			UIData.EnableUpdate=true;
        }
示例#9
0
        public static void CubeToSphere()
        {
            UIData.resetDisplay = false;
//			DestroyObject();
            HideObject();
            if (UIData.atomtype == UIData.AtomType.sphere)
            {
                GameObject    spmObject = GameObject.FindGameObjectWithTag("SphereManager");
                SphereManager spManager = spmObject.GetComponent <SphereManager>();
                spManager.EnableRenderers();
            }

            if (!UIData.isSphereLoaded)
            {
                IAtomStyle displayAtom;

                Debug.Log("UIData.atomtype :: " + UIData.atomtype);
                displayAtom = new AtomSphereStyle();
                displayAtom.DisplayAtoms(UIData.atomtype);
            }

            if (UIData.bondtype == UIData.BondType.cube || UIData.bondtype == UIData.BondType.hyperstick || UIData.bondtype == UIData.BondType.bbhyperstick)
            {
                IBondStyle displayBond = new BondCubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.line)
            {
                IBondStyle displayBond = new BondLineStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.tubestick)
            {
                IBondStyle displayBond = new BondTubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.particlestick)
            {
                IBondStyle displayBond = new BondParticleStyle();
                displayBond.DisplayBonds();
            }
            CreatGameObjectArray();
            BallUpdate.resetRadii = true;
            //BallUpdate.resetColors = true;
            Debug.Log("Exiting :: CubeToSphere");
        }
示例#10
0
        public static void SphereToCube()
        {
            UIData.resetDisplay = false;
//			DestroyObject();
            HideObject();
            if (UIData.atomtype == UIData.AtomType.cube)
            {
                GameObject  cbmObject = GameObject.FindGameObjectWithTag("CubeManager");
                CubeManager cbManager = cbmObject.GetComponent <CubeManager>();
                cbManager.EnableRenderers();

                if (!UIData.isCubeLoaded)
                {
                    IAtomStyle displayAtom;

                    Debug.Log("UIData.atomtype :: " + UIData.atomtype);
                    displayAtom = new AtomCubeStyle();
                    displayAtom.DisplayAtoms(UIData.atomtype);
                }
            }
            else if (UIData.atomtype == UIData.AtomType.hyperball)
            {
                GameObject   hbmObject = GameObject.FindGameObjectWithTag("HBallManager");
                HBallManager hbManager = hbmObject.GetComponent <HBallManager>();
                hbManager.EnableRenderers();

                if (!UIData.isHBallLoaded)
                {
                    IAtomStyle displayAtom;

                    Debug.Log("UIData.atomtype :: " + UIData.atomtype);
                    displayAtom = new AtomCubeStyle();
                    displayAtom.DisplayAtoms(UIData.atomtype);
                }
            }


            if (UIData.bondtype == UIData.BondType.cube || UIData.bondtype == UIData.BondType.hyperstick || UIData.bondtype == UIData.BondType.bbhyperstick)
            {
                IBondStyle displayBond = new BondCubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.line)
            {
                IBondStyle displayBond = new BondLineStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.tubestick)
            {
                IBondStyle displayBond = new BondTubeStyle();
                displayBond.DisplayBonds();
            }
            else if (UIData.bondtype == UIData.BondType.particlestick)
            {
                IBondStyle displayBond = new BondParticleStyle();
                displayBond.DisplayBonds();
            }
            CreatGameObjectArray();
            BallUpdate.resetRadii = true;
            //BallUpdate.resetColors = true;
            Debug.Log("Exiting :: SphereToCube");
        }
示例#11
0
 public BondLine(BondLineStyle style, Point startPoint, Point endPoint, Bond bond)
     : this(style, startPoint, endPoint)
 {
     Bond = bond;
 }
示例#12
0
 public void SetLineStyle(BondLineStyle style)
 {
     Style = style;
 }
示例#13
0
 private BondLine(BondLineStyle style, Point startPoint, Point endPoint)
 {
     Style = style;
     Start = startPoint;
     End   = endPoint;
 }
示例#14
0
 public BondLine(BondLineStyle style, Point startPoint, Point endPoint)
 {
     Style  = style;
     _start = startPoint;
     _end   = endPoint;
 }