public class RingPlacer extends Object
Modifier and Type | Field and Description |
---|---|
static Map<Integer,Double> |
defaultAngles
Default ring start angles.
|
static Map<Integer,Double> |
jcpAngles
Suggested ring start angles for JChempaint, different due to Y inversion of canvas.
|
static double |
RAD_30 |
Constructor and Description |
---|
RingPlacer()
The empty constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allPlaced(IRingSet rs)
True if coordinates have been assigned to all atoms in all rings.
|
void |
checkAndMarkPlaced(IRingSet rs)
Walks throught the atoms of each ring in a ring set and marks
a ring as PLACED if all of its atoms have been placed.
|
AtomPlacer |
getAtomPlacer() |
IAtomContainer |
getMolecule() |
double |
getNativeRingRadius(IRing ring,
double bondLength)
Returns the ring radius of a perfect polygons of size ring.getAtomCount()
The ring radius is the distance of each atom to the ringcenter.
|
void |
partitionNonRingPartners(IAtom atom,
IRing ring,
IAtomContainer ringAtoms,
IAtomContainer nonRingAtoms)
Partition the bonding partners of a given atom into ring atoms and non-ring atoms
|
void |
placeFusedRing(IRing ring,
IAtomContainer sharedAtoms,
javax.vecmath.Vector2d ringCenterVector,
double bondLength)
Generated coordinates for a given ring, which is fused to another ring.
|
void |
placeRing(IRing ring,
IAtomContainer sharedAtoms,
javax.vecmath.Point2d sharedAtomsCenter,
javax.vecmath.Vector2d ringCenterVector,
double bondLength)
Generated coordinates for a given ring.
|
void |
placeRing(IRing ring,
javax.vecmath.Point2d ringCenter,
double bondLength)
Place ring with default start angles, using
defaultAngles . |
void |
placeRing(IRing ring,
javax.vecmath.Point2d ringCenter,
double bondLength,
Map<Integer,Double> startAngles)
Place ring with user provided angles.
|
IAtomContainer |
placeRingSubstituents(IRingSet rs,
double bondLength)
Positions the aliphatic substituents of a ring system
|
void |
placeSpiroRing(IRing ring,
IAtomContainer sharedAtoms,
javax.vecmath.Point2d sharedAtomsCenter,
javax.vecmath.Vector2d ringCenterVector,
double bondLength)
Generated coordinates for a given ring, which is connected to a spiro ring.
|
void |
setAtomPlacer(AtomPlacer atomPlacer) |
void |
setMolecule(IAtomContainer molecule) |
public static final double RAD_30
public static final Map<Integer,Double> defaultAngles
public void placeRing(IRing ring, IAtomContainer sharedAtoms, javax.vecmath.Point2d sharedAtomsCenter, javax.vecmath.Vector2d ringCenterVector, double bondLength)
ring
- The ring to be placedsharedAtoms
- The atoms of this ring, also members of another ring, which are already placedsharedAtomsCenter
- The geometric center of these atomsringCenterVector
- A vector pointing the the center of the new ringbondLength
- The standard bondlengthpublic void placeRing(IRing ring, javax.vecmath.Point2d ringCenter, double bondLength)
defaultAngles
.ring
- the ring to place.ringCenter
- center coordinates of the ring.bondLength
- given bond length.public void placeRing(IRing ring, javax.vecmath.Point2d ringCenter, double bondLength, Map<Integer,Double> startAngles)
ring
- the ring to place.ringCenter
- center coordinates of the ring.bondLength
- given bond length.startAngles
- a map with start angles when drawing the ring.public IAtomContainer placeRingSubstituents(IRingSet rs, double bondLength)
rs
- The RingSystem for which the substituents are to be laid outpublic void placeSpiroRing(IRing ring, IAtomContainer sharedAtoms, javax.vecmath.Point2d sharedAtomsCenter, javax.vecmath.Vector2d ringCenterVector, double bondLength)
ring
- The ring to be placedsharedAtoms
- The atoms of this ring, also members of another ring, which are already placedsharedAtomsCenter
- The geometric center of these atomsringCenterVector
- A vector pointing the the center of the new ringbondLength
- The standard bondlengthpublic void placeFusedRing(IRing ring, IAtomContainer sharedAtoms, javax.vecmath.Vector2d ringCenterVector, double bondLength)
ring
- The ring to be placedsharedAtoms
- The atoms of this ring, also members of another ring, which are already placedringCenterVector
- A vector pointing the the center of the new ringbondLength
- The standard bondlengthpublic boolean allPlaced(IRingSet rs)
rs
- The ringset to be checkedpublic void checkAndMarkPlaced(IRingSet rs)
rs
- The ringset to be checkedpublic void partitionNonRingPartners(IAtom atom, IRing ring, IAtomContainer ringAtoms, IAtomContainer nonRingAtoms)
atom
- The atom whose bonding partners are to be partitionedring
- The ring against which the bonding partners are checkedringAtoms
- An AtomContainer to store the ring bonding partnersnonRingAtoms
- An AtomContainer to store the non-ring bonding partnerspublic double getNativeRingRadius(IRing ring, double bondLength)
ring
- The ring for which the radius is to calculatedbondLength
- The bond length for each bond in the ringpublic IAtomContainer getMolecule()
public void setMolecule(IAtomContainer molecule)
public AtomPlacer getAtomPlacer()
public void setAtomPlacer(AtomPlacer atomPlacer)
Copyright © 2017. All Rights Reserved.