Пример #1
0
 public virtual Point3i[] calcScreens(Point3f[] centers, Vector3f[] vectors, short[] mads, float offsetFraction)
 {
     // this basically does object->screen transformation??
     Point3i[] screens = new Point3i[centers.Length];// viewer.allocTempScreens(centers.Length);
     if (offsetFraction == 0)
     {
         for (int i = centers.Length; --i >= 0; )
             screens[i] = new Point3i((int)centers[i].x, (int)centers[i].y, (int)centers[i].z);
             //viewer.transformPoint(centers[i], screens[i]);
     }
     else
     {
         offsetFraction /= 1000;
         for (int i = centers.Length; --i >= 0; )
         {
             pointT.set_Renamed(vectors[i]);
             float scale = mads[i] * offsetFraction;
             pointT.scaleAdd(scale, centers[i]);
             //if (float.IsNaN(pointT.x))
             //{
             //    System.Console.Out.WriteLine(" vectors[" + i + "]=" + vectors[i] + " centers[" + i + "]=" + centers[i] + " mads[" + i + "]=" + mads[i] + " scale=" + scale + " --> " + pointT);
             //}
             //viewer.transformPoint(pointT, screens[i]);
             screens[i] = new Point3i((int)pointT.x, (int)pointT.y, (int)pointT.z);
         }
     }
     return screens;
 }
Пример #2
0
        public virtual void calc1Screen(Point3f center, Vector3f vector, short mad, float offsetFraction, Point3i screen)
		{
			pointT.set_Renamed(vector);
			float scale = mad * offsetFraction;
			pointT.scaleAdd(scale, center);
            //viewer.transformPoint(pointT, screen);
		}
Пример #3
0
		// copied from sheet -- not correct
        public override void calcAxis()
		{
			if (axisA != null)
				return ;
			
			axisA = new Point3f();
			if (lowerNeighborIsHelixOrSheet())
				apolymer.getLeadMidPoint(monomerIndex, axisA);
			else
				apolymer.getLeadMidPoint(monomerIndex + 1, axisA);
			
			axisB = new Point3f();
			if (upperNeighborIsHelixOrSheet())
				apolymer.getLeadMidPoint(monomerIndex + monomerCount, axisB);
			else
				apolymer.getLeadMidPoint(monomerIndex + monomerCount - 1, axisB);
			
			axisUnitVector = new Vector3f();
			axisUnitVector.sub(axisB, axisA);
			axisUnitVector.normalize();
			
			Point3f tempA = new Point3f();
			apolymer.getLeadMidPoint(monomerIndex, tempA);
			projectOntoAxis(tempA);
			Point3f tempB = new Point3f();
			apolymer.getLeadMidPoint(monomerIndex + monomerCount, tempB);
			projectOntoAxis(tempB);
			axisA = tempA;
			axisB = tempB;
		}
Пример #4
0
        public override void calcAxis()
		{
			if (axisA != null)
				return ;
			if (monomerCount == 2)
			{
				axisA = aminoPolymer.getLeadPoint(monomerIndex);
				axisB = aminoPolymer.getLeadPoint(monomerIndex + 1);
			}
			else
			{
				axisA = new Point3f();
				aminoPolymer.getLeadMidPoint(monomerIndex + 1, axisA);
				axisB = new Point3f();
				aminoPolymer.getLeadMidPoint(monomerIndex + monomerCount - 1, axisB);
			}
			
			axisUnitVector = new Vector3f();
			axisUnitVector.sub(axisB, axisA);
			axisUnitVector.normalize();
			
			Point3f tempA = new Point3f();
			aminoPolymer.getLeadMidPoint(monomerIndex, tempA);
			if (!lowerNeighborIsHelixOrSheet())
				projectOntoAxis(tempA);
			Point3f tempB = new Point3f();
			aminoPolymer.getLeadMidPoint(monomerIndex + monomerCount, tempB);
			if (!upperNeighborIsHelixOrSheet())
				projectOntoAxis(tempB);
			axisA = tempA;
			axisB = tempB;
		}
Пример #5
0
        /// <summary> Computes the square of the distance between this point and point p1.</summary>
        /// <param name="p1">the other point
        /// </param>
        /// <returns> the square of distance between these two points as a float
        /// </returns>
        public float distanceSquared(Point3f p1)
        {
            double dx = x - p1.x;
            double dy = y - p1.y;
            double dz = z - p1.z;

            //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'"
            return((float)(dx * dx + dy * dy + dz * dz));
        }
