# Class AtomSetCollection

java.lang.Object
org.jmol.adapter.smarter.AtomSetCollection

public class AtomSetCollection extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`int`
`ac`
`boolean`
`allowMultiple`
`boolean`
`atomMapAnyCase`
`Atom[]`
`atoms`
`int[]`
`atomSetAtomCounts`
`int`
`atomSetCount`
`Map<String,Object>`
`atomSetInfo`
`Map<String,Atom>`
`atomSymbolicMap`
`int`
`baseSymmetryAtomCount`
`int`
`bondCount`
`Bond[]`
`bonds`
`BS`
`bsAtoms`
`BS`
`bsStructuredModels`
`boolean`
`coordinatesAreFractional`
`boolean`
`crystalReaderLatticeOpsOnly`
`boolean`
`doFixPeriodic`
`String`
`errorMessage`
`String`
`fileTypeName`
`int`
`firstAtomToBond`
`boolean`
`haveAnisou`
`boolean`
`haveUnitCell`
`int`
`iSet`
`int`
`structureCount`
`Structure[]`
`structures`
`int`
`vibScale`
`XtalSymmetry`
`xtalSymmetry`

## Constructor Summary

Constructors
Constructor
Description
`AtomSetCollection(String fileTypeName, AtomSetCollectionReader reader, AtomSetCollection[] array, Lst<?> list)`

## Method Summary

