Пример #1
0
		public void setViewerG3dFrame(/*Viewer viewer,*/ NuGraphics3D g3d, Frame frame)
		{
            //this.viewer = viewer;
            this.g3d = g3d;
            this.frame = frame;
			initShape();
		}
Пример #2
0
		//UPGRADE_NOTE: ref keyword was added to struct-type parameters. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1303'"
        public virtual void render(NuGraphics3D g3d, ref System.Drawing.Rectangle rectClip, Frame frame, int displayModelIndex, Shape shape)
		{
            this.g3d = g3d;
			this.rectClip = rectClip;
			this.frame = frame;
			this.displayModelIndex = displayModelIndex;
			this.shape = shape;
			render();
		}
Пример #3
0
		//UPGRADE_NOTE: ref keyword was added to struct-type parameters. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1303'"
        public virtual void render(NuGraphics3D g3d, ref System.Drawing.Rectangle rectClip, Frame frame, int displayModelIndex, int shapeType)
		{
            if (frame == null || frame.atomCount <= 0)
                return;

            //viewer.calcTransformMatrices();

            //for (int i = 0; i < JmolConstants.SHAPE_MAX; ++i)
            //{
            Shape shape = frame.shapes[shapeType/*i*/];
                //if (shape == null)
                //    continue;
            if (shape != null)
                getRenderer(shapeType/*i*/, g3d).render(g3d, ref rectClip, frame, displayModelIndex, shape);
            //}

            g3d.Flush();
		}
Пример #4
0
		private void addBond(Bond bond, Frame frame)
		{
			if (bonds == null)
			{
				bonds = new Bond[1];
				bonds[0] = bond;
			}
			else
			{
                bonds = frame.addToBonds(bond, bonds);
			}
		}
Пример #5
0
        public Bond bondMutually(Atom atomOther, short order, Frame frame)
		{
			if (isBonded(atomOther))
				return null;
			Bond bond = new Bond(this, atomOther, order, frame);
			addBond(bond, frame);
			atomOther.addBond(bond, frame);
			return bond;
		}
Пример #6
0
        public Atom(/*Viewer viewer,*/ Frame frame, int modelIndex, int atomIndex, sbyte elementNumber, string atomName, int formalCharge, float partialCharge, int occupancy, float bfactor, float x, float y, float z, bool isHetero, int atomSerial, char chainID, float vibrationX, float vibrationY, float vibrationZ, char alternateLocationID, object clientAtomReference)
		{
            this.modelIndex = (short)modelIndex;
            this.atomIndex = atomIndex;
            this.elementNumber = elementNumber;
            this.formalChargeAndFlags = (sbyte)(formalCharge << 3);
            ////this.colixAtom = viewer.getColixAtom(this);
            this.alternateLocationID = (sbyte)alternateLocationID;
            ////MadAtom = viewer.MadAtom;
            this.point3f = new Point3f(x, y, z);
            if (isHetero)
                formalChargeAndFlags |= IS_HETERO_FLAG;
			
            if (atomName != null)
            {
                if (frame.atomNames == null)
                    frame.atomNames = new string[frame.atoms.Length];
                frame.atomNames[atomIndex] = string.Intern(atomName);
            }

            sbyte specialAtomID = lookupSpecialAtomID(atomName);
            if (specialAtomID != 0)
            {
                if (frame.specialAtomIDs == null)
                    frame.specialAtomIDs = new sbyte[frame.atoms.Length];
                frame.specialAtomIDs[atomIndex] = specialAtomID;
            }

            if (occupancy < 0)
                occupancy = 0;
            else if (occupancy > 100)
                occupancy = 100;
            if (occupancy != 100)
            {
                if (frame.occupancies == null)
                    frame.occupancies = new sbyte[frame.atoms.Length];
                frame.occupancies[atomIndex] = (sbyte)occupancy;
            }

            if (atomSerial != Int32.MinValue)
            {
                if (frame.atomSerials == null)
                    frame.atomSerials = new int[frame.atoms.Length];
                frame.atomSerials[atomIndex] = atomSerial;
            }

            if (!Single.IsNaN(partialCharge))
            {
                if (frame.partialCharges == null)
                    frame.partialCharges = new float[frame.atoms.Length];
                frame.partialCharges[atomIndex] = partialCharge;
            }
			
            if (!Single.IsNaN(bfactor) && bfactor != 0)
            {
                if (frame.bfactor100s == null)
                    frame.bfactor100s = new short[frame.atoms.Length];
                //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
                frame.bfactor100s[atomIndex] = (short) (bfactor * 100);
            }

            if (!Single.IsNaN(vibrationX) && !Single.IsNaN(vibrationY) && !Single.IsNaN(vibrationZ))
            {
                if (frame.vibrationVectors == null)
                    frame.vibrationVectors = new Vector3f[frame.atoms.Length];
                frame.vibrationVectors[atomIndex] = new Vector3f(vibrationX, vibrationY, vibrationZ);
                formalChargeAndFlags |= VIBRATION_VECTOR_FLAG;
            }
            if (clientAtomReference != null)
            {
                if (frame.clientAtomReferences == null)
                    frame.clientAtomReferences = new object[frame.atoms.Length];
                frame.clientAtomReferences[atomIndex] = clientAtomReference;
            }
		}
Пример #7
0
        public Bond(Atom atom1, Atom atom2, short order, Frame frame)
            :this(atom1, atom2, order, /*((order & JmolConstants.BOND_HYDROGEN_MASK) != 0?*/1/*:frame.viewer.MadBond)*/, (short)0)
		{ }
Пример #8
0
        public Mmset(Frame frame)
		{
			InitBlock();
            this.frame = frame;
		}
Пример #9
0
			private void  InitBlock(Frame enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
Пример #10
0
			public WithinAnyModelIterator(Frame enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}
Пример #11
0
            public SelectedBondIterator(Frame enclosingInstance, short bondType, BitArray bsSelected)
			{
				InitBlock(enclosingInstance);
				this.bondType = bondType;
				this.bsSelected = bsSelected;
				iBond = 0;
                //bondSelectionModeOr = Enclosing_Instance.viewer.BondSelectionModeOr;
			}
Пример #12
0
		//  private Group[] mainchain;

        public Chain(Frame frame, Model model, char chainID)
		{
            this.frame = frame;
			this.model = model;
			this.chainID = chainID;
		}