test_class.file: tool/sdg/src/test/java/org/openscience/cdk/layout/AtomPlacerTest.java
test_class.identifier: AtomPlacerTest
test_class.superclass: extends CDKTestCase
test_case.body: @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_case.class_method_signature: AtomPlacerTest.emptyAtomsListTest()
test_case.full_signature: @Test public void emptyAtomsListTest()
test_case.identifier: emptyAtomsListTest
test_case.invocations: populatePolygonCorners assertFalse
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void emptyAtomsListTest()
focal_class.declarator: ANGLE_120 = Math.toRadians(120)
focal_class.modifier: private static final
focal_class.original_string: private static final double ANGLE_120 = Math.toRadians(120);
focal_class.type: double
focal_class.var_name: ANGLE_120
focal_class.declarator: debug = true
focal_class.modifier: public final static
focal_class.original_string: public final static boolean debug = true;
focal_class.type: boolean
focal_class.var_name: debug
focal_class.declarator: PRIORITY = "Weight"
focal_class.modifier: public static final
focal_class.original_string: public static final String PRIORITY = "Weight";
focal_class.type: String
focal_class.var_name: PRIORITY
focal_class.declarator: logger = LoggingToolFactory.createLoggingTool(AtomPlacer.class)
focal_class.modifier: private static
focal_class.original_string: private static ILoggingTool logger = LoggingToolFactory.createLoggingTool(AtomPlacer.class);
focal_class.type: ILoggingTool
focal_class.var_name: logger
focal_class.declarator: molecule = null
focal_class.original_string: IAtomContainer molecule = null;
focal_class.type: IAtomContainer
focal_class.var_name: molecule
focal_class.file: tool/sdg/src/main/java/org/openscience/cdk/layout/AtomPlacer.java
focal_class.identifier: AtomPlacer
focal_class.class_method_signature: AtomPlacer.AtomPlacer()
focal_class.full_signature: public  AtomPlacer()
focal_class.identifier: AtomPlacer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  AtomPlacer()
focal_class.class_method_signature: AtomPlacer.getMolecule()
focal_class.full_signature: public IAtomContainer getMolecule()
focal_class.identifier: getMolecule
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer getMolecule()
focal_class.class_method_signature: AtomPlacer.setMolecule(IAtomContainer molecule)
focal_class.full_signature: public void setMolecule(IAtomContainer molecule)
focal_class.identifier: setMolecule
focal_class.modifiers: public
focal_class.parameters: (IAtomContainer molecule)
focal_class.return: void
focal_class.signature: void setMolecule(IAtomContainer molecule)
focal_class.class_method_signature: AtomPlacer.distributePartners(IAtom atom, IAtomContainer placedNeighbours, Point2d sharedAtomsCenter,
              IAtomContainer unplacedNeighbours, double bondLength)
focal_class.full_signature: public void distributePartners(IAtom atom, IAtomContainer placedNeighbours, Point2d sharedAtomsCenter,
              IAtomContainer unplacedNeighbours, double bondLength)
focal_class.identifier: distributePartners
focal_class.modifiers: public
focal_class.parameters: (IAtom atom, IAtomContainer placedNeighbours, Point2d sharedAtomsCenter,
              IAtomContainer unplacedNeighbours, double bondLength)
focal_class.return: void
focal_class.signature: void distributePartners(IAtom atom, IAtomContainer placedNeighbours, Point2d sharedAtomsCenter,
              IAtomContainer unplacedNeighbours, double bondLength)