Modifier and Type
Method
Description
`Atom`
`addAtom(Atom atom)`
`void`
`addAtomWithMappedName(Atom atom)`
`void`
`addAtomWithMappedSerialNumber(Atom atom)`
`void`
`addBond(Bond bond)`
`void`
`addBondNoCheck(Bond bond)`
`Atom`
`addNewAtom()`
`Bond`
`addNewBondFromNames(String atomName1, String atomName2, int order)`
`Bond`
`addNewBondWithOrder(int atomIndex1, int atomIndex2, int order)`
`Bond`
`addNewBondWithOrderA(Atom atom1, Atom atom2, int order)`
`void`
`addStructure(Structure structure)`
`V3`
`addVibrationVector(int iatom, float x, float y, float z)`
`void`
`addVibrationVectorWithSymmetry(int iatom, float vx, float vy, float vz, boolean withSymmetry)`
`void`
`appendAtomSetCollection(int collectionIndex, AtomSetCollection collection)`
Appends an AtomSetCollection
`void`
`centralize()`
`void`
`checkNoEmptyModel()`
`void`
`clearGlobalBoolean(int globalIndex)`
`void`
`cloneAtomSetWithBonds(boolean isLast)`
`int`
`cloneFirstAtomSet(int atomCount)`
`int`
`cloneLastAtomSet()`
`int`
`cloneLastAtomSetFromPoints(int ac, P3[] pts)`
`void`
`discardPreviousAtoms()`
`void`
`finalizeStructures()`
`void`
`finalizeTrajectoryAs(Lst<P3[]> trajectorySteps, Lst<V3[]> vibrationSteps)`
`void`
`fix2Stereo()`
`Atom`
`getAtomFromName(String atomName)`
`int`
`getAtomIndex(String name)`
`int`
`getAtomSetAtomCount(int i)`
`int`
`getAtomSetAtomIndex(int i)`
`Map<String,Object>`
`getAtomSetAuxiliaryInfo(int atomSetIndex)`
`Object`
`getAtomSetAuxiliaryInfoValue(int index, String key)`
`int`
`getAtomSetBondCount(int i)`
`String[][]`
`getBondList()`
`BS`
`getBSAtoms(int n)`
Create bsAtoms if it is null, and set bits if desired.
`int`
`getHydrogenAtomCount()`
`int`
`getLastAtomSetAtomCount()`
`int`
`getLastAtomSetAtomIndex()`
`XtalSymmetry.FileSymmetry`
`getSymmetry()`
`XtalSymmetry`
`getXSymmetry()`
`void`
`mapPartialCharge(String atomName, float charge)`
`void`
`newAtomSet()`
Create a new atoms set, clearing the atom map
`void`
`newAtomSetClear(boolean doClearMap)`
Create a new atom set, optionally clearing the atom map.
`Atom`
`newCloneAtom(Atom atom)`
`XtalSymmetry.FileSymmetry`
`newFileSymmetry()`
`void`
`removeAtomSet(int imodel)`
note that sets must be iterated from LAST to FIRST not a general method -- would mess up if we had unit cells
`void`
`removeCurrentAtomSet()`
`void`
`removeLastUnselectedAtoms()`
`void`
`setAnisoBorU(Atom atom, float[] data, int type)`
`void`
`setAtomMapAnyCase()`
`void`
`setAtomProperties(String key, Object data, int atomSetIndex, boolean isGroup)`
`boolean`
`setAtomSetCollectionPartialCharges(String auxKey)`
Sets the partial atomic charges based on asc auxiliary info
`void`
`setAtomSetEnergy(String energyString, float value)`
/ for XmlChem3dReader, but could be for CUBE
`String`
`setAtomSetFrequency(int mode, String pathKey, String label, String freq, String units)`
`void`
`setAtomSetModelProperty(String key, String value)`
Sets a property for the current AtomSet used specifically for creating directories and plots of frequencies and molecular energies
`void`
`setAtomSetModelPropertyForSet(String key, String value, int atomSetIndex)`
Sets the a property for the an AtomSet
`void`
`setAtomSetName(String atomSetName)`
Sets the name for the current AtomSet
`void`
`setAtomSetNumber(int index, int atomSetNumber)`
`void`
`setBSAtomsForSet(int iSet)`
Add a full set of atoms to BSAtoms if they are not already indicated there.
`void`
`setCollectionName(String collectionName)`
`void`
`setCoordinatesAreFractional(boolean tf)`
`void`
`setCurrentAtomSetNumber(int atomSetNumber)`
Sets the number for the current AtomSet
`void`
`setCurrentModelInfo(String key, Object value)`
Sets auxiliary information for the AtomSet
`void`
`setGlobalBoolean(int globalIndex)`
`void`
`setInfo(String key, Object value)`
`void`
`setModelInfoForSet(String key, Object value, int atomSetIndex)`
Sets auxiliary information for an AtomSet
`void`
`setNoAutoBond()`
`XtalSymmetry.FileSymmetry`
`setSymmetryFromAuditBlock(XtalSymmetry.FileSymmetry symmetry)`
`void`
`setTensors()`
`void`
`setTrajectory()`
`void`
`setU(Atom atom, int i, float val)`

### Methods inherited from class Object

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

## Field Details

### bsAtoms

public BS bsAtoms

### fileTypeName

public String fileTypeName

### atomSetInfo

public Map<String,Object> atomSetInfo

### atoms

public Atom[] atoms

### ac

public int ac

### bonds

public Bond[] bonds

### bondCount

public int bondCount

### structures

public Structure[] structures

### structureCount

public int structureCount

### atomSetCount

public int atomSetCount

### iSet

public int iSet

### atomSetAtomCounts

public int[] atomSetAtomCounts

### errorMessage

public String errorMessage

### coordinatesAreFractional

public boolean coordinatesAreFractional

### doFixPeriodic

public boolean doFixPeriodic

### allowMultiple

public boolean allowMultiple

### atomMapAnyCase

public boolean atomMapAnyCase

### bsStructuredModels

public BS bsStructuredModels

### haveAnisou

public boolean haveAnisou

### baseSymmetryAtomCount

public int baseSymmetryAtomCount

### crystalReaderLatticeOpsOnly

public boolean crystalReaderLatticeOpsOnly

### xtalSymmetry

public XtalSymmetry xtalSymmetry

### atomSymbolicMap

public Map<String,Atom> atomSymbolicMap

### haveUnitCell

public boolean haveUnitCell

### vibScale

