/// <summary> /// find bounding box in kdops /// </summary> /// <param name="atomList"></param> /// <param name="kVector"></param> private void SetBoundingBox(AtomInfo[] atomList, KVector kVector) { minMaxList = new MinMaxInfo[kVector.K]; for (int i = 0; i < kVector.K; i++) { minMaxList[i].Intialize(); } if (kVector.K == KVector.baseDim) { SetBoundingBox(atomList); return; } foreach (AtomInfo atom in atomList) { double [] point3d = new double [3] { atom.xyz.X, atom.xyz.Y, atom.xyz.Z }; double [] projectedValues = kVector * point3d; for (int i = 0; i < projectedValues.Length; i++) { if (minMaxList[i].maximum < projectedValues[i]) { minMaxList[i].maximum = projectedValues[i]; } if (minMaxList[i].minimum > projectedValues[i]) { minMaxList[i].minimum = projectedValues[i]; } } } }
public Node(AtomInfo[] atoms, KVector kVector) { atomList = atoms; foreach (AtomInfo atom in atomList) { double[] coord = new double [3] { atom.xyz.X, atom.xyz.Y, atom.xyz.Z }; atom.ProjectedCoord = kVector * coord; } boundBox = new BoundingBox(atoms, kVector); }
/// <summary> /// update the bounding box /// due to translation of the chain /// </summary> /// <param name="transVector">translation vector, the translation in X, Y, and Z</param> /// <param name="kVector">kdops vectors</param> /// <returns></returns> public BoundingBox UpdateBoundingBox(double [] transVector, KVector kVector) { BoundingBox updatedBoundBox = new BoundingBox(); if (minMaxList == null) { return(null); } double [] transValues = kVector * transVector; updatedBoundBox.minMaxList = new MinMaxInfo [minMaxList.Length]; for (int i = 0; i < kVector.K; i++) { updatedBoundBox.minMaxList[i].maximum = minMaxList[i].maximum + transValues[i]; updatedBoundBox.minMaxList[i].minimum = minMaxList[i].minimum + transValues[i]; } return(updatedBoundBox); }
public BoundingBox(AtomInfo[] atomList, KVector kVector) { SetBoundingBox(atomList, kVector); }