org.openscience.cdk
Class Crystal

java.lang.Object
  extended by org.openscience.cdk.ChemObject
      extended by org.openscience.cdk.AtomContainer
          extended by org.openscience.cdk.Crystal
All Implemented Interfaces:
Serializable, Cloneable, IAtomContainer, ICDKObject, IChemObject, IChemObjectListener, ICrystal
Direct Known Subclasses:
DebugCrystal

public class Crystal
extends AtomContainer
implements Serializable, ICrystal, Cloneable

Class representing a molecular crystal. The crystal is described with molecules in fractional coordinates and three cell axes: a,b and c.

The crystal is designed to store only the asymmetric atoms. Though this is not enforced, it is assumed by all methods.

See Also:
Serialized Form
Keywords:
crystal
Belongs to CDK module:
data
Source code:
cdk-1.4.x

Constructor Summary
Crystal()
          Constructs a new crystal with zero length cell axis.
Crystal(IAtomContainer container)
          Constructs a new crystal with zero length cell axis and adds the atoms in the AtomContainer as cell content.
 
Method Summary
 Object clone()
          Makes a clone of this crystal.
 javax.vecmath.Vector3d getA()
          Gets the A unit cell axes in Cartesian coordinates as a three element double array.
 javax.vecmath.Vector3d getB()
          Gets the B unit cell axes in Cartesian coordinates as a three element double array.
 javax.vecmath.Vector3d getC()
          Gets the C unit cell axes in Cartesian coordinates as a three element double array.
 String getSpaceGroup()
          Gets the space group of this crystal.
 Integer getZ()
          Gets the number of asymmetric parts in the unit cell.
 void setA(javax.vecmath.Vector3d newAxis)
          Sets the A unit cell axes in Cartesian coordinates in a Euclidean space.
 void setB(javax.vecmath.Vector3d newAxis)
          Sets the B unit cell axes in Cartesian coordinates.
 void setC(javax.vecmath.Vector3d newAxis)
          Sets the C unit cell axes in Cartesian coordinates.
 void setSpaceGroup(String group)
          Sets the space group of this crystal.
 void setZ(Integer value)
          Sets the number of asymmetric parts in the unit cell.
 String toString()
          Returns a String representation of this crystal.
 
Methods inherited from class org.openscience.cdk.AtomContainer
add, addAtom, addBond, addBond, addBond, addElectronContainer, addLonePair, addLonePair, addSingleElectron, addSingleElectron, addStereoElement, atoms, bonds, contains, contains, contains, contains, contains, electronContainers, getAtom, getAtomCount, getAtomNumber, getBond, getBond, getBondCount, getBondNumber, getBondNumber, getBondOrderSum, getConnectedAtomsCount, getConnectedAtomsList, getConnectedBondsCount, getConnectedBondsCount, getConnectedBondsList, getConnectedElectronContainersList, getConnectedLonePairsCount, getConnectedLonePairsList, getConnectedSingleElectronsCount, getConnectedSingleElectronsList, getElectronContainer, getElectronContainerCount, getFirstAtom, getLastAtom, getLonePair, getLonePairCount, getLonePairNumber, getMaximumBondOrder, getMinimumBondOrder, getSingleElectron, getSingleElectronCount, getSingleElectronNumber, lonePairs, remove, removeAllBonds, removeAllElectronContainers, removeAllElements, removeAtom, removeAtom, removeAtomAndConnectedElectronContainers, removeBond, removeBond, removeBond, removeElectronContainer, removeElectronContainer, removeLonePair, removeLonePair, removeSingleElectron, removeSingleElectron, setAtom, setAtoms, setBonds, singleElectrons, stateChanged, stereoElements
 
Methods inherited from class org.openscience.cdk.ChemObject
addListener, compare, getBuilder, getFlag, getFlags, getID, getListenerCount, getNotification, getProperties, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty, shallowCopy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openscience.cdk.interfaces.ICrystal
add, addAtom
 