focal_class.class_method_signature: AtomPlacer.doAngleSnap(IAtom atom, IAtomContainer placedNeighbours)
focal_class.full_signature: private boolean doAngleSnap(IAtom atom, IAtomContainer placedNeighbours)
focal_class.identifier: doAngleSnap
focal_class.modifiers: private
focal_class.parameters: (IAtom atom, IAtomContainer placedNeighbours)
focal_class.return: boolean
focal_class.signature: boolean doAngleSnap(IAtom atom, IAtomContainer placedNeighbours)
focal_class.class_method_signature: AtomPlacer.placeLinearChain(IAtomContainer atomContainer, Vector2d initialBondVector, double bondLength)
focal_class.full_signature: public void placeLinearChain(IAtomContainer atomContainer, Vector2d initialBondVector, double bondLength)
focal_class.identifier: placeLinearChain
focal_class.modifiers: public
focal_class.parameters: (IAtomContainer atomContainer, Vector2d initialBondVector, double bondLength)
focal_class.return: void
focal_class.signature: void placeLinearChain(IAtomContainer atomContainer, Vector2d initialBondVector, double bondLength)
focal_class.class_method_signature: AtomPlacer.isTerminalD4(IAtom atom)
focal_class.full_signature: private boolean isTerminalD4(IAtom atom)
focal_class.identifier: isTerminalD4
focal_class.modifiers: private
focal_class.parameters: (IAtom atom)
focal_class.return: boolean
focal_class.signature: boolean isTerminalD4(IAtom atom)
focal_class.class_method_signature: AtomPlacer.getNextBondVector(IAtom atom, IAtom previousAtom, Point2d distanceMeasure, boolean trans)
focal_class.full_signature: public Vector2d getNextBondVector(IAtom atom, IAtom previousAtom, Point2d distanceMeasure, boolean trans)
focal_class.identifier: getNextBondVector
focal_class.modifiers: public
focal_class.parameters: (IAtom atom, IAtom previousAtom, Point2d distanceMeasure, boolean trans)
focal_class.return: Vector2d
focal_class.signature: Vector2d getNextBondVector(IAtom atom, IAtom previousAtom, Point2d distanceMeasure, boolean trans)
focal_class.class_method_signature: AtomPlacer.populatePolygonCorners(final List<IAtom> atoms,
                                         final Point2d center,
                                         final double thetaBeg,
                                         final double thetaStep,
                                         final double radius)
focal_class.full_signature: public void populatePolygonCorners(final List<IAtom> atoms,
                                         final Point2d center,
                                         final double thetaBeg,
                                         final double thetaStep,
                                         final double radius)
focal_class.identifier: populatePolygonCorners
focal_class.modifiers: public
focal_class.parameters: (final List<IAtom> atoms,
                                         final Point2d center,
                                         final double thetaBeg,
                                         final double thetaStep,
                                         final double radius)
focal_class.return: void
focal_class.signature: void populatePolygonCorners(final List<IAtom> atoms,
                                         final Point2d center,
                                         final double thetaBeg,
                                         final double thetaStep,
                                         final double radius)
