#include <atom.h>
Inheritance diagram for Atom:
Class friends | |
| |
typedef short | Type |
Atom type. | |
class | Bond |
External iteration | |
typedef Index | BondIteratorPosition |
typedef RandomAccessIterator< Atom, Bond, BondIteratorPosition, BondIteratorTraits > | BondIterator |
Random access iterator for bonds. | |
typedef ConstRandomAccessIterator< Atom, Bond, BondIteratorPosition, BondIteratorTraits > | BondConstIterator |
Constant random access iterator for bonds. | |
typedef std::reverse_iterator< BondIterator > | BondReverseIterator |
Reverse random access iterator for bonds. | |
typedef std::reverse_iterator< BondConstIterator > | BondConstReverseIterator |
Constant reverse random access iterator for bonds. | |
BondIterator | beginBond () throw () |
Return a bond iterator pointing to the first bond of the atom. | |
BondIterator | endBond () throw () |
Return a past-the-end bond iterator. | |
BondConstIterator | beginBond () const throw () |
Return a constant bond iterator pointing to the first bond. | |
BondConstIterator | endBond () const throw () |
Return a constant past-the-end bond iterator. | |
BondReverseIterator | rbeginBond () throw () |
Return a reverse bond iterator pointing to the last bond. | |
BondReverseIterator | rendBond () throw () |
Return a past-the-end bond iterator for reverse traversal. | |
BondConstReverseIterator | rbeginBond () const throw () |
Return a constant reverse bond iterator pointing to the first atom. | |
BondConstReverseIterator | rendBond () const throw () |
Return a constant past-the-end bond iterator for reverse traversal. | |
class | BondIteratorTraits |
Efficient handling of atom attributes | |
typedef std::list< Atom * > | AtomPtrList |
typedef std::list< Position > | AtomIndexList |
Position | getIndex () const |
Return the index in the static attribute array. | |
StaticAtomAttributes * | getAttributePtr () |
const StaticAtomAttributes * | getAttributePtr () const |
Position | compact (const AtomIndexList &indices) throw (Exception::OutOfRange) |
Compact memory for a list of atoms. | |
AttributeVector & | getAttributes () |
Access to the static attribute array. | |
const PreciseTime & | getAttributesModificationTime () throw () |
Get the time, when the attributes vector was last modified. | |
Attributes | |
Position | index_ |
const Element * | element_ |
String | name_ |
String | type_name_ |
float | radius_ |
unsigned char | number_of_bonds_ |
Bond * | bond_ [MAX_NUMBER_OF_BONDS] |
AttributeVector | static_attributes_ |
AtomIndexList | free_list_ |
PreciseTime | attributes_changed_time_ |
time of the last resize of the attributes vector | |
Public Types | |
Enumerations | |
enum | { UNKNOWN_TYPE = -1, ANY_TYPE = 0, MAX_NUMBER_OF_BONDS = 12 } |
Unnamed enumeration of all non-categorized constants. More... | |
enum | Property { NUMBER_OF_PROPERTIES = 0 } |
Predefined properties. More... | |
enum | FullNameType { NO_VARIANT_EXTENSIONS, ADD_VARIANT_EXTENSIONS, ADD_RESIDUE_ID, ADD_VARIANT_EXTENSIONS_AND_ID, ADD_CHAIN_RESIDUE_ID, ADD_VARIANT_EXTENSIONS_AND_CHAIN_RESIDUE_ID } |
The type of name used for getFullName. More... | |
Public Member Functions | |
Constructors | |
Atom () throw () | |
Default constructor. | |
Atom (const Atom &atom, bool deep=true) throw () | |
Copy constructor. | |
Atom (Element &element, const String &name, const String &type_name=BALL_ATOM_DEFAULT_TYPE_NAME, Type atom_type=BALL_ATOM_DEFAULT_TYPE, const Vector3 &position=Vector3(BALL_ATOM_DEFAULT_POSITION), const Vector3 &velocity=Vector3(BALL_ATOM_DEFAULT_VELOCITY), const Vector3 &force=Vector3(BALL_ATOM_DEFAULT_FORCE), float charge=BALL_ATOM_DEFAULT_CHARGE, float radius=BALL_ATOM_DEFAULT_RADIUS, Index formal_charge=BALL_ATOM_DEFAULT_FORMAL_CHARGE) throw () | |
Detailed state initializing constructor. | |
Destructors | |
virtual | ~Atom () throw () |
Destructor. | |
virtual void | clear () throw () |
Explicit default initialization. | |
virtual void | destroy () throw () |
Explicit destructor. | |
Persistence | |
virtual void | persistentWrite (PersistenceManager &pm, const char *name=0) const throw (Exception::GeneralException) |
Write an Atom to a persistent stream. | |
virtual void | persistentRead (PersistenceManager &pm) throw (Exception::GeneralException) |
Read an Atom from a persistent stream. | |
Assignment methods | |
void | set (const Atom &atom, bool deep=true) throw () |
Deep/shallow assignment. | |
void | get (Atom &atom, bool deep=true) const throw () |
Deep/shallow assignment. | |
Atom & | operator= (const Atom &atom) throw () |
Assignment operator. | |
void | swap (Atom &atom) throw () |
Swap the contents of two atoms. | |
bool | operator== (const Atom &atom) const throw () |
Equality operator. | |
bool | operator!= (const Atom &atom) const throw () |
Inequality operator. | |
Accessors | |
void | setElement (const Element &element) throw () |
Assign the atom's element. | |
const Element & | getElement () const throw () |
Return the atom's element. | |
void | setCharge (float charge) throw () |
Set the atom's (partial) charge. | |
float | getCharge () const throw () |
Return the atom's (partial) charge. | |
void | setFormalCharge (Index formal_charge) throw () |
Set the atom's formal charge. | |
Index | getFormalCharge () const throw () |
Return the atom's formal charge. | |
const Molecule * | getMolecule () const throw () |
Return the molecule the atom is contained in (const). | |
Molecule * | getMolecule () throw () |
Return the molecule the atom is contained in (mutable). | |
const Fragment * | getFragment () const throw () |
Return the fragment the atom is contained in (const). | |
Fragment * | getFragment () throw () |
Return the fragment the atom is contained in (mutable). | |
const Residue * | getResidue () const throw () |
Return the residue the atom is contained in (const). | |
Residue * | getResidue () throw () |
Return the residue the atom is contained in (mutable). | |
const SecondaryStructure * | getSecondaryStructure () const throw () |
Return the secondary structure the atom is contained in (const). | |
SecondaryStructure * | getSecondaryStructure () throw () |
Return the secondary structure the atom is contained in (mutable). | |
const Chain * | getChain () const throw () |
Return the chain the atom is contained in (const). | |
Chain * | getChain () throw () |
Return the chain the atom is contained in (mutable). | |
void | setName (const String &name) throw () |
Set the atom name. | |
const String & | getName () const throw () |
Return the atom name. | |
String | getFullName (FullNameType type=ADD_VARIANT_EXTENSIONS) const throw () |
Assemble a fully specified atom name. | |
void | setPosition (const Vector3 &position) throw () |
Assign the atom coordinates. | |
Vector3 & | getPosition () throw () |
Return the atom coordinates (mutable). | |
const Vector3 & | getPosition () const throw () |
Return the atom coordinates (const). | |
void | setRadius (float radius) throw () |
Set the atom radius. | |
float | getRadius () const throw () |
Return the atom radius. | |
void | setType (Type atom_type) throw () |
Assign the numerical atom type. | |
Type | getType () const throw () |
Return the (numerical) atom type. | |
String | getTypeName () const throw () |
Return the atom type name. | |
void | setTypeName (const String &name) throw () |
Assign the atom type name. | |
void | setVelocity (const Vector3 &velocity) throw () |
Set the atom velocity BALL uses units of for the velocity. | |
const Vector3 & | getVelocity () const throw () |
Return the atom velocity. | |
void | setForce (const Vector3 &force) throw () |
Assign the atom's force vevtor. | |
const Vector3 & | getForce () const throw () |
Return the atom's force vector (const). | |
Vector3 & | getForce () throw () |
Return the atom's force vector (mutable). | |
Size | countBonds () const throw () |
Return the number of bonds. | |
Bond * | getBond (Position index) throw (Exception::IndexOverflow) |
Return a bond by its index (mutable). | |
const Bond * | getBond (Position index) const throw (Exception::IndexOverflow) |
Return a bond by its index (const). | |
Bond * | getBond (const Atom &atom) throw () |
Return a bond by its partner atom (const). | |
const Bond * | getBond (const Atom &atom) const throw () |
Return a bond by its partner atom (mutable) The reference is 0 if this instance does not have a bond with atom . | |
Miscellaneous | |
Bond * | createBond (Atom &atom) throw (Exception::TooManyBonds) |
Create a new bond to an atom. | |
Bond * | createBond (Bond &bond, Atom &atom) throw (Exception::TooManyBonds) |
Create a new bond from an already existing instance of Bond. | |
Bond * | cloneBond (Bond &bond, Atom &atom) throw () |
Create a copy of a bond. | |
bool | destroyBond (const Atom &atom) throw () |
Explicit bond destruction. | |
void | destroyBonds () throw () |
Explicit bond table destruction. | |
Predicates | |
bool | hasBond (const Bond &bond) const throw () |
Determine whether the atom takes part in a certain bond. | |
bool | isBoundTo (const Atom &atom) const throw () |
Determine whether there exists a bond to another atom. | |
bool | isBound () const throw () |
Determine whether the atom has any bond. | |
bool | isGeminal (const Atom &atom) const throw () |
True if the two atoms are geminal. | |
bool | isVicinal (const Atom &atom) const throw () |
True if the two atoms are vicinal. | |
Debuggers and diagnostics | |
virtual bool | isValid () const throw () |
Internal state and consistency self-validation. | |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Internal state dump. | |
Internal iteration | |
bool | applyBonds (UnaryProcessor< Bond > &processor) throw () |
Application of an unary processor on every contained bond. |
A class representing atoms. During each runtime instance of a program an atom is unique and identified by a Object::Handle . Atom equality is defined as atom identity, so there cannot be any two identical atoms. A linear ordering of atoms is defined as the linear order of the Object::Handle s.
|
Random access iterator for bonds.
|
|
Atom type.
|
|
Unnamed enumeration of all non-categorized constants.
|
|
The type of name used for getFullName.
|
|
Predefined properties. Enumeration of all properties that are used by the BALL kernel. Reimplemented in PDBAtom. |
|
Default constructor. The state of this instance is:
|
|
Copy constructor. The copy is either deep (default) or shallow.
|
|
Detailed state initializing constructor. The item bond table is empty (atom has no bonds).
|
|
Destructor. If the atom has bonds in common with an other atom that atom is disconnected and the associated Bond instance is destroyed. Calls Atom::destroy .
|
|
Application of an unary processor on every contained bond.
|
|
Explicit default initialization. Calls Composite::clear and resets the attributes to the default values. In contrast to destroy , the atom is not removed from any composite structure, i.e. its parent fragment pointer remains unchanged.
Reimplemented from Composite. Reimplemented in PDBAtom. |
|
Create a copy of a bond. This is mostly for internal use and should not be required by most users. |
|
Compact memory for a list of atoms. This method packs the static attributes of the atom in the given range into a contiguous memory segment in order to increase locality. |
|
Create a new bond from an already existing instance of Bond. Initialize the bond bond to connect this instance to atom . Calls Bond::createBond . The state of the bond is initialzed to the default values.
|
|
Create a new bond to an atom. Create a new instance of Bond connecting this instance to atom . Calls Bond::createBond . The state of the bond is initialized to the default values.
|
|
Explicit destructor. Destroy this instance explicitly and reset its attributes to the default values.
Reimplemented from Composite. Reimplemented in PDBAtom. |
|
Explicit bond destruction. Destroy the bond connecting {*this atom} and atom explicitly. If the bond is auto-deletable the default destructor is called otherwise Bond::destroy .
|
|
Explicit bond table destruction. Destroy all the bonds connecting {*this atom} with another atom explicitly. If the bonds are auto-deletable the default destructors are called otherwise Bond::destroy .
|
|
Internal state dump. Dump the current internal state of this instance to the output ostream s with dumping depth depth . For debugging purposes only.
Reimplemented from Composite. Reimplemented in PDBAtom. |
|
Deep/shallow assignment. The inverse operation to set , behaves identically.
|
|
Get the time, when the attributes vector was last modified. This needed for the GeometricObject 's in VIEW, because they store pointer to the position of atoms. These have to be updated, after a resize of the vector. |
|
Return a bond by its partner atom (mutable) The reference is 0 if this instance does not have a bond with atom .
|
|
Return a bond by its partner atom (const). The reference is 0 if this instance does not have a bond with atom .
|
|
Return a bond by its index (const).
|
|
Return a bond by its index (mutable). The reference is 0 if this instance does not have a bond with index index .
|
|
Return the chain the atom is contained in (const). A NULL pointer is returned if this atom is not part of a chain.
Reimplemented in PDBAtom. |
|
Return the atom's (partial) charge. Charges should be assigned in multiples of the proton charge (elementary charge). |
|
Return the fragment the atom is contained in (const). A NULL pointer is returned if this atom is not part of a fragment.
|
|
Assemble a fully specified atom name.
This method returns at fully specified atom name as used for charge and type assignments. The name consists of the name of the residue the atom is contained in, a colon, and the atom name. Blanks are removed from both names. For example, for the alpha carbon atom of isoleucine
|
|
Return the molecule the atom is contained in (const). A NULL pointer is returned if this atom is not part of a molecule.
|
|
Return the residue the atom is contained in (const). A NULL pointer is returned if this atom is not part of a residue.
Reimplemented in PDBAtom. |
|
Return the secondary structure the atom is contained in (const). A NULL pointer is returned if this atom is not part of a secondary structure.
|
|
Return the atom velocity. BALL uses units of for the velocity. |
|
Determine whether the atom takes part in a certain bond.
|
|
Determine whether the atom has any bond.
|
|
Determine whether there exists a bond to another atom. Calls Atom::getBond . Hydrogen bonds (type = Bond::TYPE__HYDROGEN) are ignored.
|
|
True if the two atoms are geminal. Two atoms are geminal if they do not share a common bond but both have a bond to a third atom. For example the two hydrogen atoms in water are geminal. Hydrogen bonds (type = Bond::TYPE__HYDROGEN) are ignored.
|
|
Internal state and consistency self-validation.
Reimplemented from Composite. |
|
True if the two atoms are vicinal. Two atoms are vicinal if they are separated by three bonds (1-4 position). Hydrogen bonds (type = Bond::TYPE__HYDROGEN) are ignored.
|
|
Inequality operator.
|
|
Assignment operator. The assignment is always deep. Calls Atom::set .
|
|
Equality operator. Two atoms are equal if they have the same handle.
|
|
Read an Atom from a persistent stream.
Reimplemented from Composite. Reimplemented in PDBAtom. |
|
Write an Atom to a persistent stream.
Reimplemented from Composite. Reimplemented in PDBAtom. |
|
Deep/shallow assignment.
The assignment is either deep or shallow (default is deep). In the case of a deep assignment, all composites contained in
|
|
Set the atom's (partial) charge. Charges should be assigned in multiples of the proton charge (elementary charge). |
|
Assign the atom's force vevtor. BALL uses units of Newton (1 N = 1 J/m) as the unit of force. |
|
Assign the atom coordinates. BALL uses units of Angstrom for atom coordinates. |
|
Set the atom radius. BALL uses units of Angstrom for the atom radii. |
|
Set the atom velocity BALL uses units of for the velocity.
|
|
Swap the contents of two atoms. The static attributes are swapped by exchanging the indices of the two atoms!
|