AtomPlacer3D { public Point3d geometricCenterAllPlacedAtoms(IAtomContainer molecule) { IAtomContainer allPlacedAtoms = getAllPlacedAtoms(molecule); return GeometryUtil.get3DCenter(allPlacedAtoms); } AtomPlacer3D(); void initilize(Map parameterSet); int[] findHeavyAtomsInChain(IAtomContainer molecule, IAtomContainer chain); IAtomContainer markPlaced(IAtomContainer ac); void placeAliphaticHeavyChain(IAtomContainer molecule, IAtomContainer chain); void zmatrixChainToCartesian(IAtomContainer molecule, boolean flagBranched); double getBondLengthValue(String id1, String id2); double getAngleValue(String id1, String id2, String id3); IAtom getNextUnplacedHeavyAtomWithAliphaticPlacedNeighbour(IAtomContainer molecule); IAtom getNextPlacedHeavyAtomWithUnplacedAliphaticNeighbour(IAtomContainer molecule); IAtom getNextPlacedHeavyAtomWithUnplacedRingNeighbour(IAtomContainer molecule); IAtom getFarthestAtom(Point3d refAtomPoint, IAtomContainer ac); IAtom getUnplacedRingHeavyAtom(IAtomContainer molecule, IAtom atom); Point3d geometricCenterAllPlacedAtoms(IAtomContainer molecule); IAtom getPlacedHeavyAtom(IAtomContainer molecule, IAtom atom); IAtom getPlacedHeavyAtom(IAtomContainer molecule, IAtom atomA, IAtom atomB); IAtomContainer getPlacedHeavyAtoms(IAtomContainer molecule, IAtom atom); int numberOfUnplacedHeavyAtoms(IAtomContainer ac); boolean allHeavyAtomsPlaced(IAtomContainer ac);  }
@Test public void testGeometricCenterAllPlacedAtoms_IAtomContainer() throws Exception { IAtomContainer ac = makeAlphaPinene(); for (int i = 0; i < ac.getAtomCount(); i++) { ac.getAtom(i).setFlag(CDKConstants.ISPLACED, true); } ac.getAtom(0).setPoint3d(new Point3d(1.39, 2.04, 0)); ac.getAtom(0).setPoint3d(new Point3d(2.02, 2.28, -1.12)); ac.getAtom(0).setPoint3d(new Point3d(3.44, 2.80, -1.09)); ac.getAtom(0).setPoint3d(new Point3d(3.91, 2.97, 0.35)); ac.getAtom(0).setPoint3d(new Point3d(3.56, 1.71, 1.16)); ac.getAtom(0).setPoint3d(new Point3d(2.14, 2.31, 1.29)); ac.getAtom(0).setPoint3d(new Point3d(0, 1.53, 0)); ac.getAtom(0).setPoint3d(new Point3d(2.83, 3.69, 1.17)); ac.getAtom(0).setPoint3d(new Point3d(3.32, 4.27, 2.49)); ac.getAtom(0).setPoint3d(new Point3d(2.02, 4.68, 0.35)); Point3d center = new AtomPlacer3D().geometricCenterAllPlacedAtoms(ac); Assert.assertEquals(2.02, center.x, 0.01); Assert.assertEquals(4.68, center.y, 0.01); Assert.assertEquals(0.35, center.z, 0.01); }