Пример #6
0
        public virtual void render1Chain(int monomerCount, Monomer[] monomers, Point3f[] centers, Vector3f[] vectors, short[] mads, short[] colixes)
		{
			Point3i[] ribbonTopScreens;
			Point3i[] ribbonBottomScreens;
			
			ribbonTopScreens = calcScreens(centers, vectors, mads, isNucleic?1f:0.5f);
			ribbonBottomScreens = calcScreens(centers, vectors, mads, isNucleic?0f:- 0.5f);
			render2Strand(monomerCount, monomers, mads, colixes, ribbonTopScreens, ribbonBottomScreens);
            //viewer.freeTempScreens(ribbonTopScreens);
            //viewer.freeTempScreens(ribbonBottomScreens);
		}
Пример #7
0
        public Point3i[] calcScreenLeadMidpoints(int monomerCount, Point3f[] leadMidpoints)
		{
			int count = monomerCount + 1;
            Point3i[] leadMidpointScreens = new Point3i[count];// null;// viewer.allocTempScreens(count);
			for (int i = count; --i >= 0; )
			{
                leadMidpointScreens[i] = new Point3i((int)leadMidpoints[i].x, (int)leadMidpoints[i].y, (int)leadMidpoints[i].z);
				//viewer.transformPoint(leadMidpoints[i], leadMidpointScreens[i]);
				//g3d.fillSphereCentered(Graphics3D.CYAN, 15, leadMidpointScreens[i]);
                g3d.fillSphereCentered(0, 15, leadMidpointScreens[i]);
			}
			return leadMidpointScreens;
		}
Пример #8
0
        public NuHermite3D(NuGraphics3D g3d)
        {
            this.g3d = g3d;

            for (int i = 16; --i >= 0; )
            {
                pLeft[i] = new Point3i();
                pRight[i] = new Point3i();

                pTopLeft[i] = new Point3f();
                pTopRight[i] = new Point3f();
                pBotLeft[i] = new Point3f();
                pBotRight[i] = new Point3f();
            }
            triStripBuffer = new List<List<Vector3>>();
        }
Пример #9
0
        public virtual Point3i[] calcScreens(Point3f[] centers, Vector3f[] vectors, short[] mads, float offsetFraction)
		{
			int count = centers.Length;
            Point3i[] screens = new Point3i[count];// null;// viewer.allocTempScreens(count);
			if (offsetFraction == 0)
			{
                for (int i = count; --i >= 0; )
                    screens[i] = new Point3i((int)centers[i].x, (int)centers[i].y, (int)centers[i].z);
                //    viewer.transformPoint(centers[i], screens[i]);
			}
			else
			{
				for (int i = count; --i >= 0; )
				{
					pointT.set_Renamed(vectors[i]);
					//boolean isSpecial = isSpecials[i];
					short mad = mads[i];
					/*
					if (isSpecial && !lastWasSpecial)
					mad *= 2;
					*/
					/*
					short mad = isSpecial || i == 0 ? mads[i] : mads[i - 1];
					if (i + 1 < count && isSpecial) {
					if (isSpecial && ! isSpecials[i + 1])
					mad = mads[i];
					}
					*/
					float scale = mad * offsetFraction;
					pointT.scaleAdd(scale, centers[i]);
                    screens[i] = new Point3i((int)pointT.x, (int)pointT.y, (int)pointT.z);
                    //viewer.transformPoint(pointT, screens[i]);
				}
			}
			return screens;
		}
Пример #10
0
        public Point3i transformPoint(Point3f pointAngstroms, Vector3f vibrationVector)
		{
            return null;// transformManager.transformPoint(pointAngstroms, vibrationVector);
		}
Пример #11
0
        public Point3i transformPoint(Point3f pointAngstroms)
		{
            return null;// transformManager.transformPoint(pointAngstroms);
		}
Пример #12
0
        public static float length(Point3f point)
		{
			return (float) Math.Sqrt(point.x * point.x + point.y * point.y + point.z * point.z);
		}
