/** Array of fractional x coordinate. * * normally xFract, yFract and zFract should all be present or absent. If present a _crystal_ element should also occur. * --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). * @param value xFract value * @throws RuntimeException attribute wrong value/type */ public void setXFract(double[] value) throws RuntimeException { if (value == null) { throw new RuntimeException("null xFract"); } List<CMLAtom> atomList = this.getAtoms(value.length, "xFract"); int i = 0; for (CMLAtom atom : atomList) { atom.setXFract(value[i++]); } } /** Array of fractional y coordinate.
/** * sets Point3 for x3 y3 z3. * * @param point */ public void setXYZFract(Point3 point) { this.setXFract(point.getArray()[0]); this.setYFract(point.getArray()[1]); this.setZFract(point.getArray()[2]); }
private void mapFractionalCoordsToCML(CMLAtom cmlAtom, IAtom cdkAtom) { if (cdkAtom.getFractionalPoint3d() != null) { cmlAtom.setXFract(cdkAtom.getFractionalPoint3d().x); cmlAtom.setYFract(cdkAtom.getFractionalPoint3d().y); cmlAtom.setZFract(cdkAtom.getFractionalPoint3d().z); } }
private void mapFractionalCoordsToCML(CMLAtom cmlAtom, IAtom cdkAtom) { if (cdkAtom.getFractionalPoint3d() != null) { cmlAtom.setXFract(cdkAtom.getFractionalPoint3d().x); cmlAtom.setYFract(cdkAtom.getFractionalPoint3d().y); cmlAtom.setZFract(cdkAtom.getFractionalPoint3d().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 increaseXYZFract(double dx, double dy, double dz) { if (hasCoordinates(CoordinateType.CARTESIAN)) { this.setXFract(this.getXFract() + dx); this.setYFract(this.getYFract() + dy); this.setZFract(this.getZFract() + dz); } }
&& this.hasCoordinates(CoordinateType.FRACTIONAL)) { i = (int) (this.getXFract() * factor); this.setXFract(((double) i) * epsilon); i = (int) (this.getYFract() * factor); this.setYFract(((double) i) * epsilon);