test_class.file: tool/builder3d/src/test/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3DTest.java
test_class.identifier: AtomTetrahedralLigandPlacer3DTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testAdd3DCoordinatesForSinglyBondedLigands_IAtomContainer() throws Exception {
          IAtom atom1 = new Atom("C");
          atom1.setPoint3d(new Point3d(1, 1, 1));
          IAtom atom2 = new Atom("H");
          IAtom atom3 = new Atom("H");
          IAtom atom4 = new Atom("H");
          IAtom atom5 = new Atom("H");
          IBond bond1 = new Bond(atom1, atom2);
          IBond bond2 = new Bond(atom1, atom3);
          IBond bond3 = new Bond(atom1, atom4);
          IBond bond4 = new Bond(atom1, atom5);
          IAtomContainer ac = atom1.getBuilder().newInstance(IAtomContainer.class);
          atom1.setFormalNeighbourCount(4);
          atom2.setFormalNeighbourCount(1);
          atom3.setFormalNeighbourCount(1);
          atom4.setFormalNeighbourCount(1);
          atom5.setFormalNeighbourCount(1);
          ac.addAtom(atom1);
          ac.addAtom(atom2);
          ac.addAtom(atom3);
          ac.addAtom(atom4);
          ac.addAtom(atom5);
          ac.addBond(bond1);
          ac.addBond(bond2);
          ac.addBond(bond3);
          ac.addBond(bond4);
          new AtomTetrahedralLigandPlacer3D().add3DCoordinatesForSinglyBondedLigands(ac);
          ModelBuilder3DTest.checkAverageBondLength(ac);
      }