Пример #13
0
 /// <summary> Computes the L-1 (Manhattan) distance between this point and point p1.
 /// The L-1 distance is equal to abs(x1-x2) + abs(y1-y2) + abs(z1-z2) .
 /// </summary>
 /// <param name="p1">the other point
 /// </param>
 public float distanceL1(Point3f p1)
 {
     return(System.Math.Abs(x - p1.x) + System.Math.Abs(y - p1.y) + System.Math.Abs(z - p1.z));
 }
Пример #14
0
        public void freeTempPoints(Point3f[] tempPoints)
		{
            //tempManager.freeTempPoints(tempPoints);
		}
Пример #15
0
        public void transformPoints(Point3f[] pointsAngstroms, Point3i[] pointsScreens)
		{
            //transformManager.transformPoints(pointsAngstroms.length, pointsAngstroms, pointsScreens);
		}
Пример #16
0
 /// <summary> Computes the L-infinite distance between this point and point p1.
 /// The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2), abs(z1-z2)].
 /// </summary>
 /// <param name="p1">the other point
 /// </param>
 public float distanceLinf(Point3f p1)
 {
     return(System.Math.Max(System.Math.Max(System.Math.Abs(x - p1.x), System.Math.Abs(y - p1.y)), System.Math.Abs(z - p1.z)));
 }
Пример #17
0
        public static float computeTorsion(Point3f p1, Point3f p2, Point3f p3, Point3f p4)
        {
            float ijx = p1.x - p2.x;
            float ijy = p1.y - p2.y;
            float ijz = p1.z - p2.z;

            float kjx = p3.x - p2.x;
            float kjy = p3.y - p2.y;
            float kjz = p3.z - p2.z;

            float klx = p3.x - p4.x;
            float kly = p3.y - p4.y;
            float klz = p3.z - p4.z;

            float ax = ijy * kjz - ijz * kjy;
            float ay = ijz * kjx - ijx * kjz;
            float az = ijx * kjy - ijy * kjx;
            float cx = kjy * klz - kjz * kly;
            float cy = kjz * klx - kjx * klz;
            float cz = kjx * kly - kjy * klx;

            float ai2 = 1f / (ax * ax + ay * ay + az * az);
            float ci2 = 1f / (cx * cx + cy * cy + cz * cz);

            //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'"
            float ai = (float)System.Math.Sqrt(ai2);
            //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'"
            float ci = (float)System.Math.Sqrt(ci2);
            float denom = ai * ci;
            float cross = ax * cx + ay * cy + az * cz;
            float cosang = cross * denom;
            if (cosang > 1)
                cosang = 1;
            if (cosang < -1)
                cosang = -1;

            //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'"
            float torsion = toDegrees((float)System.Math.Acos(cosang));
            float dot = ijx * cx + ijy * cy + ijz * cz;
            float absDot = System.Math.Abs(dot);
            torsion = (dot / absDot > 0) ? torsion : -torsion;
            return torsion;
        }
Пример #18
0
        public virtual int calcHbondEnergy(Point3f nitrogenPoint, Point3f hydrogenPoint, AminoMonomer target)
		{
			Point3f targetOxygenPoint = target.CarbonylOxygenAtomPoint;
			
			float distON2 = targetOxygenPoint.distanceSquared(nitrogenPoint);
			if (distON2 < minimumHbondDistance2)
				return - 9900;
			
			//why would this not have been in here? RMH 03/8/06
			//   if (distON2 > hbondMax2)
			//      return 0;
			//nevermind! :)
			
			if (debugHbonds)
				System.Console.Out.WriteLine("calchbondenergy: " + hydrogenPoint.x + "," + hydrogenPoint.y + "," + hydrogenPoint.z);
			
			float distOH2 = targetOxygenPoint.distanceSquared(hydrogenPoint);
			if (distOH2 < minimumHbondDistance2)
				return - 9900;
			
			Point3f targetCarbonPoint = target.CarbonylCarbonAtomPoint;
			float distCH2 = targetCarbonPoint.distanceSquared(hydrogenPoint);
			if (distCH2 < minimumHbondDistance2)
				return - 9900;
			
			float distCN2 = targetCarbonPoint.distanceSquared(nitrogenPoint);
			if (distCN2 < minimumHbondDistance2)
				return - 9900;
			
			double distOH = System.Math.Sqrt(distOH2);
			double distCH = System.Math.Sqrt(distCH2);
			double distCN = System.Math.Sqrt(distCN2);
			double distON = System.Math.Sqrt(distON2);
			
			//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'"
			int energy = (int) ((QConst / distOH - QConst / distCH + QConst / distCN - QConst / distON));
			
			if (debugHbonds)
				System.Console.Out.WriteLine(" distOH=" + distOH + " distCH=" + distCH + " distCN=" + distCN + " distON=" + distON + " energy=" + energy);
			if (energy < - 9900)
				return - 9900;
			if (energy > - 500)
				return 0;
			return energy;
		}
