AtomPlacer3D { public IAtomContainer getPlacedHeavyAtoms(IAtomContainer molecule, IAtom atom) { List<IBond> bonds = molecule.getConnectedBondsList(atom); IAtomContainer connectedAtoms = molecule.getBuilder().newInstance(IAtomContainer.class); IAtom connectedAtom = null; for (IBond bond : bonds) { connectedAtom = bond.getOther(atom); if (isPlacedHeavyAtom(connectedAtom)) { connectedAtoms.addAtom(connectedAtom); } } return connectedAtoms; } 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 testGetPlacedHeavyAtoms_IAtomContainer_IAtom() { IAtomContainer ac = makeAlphaPinene(); IAtomContainer acplaced = new AtomPlacer3D().getPlacedHeavyAtoms(ac, ac.getAtom(0)); Assert.assertEquals(0, acplaced.getAtomCount()); ac.getAtom(1).setFlag(CDKConstants.ISPLACED, true); acplaced = new AtomPlacer3D().getPlacedHeavyAtoms(ac, ac.getAtom(0)); Assert.assertEquals(1, acplaced.getAtomCount()); }