test_case.class_method_signature: AtomTetrahedralLigandPlacer3DTest.testAdd3DCoordinatesForSinglyBondedLigands_IAtomContainer()
test_case.full_signature: @Test public void testAdd3DCoordinatesForSinglyBondedLigands_IAtomContainer()
test_case.identifier: testAdd3DCoordinatesForSinglyBondedLigands_IAtomContainer
test_case.invocations: setPoint3d newInstance getBuilder setFormalNeighbourCount setFormalNeighbourCount setFormalNeighbourCount setFormalNeighbourCount setFormalNeighbourCount addAtom addAtom addAtom addAtom addAtom addBond addBond addBond addBond add3DCoordinatesForSinglyBondedLigands checkAverageBondLength
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAdd3DCoordinatesForSinglyBondedLigands_IAtomContainer()
focal_class.declarator: pSet                  = null
focal_class.modifier: private
focal_class.original_string: private Map                 pSet                  = null;
focal_class.type: Map
focal_class.var_name: pSet
focal_class.declarator: DEFAULT_BOND_LENGTH_H = 1.0
focal_class.modifier: public final static
focal_class.original_string: public final static double  DEFAULT_BOND_LENGTH_H = 1.0;
focal_class.type: double
focal_class.var_name: DEFAULT_BOND_LENGTH_H
focal_class.declarator: TETRAHEDRAL_ANGLE     = 2.0 * Math.acos(1.0 / Math.sqrt(3.0))
focal_class.modifier: public final static
focal_class.original_string: public final static double  TETRAHEDRAL_ANGLE     = 2.0 * Math.acos(1.0 / Math.sqrt(3.0));
focal_class.type: double
focal_class.var_name: TETRAHEDRAL_ANGLE
focal_class.declarator: SP2_ANGLE             = 120 * Math.PI / 180
focal_class.modifier: private final static
focal_class.original_string: private final static double SP2_ANGLE             = 120 * Math.PI / 180;
focal_class.type: double
focal_class.var_name: SP2_ANGLE
focal_class.declarator: SP_ANGLE              = Math.PI
focal_class.modifier: private final static
focal_class.original_string: private final static double SP_ANGLE              = Math.PI;
focal_class.type: double
focal_class.var_name: SP_ANGLE
focal_class.declarator: XV                    = new Vector3d(1.0, 0.0, 0.0)
focal_class.modifier: final static
focal_class.original_string: final static Vector3d       XV                    = new Vector3d(1.0, 0.0, 0.0);
focal_class.type: Vector3d
focal_class.var_name: XV
focal_class.declarator: YV                    = new Vector3d(0.0, 1.0, 0.0)
focal_class.modifier: final static
focal_class.original_string: final static Vector3d       YV                    = new Vector3d(0.0, 1.0, 0.0);
focal_class.type: Vector3d
focal_class.var_name: YV
focal_class.file: tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomTetrahedralLigandPlacer3D.java
focal_class.identifier: AtomTetrahedralLigandPlacer3D
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.AtomTetrahedralLigandPlacer3D()
focal_class.full_signature:   AtomTetrahedralLigandPlacer3D()
focal_class.identifier: AtomTetrahedralLigandPlacer3D
focal_class.parameters: ()
focal_class.signature:  AtomTetrahedralLigandPlacer3D()
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.setParameterSet(Map moleculeParameter)
focal_class.full_signature: public void setParameterSet(Map moleculeParameter)
focal_class.identifier: setParameterSet
focal_class.modifiers: public
focal_class.parameters: (Map moleculeParameter)
focal_class.return: void
focal_class.signature: void setParameterSet(Map moleculeParameter)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.add3DCoordinatesForSinglyBondedLigands(IAtomContainer atomContainer)
focal_class.full_signature: public void add3DCoordinatesForSinglyBondedLigands(IAtomContainer atomContainer)
focal_class.identifier: add3DCoordinatesForSinglyBondedLigands
focal_class.modifiers: public
focal_class.parameters: (IAtomContainer atomContainer)
focal_class.return: void
focal_class.signature: void add3DCoordinatesForSinglyBondedLigands(IAtomContainer atomContainer)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.rescaleBondLength(IAtom atom1, IAtom atom2, Point3d point2)
focal_class.full_signature: public Point3d rescaleBondLength(IAtom atom1, IAtom atom2, Point3d point2)
focal_class.identifier: rescaleBondLength
focal_class.modifiers: public
focal_class.parameters: (IAtom atom1, IAtom atom2, Point3d point2)
focal_class.return: Point3d
focal_class.signature: Point3d rescaleBondLength(IAtom atom1, IAtom atom2, Point3d point2)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.get3DCoordinatesForLigands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, int nwanted, double length, double angle)
focal_class.full_signature: public Point3d[] get3DCoordinatesForLigands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, int nwanted, double length, double angle)
focal_class.identifier: get3DCoordinatesForLigands
focal_class.modifiers: public
focal_class.parameters: (IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, int nwanted, double length, double angle)
focal_class.return: Point3d[]
focal_class.signature: Point3d[] get3DCoordinatesForLigands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, int nwanted, double length, double angle)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.get3DCoordinatesForSPLigands(IAtom refAtom, IAtomContainer withCoords, double length, double angle)
focal_class.full_signature: public Point3d get3DCoordinatesForSPLigands(IAtom refAtom, IAtomContainer withCoords, double length, double angle)
focal_class.identifier: get3DCoordinatesForSPLigands
focal_class.modifiers: public
focal_class.parameters: (IAtom refAtom, IAtomContainer withCoords, double length, double angle)
focal_class.return: Point3d
focal_class.signature: Point3d get3DCoordinatesForSPLigands(IAtom refAtom, IAtomContainer withCoords, double length, double angle)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.get3DCoordinatesForSP2Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, double length, double angle)
focal_class.full_signature: public Point3d[] get3DCoordinatesForSP2Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, double length, double angle)
focal_class.identifier: get3DCoordinatesForSP2Ligands
focal_class.modifiers: public
focal_class.parameters: (IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, double length, double angle)
focal_class.return: Point3d[]
focal_class.signature: Point3d[] get3DCoordinatesForSP2Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, double length, double angle)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.get3DCoordinatesForSP3Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, int nwanted, double length, double angle)
focal_class.full_signature: public Point3d[] get3DCoordinatesForSP3Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, int nwanted, double length, double angle)
focal_class.identifier: get3DCoordinatesForSP3Ligands
focal_class.modifiers: public
focal_class.parameters: (IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, int nwanted, double length, double angle)
focal_class.return: Point3d[]
focal_class.signature: Point3d[] get3DCoordinatesForSP3Ligands(IAtom refAtom, IAtomContainer noCoords, IAtomContainer withCoords,
              IAtom atomC, int nwanted, double length, double angle)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.calculate3DCoordinates0(Point3d aPoint, int nwanted, double length)