Пример #19
0
        public virtual void bondAminoHydrogen(int indexDonor, Point3f hydrogenPoint, BitArray bsA, BitArray bsB)
		{
			AminoMonomer source = (AminoMonomer) monomers[indexDonor];
			Point3f sourceAlphaPoint = source.LeadAtomPoint;
			Point3f sourceNitrogenPoint = source.NitrogenAtomPoint;
			int energyMin1 = 0;
			int energyMin2 = 0;
			int indexMin1 = - 1;
			int indexMin2 = - 1;
			for (int i = monomerCount; --i >= 0; )
			{
				if ((i == indexDonor || (i + 1) == indexDonor) || (i - 1) == indexDonor)
					continue;
				AminoMonomer target = (AminoMonomer) monomers[i];
				Point3f targetAlphaPoint = target.LeadAtomPoint;
				float dist2 = sourceAlphaPoint.distanceSquared(targetAlphaPoint);
				if (dist2 > maxHbondAlphaDistance2)
					continue;
				int energy = calcHbondEnergy(sourceNitrogenPoint, hydrogenPoint, target);
				if (debugHbonds)
					System.Console.Out.WriteLine("HbondEnergy=" + energy + " dist2=" + dist2 + " max^2=" + maxHbondAlphaDistance2);
				if (energy < energyMin1)
				{
					energyMin2 = energyMin1;
					indexMin2 = indexMin1;
					energyMin1 = energy;
					indexMin1 = i;
				}
				else if (energy < energyMin2)
				{
					energyMin2 = energy;
					indexMin2 = i;
				}
			}
			if (indexMin1 >= 0)
			{
				mainchainHbondOffsets[indexDonor] = (short) (indexDonor - indexMin1);
				min1Indexes[indexDonor] = (short) indexMin1;
				min1Energies[indexDonor] = (short) energyMin1;
				createResidueHydrogenBond(indexDonor, indexMin1, bsA, bsB);
				if (indexMin2 >= 0)
				{
					createResidueHydrogenBond(indexDonor, indexMin2, bsA, bsB);
					min2Indexes[indexDonor] = (short) indexMin2;
					min2Energies[indexDonor] = (short) energyMin2;
				}
			}
		}
Пример #20
0
		/// <summary> Transforms the point parameter with this Matrix4f and
		/// places the result back into point.  The fourth element of the
		/// point input paramter is assumed to be one.
		/// </summary>
		/// <param name="point">the input point to be transformed.
		/// </param>
		public void  transform(Point3f point)
		{
			transform(point, point);
		}
Пример #21
0
		/// <summary> Transforms the point parameter with this Matrix4f and places the result
		/// into pointOut. The fourth element of the point input paramter is assumed
		/// to be one.
		/// </summary>
		/// <param name="point">the input point to be transformed.
		/// </param>
		/// <param name="pointOut">the transformed point
		/// </param>
		public void  transform(Point3f point, Point3f pointOut)
		{
			pointOut.set_Renamed(m00 * point.x + m01 * point.y + m02 * point.z + m03, m10 * point.x + m11 * point.y + m12 * point.z + m13, m20 * point.x + m21 * point.y + m22 * point.z + m23);
		}
Пример #22
0
 static void set(Point3f p3f, Point3i p3i)
 {
     p3f.x = p3i.x;
     p3f.y = p3i.y;
     p3f.z = p3i.z;
 }
Пример #23
0
        public void transformPoint(Point3f pointAngstroms, Vector3f vibrationVector, Point3i pointScreen)
		{
            //transformManager.transformPoint(pointAngstroms, vibrationVector, pointScreen);
		}
Пример #24
0
        public void transformPoint(Point3f pointAngstroms, Point3f pointScreen)
		{
            //transformManager.transformPoint(pointAngstroms, pointScreen);
		}
