# Class AtomCollection

java.lang.Object
org.jmol.modelset.AtomCollection

Direct Known Subclasses:
  `BondCollection`

public abstract class AtomCollection extends Object

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected class`
`AtomCollection.AtomSorter`

## Field Summary

Fields
Modifier and Type
Field
Description
`int`
`ac`
`Atom[]`
`at`
`Object[][]`
`atomTensorList`
/////////////////////////////////////////////////////////////
`Map<String, Lst<Object>>`
`atomTensors`
`BioModelSet`
`bioModelset`
If any model in the collection is a BioModel, then it is also indicated here as a "bioModelset", meaning
`BS`
`bsClickable`
`BS`
`bsModulated`
`BS`
`bsPartialCharges`
`protected Bspf`
`bspf`
Binary Space Partitioning Forest
`BS`
`bsVisible`
`static final int`
`CALC_H_ALLOW_H`
`static final int`
`CALC_H_DOALL`
`static final int`
`CALC_H_HAVEH`
`static final int`
`CALC_H_IGNORE_H`
`static final int`
`CALC_H_JUSTC`
`static final int`
`CALC_H_QUICK`
`boolean`
`canSkipLoad`
`protected GData`
`g3d`
`protected boolean`
`haveChirality`
`boolean`
`haveStraightness`
`protected float`
`maxBondingRadius`
`float[]`
`occupancies`
`protected SymmetryInterface`
`pointGroup`
`protected boolean`
`preserveState`
`protected int[]`
`surfaceDistance100s`
`static final int`
`TAINT_ATOMNAME`
`static final int`
`TAINT_ATOMNO`
`static final int`
`TAINT_ATOMTYPE`
`static final int`
`TAINT_BONDINGRADIUS`
`static final int`
`TAINT_CHAIN`
`static final int`
`TAINT_COORD`
`static final int`
`TAINT_ELEMENT`
`static final int`
`TAINT_FORMALCHARGE`
`static final int`
`TAINT_HYDROPHOBICITY`
`static final int`
`TAINT_MAX`
`static final int`
`TAINT_OCCUPANCY`
`static final int`
`TAINT_PARTIALCHARGE`
`static final int`
`TAINT_RESNO`
`static final int`
`TAINT_SEQID`
`static final int`
`TAINT_SITE`
`static final int`
`TAINT_TEMPERATURE`
`static final int`
`TAINT_VALENCE`
`static final int`
`TAINT_VANDERWAALS`
`static final int`
`TAINT_VIBRATION`
`BS[]`
`tainted`
// SETTABLE atomic properties ///////////////
`Trajectory`
`trajectory`
`static String[]`
`userSettableValues`
`Vibration`
`vib`
`Vibration[]`
`vibrations`
`Viewer`
`vwr`

## Constructor Summary

Constructors
Constructor
Description
`AtomCollection()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addTensor(Tensor t, String type)`
`P3[][]`
`calculateHydrogens(BS bs, int[] nTotal, Lst<Atom> vConnect, int flags)`
get a list of potential H atom positions based on elemental valence and formal charge
`P3[]`
`calculateSurface(BS bsSelected, float envelopeRadius)`
`float`
`calculateVolume(BS bs, VDW vType)`
`int`
`chainToUpper(int chainID)`
`void`
`clearBfactorRange()`
`void`
`clearVisibleSets()`
`protected void`
`deleteModelAtoms(int firstAtomIndex, int nAtoms, BS bsAtoms)`
`protected void`
`fillADa(AtomData atomData, int mode)`
`protected void`
`findMaxRadii()`
`protected void`
`findNearest2(int x, int y, Atom[] closest, BS bsNot, int min)`
////////////////////////////////////////
`int`
`fixFormalCharges(BS bs)`
`Lst<P3>`
`generateCrystalClass(int atomIndex, P3 pt)`
`Lst<Object>`
`getAllAtomTensors(String type)`
`Atom`
`getAtom(int iatom)`
`BS`
`getAtomBitsMDa(int tokType, Object specInfo, BS bs)`
general unqualified lookup of atom set type
`float[]`
`getAtomicCharges()`
`void`
`getAtomIdentityInfo(int i, Map<String,Object> info, P3 ptTemp)`
`int[]`
`getAtomIndices(BS bs)`
`String`
`getAtomInfo(int i, String format, P3 ptTemp)`
`Lst<P3>`
`getAtomPointVector(BS bs)`
`BS`
`getAtomsFromAtomNumberInFrame(int atomNumber)`
`void`
`getAtomsInFrame(BS bsAtoms)`
`BS`
`getAtomsNearPlane(float distance, P4 plane)`
`Tensor`
`getAtomTensor(int i, String type)`
`Object[]`
`getAtomTensorList(int i)`
`String[]`
`getAtomTypes()`
`int`
`getBfactor100Hi()`
`int`
`getBfactor100Lo()`
`short[]`
`getBFactors()`
`float[]`
`getBondingRadii()`
`BS`
`getChainBits(int chainID)`
`BS`
`getClickableSet(boolean forceNew)`
`String`
`getElementName(int i)`
`int`
`getFirstAtomIndexFromAtomNumber(int atomNumber, BS bsVisibleFrames)`
`String`
`getHybridizationAndAxes(int atomIndex, int atomicNumber, V3 z, V3 x, String lcaoTypeRaw, boolean hybridizationCompatible, boolean doAlignZ, boolean isQuick, T3 ref)`
`float[]`
`getHydrophobicity()`
`LabelToken`
`getLabeler()`
///////// atoms //////////////
`float`
`getMaxVanderwaalsRadius()`
`int`
`getMissingHydrogenCount(Atom atom, boolean allowNegative)`
`JmolModulationSet`
`getModulation(int iAtom)`
`float`
`getOccupancyFloat(int i)`
`float[]`
`getPartialCharges()`
`Quat`
`getQuaternion(int i, char qtype)`
`protected float`
`getRadiusVdwJmol(Atom atom)`
`BS`
`getSeqcodeBits(int seqcode, boolean returnEmpty)`
`BS`
`getSpecNameOrNull(String name, boolean checkStar)`
`int`
`getSurfaceDistanceMax()`
`BS`
`getTaintedAtoms(int type)`
`static int`
`getUserSettableType(String dataType)`
/ atom coordinate and property changing //////////
`float`
`getVibCoord(int atomIndex, char c)`
also handles modulation info
`Vibration`
`getVibration(int atomIndex, boolean forceNew)`
`BS`
`getVisibleSet(boolean forceNew)`
`boolean`
`isAtomHidden(int iAtom)`
`static boolean`
`isDeleted(Atom atom)`
`boolean`
`isModulated(int i)`
`protected void`
`mergeAtomArrays(AtomCollection mergeModelSet)`
`boolean`
`modelSetHasVibrationVectors()`
`protected void`
`releaseModelSetAC()`
`void`
`scaleVectorsToMax(float max)`
Scales vibrations and associated vectors such that the maximum length is the given value
`protected void`
`setAPa(BS bs, int tok, int iValue, float fValue, String sValue, float[] values, String[] list)`
`void`
`setAtomCoord(int atomIndex, float x, float y, float z)`
`protected void`
`setAtomCoord2(BS bs, int tokType, Object xyzValues)`
`void`
`setAtomCoordRelative(int atomIndex, float x, float y, float z)`
`void`
`setAtomData(int type, String name, String dataString, boolean isDefault)`
`void`
`setAtomName(int atomIndex, String name, boolean doTaint)`
`void`
`setAtomNumber(int atomIndex, int atomno, boolean doTaint)`
`protected void`
`setAtomsCoordRelative(BS bs, float x, float y, float z)`
`void`
`setAtomTensors(int atomIndex, Lst<Object> list)`
`Vibration`
`setAtomVibrationVector(int atomIndex, T3 vib)`
`protected void`
`setBFactor(int atomIndex, float bfactor, boolean doTaint)`
`protected void`
`setBondingRadius(int atomIndex, float radius)`
`void`
`setBsHidden(BS bs)`
`void`
`setElement(Atom atom, int atomicNumber, boolean doTaint)`
`void`
`setFormalCharges(BS bs, int formalCharge)`
`void`
`setOccupancy(int atomIndex, float occupancy, boolean doTaint)`
`protected void`
`setPartialCharge(int atomIndex, float partialCharge, boolean doTaint)`
`void`
`setPreserveState(boolean TF)`
`void`
`setSite(Atom atom, int site, boolean doTaint)`
`void`
`setTaintedAtoms(BS bs, int type)`
`protected void`
`setupAC()`
`void`
`taintAtom(int atomIndex, int type)`
`void`
`taintAtoms(BS bsAtoms, int type)`
`void`
`unTaintAtoms(BS bs, int type)`
`void`
`validateBspf(boolean isValid)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### vwr