focal_class.full_signature: public Point3d[] calculate3DCoordinates0(Point3d aPoint, int nwanted, double length)
focal_class.identifier: calculate3DCoordinates0
focal_class.modifiers: public
focal_class.parameters: (Point3d aPoint, int nwanted, double length)
focal_class.return: Point3d[]
focal_class.signature: Point3d[] calculate3DCoordinates0(Point3d aPoint, int nwanted, double length)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.calculate3DCoordinates1(Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
              double length, double angle)
focal_class.full_signature: public Point3d[] calculate3DCoordinates1(Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
              double length, double angle)
focal_class.identifier: calculate3DCoordinates1
focal_class.modifiers: public
focal_class.parameters: (Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
              double length, double angle)
focal_class.return: Point3d[]
focal_class.signature: Point3d[] calculate3DCoordinates1(Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
              double length, double angle)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.calculate3DCoordinates2(Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
              double length, double angle)
focal_class.full_signature: public Point3d[] calculate3DCoordinates2(Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
              double length, double angle)
focal_class.identifier: calculate3DCoordinates2
focal_class.modifiers: public
focal_class.parameters: (Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
              double length, double angle)
focal_class.return: Point3d[]
focal_class.signature: Point3d[] calculate3DCoordinates2(Point3d aPoint, Point3d bPoint, Point3d cPoint, int nwanted,
              double length, double angle)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.calculate3DCoordinates3(Point3d aPoint, Point3d bPoint, Point3d cPoint, Point3d dPoint, double length)
focal_class.full_signature: public Point3d calculate3DCoordinates3(Point3d aPoint, Point3d bPoint, Point3d cPoint, Point3d dPoint, double length)
focal_class.identifier: calculate3DCoordinates3
focal_class.modifiers: public
focal_class.parameters: (Point3d aPoint, Point3d bPoint, Point3d cPoint, Point3d dPoint, double length)
focal_class.return: Point3d
focal_class.signature: Point3d calculate3DCoordinates3(Point3d aPoint, Point3d bPoint, Point3d cPoint, Point3d dPoint, double length)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.calculate3DCoordinatesSP2_1(Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
              double angle)
focal_class.full_signature: public Point3d calculate3DCoordinatesSP2_1(Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
              double angle)
focal_class.identifier: calculate3DCoordinatesSP2_1
focal_class.modifiers: public
focal_class.parameters: (Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
              double angle)
focal_class.return: Point3d
focal_class.signature: Point3d calculate3DCoordinatesSP2_1(Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
              double angle)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.calculate3DCoordinatesSP2_2(Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
              double angle)
focal_class.full_signature: public Point3d[] calculate3DCoordinatesSP2_2(Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
              double angle)
focal_class.identifier: calculate3DCoordinatesSP2_2
focal_class.modifiers: public
focal_class.parameters: (Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
              double angle)
focal_class.return: Point3d[]
focal_class.signature: Point3d[] calculate3DCoordinatesSP2_2(Point3d aPoint, Point3d bPoint, Point3d cPoint, double length,
              double angle)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.getNonColinearVector(Vector3d ab)