focal_class.class_method_signature: AtomPlacer.partitionPartners(IAtom atom, IAtomContainer unplacedPartners, IAtomContainer placedPartners)
focal_class.full_signature: public void partitionPartners(IAtom atom, IAtomContainer unplacedPartners, IAtomContainer placedPartners)
focal_class.identifier: partitionPartners
focal_class.modifiers: public
focal_class.parameters: (IAtom atom, IAtomContainer unplacedPartners, IAtomContainer placedPartners)
focal_class.return: void
focal_class.signature: void partitionPartners(IAtom atom, IAtomContainer unplacedPartners, IAtomContainer placedPartners)
focal_class.class_method_signature: AtomPlacer.getInitialLongestChain(IAtomContainer molecule)
focal_class.full_signature: static public IAtomContainer getInitialLongestChain(IAtomContainer molecule)
focal_class.identifier: getInitialLongestChain
focal_class.modifiers: static public
focal_class.parameters: (IAtomContainer molecule)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer getInitialLongestChain(IAtomContainer molecule)
focal_class.class_method_signature: AtomPlacer.getLongestUnplacedChain(IAtomContainer molecule, IAtom startAtom)
focal_class.full_signature: static public IAtomContainer getLongestUnplacedChain(IAtomContainer molecule, IAtom startAtom)
focal_class.identifier: getLongestUnplacedChain
focal_class.modifiers: static public
focal_class.parameters: (IAtomContainer molecule, IAtom startAtom)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer getLongestUnplacedChain(IAtomContainer molecule, IAtom startAtom)
focal_class.class_method_signature: AtomPlacer.breadthFirstSearch(IAtomContainer ac, List<IAtom> sphere, IAtomContainer[] pathes)
focal_class.full_signature: static public void breadthFirstSearch(IAtomContainer ac, List<IAtom> sphere, IAtomContainer[] pathes)
focal_class.identifier: breadthFirstSearch
focal_class.modifiers: static public
focal_class.parameters: (IAtomContainer ac, List<IAtom> sphere, IAtomContainer[] pathes)
focal_class.return: void
focal_class.signature: void breadthFirstSearch(IAtomContainer ac, List<IAtom> sphere, IAtomContainer[] pathes)
focal_class.class_method_signature: AtomPlacer.listPlaced(IAtomContainer ac)
focal_class.full_signature: public String listPlaced(IAtomContainer ac)
focal_class.identifier: listPlaced
focal_class.modifiers: public
focal_class.parameters: (IAtomContainer ac)
focal_class.return: String
focal_class.signature: String listPlaced(IAtomContainer ac)
focal_class.class_method_signature: AtomPlacer.listNumbers(IAtomContainer mol, IAtomContainer ac)
focal_class.full_signature: static public String listNumbers(IAtomContainer mol, IAtomContainer ac)
focal_class.identifier: listNumbers
focal_class.modifiers: static public
focal_class.parameters: (IAtomContainer mol, IAtomContainer ac)
focal_class.return: String
focal_class.signature: String listNumbers(IAtomContainer mol, IAtomContainer ac)
focal_class.class_method_signature: AtomPlacer.listNumbers(IAtomContainer mol, List<IAtom> ac)
focal_class.full_signature: static public String listNumbers(IAtomContainer mol, List<IAtom> ac)
focal_class.identifier: listNumbers
focal_class.modifiers: static public
focal_class.parameters: (IAtomContainer mol, List<IAtom> ac)
focal_class.return: String
focal_class.signature: String listNumbers(IAtomContainer mol, List<IAtom> ac)
focal_class.class_method_signature: AtomPlacer.allPlaced(IAtomContainer ac)
focal_class.full_signature: static public boolean allPlaced(IAtomContainer ac)
focal_class.identifier: allPlaced
focal_class.modifiers: static public
focal_class.parameters: (IAtomContainer ac)
focal_class.return: boolean
focal_class.signature: boolean allPlaced(IAtomContainer ac)
focal_class.class_method_signature: AtomPlacer.markNotPlaced(IAtomContainer ac)
focal_class.full_signature: static public void markNotPlaced(IAtomContainer ac)
focal_class.identifier: markNotPlaced
focal_class.modifiers: static public
focal_class.parameters: (IAtomContainer ac)
focal_class.return: void
focal_class.signature: void markNotPlaced(IAtomContainer ac)
focal_class.class_method_signature: AtomPlacer.markPlaced(IAtomContainer ac)
focal_class.full_signature: static public void markPlaced(IAtomContainer ac)
focal_class.identifier: markPlaced
focal_class.modifiers: static public
focal_class.parameters: (IAtomContainer ac)
focal_class.return: void
focal_class.signature: void markPlaced(IAtomContainer ac)
focal_class.class_method_signature: AtomPlacer.getPlacedAtoms(IAtomContainer ac)
focal_class.full_signature: static public IAtomContainer getPlacedAtoms(IAtomContainer ac)
focal_class.identifier: getPlacedAtoms
focal_class.modifiers: static public
focal_class.parameters: (IAtomContainer ac)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer getPlacedAtoms(IAtomContainer ac)
focal_class.class_method_signature: AtomPlacer.copyPlaced(IRing dest, IAtomContainer src)
focal_class.full_signature: static void copyPlaced(IRing dest, IAtomContainer src)
focal_class.identifier: copyPlaced
focal_class.modifiers: static
focal_class.parameters: (IRing dest, IAtomContainer src)
focal_class.return: void
focal_class.signature: void copyPlaced(IRing dest, IAtomContainer src)
focal_class.class_method_signature: AtomPlacer.getDegreeSum(IAtomContainer ac, IAtomContainer superAC)
focal_class.full_signature: static int getDegreeSum(IAtomContainer ac, IAtomContainer superAC)
focal_class.identifier: getDegreeSum
focal_class.modifiers: static
focal_class.parameters: (IAtomContainer ac, IAtomContainer superAC)
focal_class.return: int
focal_class.signature: int getDegreeSum(IAtomContainer ac, IAtomContainer superAC)
focal_class.class_method_signature: AtomPlacer.prioritise(IAtomContainer mol)
focal_class.full_signature: static void prioritise(IAtomContainer mol)
focal_class.identifier: prioritise
focal_class.modifiers: static
focal_class.parameters: (IAtomContainer mol)
focal_class.return: void
focal_class.signature: void prioritise(IAtomContainer mol)
focal_class.class_method_signature: AtomPlacer.prioritise(IAtomContainer mol, int[][] adjList)
focal_class.full_signature: static void prioritise(IAtomContainer mol, int[][] adjList)
focal_class.identifier: prioritise
focal_class.modifiers: static
focal_class.parameters: (IAtomContainer mol, int[][] adjList)
focal_class.return: void
focal_class.signature: void prioritise(IAtomContainer mol, int[][] adjList)
focal_class.class_method_signature: AtomPlacer.getPriority(IAtomContainer mol, int[][] adjList)
focal_class.full_signature: static int[] getPriority(IAtomContainer mol, int[][] adjList)
focal_class.identifier: getPriority
focal_class.modifiers: static
focal_class.parameters: (IAtomContainer mol, int[][] adjList)
focal_class.return: int[]
focal_class.signature: int[] getPriority(IAtomContainer mol, int[][] adjList)
focal_class.class_method_signature: AtomPlacer.isColinear(IAtom atom, Iterable<IBond> bonds)
focal_class.full_signature: static boolean isColinear(IAtom atom, Iterable<IBond> bonds)
focal_class.identifier: isColinear
focal_class.modifiers: static
focal_class.parameters: (IAtom atom, Iterable<IBond> bonds)
focal_class.return: boolean
focal_class.signature: boolean isColinear(IAtom atom, Iterable<IBond> bonds)
focal_class.class_method_signature: AtomPlacer.shouldBeLinear(IAtom atom, IAtomContainer molecule)
focal_class.full_signature: @Deprecated static public boolean shouldBeLinear(IAtom atom, IAtomContainer molecule)
focal_class.identifier: shouldBeLinear
focal_class.modifiers: @Deprecated static public
focal_class.parameters: (IAtom atom, IAtomContainer molecule)
focal_class.return: boolean
focal_class.signature: boolean shouldBeLinear(IAtom atom, IAtomContainer molecule)
focal_class.class_method_signature: AtomPlacer.newVector(Tuple2d to, Tuple2d from)
focal_class.full_signature: static Vector2d newVector(Tuple2d to, Tuple2d from)
focal_class.identifier: newVector
focal_class.modifiers: static
focal_class.parameters: (Tuple2d to, Tuple2d from)
focal_class.return: Vector2d
focal_class.signature: Vector2d newVector(Tuple2d to, Tuple2d from)
focal_method.body: public void populatePolygonCorners(final List<IAtom> atoms,
                                         final Point2d center,
                                         final double thetaBeg,
                                         final double thetaStep,
                                         final double radius) {
          final int numAtoms = atoms.size();
          double theta = thetaBeg;
  
          logger.debug("populatePolygonCorners(numAtoms=", numAtoms, ", center=", center, ", thetaBeg=", Math.toDegrees(thetaBeg), ", r=", radius);
  
          for (IAtom atom : atoms) {
              theta += thetaStep;
              double x = Math.cos(theta) * radius;
              double y = Math.sin(theta) * radius;
              double newX = x + center.x;
              double newY = y + center.y;
              atom.setPoint2d(new Point2d(newX, newY));
              atom.setFlag(CDKConstants.ISPLACED, true);
              logger.debug("populatePolygonCorners - angle=", Math.toDegrees(theta), ", newX=", newX, ", newY=", newY);
          }
      }
focal_method.class_method_signature: AtomPlacer.populatePolygonCorners(final List<IAtom> atoms,
                                         final Point2d center,
                                         final double thetaBeg,
                                         final double thetaStep,
                                         final double radius)
focal_method.full_signature: public void populatePolygonCorners(final List<IAtom> atoms,
                                         final Point2d center,
                                         final double thetaBeg,
                                         final double thetaStep,
                                         final double radius)
focal_method.identifier: populatePolygonCorners
focal_method.invocations: size debug toDegrees cos sin setPoint2d setFlag debug toDegrees
focal_method.modifiers: public
focal_method.parameters: (final List<IAtom> atoms,
                                         final Point2d center,
                                         final double thetaBeg,
                                         final double thetaStep,
                                         final double radius)
focal_method.return: void
focal_method.signature: void populatePolygonCorners(final List<IAtom> atoms,
                                         final Point2d center,
                                         final double thetaBeg,
                                         final double thetaStep,
                                         final double radius)