public Viewer vwr

### g3d

protected GData g3d

### bioModelset

public BioModelSet bioModelset
If any model in the collection is a BioModel, then it is also indicated here as a "bioModelset", meaning

### at

public Atom[] at

### ac

public int ac

### trajectory

public Trajectory trajectory

### pointGroup

protected SymmetryInterface pointGroup

### maxBondingRadius

protected float maxBondingRadius

### haveChirality

protected boolean haveChirality

### bspf

protected Bspf bspf
Binary Space Partitioning Forest

### preserveState

protected boolean preserveState

### canSkipLoad

public boolean canSkipLoad

### haveStraightness

public boolean haveStraightness

### bsVisible

public BS bsVisible

### bsClickable

public BS bsClickable

### bsModulated

public BS bsModulated

### atomTensorList

public Object[][] atomTensorList
/////////////////////////////////////////////////////////////

### atomTensors

public Map<String, Lst<Object>> atomTensors

### surfaceDistance100s

protected int[] surfaceDistance100s

### tainted

public BS[] tainted
// SETTABLE atomic properties ///////////////

### userSettableValues

public static String[] userSettableValues

### TAINT_ATOMNAME

public static final int TAINT_ATOMNAME

See Also:
  - Constant Field Values

### TAINT_ATOMTYPE

