/** Normally used in CML2 array mode. * * * --type info-- * * An array of coordinateComponents for a single coordinate. * An array of coordinateComponents for a single coordinate * where these all refer to an X-coordinate (NOT x,y,z).Instances of this type will be * used in array-style representation of 2-D or 3-D coordinates. Currently no machine * validation. Currently not used in STMML, but re-used by CML (see example). * must have already processed setAtomID * @param value must match atom count * @throws RuntimeException null x3, inconsistent atom count, etc. */ public void setX3(double[] value) throws RuntimeException { if (value == null) { throw new RuntimeException("null x3"); } List<CMLAtom> atomList = this.getAtoms(value.length, "x3"); int i = 0; for (CMLAtom atom : atomList) { atom.setX3(value[i++]); } } /** Normally used in CML2 array mode.
/** * sets Point3 for x3 y3 z3. * * @param point */ public void setXYZ3(Point3 point) { this.setX3(point.getArray()[0]); this.setY3(point.getArray()[1]); this.setZ3(point.getArray()[2]); }
private void map3DCoordsToCML(CMLAtom cmlAtom, IAtom cdkAtom) { if (cdkAtom.getPoint3d() != null) { cmlAtom.setX3(cdkAtom.getPoint3d().x); cmlAtom.setY3(cdkAtom.getPoint3d().y); cmlAtom.setZ3(cdkAtom.getPoint3d().z); } }
private void map3DCoordsToCML(CMLAtom cmlAtom, IAtom cdkAtom) { if (cdkAtom.getPoint3d() != null) { cmlAtom.setX3(cdkAtom.getPoint3d().x); cmlAtom.setY3(cdkAtom.getPoint3d().y); cmlAtom.setZ3(cdkAtom.getPoint3d().z); } }
/** * increase x3, y3 and z3 coordinates. * * if x3, y3 or z3 is unset, no action * * @param dx * amount to add * @param dy * amount to add * @param dz * amount to add */ public void increaseXYZ3(double dx, double dy, double dz) { if (hasCoordinates(CoordinateType.CARTESIAN)) { this.setX3(this.getX3() + dx); this.setY3(this.getY3() + dy); this.setZ3(this.getZ3() + dz); } }
/** * translate molecule in 3D. * * @param delta3 * add to all 3D coordinates */ public void translate3D(Vector3 delta3) { List<CMLAtom> atoms = this.getAtoms(); for (int i = 0; i < atoms.size(); i++) { CMLAtom atom = atoms.get(i); if (atom.getX3Attribute() != null && atom.getY3Attribute() != null && atom.getZ3Attribute() != null) { atom.setX3(atom.getX3() + delta3.getArray()[0]); atom.setY3(atom.getY3() + delta3.getArray()[1]); atom.setZ3(atom.getZ3() + delta3.getArray()[2]); } } }
&& this.hasCoordinates(CoordinateType.CARTESIAN)) { i = (int) (this.getX3() * factor); this.setX3(((double) i) * epsilon); i = (int) (this.getY3() * factor); this.setY3(((double) i) * epsilon);