public int vibScale

### firstAtomToBond

public int firstAtomToBond

## Constructor Details

### AtomSetCollection

public AtomSetCollection(String fileTypeName, AtomSetCollectionReader reader, AtomSetCollection[] array, Lst<?> list)

## Method Details

### setCollectionName

public void setCollectionName(String collectionName)

### clearGlobalBoolean

public void clearGlobalBoolean(int globalIndex)

### setGlobalBoolean

public void setGlobalBoolean(int globalIndex)

### setTrajectory

public void setTrajectory()

### appendAtomSetCollection

public void appendAtomSetCollection(int collectionIndex, AtomSetCollection collection)
Appends an AtomSetCollection

Parameters:
  `collectionIndex` - collection index for new model number
  `collection` - AtomSetCollection to append

### setNoAutoBond

public void setNoAutoBond()

### discardPreviousAtoms

public void discardPreviousAtoms()

### removeCurrentAtomSet

public void removeCurrentAtomSet()

### getHydrogenAtomCount

public int getHydrogenAtomCount()

### newCloneAtom

public Atom newCloneAtom(Atom atom)

### cloneFirstAtomSet

public int cloneFirstAtomSet(int atomCount)

### cloneAtomSetWithBonds

public void cloneAtomSetWithBonds(boolean isLast)

### cloneLastAtomSet

public int cloneLastAtomSet()

### cloneLastAtomSetFromPoints

public int cloneLastAtomSetFromPoints(int ac, P3[] pts)

### getLastAtomSetAtomCount

public int getLastAtomSetAtomCount()

### getLastAtomSetAtomIndex

public int getLastAtomSetAtomIndex()

### addNewAtom

public Atom addNewAtom()

### addAtom

public Atom addAtom(Atom atom)

### addAtomWithMappedName

public void addAtomWithMappedName(Atom atom)

### addAtomWithMappedSerialNumber

public void addAtomWithMappedSerialNumber(Atom atom)

### getAtomFromName

public Atom getAtomFromName(String atomName)

### setAtomMapAnyCase

public void setAtomMapAnyCase()

### getAtomIndex

public int getAtomIndex(String name)

### addNewBondWithOrder

public Bond addNewBondWithOrder(int atomIndex1, int atomIndex2, int order)

### addNewBondFromNames

public Bond addNewBondFromNames(String atomName1, String atomName2, int order)

### addNewBondWithOrderA

public Bond addNewBondWithOrderA(Atom atom1, Atom atom2, int order)

### addBond

public void addBond(Bond bond)

### addBondNoCheck

public void addBondNoCheck(Bond bond)

### finalizeStructures

public void finalizeStructures()

### addStructure

public void addStructure(Structure structure)

### addVibrationVectorWithSymmetry

public void addVibrationVectorWithSymmetry(int iatom, float vx, float vy, float vz, boolean withSymmetry)

### addVibrationVector

public V3 addVibrationVector(int iatom, float x, float y, float z)

### setCoordinatesAreFractional

public void setCoordinatesAreFractional(boolean tf)

### setAnisoBorU

public void setAnisoBorU(Atom atom, float[] data, int type)

### setU

public void setU(Atom atom, int i, float val)

### getXSymmetry

public XtalSymmetry getXSymmetry()

### getSymmetry

public XtalSymmetry.FileSymmetry getSymmetry()

### setSymmetryFromAuditBlock

public XtalSymmetry.FileSymmetry setSymmetryFromAuditBlock(XtalSymmetry.FileSymmetry symmetry)

### newFileSymmetry

public XtalSymmetry.FileSymmetry newFileSymmetry()

### setTensors

public void setTensors()

### setInfo

public void setInfo(String key, Object value)

### setAtomSetCollectionPartialCharges

public boolean setAtomSetCollectionPartialCharges(String auxKey)
Sets the partial atomic charges based on asc auxiliary info

Parameters:
  `auxKey` - The auxiliary key name that contains the charges