public static final int TAINT_ATOMTYPE

See Also:
  - Constant Field Values

### TAINT_COORD

public static final int TAINT_COORD

See Also:
  - Constant Field Values

### TAINT_ELEMENT

public static final int TAINT_ELEMENT

See Also:
  - Constant Field Values

### TAINT_FORMALCHARGE

public static final int TAINT_FORMALCHARGE

See Also:
  - Constant Field Values

### TAINT_HYDROPHOBICITY

public static final int TAINT_HYDROPHOBICITY

See Also:
  - Constant Field Values

### TAINT_BONDINGRADIUS

public static final int TAINT_BONDINGRADIUS

See Also:
  - Constant Field Values

### TAINT_OCCUPANCY

public static final int TAINT_OCCUPANCY

See Also:
  - Constant Field Values

### TAINT_PARTIALCHARGE

public static final int TAINT_PARTIALCHARGE

See Also:
  - Constant Field Values

### TAINT_TEMPERATURE

public static final int TAINT_TEMPERATURE

See Also:
  - Constant Field Values

### TAINT_VALENCE

public static final int TAINT_VALENCE

See Also:
  - Constant Field Values

### TAINT_VANDERWAALS

public static final int TAINT_VANDERWAALS

See Also:
  - Constant Field Values

### TAINT_VIBRATION

public static final int TAINT_VIBRATION

See Also:
  - Constant Field Values

### TAINT_ATOMNO

public static final int TAINT_ATOMNO

See Also:
  - Constant Field Values

### TAINT_SEQID

public static final int TAINT_SEQID

See Also:
  - Constant Field Values

### TAINT_RESNO

public static final int TAINT_RESNO

See Also:
  - Constant Field Values

### TAINT_CHAIN

public static final int TAINT_CHAIN

See Also:
  - Constant Field Values

### TAINT_SITE

public static final int TAINT_SITE

See Also:
  - Constant Field Values

### TAINT_MAX

public static final int TAINT_MAX

See Also:
  - Constant Field Values

### vibrations

public Vibration[] vibrations

### vib

public Vibration vib

### occupancies

public float[] occupancies

### bsPartialCharges

public BS bsPartialCharges

### CALC_H_DOALL

public static final int CALC_H_DOALL

See Also:
  - Constant Field Values

### CALC_H_JUSTC

public static final int CALC_H_JUSTC

See Also:
  - Constant Field Values

