/** {@inheritDoc} */ @Override public Point3d getPoint3d() { Point3d point3d = super.getPoint3d(); if (point3d == null) { logger.debug("Getting point3d: null"); } else { logger.debug("Getting point3d: x=" + point3d.x + ", y=" + point3d.y, ", z=" + point3d.z); } return point3d; }
stringContent.append(", 2D:[").append(getPoint2d()).append(']'); if (getPoint3d() != null) { stringContent.append(", 3D:[").append(getPoint3d()).append(']');
stringContent.append(", 2D:[").append(getPoint2d()).append(']'); if (getPoint3d() != null) { stringContent.append(", 3D:[").append(getPoint3d()).append(']');
@Test public void testRotate_IAtom_Point3d_Point3d_double() { Atom atom1 = new Atom("C"); atom1.setPoint3d(new Point3d(1, 1, 0)); GeometryUtil.rotate(atom1, new Point3d(2, 0, 0), new Point3d(2, 2, 0), 90); assertEquals(new Point3d(2.0, 1.0, 1.0), atom1.getPoint3d(), 0.2); }
@Test public void testAtom3D() throws Exception { IAtomContainer mol = new AtomContainer(); Atom atom = new Atom("N"); Point3d p3d = new Point3d(1.3, 1.4, 0.9); atom.setPoint3d(p3d); mol.addAtom(atom); IAtomContainer roundTrippedMol = CMLRoundTripTool.roundTripMolecule(convertor, mol); Assert.assertEquals(1, roundTrippedMol.getAtomCount()); IAtom roundTrippedAtom = roundTrippedMol.getAtom(0); assertEquals(atom.getPoint3d(), roundTrippedAtom.getPoint3d(), 0.00001); }
@Test public void testAtom2DAnd3D() throws Exception { IAtomContainer mol = new AtomContainer(); Atom atom = new Atom("N"); Point2d p2d = new Point2d(1.3, 1.4); atom.setPoint2d(p2d); Point3d p3d = new Point3d(1.3, 1.4, 0.9); atom.setPoint3d(p3d); mol.addAtom(atom); IAtomContainer roundTrippedMol = CMLRoundTripTool.roundTripMolecule(convertor, mol); Assert.assertEquals(1, roundTrippedMol.getAtomCount()); IAtom roundTrippedAtom = roundTrippedMol.getAtom(0); assertEquals(atom.getPoint2d(), roundTrippedAtom.getPoint2d(), 0.00001); assertEquals(atom.getPoint3d(), roundTrippedAtom.getPoint3d(), 0.00001); }