Пример #25
0
 /// <summary> Constructs and initializes a Point3d from the specified Point3f.</summary>
 /// <param name="p1">the Point3f containing the initialization x y z data
 /// </param>
 public Point3d(Point3f p1) : base(p1)
 {
 }
Пример #26
0
        public void setCenter(Point3f center)
		{
            //modelManager.RotationCenter = center;
			refresh();
		}
Пример #27
0
 /// <summary> Returns the distance between this point and point p1.</summary>
 /// <param name="p1">the other point
 /// </param>
 /// <returns> the distance between these two points
 /// </returns>
 public float distance(Point3f p1)
 {
     //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'"
     return((float)System.Math.Sqrt(distanceSquared(p1)));
 }
Пример #28
0
        public virtual void calcSums(int count, Point3f[] points, float[] lengths)
		{
			sumXiLi = sumYiLi = sumZiLi = 0;
			for (int i = count; --i >= 0; )
			{
				Point3f point = points[i];
				float length = lengths[i];
				sumXiLi += point.x * length;
				sumYiLi += point.y * length;
				sumZiLi += point.z * length;
			}
		}
Пример #29
0
        public virtual void calcSegments()
		{
			if (segments != null)
				return ;
			calcAxis();
			/*
			System.out.println("axisA=" + axisA.x + "," + axisA.y + "," + axisA.z);
			System.out.println("axisB=" + axisB.x + "," + axisB.y + "," + axisB.z);
			*/
			segments = new Point3f[monomerCount + 1];
			segments[monomerCount] = axisB;
			segments[0] = axisA;
			for (int i = monomerCount; --i > 0; )
			{
				Point3f point = segments[i] = new Point3f();
				apolymer.getLeadMidPoint(monomerIndex + i, point);
				projectOntoAxis(point);
			}
			/*
			for (int i = 0; i < segments.length; ++i) {
			Point3f point = segments[i];
			System.out.println("segment[" + i + "]=" +
			point.x + "," + point.y + "," + point.z);
			}
			*/
		}
Пример #30
0
		/// <summary>*************************************************************
		/// see:
		/// Defining the Axis of a Helix
		/// Peter C Kahn
		/// Computers Chem. Vol 13, No 3, pp 185-189, 1989
		/// 
		/// Simple Methods for Computing the Least Squares Line
		/// in Three Dimensions
		/// Peter C Kahn
		/// Computers Chem. Vol 13, No 3, pp 191-195, 1989
		/// **************************************************************
		/// </summary>
        public virtual void calcCenter()
		{
			if (center == null)
			{
				int i = monomerIndex + monomerCount - 1;
				center = new Point3f(apolymer.getLeadPoint(i));
				while (--i >= monomerIndex)
					center.add(apolymer.getLeadPoint(i));
				center.scale(1f / monomerCount);
				//      System.out.println("structure center is at :" + center);
			}
		}
Пример #31
0
        public virtual bool maybeGetBaseRing5Points(Point3f[] ring5Points)
		{
			if (isPurine_Renamed_Field)
				for (int i = 5; --i >= 0; )
				{
					Atom atom = getAtomFromOffsetIndex(ring5OffsetIndexes[i]);
					atom.formalChargeAndFlags |= Atom.VISIBLE_FLAG;
					ring5Points[i] = atom.point3f;
				}
			return isPurine_Renamed_Field;
		}
Пример #32
0
        public virtual void getBaseRing6Points(Point3f[] ring6Points)
		{
			for (int i = 6; --i >= 0; )
			{
				Atom atom = getAtomFromOffsetIndex(i + 3);
				atom.formalChargeAndFlags |= Atom.VISIBLE_FLAG;
				ring6Points[i] = atom.point3f;
			}
		}
Пример #33
0
		/// <summary> Constructs and initializes a Point3d from the specified Point3f.</summary>
		/// <param name="p1">the Point3f containing the initialization x y z data
		/// </param>
		public Point3d(Point3f p1):base(p1)
		{
		}
Пример #34
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;
            }
		}
Пример #35
0
        public virtual void projectOntoAxis(Point3f point)
		{
			// assumes axisA, axisB, and axisUnitVector are set;
			vectorProjection.sub(point, axisA);
			float projectedLength = vectorProjection.dot(axisUnitVector);
			point.set_Renamed(axisUnitVector);
			point.scaleAdd(projectedLength, axisA);
		}