@Test public void emptyAtomsListTest() { List<IAtom> atoms = new ArrayList<IAtom>(); // switch on debugging, to see if NPE is thrown AtomPlacer placer = new AtomPlacer(); boolean npeThrown = false; try { placer.populatePolygonCorners(atoms, new Point2d(0, 0), 0, 10, 10); } catch (NullPointerException npe) { npeThrown = true; } Assert.assertFalse("Null pointer for empty atoms list", npeThrown); }
@Test public void triangleTest() { List<IAtom> atoms = new ArrayList<IAtom>(); atoms.add(new Atom("C")); atoms.add(new Atom("C")); atoms.add(new Atom("C")); AtomPlacer placer = new AtomPlacer(); placer.populatePolygonCorners(atoms, new Point2d(0, 0), 0, 10, 10); for (IAtom atom : atoms) { Assert.assertNotNull(atom.getPoint2d()); } }
ac.removeAtom(ac.getAtom(0)); AtomPlacer ap=new AtomPlacer(); while(lastplaced!=null){ IAtomContainer placedNeighbours=ac.getBuilder().newInstance(IAtomContainer.class);
logger.debug("bond length", bondLength); AtomPlacer atomPlacer = new AtomPlacer(); atomPlacer.setMolecule(container);
logger.debug("bond length", bondLength); AtomPlacer atomPlacer = new AtomPlacer(); atomPlacer.setMolecule(container);
AtomPlacer atomPlacer = new AtomPlacer(); atomPlacer.setMolecule(chemModel.getBuilder().newInstance(IAtomContainer.class,atomCon)); double bondLength;
m.getAtom(0).setFlag(CDKConstants.ISPLACED, true); AtomPlacer atomPlacer = new AtomPlacer(); atomPlacer.setMolecule(m); atomPlacer.placeLinearChain(m, new Vector2d(0, 1.5), 1.5);
@Test public void cumulated_x2() { IAtomContainer m = new AtomContainer(5, 4, 0, 0); m.addAtom(atom("C", 3)); m.addAtom(atom("C", 1)); m.addAtom(atom("C", 0)); m.addAtom(atom("C", 1)); m.addAtom(atom("C", 3)); m.addBond(0, 1, IBond.Order.SINGLE); m.addBond(1, 2, IBond.Order.DOUBLE); m.addBond(2, 3, IBond.Order.DOUBLE); m.addBond(3, 4, IBond.Order.SINGLE); m.getAtom(0).setPoint2d(new Point2d(0, 0)); m.getAtom(0).setFlag(CDKConstants.ISPLACED, true); AtomPlacer atomPlacer = new AtomPlacer(); atomPlacer.setMolecule(m); atomPlacer.placeLinearChain(m, new Vector2d(0, 1.5), 1.5); Point2d p1 = m.getAtom(1).getPoint2d(); Point2d p2 = m.getAtom(2).getPoint2d(); Point2d p3 = m.getAtom(3).getPoint2d(); Vector2d p2p1 = new Vector2d(p1.x - p2.x, p1.y - p2.y); Vector2d p2p3 = new Vector2d(p3.x - p2.x, p3.y - p2.y); p2p1.normalize(); p2p3.normalize(); double theta = Math.acos(p2p1.x * p2p3.x + p2p1.y * p2p3.y); assertThat(theta, closeTo(Math.PI, 0.05)); }
AtomPlacer atomPlacer = new AtomPlacer(); AtomPlacer3D ap3d = new AtomPlacer3D(); AtomTetrahedralLigandPlacer3D atlp3d = new AtomTetrahedralLigandPlacer3D();