### CALC_H_HAVEH

public static final int CALC_H_HAVEH

See Also:
  - Constant Field Values

### CALC_H_QUICK

public static final int CALC_H_QUICK

See Also:
  - Constant Field Values

### CALC_H_IGNORE_H

public static final int CALC_H_IGNORE_H

See Also:
  - Constant Field Values

### CALC_H_ALLOW_H

public static final int CALC_H_ALLOW_H

See Also:
  - Constant Field Values

## Constructor Details

### AtomCollection

public AtomCollection()

## Method Details

### getAtom

public Atom getAtom(int iatom)

### setupAC

protected void setupAC()

### releaseModelSetAC

protected void releaseModelSetAC()

### mergeAtomArrays

protected void mergeAtomArrays(AtomCollection mergeModelSet)

### getAtomPointVector

public Lst<P3> getAtomPointVector(BS bs)

### modelSetHasVibrationVectors

public boolean modelSetHasVibrationVectors()

### getAtomTypes

public String[] getAtomTypes()

### getPartialCharges

public float[] getPartialCharges()

### getBondingRadii

public float[] getBondingRadii()

### getBFactors

public short[] getBFactors()

### getHydrophobicity

public float[] getHydrophobicity()

### setBsHidden

public void setBsHidden(BS bs)

### isAtomHidden

public boolean isAtomHidden(int iAtom)

### getLabeler

public LabelToken getLabeler()
///////// atoms //////////////

### getAtomInfo

public String getAtomInfo(int i, String format, P3 ptTemp)

### getElementName

public String getElementName(int i)

### getQuaternion

public Quat getQuaternion(int i, char qtype)

### getFirstAtomIndexFromAtomNumber

public int getFirstAtomIndexFromAtomNumber(int atomNumber, BS bsVisibleFrames)

### setFormalCharges

public void setFormalCharges(BS bs, int formalCharge)

### getAtomicCharges

public float[] getAtomicCharges()

### getRadiusVdwJmol

protected float getRadiusVdwJmol(Atom atom)

### getMaxVanderwaalsRadius

public float getMaxVanderwaalsRadius()

### findMaxRadii

protected void findMaxRadii()

### clearBfactorRange

public void clearBfactorRange()

### getBfactor100Lo

public int getBfactor100Lo()

### getBfactor100Hi

public int getBfactor100Hi()

### getSurfaceDistanceMax

public int getSurfaceDistanceMax()

### calculateVolume

public float calculateVolume(BS bs, VDW vType)

### calculateSurface

public P3[] calculateSurface(BS bsSelected, float envelopeRadius)

### setAtomCoord2

protected void setAtomCoord2(BS bs, int tokType, Object xyzValues)

### setAtomVibrationVector

public Vibration setAtomVibrationVector(int atomIndex, T3 vib)

### setAtomCoord

public void setAtomCoord(int atomIndex, float x, float y, float z)

### setAtomCoordRelative

public void setAtomCoordRelative(int atomIndex, float x, float y, float z)

### setAtomsCoordRelative

protected void setAtomsCoordRelative(BS bs, float x, float y, float z)

### setAPa

protected void setAPa(BS bs, int tok, int iValue, float fValue, String sValue, float[] values, String[] list)

### getVibCoord

public float getVibCoord(int atomIndex, char c)
also handles modulation info

Parameters:
  `atomIndex` -
  `c` - generally x, y, z, but for modulation could be 1, 2, 3, or O (oh, not zero)
Returns:
  value or NaN

### getVibration

public Vibration getVibration(int atomIndex, boolean forceNew)

### getModulation

public JmolModulationSet getModulation(int iAtom)

### setAtomName

public void setAtomName(int atomIndex, String name, boolean doTaint)

### setAtomNumber

public void setAtomNumber(int atomIndex, int atomno, boolean doTaint)

### setElement

public void setElement(Atom atom, int atomicNumber, boolean doTaint)

### setSite

public void setSite(Atom atom, int site, boolean doTaint)

### setOccupancy

public void setOccupancy(int atomIndex, float occupancy, boolean doTaint)

### getOccupancyFloat

public float getOccupancyFloat(int i)

### setPartialCharge

