org.jmol.modelset

Class BondCollection

public abstract class BondCollection extends AtomCollection

Field Summary
intbondCount
static intbondGrowthIncrement
Bond[]bonds
protected BitSetbsAromatic
BitSetbsAromaticDouble
BitSetbsAromaticSingle
protected BitSetbsPseudoHBonds
protected shortdefaultCovalentMad
protected Bond[][][]freeBonds
booleanhaveWarned
floathbondMax
floathbondMin
floathbondMin2
protected static intMAX_BONDS_LENGTH_TO_CACHE
protected static intMAX_NUM_TO_CACHE
protected int[]numCached
Method Summary
voidaddBondToAtom(Atom atom, Bond bond)
voidaddHydrogenBond(Atom atom1, Atom atom2, short order, BitSet bsA, BitSet bsB)
These are not actual hydrogen bonds.
Bond[]addToBonds(Bond newBond, Bond[] oldBonds)
voidassignAromaticBonds()
protected voidassignAromaticBonds(boolean isUserCalculation, BitSet bsBonds)
algorithm discussed above.
booleanassignAromaticDouble(Bond bond)
try to assign AROMATICDOUBLE to this bond.
booleanassignAromaticDouble(Atom atom)
N atoms with 3 bonds cannot also have a double bond; other atoms need one and only one double bond; the rest must be single bonds.
voidassignAromaticNandO(BitSet bsSelected)
booleanassignAromaticSingle(Bond bond)
try to assign AROMATICSINGLE to this bond.
booleanassignAromaticSingle(Atom atom, int notBondIndex)
N atoms with 3 bonds cannot also have a double bond; other atoms needs all single bonds, because the bond leading up to it is double.
booleanassignAromaticSingleHetero(Atom atom)
protected intautoHbond(BitSet bsA, BitSet bsB, BitSet bsBonds)
BondbondAtoms(Atom atom1, Atom atom2, short order, short mad, BitSet bsBonds)
protected BondbondMutually(Atom atom, Atom atomOther, short order, short mad)
booleancheckValencesAndBond(Atom atomA, Atom atomB, short order, short mad, BitSet bsBonds)
protected voiddeleteAllBonds()
protected voiddeleteBonds(BitSet bs)
protected int[]deleteConnections(float minDistance, float maxDistance, short order, BitSet bsA, BitSet bsB, boolean isBonds, boolean matchNull, float minDistanceSquared, float maxDistanceSquared)
protected BitSetgetAtomBits(int tokType, Object specInfo)
BondgetBondAt(int bondIndex)
AtomgetBondAtom1(int i)
AtomgetBondAtom2(int i)
shortgetBondColix1(int i)
shortgetBondColix2(int i)
intgetBondCount()
protected intgetBondCountInModel(int modelIndex)
for general use
BondIteratorgetBondIterator(short bondType, BitSet bsSelected)
BondIteratorgetBondIterator(BitSet bsSelected)
intgetBondModelIndex(int i)
shortgetBondOrder(int i)
protected shortgetBondOrder(Atom atomA, float bondingRadiusA, Atom atomB, float bondingRadiusB, float distance2, float minBondDistance2, float bondTolerance)
floatgetBondRadius(int i)
Bond[]getBonds()
BitSetgetBondsForSelectedAtoms(BitSet bsAtoms)
protected BitSetgetBondsForSelectedAtoms(BitSet bsAtoms, boolean bondSelectionModeOr)
protected shortgetDefaultMadFromOrder(short order)
When creating a new bond, determine bond diameter from order
BondgetOrAddBond(Atom atom, Atom atomOther, short order, short mad, BitSet bsBonds)
voidmerge(ModelSet modelSet)
protected voidreleaseModelSet()
voidresetAromatic()
protected BondsetBond(int index, Bond bond)

Field Detail

bondCount

int bondCount

bondGrowthIncrement

private static final int bondGrowthIncrement

bonds

Bond[] bonds

bsAromatic

protected BitSet bsAromatic

bsAromaticDouble

private BitSet bsAromaticDouble

bsAromaticSingle

private BitSet bsAromaticSingle

bsPseudoHBonds

protected BitSet bsPseudoHBonds

defaultCovalentMad

protected short defaultCovalentMad

freeBonds

protected Bond[][][] freeBonds

haveWarned

private boolean haveWarned

hbondMax

private float hbondMax

hbondMin

private float hbondMin

hbondMin2

private float hbondMin2

MAX_BONDS_LENGTH_TO_CACHE

protected static final int MAX_BONDS_LENGTH_TO_CACHE

MAX_NUM_TO_CACHE

protected static final int MAX_NUM_TO_CACHE

numCached

protected int[] numCached

Method Detail

addBondToAtom

private void addBondToAtom(Atom atom, Bond bond)

addHydrogenBond

