コード例 #1
0
ファイル: Shape.cs プロジェクト: xuchuansheng/GenXSource
		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
ファイル: Atom.cs プロジェクト: xuchuansheng/GenXSource
		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
ファイル: Atom.cs プロジェクト: xuchuansheng/GenXSource
        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
ファイル: Atom.cs プロジェクト: xuchuansheng/GenXSource
        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
ファイル: Bond.cs プロジェクト: xuchuansheng/GenXSource
        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
ファイル: Mmset.cs プロジェクト: xuchuansheng/GenXSource
        public Mmset(Frame frame)
		{
			InitBlock();
            this.frame = frame;
		}
コード例 #9
0
ファイル: Frame.cs プロジェクト: xuchuansheng/GenXSource
			private void  InitBlock(Frame enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
コード例 #10
0
ファイル: Frame.cs プロジェクト: xuchuansheng/GenXSource
			public WithinAnyModelIterator(Frame enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}
コード例 #11
0
ファイル: Frame.cs プロジェクト: xuchuansheng/GenXSource
            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
ファイル: Chain.cs プロジェクト: xuchuansheng/GenXSource
		//  private Group[] mainchain;

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