public class AtomPlacer extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
debug |
static String |
PRIORITY |
Constructor and Description |
---|
AtomPlacer()
Constructor for the AtomPlacer object
|
Modifier and Type | Method and Description |
---|---|
static boolean |
allPlaced(IAtomContainer ac)
True is all the atoms in the given AtomContainer have been placed
|
static void |
breadthFirstSearch(IAtomContainer ac,
List<IAtom> sphere,
IAtomContainer[] pathes)
Performs a breadthFirstSearch in an AtomContainer starting with a
particular sphere, which usually consists of one start atom, and searches
for the longest aliphatic chain which is yet unplaced.
|
void |
distributePartners(IAtom atom,
IAtomContainer placedNeighbours,
javax.vecmath.Point2d sharedAtomsCenter,
IAtomContainer unplacedNeighbours,
double bondLength)
Distribute the bonded atoms (neighbours) of an atom such that they fill the
remaining space around an atom in a geometrically nice way.
|
static IAtomContainer |
getInitialLongestChain(IAtomContainer molecule)
Search an aliphatic molecule for the longest chain.
|
static IAtomContainer |
getLongestUnplacedChain(IAtomContainer molecule,
IAtom startAtom)
Search a molecule for the longest unplaced, aliphatic chain in it.
|
IAtomContainer |
getMolecule()
Return the molecule the AtomPlacer currently works with
|
javax.vecmath.Vector2d |
getNextBondVector(IAtom atom,
IAtom previousAtom,
javax.vecmath.Point2d distanceMeasure,
boolean trans)
Returns the next bond vector needed for drawing an extended linear chain of
atoms.
|
static IAtomContainer |
getPlacedAtoms(IAtomContainer ac)
Get all the placed atoms in an AtomContainer
|
static String |
listNumbers(IAtomContainer mol,
IAtomContainer ac)
Returns a string with the numbers of all atoms in an AtomContainer relative
to a given molecule.
|
static String |
listNumbers(IAtomContainer mol,
List<IAtom> ac)
Returns a string with the numbers of all atoms in a Vector relative to a
given molecule.
|
String |
listPlaced(IAtomContainer ac)
Returns a string with the numbers of all placed atoms in an AtomContainer
|
static void |
markNotPlaced(IAtomContainer ac)
Marks all the atoms in the given AtomContainer as not placed
|
static void |
markPlaced(IAtomContainer ac)
Marks all the atoms in the given AtomContainer as placed
|
void |
partitionPartners(IAtom atom,
IAtomContainer unplacedPartners,
IAtomContainer placedPartners)
Partition the bonding partners of a given atom into placed (coordinates
assinged) and not placed.
|
void |
placeLinearChain(IAtomContainer atomContainer,
javax.vecmath.Vector2d initialBondVector,
double bondLength)
Places the atoms in a linear chain.
|
void |
populatePolygonCorners(List<IAtom> atoms,
javax.vecmath.Point2d center,
double thetaBeg,
double thetaStep,
double radius)
Populates the corners of a polygon with atoms.
|
void |
setMolecule(IAtomContainer molecule)
Sets the molecule the AtomPlacer currently works with
|
static boolean |
shouldBeLinear(IAtom atom,
IAtomContainer molecule)
Deprecated.
|
public static final boolean debug
public static final String PRIORITY
public IAtomContainer getMolecule()
public void setMolecule(IAtomContainer molecule)
molecule
- the molecule the AtomPlacer currently works withpublic void distributePartners(IAtom atom, IAtomContainer placedNeighbours, javax.vecmath.Point2d sharedAtomsCenter, IAtomContainer unplacedNeighbours, double bondLength)
atom
- The atom whose partners are to be placedplacedNeighbours
- The atoms which are already placedunplacedNeighbours
- The partners to be placedbondLength
- The standared bond length for the newly placed
AtomssharedAtomsCenter
- The 2D centre of the placed Atomspublic void placeLinearChain(IAtomContainer atomContainer, javax.vecmath.Vector2d initialBondVector, double bondLength)
Expects the first atom to be placed and places the next atom according to initialBondVector. The rest of the chain is placed such that it is as linear as possible (in the overall result, the angles in the chain are set to 120 Deg.)
atomContainer
- The IAtomContainer containing the chain atom to be placedinitialBondVector
- The Vector indicating the direction of the first bondbondLength
- The factor used to scale the initialBondVectorpublic javax.vecmath.Vector2d getNextBondVector(IAtom atom, IAtom previousAtom, javax.vecmath.Point2d distanceMeasure, boolean trans)
atom
- An atom for which the vector to the next atom to
draw is calculatedpreviousAtom
- The preceding atom for angle calculationdistanceMeasure
- A point from which the next atom is to be farmost
awaytrans
- if true E (trans) configurations are built, false makes Z (cis) configurationspublic void populatePolygonCorners(List<IAtom> atoms, javax.vecmath.Point2d center, double thetaBeg, double thetaStep, double radius)
atoms
- All the atoms to drawthetaBeg
- A start angle (in radians), giving the angle of the most clockwise
atom which has already been placedthetaStep
- An angle (in radians) to be added for each atom from
atomsToDrawcenter
- The center of a ring, or an atom for which the
partners are to be placedradius
- The radius of the polygon to be populated: bond
length or ring radiuspublic void partitionPartners(IAtom atom, IAtomContainer unplacedPartners, IAtomContainer placedPartners)
atom
- The atom whose bonding partners are to be
partitionedunplacedPartners
- A vector for the unplaced bonding partners to go inplacedPartners
- A vector for the placed bonding partners to go inpublic static IAtomContainer getInitialLongestChain(IAtomContainer molecule) throws CDKException
molecule
- The molecule
to be search for the longest unplaced chainNoSuchAtomException
- Description of
the ExceptionCDKException
public static IAtomContainer getLongestUnplacedChain(IAtomContainer molecule, IAtom startAtom) throws CDKException
molecule
- The molecule to be
search for the longest unplaced chainstartAtom
- A start atom from
which the chain search startsCDKException
- Description of the
Exceptionpublic static void breadthFirstSearch(IAtomContainer ac, List<IAtom> sphere, IAtomContainer[] pathes) throws CDKException
ac
- The AtomContainer to
be searchedsphere
- A sphere of atoms to
start the search withpathes
- A vector of N pathes
(N = no of heavy atoms).CDKException
- Description of the
Exceptionpublic String listPlaced(IAtomContainer ac)
ac
- The AtomContainer for which the placed atoms are to be listedpublic static String listNumbers(IAtomContainer mol, IAtomContainer ac) throws CDKException
ac
- The AtomContainer for
which the placed atoms are to be listedmol
- Description of the
ParameterCDKException
- Description of the
Exceptionpublic static String listNumbers(IAtomContainer mol, List<IAtom> ac)
ac
- The Vector for which the placed atoms are to
be listedmol
- Description of the Parameterpublic static boolean allPlaced(IAtomContainer ac)
ac
- The AtomContainer to be searchedpublic static void markNotPlaced(IAtomContainer ac)
ac
- The AtomContainer whose atoms are to be markedpublic static void markPlaced(IAtomContainer ac)
ac
- The AtomContainer whose atoms are to be markedpublic static IAtomContainer getPlacedAtoms(IAtomContainer ac)
ac
- The AtomContainer to be searched for placed atoms@Deprecated public static boolean shouldBeLinear(IAtom atom, IAtomContainer molecule)
Copyright © 2021. All rights reserved.