void addHydrogenBond(Atom atom1, Atom atom2, short order, BitSet bsA, BitSet bsB)
These are not actual hydrogen bonds. They are N-O bonds in proteins and nucleic acids The method is called by AminoPolymer and NucleicPolymer methods, which are indirectly called by this.autoHbond

Parameters: atom1 atom2 order bsA bsB

addToBonds

private Bond[] addToBonds(Bond newBond, Bond[] oldBonds)

assignAromaticBonds

public void assignAromaticBonds()

assignAromaticBonds

protected void assignAromaticBonds(boolean isUserCalculation, BitSet bsBonds)
algorithm discussed above.

Parameters: isUserCalculation if set, don't reset the base aromatic bitset and do report changes to STICKS as though this were a bondOrder command. bsBonds passed to us by autoBond routine

assignAromaticDouble

private boolean assignAromaticDouble(Bond bond)
try to assign AROMATICDOUBLE to this bond. Each atom needs to be have all single bonds except for this one.

Parameters: bond

Returns: true if successful; false otherwise

assignAromaticDouble

private boolean assignAromaticDouble(Atom atom)
N atoms with 3 bonds cannot also have a double bond; other atoms need one and only one double bond; the rest must be single bonds.

Parameters: atom

Returns: true if successful, false if not

assignAromaticNandO

private void assignAromaticNandO(BitSet bsSelected)

assignAromaticSingle

private boolean assignAromaticSingle(Bond bond)
try to assign AROMATICSINGLE to this bond. Each atom needs to be able to have one aromatic double bond attached.

Parameters: bond

Returns: true if successful; false otherwise

assignAromaticSingle

private boolean assignAromaticSingle(Atom atom, int notBondIndex)
N atoms with 3 bonds cannot also have a double bond; other atoms needs all single bonds, because the bond leading up to it is double.

Parameters: atom notBondIndex that index of the bond leading to this atom --- to be ignored

Returns: true if successful, false if not

assignAromaticSingleHetero

private boolean assignAromaticSingleHetero(Atom atom)

autoHbond

protected int autoHbond(BitSet bsA, BitSet bsB, BitSet bsBonds)

bondAtoms

public Bond bondAtoms(Atom atom1, Atom atom2, short order, short mad, BitSet bsBonds)

bondMutually

protected Bond bondMutually(Atom atom, Atom atomOther, short order, short mad)

checkValencesAndBond

boolean checkValencesAndBond(Atom atomA, Atom atomB, short order, short mad, BitSet bsBonds)

deleteAllBonds

protected void deleteAllBonds()

deleteBonds

protected void deleteBonds(BitSet bs)

deleteConnections

protected int[] deleteConnections(float minDistance, float maxDistance, short order, BitSet bsA, BitSet bsB, boolean isBonds, boolean matchNull, float minDistanceSquared, float maxDistanceSquared)

getAtomBits

protected BitSet getAtomBits(int tokType, Object specInfo)

getBondAt

public Bond getBondAt(int bondIndex)

getBondAtom1

public Atom getBondAtom1(int i)

getBondAtom2

public Atom getBondAtom2(int i)

getBondColix1

public short getBondColix1(int i)

getBondColix2

public short getBondColix2(int i)

getBondCount

public int getBondCount()

getBondCountInModel

protected int getBondCountInModel(int modelIndex)
for general use

Parameters: modelIndex the model of interest or -1 for all

Returns: the actual number of connections

getBondIterator

public BondIterator getBondIterator(short bondType, BitSet bsSelected)

getBondIterator

public BondIterator getBondIterator(BitSet bsSelected)

getBondModelIndex

public int getBondModelIndex(int i)

getBondOrder

public short getBondOrder(int i)

getBondOrder

protected short getBondOrder(Atom atomA, float bondingRadiusA, Atom atomB, float bondingRadiusB, float distance2, float minBondDistance2, float bondTolerance)

getBondRadius

public float getBondRadius(int i)

getBonds

public Bond[] getBonds()

getBondsForSelectedAtoms

public BitSet getBondsForSelectedAtoms(BitSet bsAtoms)

getBondsForSelectedAtoms

protected BitSet getBondsForSelectedAtoms(BitSet bsAtoms, boolean bondSelectionModeOr)

getDefaultMadFromOrder

protected short getDefaultMadFromOrder(short order)
When creating a new bond, determine bond diameter from order

Parameters: order

Returns: if hydrogen bond, default to 1; otherwise 0 (general default)

getOrAddBond

private Bond getOrAddBond(Atom atom, Atom atomOther, short order, short mad, BitSet bsBonds)

merge

void merge(ModelSet modelSet)

releaseModelSet

protected void releaseModelSet()

resetAromatic

public void resetAromatic()

setBond

protected Bond setBond(int index, Bond bond)