protected void setPartialCharge(int atomIndex, float partialCharge, boolean doTaint)

### setBondingRadius

protected void setBondingRadius(int atomIndex, float radius)

### setBFactor

protected void setBFactor(int atomIndex, float bfactor, boolean doTaint)

### setAtomData

public void setAtomData(int type, String name, String dataString, boolean isDefault)

### validateBspf

public void validateBspf(boolean isValid)

### setPreserveState

public void setPreserveState(boolean TF)

### getUserSettableType

public static int getUserSettableType(String dataType)
/ atom coordinate and property changing //////////

### getTaintedAtoms

public BS getTaintedAtoms(int type)

### taintAtoms

public void taintAtoms(BS bsAtoms, int type)

### taintAtom

public void taintAtom(int atomIndex, int type)

### setTaintedAtoms

public void setTaintedAtoms(BS bs, int type)

### unTaintAtoms

public void unTaintAtoms(BS bs, int type)

### findNearest2

protected void findNearest2(int x, int y, Atom[] closest, BS bsNot, int min)
////////////////////////////////////////

### fillADa

protected void fillADa(AtomData atomData, int mode)

### calculateHydrogens

public P3[][] calculateHydrogens(BS bs, int[] nTotal, Lst<Atom> vConnect, int flags)
get a list of potential H atom positions based on elemental valence and formal charge

Parameters:
  `bs` -
  `nTotal` -
  `vConnect` -
  `flags` - [CALC_H_DOALL | CALC_H_JUSTC | CALC_H_HAVEH | CALC_H_QUICK
Returns:
  array of arrays of points added to specific atoms

### getMissingHydrogenCount

public int getMissingHydrogenCount(Atom atom, boolean allowNegative)

### fixFormalCharges

public int fixFormalCharges(BS bs)

### getHybridizationAndAxes

public String getHybridizationAndAxes(int atomIndex, int atomicNumber, V3 z, V3 x, String lcaoTypeRaw, boolean hybridizationCompatible, boolean doAlignZ, boolean isQuick, T3 ref)

### getAtomBitsMDa

public BS getAtomBitsMDa(int tokType, Object specInfo, BS bs)
general unqualified lookup of atom set type

Parameters:
  `tokType` -
  `specInfo` -
  `bs` - - to be filled
Returns:
  BitSet; or null if we mess up the type

### getChainBits

public BS getChainBits(int chainID)

### chainToUpper

public int chainToUpper(int chainID)

### getSeqcodeBits

public BS getSeqcodeBits(int seqcode, boolean returnEmpty)

### getSpecNameOrNull

public BS getSpecNameOrNull(String name, boolean checkStar)

### getAtomIndices

public int[] getAtomIndices(BS bs)

### getAtomsNearPlane

public BS getAtomsNearPlane(float distance, P4 plane)

### clearVisibleSets

public void clearVisibleSets()

### getAtomsInFrame

public void getAtomsInFrame(BS bsAtoms)

### getVisibleSet

public BS getVisibleSet(boolean forceNew)

### getClickableSet

public BS getClickableSet(boolean forceNew)

### isModulated

public boolean isModulated(int i)

### deleteModelAtoms

protected void deleteModelAtoms(int firstAtomIndex, int nAtoms, BS bsAtoms)

### getAtomIdentityInfo

public void getAtomIdentityInfo(int i, Map<String,Object> info, P3 ptTemp)

### getAtomTensorList

public Object[] getAtomTensorList(int i)

### setAtomTensors

public void setAtomTensors(int atomIndex, Lst<Object> list)

### addTensor

public void addTensor(Tensor t, String type)

### getAtomTensor

public Tensor getAtomTensor(int i, String type)

### getAllAtomTensors

public Lst<Object> getAllAtomTensors(String type)

### scaleVectorsToMax

public void scaleVectorsToMax(float max)
Scales vibrations and associated vectors such that the maximum length is the given value

Parameters:
  `max` -

### getAtomsFromAtomNumberInFrame

public BS getAtomsFromAtomNumberInFrame(int atomNumber)

### generateCrystalClass

public Lst<P3> generateCrystalClass(int atomIndex, P3 pt)

### isDeleted

public static boolean isDeleted(Atom atom)