Methods inherited from interface org.openscience.cdk.interfaces.IAtomContainer
addBond, addBond, addBond, addElectronContainer, addLonePair, addLonePair, addSingleElectron, addSingleElectron, addStereoElement, atoms, bonds, contains, contains, contains, contains, contains, electronContainers, getAtom, getAtomCount, getAtomNumber, getBond, getBond, getBondCount, getBondNumber, getBondNumber, getBondOrderSum, getConnectedAtomsCount, getConnectedAtomsList, getConnectedBondsCount, getConnectedBondsCount, getConnectedBondsList, getConnectedElectronContainersList, getConnectedLonePairsCount, getConnectedLonePairsList, getConnectedSingleElectronsCount, getConnectedSingleElectronsList, getElectronContainer, getElectronContainerCount, getFirstAtom, getLastAtom, getLonePair, getLonePairCount, getLonePairNumber, getMaximumBondOrder, getMinimumBondOrder, getSingleElectron, getSingleElectronCount, getSingleElectronNumber, lonePairs, remove, removeAllBonds, removeAllElectronContainers, removeAllElements, removeAtom, removeAtom, removeAtomAndConnectedElectronContainers, removeBond, removeBond, removeBond, removeElectronContainer, removeElectronContainer, removeLonePair, removeLonePair, removeSingleElectron, removeSingleElectron, setAtom, setAtoms, setBonds, singleElectrons, stereoElements
 
Methods inherited from interface org.openscience.cdk.interfaces.IChemObject
addListener, getFlag, getFlags, getID, getListenerCount, getNotification, getProperties, getProperty, notifyChanged, notifyChanged, removeListener, removeProperty, setFlag, setFlags, setID, setNotification, setProperties, setProperty
 
Methods inherited from interface org.openscience.cdk.interfaces.ICDKObject
getBuilder
 
Methods inherited from interface org.openscience.cdk.interfaces.IChemObjectListener
stateChanged
 

Constructor Detail

Crystal

public Crystal()
Constructs a new crystal with zero length cell axis.


Crystal

public Crystal(IAtomContainer container)
Constructs a new crystal with zero length cell axis and adds the atoms in the AtomContainer as cell content.

Parameters:
container - the AtomContainer providing the atoms and bonds
Method Detail

setA

public void setA(javax.vecmath.Vector3d newAxis)
Sets the A unit cell axes in Cartesian coordinates in a Euclidean space.

Specified by:
setA in interface ICrystal
Parameters:
newAxis - the new A axis
See Also:
getA()

getA

public javax.vecmath.Vector3d getA()
Gets the A unit cell axes in Cartesian coordinates as a three element double array.

Specified by:
getA in interface ICrystal
Returns:
a Vector3D representing the A axis
See Also:
setA(javax.vecmath.Vector3d)

setB

public void setB(javax.vecmath.Vector3d newAxis)
Sets the B unit cell axes in Cartesian coordinates.

Specified by:
setB in interface ICrystal
Parameters:
newAxis - the new B axis
See Also:
getB()

getB

public javax.vecmath.Vector3d getB()
Gets the B unit cell axes in Cartesian coordinates as a three element double array.

Specified by:
getB in interface ICrystal
Returns:
a Vector3D representing the B axis
See Also:
setB(javax.vecmath.Vector3d)

setC

public void setC(javax.vecmath.Vector3d newAxis)
Sets the C unit cell axes in Cartesian coordinates.

Specified by:
setC in interface ICrystal
Parameters:
newAxis - the new C axis
See Also:
getC()

getC

public javax.vecmath.Vector3d getC()
Gets the C unit cell axes in Cartesian coordinates as a three element double array.

Specified by:
getC in interface ICrystal
Returns:
a Vector3D representing the C axis
See Also:
setC(javax.vecmath.Vector3d)

getSpaceGroup

public String getSpaceGroup()
Gets the space group of this crystal.

Specified by:
getSpaceGroup in interface ICrystal
Returns:
the space group of this crystal structure
See Also:
setSpaceGroup(java.lang.String)

setSpaceGroup

public void setSpaceGroup(String group)
Sets the space group of this crystal.

Specified by:
setSpaceGroup in interface ICrystal
Parameters:
group - the space group of this crystal structure
See Also:
getSpaceGroup()

getZ

public Integer getZ()
Gets the number of asymmetric parts in the unit cell.

Specified by:
getZ in interface ICrystal
Returns:
the number of asymmetric parts in the unit cell
See Also:
setZ(java.lang.Integer)

setZ

public void setZ(Integer value)
Sets the number of asymmetric parts in the unit cell.

Specified by:
setZ in interface ICrystal
Parameters:
value - the number of asymmetric parts in the unit cell
See Also:
getZ()

clone

public Object clone()
             throws CloneNotSupportedException
Makes a clone of this crystal.

Specified by:
clone in interface IChemObject
Overrides:
clone in class AtomContainer
Returns:
The cloned crystal.
Throws:
CloneNotSupportedException - if the IChemObject cannot be cloned
See Also:
ChemObject.shallowCopy()

toString

public String toString()
Returns a String representation of this crystal.

Specified by:
toString in interface IChemObject
Overrides:
toString in class AtomContainer
Returns:
The string representation of this Container