focal_class.full_signature: private Vector3d getNonColinearVector(Vector3d ab)
focal_class.identifier: getNonColinearVector
focal_class.modifiers: private
focal_class.parameters: (Vector3d ab)
focal_class.return: Vector3d
focal_class.signature: Vector3d getNonColinearVector(Vector3d ab)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.rotate(Vector3d vector, Vector3d axis, double angle)
focal_class.full_signature: public static Vector3d rotate(Vector3d vector, Vector3d axis, double angle)
focal_class.identifier: rotate
focal_class.modifiers: public static
focal_class.parameters: (Vector3d vector, Vector3d axis, double angle)
focal_class.return: Vector3d
focal_class.signature: Vector3d rotate(Vector3d vector, Vector3d axis, double angle)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.getDistanceValue(String id1, String id2)
focal_class.full_signature: private double getDistanceValue(String id1, String id2)
focal_class.identifier: getDistanceValue
focal_class.modifiers: private
focal_class.parameters: (String id1, String id2)
focal_class.return: double
focal_class.signature: double getDistanceValue(String id1, String id2)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.getAngleValue(String id1, String id2, String id3)
focal_class.full_signature: public double getAngleValue(String id1, String id2, String id3)
focal_class.identifier: getAngleValue
focal_class.modifiers: public
focal_class.parameters: (String id1, String id2, String id3)
focal_class.return: double
focal_class.signature: double getAngleValue(String id1, String id2, String id3)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.makeStereocenter(Point3d atomA, IBond ax, Point3d atomB, Point3d atomC, Point3d[] branchPoints)
focal_class.full_signature: public int makeStereocenter(Point3d atomA, IBond ax, Point3d atomB, Point3d atomC, Point3d[] branchPoints)
focal_class.identifier: makeStereocenter
focal_class.modifiers: public
focal_class.parameters: (Point3d atomA, IBond ax, Point3d atomB, Point3d atomC, Point3d[] branchPoints)
focal_class.return: int
focal_class.signature: int makeStereocenter(Point3d atomA, IBond ax, Point3d atomB, Point3d atomC, Point3d[] branchPoints)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.getSpatproduct(Vector3d a, Vector3d b, Vector3d c)
focal_class.full_signature: public double getSpatproduct(Vector3d a, Vector3d b, Vector3d c)
focal_class.identifier: getSpatproduct
focal_class.modifiers: public
focal_class.parameters: (Vector3d a, Vector3d b, Vector3d c)
focal_class.return: double
focal_class.signature: double getSpatproduct(Vector3d a, Vector3d b, Vector3d c)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.getTorsionAngle(Point3d a, Point3d b, Point3d c, Point3d d)
focal_class.full_signature: public double getTorsionAngle(Point3d a, Point3d b, Point3d c, Point3d d)
focal_class.identifier: getTorsionAngle
focal_class.modifiers: public
focal_class.parameters: (Point3d a, Point3d b, Point3d c, Point3d d)
focal_class.return: double
focal_class.signature: double getTorsionAngle(Point3d a, Point3d b, Point3d c, Point3d d)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.getPlacedAtomsInAtomContainer(IAtom atom, IAtomContainer ac)
focal_class.full_signature: public IAtomContainer getPlacedAtomsInAtomContainer(IAtom atom, IAtomContainer ac)
focal_class.identifier: getPlacedAtomsInAtomContainer
focal_class.modifiers: public
focal_class.parameters: (IAtom atom, IAtomContainer ac)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer getPlacedAtomsInAtomContainer(IAtom atom, IAtomContainer ac)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.getUnsetAtomsInAtomContainer(IAtom atom, IAtomContainer ac)
focal_class.full_signature: public IAtomContainer getUnsetAtomsInAtomContainer(IAtom atom, IAtomContainer ac)
focal_class.identifier: getUnsetAtomsInAtomContainer
focal_class.modifiers: public
focal_class.parameters: (IAtom atom, IAtomContainer ac)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer getUnsetAtomsInAtomContainer(IAtom atom, IAtomContainer ac)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.hasUnsetNeighbour(IAtom atom, IAtomContainer ac)
focal_class.full_signature: public boolean hasUnsetNeighbour(IAtom atom, IAtomContainer ac)
focal_class.identifier: hasUnsetNeighbour
focal_class.modifiers: public
focal_class.parameters: (IAtom atom, IAtomContainer ac)
focal_class.return: boolean
focal_class.signature: boolean hasUnsetNeighbour(IAtom atom, IAtomContainer ac)
focal_class.class_method_signature: AtomTetrahedralLigandPlacer3D.getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac)
focal_class.full_signature: public IAtom getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac)
focal_class.identifier: getPlacedHeavyAtomInAtomContainer
focal_class.modifiers: public
focal_class.parameters: (IAtom atomA, IAtom atomB, IAtomContainer ac)
focal_class.return: IAtom
focal_class.signature: IAtom getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac)
focal_method.body: public void add3DCoordinatesForSinglyBondedLigands(IAtomContainer atomContainer) throws CDKException {
          IAtom refAtom = null;
          IAtom atomC = null;
          int nwanted = 0;
          for (int i = 0; i < atomContainer.getAtomCount(); i++) {
              refAtom = atomContainer.getAtom(i);
              if (!refAtom.getSymbol().equals("H") && hasUnsetNeighbour(refAtom, atomContainer)) {
                  IAtomContainer noCoords = getUnsetAtomsInAtomContainer(refAtom, atomContainer);
                  IAtomContainer withCoords = getPlacedAtomsInAtomContainer(refAtom, atomContainer);
                  if (withCoords.getAtomCount() > 0) {
                      atomC = getPlacedHeavyAtomInAtomContainer(withCoords.getAtom(0), refAtom, atomContainer);
                  }
                  if (refAtom.getFormalNeighbourCount() == 0 && refAtom.getSymbol().equals("C")) {
                      nwanted = noCoords.getAtomCount();
                  } else if (refAtom.getFormalNeighbourCount() == 0 && !refAtom.getSymbol().equals("C")) {
                      nwanted = 4;
                  } else {
                      nwanted = refAtom.getFormalNeighbourCount() - withCoords.getAtomCount();
                  }
                  Point3d[] newPoints = get3DCoordinatesForLigands(refAtom, noCoords, withCoords, atomC, nwanted,
                          DEFAULT_BOND_LENGTH_H, -1);
                  for (int j = 0; j < noCoords.getAtomCount(); j++) {
                      IAtom ligand = noCoords.getAtom(j);
                      Point3d newPoint = rescaleBondLength(refAtom, ligand, newPoints[j]);
                      ligand.setPoint3d(newPoint);
                      ligand.setFlag(CDKConstants.ISPLACED, true);
                  }
  
                  noCoords.removeAllElements();
                  withCoords.removeAllElements();
              }
          }
      }
focal_method.class_method_signature: AtomTetrahedralLigandPlacer3D.add3DCoordinatesForSinglyBondedLigands(IAtomContainer atomContainer)
focal_method.full_signature: public void add3DCoordinatesForSinglyBondedLigands(IAtomContainer atomContainer)
focal_method.identifier: add3DCoordinatesForSinglyBondedLigands
focal_method.invocations: getAtomCount getAtom equals getSymbol hasUnsetNeighbour getUnsetAtomsInAtomContainer getPlacedAtomsInAtomContainer getAtomCount getPlacedHeavyAtomInAtomContainer getAtom getFormalNeighbourCount equals getSymbol getAtomCount getFormalNeighbourCount equals getSymbol getFormalNeighbourCount getAtomCount get3DCoordinatesForLigands getAtomCount getAtom rescaleBondLength setPoint3d setFlag removeAllElements removeAllElements
focal_method.modifiers: public
focal_method.parameters: (IAtomContainer atomContainer)
focal_method.return: void
focal_method.signature: void add3DCoordinatesForSinglyBondedLigands(IAtomContainer atomContainer)