Returns:
  true if the data exist; false if not

### mapPartialCharge

public void mapPartialCharge(String atomName, float charge)

### finalizeTrajectoryAs

public void finalizeTrajectoryAs(Lst<P3[]> trajectorySteps, Lst<V3[]> vibrationSteps)

### newAtomSet

public void newAtomSet()
Create a new atoms set, clearing the atom map

### newAtomSetClear

public void newAtomSetClear(boolean doClearMap)
Create a new atom set, optionally clearing the atom map.

Parameters:
  `doClearMap` - set to false only in CastepReader

### getAtomSetAtomIndex

public int getAtomSetAtomIndex(int i)

### getAtomSetAtomCount

public int getAtomSetAtomCount(int i)

### getAtomSetBondCount

public int getAtomSetBondCount(int i)

### setAtomSetName

public void setAtomSetName(String atomSetName)
Sets the name for the current AtomSet

Parameters:
  `atomSetName` - The name to be associated with the current AtomSet

### setCurrentAtomSetNumber

public void setCurrentAtomSetNumber(int atomSetNumber)
Sets the number for the current AtomSet

Parameters:
  `atomSetNumber` - The number for the current AtomSet.

### setAtomSetNumber

public void setAtomSetNumber(int index, int atomSetNumber)

### setAtomSetModelProperty

public void setAtomSetModelProperty(String key, String value)
Sets a property for the current AtomSet used specifically for creating directories and plots of frequencies and molecular energies

Parameters:
  `key` - The key for the property
  `value` - The value to be associated with the key

### setAtomSetModelPropertyForSet

public void setAtomSetModelPropertyForSet(String key, String value, int atomSetIndex)
Sets the a property for the an AtomSet

Parameters:
  `key` - The key for the property
  `value` - The value for the property
  `atomSetIndex` - The index of the AtomSet to get the property

### setAtomProperties

public void setAtomProperties(String key, Object data, int atomSetIndex, boolean isGroup)

Parameters:
  `key` -
  `data` -
  `atomSetIndex` -
  `isGroup` -

### getAtomSetAuxiliaryInfoValue

public Object getAtomSetAuxiliaryInfoValue(int index, String key)

### setCurrentModelInfo

public void setCurrentModelInfo(String key, Object value)
Sets auxiliary information for the AtomSet

Parameters:
  `key` - The key for the property
  `value` - The value to be associated with the key

### setModelInfoForSet

public void setModelInfoForSet(String key, Object value, int atomSetIndex)
Sets auxiliary information for an AtomSet

Parameters:
  `key` - The key for the property
  `value` - The value for the property
  `atomSetIndex` - The index of the AtomSet to get the property

### getAtomSetAuxiliaryInfo

public Map<String,Object> getAtomSetAuxiliaryInfo(int atomSetIndex)

### setAtomSetEnergy

public void setAtomSetEnergy(String energyString, float value)
/ for XmlChem3dReader, but could be for CUBE

### setAtomSetFrequency

public String setAtomSetFrequency(int mode, String pathKey, String label, String freq, String units)

### getBondList

public String[][] getBondList()

### centralize

public void centralize()

### removeAtomSet

public void removeAtomSet(int imodel)
note that sets must be iterated from LAST to FIRST not a general method -- would mess up if we had unit cells

Parameters:
  `imodel` -

### removeLastUnselectedAtoms

public void removeLastUnselectedAtoms()

### checkNoEmptyModel

public void checkNoEmptyModel()

### getBSAtoms

public BS getBSAtoms(int n)
Create bsAtoms if it is null, and set bits if desired.

Parameters:
  `n` - if created only, -1 to set all atoms, 0 for no setting, otherwise, set [0,n)
Returns:
  bsAtoms

### setBSAtomsForSet

public void setBSAtomsForSet(int iSet)
Add a full set of atoms to BSAtoms if they are not already indicated there.

Parameters:
  `iSet` -

### fix2Stereo

public void fix2Stereo()