Loading...
Searching...
No Matches
BALL::Atom Class Reference
Kernel Classes » Molecular Datastructures

`#include <BALL/KERNEL/atom.h>`

Inheritance diagram for BALL::Atom:

## Classes

class | BondIteratorTraits

## Public Types

Enumerations
enum | { UNKNOWN_TYPE = -1 , ANY_TYPE = 0 , MAX_NUMBER_OF_BONDS = 12 }
enum | Property { NUMBER_OF_PROPERTIES = 0 }
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 }
Efficient handling of atom attributes
typedef std::list< Atom * > | AtomPtrList
typedef std::list< Position > | AtomIndexList
Public Types inherited from BALL::Composite
enum | StampType { MODIFICATION = 1 , SELECTION = 2 , BOTH = 3 }
typedef UnaryPredicate< Composite > | KernelPredicateType
typedef ForwardIterator< Composite, Composite, Composite *, AncestorIteratorTraits > | AncestorIterator
typedef ConstForwardIterator< Composite, Composite, Composite *, AncestorIteratorTraits > | AncestorConstIterator
typedef BidirectionalIterator< Composite, Composite, Composite *, ChildCompositeIteratorTraits > | ChildCompositeIterator
typedef ConstBidirectionalIterator< Composite, Composite, Composite *, ChildCompositeIteratorTraits > | ChildCompositeConstIterator
typedef std::reverse_iterator< ChildCompositeIterator > | ChildCompositeReverseIterator
typedef std::reverse_iterator< ChildCompositeConstIterator > | ChildCompositeConstReverseIterator
typedef BidirectionalIterator< Composite, Composite, Composite *, CompositeIteratorTraits > | CompositeIterator
typedef ConstBidirectionalIterator< Composite, Composite, Composite *, CompositeIteratorTraits > | CompositeConstIterator
typedef std::reverse_iterator< CompositeIterator > | CompositeReverseIterator
typedef std::reverse_iterator< CompositeConstIterator > | CompositeConstReverseIterator

## Public Member Functions

Constructors
| Atom ()
| Atom (const Atom &atom, bool deep=true)

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)

Destructors
virtual | ~Atom ()
virtual void | clear ()
virtual void | destroy ()
Persistence
virtual void | persistentWrite (PersistenceManager &pm, const char *name=0) const
virtual void | persistentRead (PersistenceManager &pm)
Assignment methods
void | set (const Atom &atom, bool deep=true)
void | get (Atom &atom, bool deep=true) const
Atom & | operator= (const Atom &atom)
void | swap (Atom &atom)
bool | operator== (const Atom &atom) const
bool | operator!= (const Atom &atom) const
Accessors
void | setElement (const Element &element)
| Assign the atom's element.
const Element & | getElement () const
| Return the atom's element.
void | setCharge (float charge)
float | getCharge () const
void | setFormalCharge (Index formal_charge)
| Set the atom's formal charge.
Index | getFormalCharge () const
| Return the atom's formal charge.
const Molecule * | getMolecule () const
Molecule * | getMolecule ()
| Return the molecule the atom is contained in (mutable).
const Fragment * | getFragment () const
Fragment * | getFragment ()
| Return the fragment the atom is contained in (mutable).
const Residue * | getResidue () const
Residue * | getResidue ()
| Return the residue the atom is contained in (mutable).
const SecondaryStructure * | getSecondaryStructure () const
SecondaryStructure * | getSecondaryStructure ()
| Return the secondary structure the atom is contained in (mutable).
const Chain * | getChain () const
Chain * | getChain ()
| Return the chain the atom is contained in (mutable).
void | setName (const String &name)
| Set the atom name.
const String & | getName () const
| Return the atom name.
String | getFullName (FullNameType type=ADD_VARIANT_EXTENSIONS) const
void | setPosition (const Vector3 &position)
Vector3 & | getPosition ()
| Return the atom coordinates (mutable).
const Vector3 & | getPosition () const
| Return the atom coordinates (const).
void | setRadius (float radius)
float | getRadius () const
| Return the atom radius.
void | setType (Type atom_type)
| Assign the numerical atom type.
Type | getType () const
| Return the (numerical) atom type.
String | getTypeName () const
| Return the atom type name.
void | setTypeName (const String &name)
| Assign the atom type name.
void | setVelocity (const Vector3 &velocity)
Vector3 & | getVelocity ()
const Vector3 & | getVelocity () const
void | setForce (const Vector3 &force)
const Vector3 & | getForce () const
| Return the atom's force vector (const).
Vector3 & | getForce ()
| Return the atom's force vector (mutable).
Size | countBonds () const
| Return the number of bonds.
Bond * | getBond (Position index)
const Bond * | getBond (Position index) const
Bond * | getBond (const Atom &atom)
const Bond * | getBond (const Atom &atom) const
Predicates
bool | hasBond (const Bond &bond) const
bool | isBoundTo (const Atom &atom) const
bool | isBound () const
bool | isGeminal (const Atom &atom) const
bool | isVicinal (const Atom &atom) const
Type predicates
virtual bool | isAtom () const
Debuggers and diagnostics
virtual bool | isValid () const
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const
Internal iteration
bool | applyBonds (UnaryProcessor< Bond > &processor)
Public Member Functions inherited from BALL::Composite
template<typename T>
BALL_INLINE bool | apply (UnaryProcessor< T > &processor)
template<typename T>
BALL_INLINE bool | apply (ConstUnaryProcessor< T > &processor) const
template<typename T>
BALL_INLINE T * | getAncestor (const T &)
template<typename T>
BALL_INLINE const T * | getAncestor (const T &) const
template<typename T>
BALL_INLINE T * | getPrevious (const T &)
template<typename T>
BALL_INLINE const T * | getPrevious (const T &dummy) const
template<typename T>
BALL_INLINE T * | getNext (const T &)
template<typename T>
BALL_INLINE const T * | getNext (const T &dummy) const
template<typename T>
BALL_INLINE bool | hasAncestor (const T &dummy) const
| Composite ()
| Composite (const Composite &composite, bool deep=true)
virtual | ~Composite ()
void | destroy (bool virtual_destroy)
void * | clone (Composite &root) const
bool | operator== (const Composite &composite) const
bool | operator!= (const Composite &composite) const
bool | isEmpty () const
bool | isRoot () const
bool | isRootOf (const Composite &composite) const
bool | isInterior () const
bool | hasChild () const
bool | isChildOf (const Composite &composite) const
bool | isFirstChild () const
bool | isFirstChildOf (const Composite &composite) const
bool | isLastChild () const
bool | isLastChildOf (const Composite &composite) const
bool | hasParent () const
bool | isParentOf (const Composite &composite) const
bool | hasSibling () const
bool | isSiblingOf (const Composite &composite) const
bool | hasPreviousSibling () const
bool | isPreviousSiblingOf (const Composite &composite) const
bool | hasNextSibling () const
bool | isNextSiblingOf (const Composite &composite) const
bool | isDescendantOf (const Composite &composite) const
template<typename T>
bool | hasAncestor (const T &dummy) const
bool | isAncestorOf (const Composite &composite) const
bool | isRelatedWith (const Composite &composite) const
bool | isHomomorph (const Composite &composite) const
bool | containsSelection () const
virtual bool | isMolecule () const
virtual bool | isProtein () const
virtual bool | isFragment () const
virtual bool | isResidue () const
virtual bool | isChain () const
void | host (Visitor< Composite > &visitor)
template<typename T>
bool | applyAncestor (UnaryProcessor< T > &processor)
template<typename T>
bool | applyAncestor (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyChild (UnaryProcessor< T > &processor)
template<typename T>
bool | applyChild (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyDescendantPreorder (UnaryProcessor< T > &processor)
template<typename T>
bool | applyDescendantPreorder (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyDescendantPostorder (UnaryProcessor< T > &processor)
template<typename T>
bool | applyDescendantPostorder (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyDescendant (UnaryProcessor< T > &processor)
template<typename T>
bool | applyDescendant (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyPreorder (UnaryProcessor< T > &processor)
template<typename T>
bool | applyPreorder (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyPostorder (UnaryProcessor< T > &processor)
template<typename T>
bool | applyPostorder (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | apply (UnaryProcessor< T > &processor)
template<typename T>
bool | apply (ConstUnaryProcessor< T > &processor) const
template<typename T>
bool | applyLevel (UnaryProcessor< T > &processor, long level)
template<typename T>
bool | applyLevel (ConstUnaryProcessor< T > &processor, long level) const
AncestorIterator | beginAncestor ()
AncestorIterator | endAncestor ()
AncestorConstIterator | beginAncestor () const
AncestorConstIterator | endAncestor () const
ChildCompositeIterator | beginChildComposite ()
ChildCompositeIterator | endChildComposite ()
ChildCompositeConstIterator | beginChildComposite () const
ChildCompositeConstIterator | endChildComposite () const
ChildCompositeReverseIterator | rbeginChildComposite ()
ChildCompositeReverseIterator | rendChildComposite ()
ChildCompositeConstReverseIterator | rbeginChildComposite () const
ChildCompositeConstReverseIterator | rendChildComposite () const
CompositeIterator | beginComposite ()
CompositeIterator | endComposite ()
CompositeConstIterator | beginComposite () const
CompositeConstIterator | endComposite () const
CompositeReverseIterator | rbeginComposite ()
CompositeReverseIterator | rendComposite ()
CompositeConstReverseIterator | rbeginComposite () const
CompositeConstReverseIterator | rendComposite () const
void | deleteChildrenList_ (std::list< Composite * > &composites)
void | set (const Composite &composite, bool deep=true)
Composite & | operator= (const Composite &composite)
void | get (Composite &composite, bool deep=true) const
Size | getDegree () const
Size | count (const KernelPredicateType &predicate) const
Size | countDescendants () const
Size | getPathLength (const Composite &composite) const
Size | getDepth () const
Size | getHeight () const
Composite & | getRoot ()
const Composite & | getRoot () const
Composite * | getLowestCommonAncestor (const Composite &composite)
const Composite * | getLowestCommonAncestor (const Composite &composite) const
template<typename T>
T * | getAncestor (const T &)
template<typename T>
const T * | getAncestor (const T &) const
template<typename T>
T * | getPrevious (const T &)
template<typename T>
const T * | getPrevious (const T &dummy) const
template<typename T>
T * | getNext (const T &)
template<typename T>
const T * | getNext (const T &dummy) const
Composite * | getParent ()
const Composite * | getParent () const
Composite * | getChild (Index index)
const Composite * | getChild (Index index) const
Composite * | getSibling (Index index)
const Composite * | getSibling (Index index) const
Composite * | getFirstChild ()
const Composite * | getFirstChild () const
Composite * | getLastChild ()
const Composite * | getLastChild () const
const PreciseTime & | getModificationTime () const
const PreciseTime & | getSelectionTime () const
void | stamp (StampType stamp=BOTH)
void | prependChild (Composite &composite)
void | appendChild (Composite &composite)
void | insertBefore (Composite &composite)
void | insertAfter (Composite &composite)
void | spliceBefore (Composite &composite)
void | spliceAfter (Composite &composite)
void | splice (Composite &composite)
bool | removeChild (Composite &child)
Size | removeSelected ()
Size | removeUnselected ()
void | replace (Composite &composite)
void | swap (Composite &composite)
virtual void | select ()
virtual void | deselect ()
Public Member Functions inherited from BALL::PersistentObject
| PersistentObject ()
virtual | ~PersistentObject ()
PersistenceManager & | operator>> (PersistenceManager &pm) const
virtual void | finalize ()
Public Member Functions inherited from BALL::Object
| Object ()
| Default constructor.
| Object (const Object &object)
| Copy constructor.
virtual | ~Object ()
| Destructor.
const Object & | operator= (const Object &)
bool | operator== (const Object &object) const
bool | operator!= (const Object &object) const
bool | operator< (const Object &object) const
bool | operator<= (const Object &object) const
bool | operator>= (const Object &object) const
bool | operator> (const Object &object) const
int | compare (const Object &object) const
virtual void | dump (::std::ostream &s=std::cout, Size depth=0) const
Handle | getHandle () const
Public Member Functions inherited from BALL::AutoDeletable
virtual | ~AutoDeletable ()
void * | operator new (size_t size)
void | operator delete (void *ptr)
void * | operator new (size_t size, void *ptr)
void | operator delete (void *ptr, void *)
bool | isAutoDeletable () const
void | setAutoDeletable (bool enable)
Public Member Functions inherited from BALL::Selectable
| Selectable ()
| Selectable (const Selectable &selectable, bool deep=true)
virtual | ~Selectable ()
void | set (const Selectable &selectable, bool deep=true)
const Selectable & | operator= (const Selectable &selectable)
void | get (Selectable &selectable, bool deep=true) const
void | swap (Selectable &selectable)
virtual void | setSelected (bool selected)
bool | isSelected () const
bool | operator== (const Selectable &selectable) const
bool | operator!= (const Selectable &selectable) const
void | write (PersistenceManager &pm) const
bool | read (PersistenceManager &pm)
virtual void | dump (::std::ostream &s=std::cout, Size depth=0) const
Public Member Functions inherited from BALL::PropertyManager
BALL_INLINE | PropertyManager ()
| Default constructor.
BALL_INLINE | PropertyManager (const PropertyManager &property_manager)
| Copy constructor.
virtual | ~PropertyManager ()
| Destructor.
void | set (const PropertyManager &property_manager)
const PropertyManager & | operator= (const PropertyManager &property_manager)
void | get (PropertyManager &property_manager) const
void | swap (PropertyManager &property_manager)
BitVector & | getBitVector ()
const BitVector & | getBitVector () const
| operator BitVector & ()
void | setProperty (Property property)
void | clearProperty (Property property)
void | toggleProperty (Property property)
Size | countProperties () const
const NamedProperty & | getNamedProperty (Position index) const
NamedProperty & | getNamedProperty (Position index)
void | setProperty (const NamedProperty &property)
void | setProperty (const std::string &name)
void | setProperty (const std::string &name, bool value)
void | setProperty (const std::string &name, int value)
void | setProperty (const std::string &name, unsigned int value)
void | setProperty (const std::string &name, float value)
void | setProperty (const std::string &name, double value)
void | setProperty (const std::string &name, const std::string &value)
void | setProperty (const std::string &name, const PersistentObject &value)
const NamedProperty & | getProperty (const std::string &name) const
NamedPropertyIterator | beginNamedProperty ()
NamedPropertyIterator | endNamedProperty ()
void | clearProperty (const std::string &name)
Size | countNamedProperties () const
bool | hasProperty (Property property) const
| Query for an unnamed property.
bool | hasProperty (const std::string &name) const
| Query for a named property.
bool | operator== (const PropertyManager &pm) const
bool | operator!= (const PropertyManager &pm) const
| Inequality operator.
void | write (PersistenceManager &pm) const
| Persistent stream writing.
bool | read (PersistenceManager &pm)
| Persistent stream reading.
bool | isValid () const
void | dump (std::ostream &s=std::cout, Size depth=0) const

## Class friends

- class Bond

typedef short | Type
class | Bond

## External iteration

typedef Index | BondIteratorPosition
typedef RandomAccessIterator< Atom, Bond, BondIteratorPosition, BondIteratorTraits > | BondIterator
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.
class | BondIteratorTraits
BondIterator | beginBond ()
| Return a bond iterator pointing to the first bond of the atom.
BondIterator | endBond ()
| Return a past-the-end bond iterator.
BondConstIterator | beginBond () const
| Return a constant bond iterator pointing to the first bond.
BondConstIterator | endBond () const
| Return a constant past-the-end bond iterator.
BondReverseIterator | rbeginBond ()
| Return a reverse bond iterator pointing to the last bond.
BondReverseIterator | rendBond ()
| Return a past-the-end bond iterator for reverse traversal.
BondConstReverseIterator | rbeginBond () const
| Return a constant reverse bond iterator pointing to the first atom.
BondConstReverseIterator | rendBond () const
| Return a constant past-the-end bond iterator for reverse traversal.

## Miscellaneous

MolecularInteractions * | interactions
bool | store_interactions_disabled_
Bond * | createBond (Atom &atom)
Bond * | createBond (Bond &bond, Atom &atom)
Bond * | cloneBond (Bond &bond, Atom &atom)
bool | destroyBond (const Atom &atom)
void | destroyBonds ()
Atom * | getPartnerAtom (Position i)
const Atom * | getPartnerAtom (Position i) const
float | getDistance (const Atom &a) const
void | addInteraction (const Atom *atom, String interaction_type, double energy)
void | addInteraction (String interaction_type, double energy)
void | disableStoreInteractions ()
void | enableStoreInteractions ()

## Attributes

static AtomIndexList | free_list_
String | name_
String | type_name_
const Element * | element_
float | radius_
Type | type_
unsigned char | number_of_bonds_
Bond * | bond_ [MAX_NUMBER_OF_BONDS]
Index | formal_charge_
Vector3 | position_
float | charge_
Vector3 | velocity_
Vector3 | force_

## Additional Inherited Members

static bool | insertParent (Composite &parent, Composite &first, Composite &last, bool destroy_parent=true)
static Handle | getNextHandle ()
static Handle | getNewHandle ()
static void | clearLastPtr ()
static UnaryProcessor< Composite > | DEFAULT_PROCESSOR
static KernelPredicateType | DEFAULT_UNARY_PREDICATE
| AutoDeletable ()
| AutoDeletable (const AutoDeletable &auto_deletable, bool deep=false)
bool | selected_

## Detailed Description

Atom class. 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.

  Two atoms can be connected via a Bond . There can be only one bond between any two atoms (double bonds etc. are expressed via the bond order attribute of the bond) and the total number of bonds of an atom is limited to eight (can be changed at compile time, see MAX_NUMBER_OF_BONDS ).

  Since Atom is derived from ProperyManager , it may contain arbitrary, user-defined properties. An atom may be inserted in a Fragment instance ("parent fragment"). The "state" of an atom is defined by its attributes:

- "element" - an instance of Element
- "formal charge" - the formal charge of the atom
- "charge" - the charge in multiples of the the proton charge
- "name" - a string identifier
- "type name" - a string identifier, meaningful in the the context of a forcefield only
- "position" - the absolute position in cartesian coordinates (Angstrom)
- "radius" - the radius (Angstrom)
- "type" - an integer type, meaningful only in the context of a forcefield
- "velocity" - velocity the velocity of the atom (Angstrom/ps)
- "force" - the force experienced by the atom (for forcefield calculations, in units of Newton)
- "bonds" - up to MAX_NUMBER_OF_BONDS bonds to other atoms
  See also
    Bond
    Molecule
    AtomContainer

Definition at line 87 of file atom.h.

## Member Typedef Documentation

## AtomIndexList

typedef std::list<Position> BALL::Atom::AtomIndexList

Definition at line 957 of file atom.h.

## AtomPtrList

typedef std::list<Atom*> BALL::Atom::AtomPtrList

Definition at line 954 of file atom.h.

## BondConstIterator

typedef ConstRandomAccessIterator<Atom, Bond, BondIteratorPosition, BondIteratorTraits> BALL::Atom::BondConstIterator

Constant random access iterator for bonds.

Definition at line 904 of file atom.h.

## BondConstReverseIterator

typedef std::reverse_iterator<BondConstIterator> BALL::Atom::BondConstReverseIterator

Constant reverse random access iterator for bonds.

Definition at line 934 of file atom.h.

## BondIterator

typedef RandomAccessIterator<Atom, Bond, BondIteratorPosition, BondIteratorTraits> BALL::Atom::BondIterator

Random access iterator for bonds.

Definition at line 887 of file atom.h.

## BondIteratorPosition

typedef Index BALL::Atom::BondIteratorPosition

Definition at line 726 of file atom.h.

## BondReverseIterator

typedef std::reverse_iterator<BondIterator> BALL::Atom::BondReverseIterator

Reverse random access iterator for bonds.

Definition at line 919 of file atom.h.

## Type

typedef short BALL::Atom::Type

Atom type.

Definition at line 103 of file atom.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Unnamed enumeration of all non-categorized constants.

Enumerator
UNKNOWN_TYPE | Unknown atom type. The type assigned for default-constructed atoms.
ANY_TYPE | Any atom type. Used as a wild card in the context of forcefields mainly
MAX_NUMBER_OF_BONDS | Maximum number of bonds of an atom.

Definition at line 111 of file atom.h.

## FullNameType

enum BALL::Atom::FullNameType

The type of name used for getFullName.

See also
  getFullName

Enumerator
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 |

Definition at line 138 of file atom.h.

## Property

enum BALL::Atom::Property

Predefined properties. Enumeration of all properties that are used by the BALL kernel.

Enumerator
NUMBER_OF_PROPERTIES |

Definition at line 130 of file atom.h.

## Constructor & Destructor Documentation

## Atom() [1/3]

BALL::Atom::Atom | ( |  | ) |

Default constructor. The state of this instance is:

- element type is unknown (Element::UNKNOWN)
- formal charge is 0
- charge is 0
- name is empty string
- type name is "?"
- position is Vector3 (0,0,0)
- radius is 0
- type INVALID_TYPE
- velocity is Vector3 (0,0,0)
- force is Vector3 (0,0,0)
- bond table is empty (atom has no bonds)
  Returns
    Atom - new atom
  See also
    Composite::Composite
    PropertyManager::PropertyManager

## Atom() [2/3]

BALL::Atom::Atom | ( | const Atom & | atom,
|  | bool | deep = true )

Copy constructor. The copy is either deep (default) or shallow.

  Note: Deep copying of atoms does not include bond cloning.

Parameters

  atom | the atom to be copied (cloned)
  deep | make a deep (=true) or shallow (=false) copy of atom

Returns
  Atom - new constructed atom cloned from atom

See also
  Composite::Composite
  PropertyManager::PropertyManager

## Atom() [3/3]

BALL::Atom::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 )

Detailed state initializing constructor. The item bond table is empty (atom has no bonds).

Parameters

  element | element type of the constructed atom
  name | name of the constructed atom
  type_name | type name name of the constructed atom
  atom_type | type of the constructed atom
  position | position of the constructed atom
  velocity | velocity of the constructed atom
  force | force acting upon the constructed atom
  charge | charge of the constructed atom
  formal_charge | formal charge of the constructed atom
  radius | radius of the constructed atom

Returns
  Atom - new constructed atom

See also
  Composite::Composite
  PropertyManager::PropertyManager

## ~Atom()

virtual BALL::Atom::~Atom | ( |  | ) |

virtual

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 .

See also
  Atom::destroy

## Member Function Documentation

## addInteraction() [1/2]

void BALL::Atom::addInteraction | ( | const Atom * | atom,
|  | String | interaction_type,
|  | double | energy )

## addInteraction() [2/2]

void BALL::Atom::addInteraction | ( | String | interaction_type,
|  | double | energy )

## applyBonds()

bool BALL::Atom::applyBonds | ( | UnaryProcessor< Bond > & | processor | ) |

Application of an unary processor on every contained bond.

Parameters

  processor | a typed unary processor for Bond instances

Returns
  bool - true if application has been terminated successfully, false otherwise

## beginBond() [1/2]

BondIterator BALL::Atom::beginBond | ( |  | ) |

inline

Return a bond iterator pointing to the first bond of the atom.

Definition at line 890 of file atom.h.

## beginBond() [2/2]

BondConstIterator BALL::Atom::beginBond | ( |  | ) | const

inline

Return a constant bond iterator pointing to the first bond.

Definition at line 907 of file atom.h.

## clear()

virtual void BALL::Atom::clear | ( |  | ) |

virtual

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.

See also
  Composite::clear
  destroy

Reimplemented from BALL::Composite.

Reimplemented in BALL::PDBAtom.

## cloneBond()

Bond * BALL::Atom::cloneBond | ( | Bond & | bond,
|  | Atom & | atom )

Create a copy of a bond. This is mostly for internal use and should not be required by most users.

## countBonds()

Size BALL::Atom::countBonds | ( |  | ) | const

Return the number of bonds.

## createBond() [1/2]

Bond * BALL::Atom::createBond | ( | Atom & | atom | ) |

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.

Returns
  Bond* - default initialized Bond instance that connects this instance to atom

Exceptions

  Exception::TooManyBonds | if one of the atom already possesses Atom::MAX_NUMBER_OF_BONDS bonds.

See also
  Bond::createBond

## createBond() [2/2]

Bond * BALL::Atom::createBond | ( | Bond & | bond,
|  | Atom & | atom )

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.

  Note: This method is recommended for use if a subclass of the Bond is to be used as the new bond. This permits extensibility of bonds to the framework client.

Returns
  Bond* - default initialized bond bond that connects this instance to atom

Exceptions

  Exception::TooManyBonds | if one of the atom already possesses Atom::MAX_NUMBER_OF_BONDS bonds.

See also
  Bond::createBond

## destroy()

virtual void BALL::Atom::destroy | ( |  | ) |

virtual

Explicit destructor. Destroy this instance explicitly and reset its attributes to the default values.

See also
  Composite::clear

Reimplemented from BALL::Composite.

Reimplemented in BALL::PDBAtom.

## destroyBond()

bool BALL::Atom::destroyBond | ( | const Atom & | atom | ) |

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 .

  Note: This method is recommended to destroy a bond of an atom explicitly instead of using the keyword delete. This is due to erroneous explicit destruction of statically allocated bonds.

Parameters

  atom | the atom that should be disconnected from this instance

See also
  AutoDeletable
  Bond::destroy

## destroyBonds()

void BALL::Atom::destroyBonds | ( |  | ) |

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 .

  Note: This method is recommended to destroy all bonds of an atom explicitly instead of using the keyword delete. This is due to erroneous explicit destruction of statically allocated bonds.

Parameters

  atom | the atom that should be disconnected from this instance

See also
  AutoDeletable
  Bond::destroy

## disableStoreInteractions()

void BALL::Atom::disableStoreInteractions | ( |  | ) |

## dump()

virtual void BALL::Atom::dump | ( | std::ostream & | s = std::cout,
|  | Size | depth = 0 ) const

virtual

Internal state dump. Dump the current internal state of this instance to the output ostream s with dumping depth depth . For debugging purposes only.

Parameters

  s | - output stream where to output the internal state
  depth | - the dumping depth

Reimplemented from BALL::Composite.

Reimplemented in BALL::PDBAtom.

## enableStoreInteractions()

void BALL::Atom::enableStoreInteractions | ( |  | ) |

## endBond() [1/2]

BondIterator BALL::Atom::endBond | ( |  | ) |

inline

Return a past-the-end bond iterator.

Definition at line 896 of file atom.h.

## endBond() [2/2]

BondConstIterator BALL::Atom::endBond | ( |  | ) | const

inline

Return a constant past-the-end bond iterator.

Definition at line 913 of file atom.h.

## get()

void BALL::Atom::get | ( | Atom & | atom,
|  | bool | deep = true ) const

Deep/shallow assignment. The inverse operation to set , behaves identically.

Parameters

  atom | the atom to be assigned to

See also
  Atom::set

## getBond() [1/4]

Bond * BALL::Atom::getBond | ( | const Atom & | atom | ) |

Return a bond by its partner atom (const). The reference is 0 if this instance does not have a bond with atom .

Parameters

  atom | the atom that is considered to have a bond with this instance

Returns
  Bond* - mutable pointer to the bond that connects atom with this instance, 0 if this instance does not have a bond with atom

See also
  Atom::createBond

## getBond() [2/4]

const Bond * BALL::Atom::getBond | ( | const Atom & | atom | ) | const

Return a bond by its partner atom (mutable) The reference is 0 if this instance does not have a bond with atom .

Parameters

  atom | the atom that is considered to have a bond with this instance

Returns
  Bond* - constant pointer to the bond that connects atom with this instance, 0 if this instance does not have a bond with atom

See also
  Atom::createBond

## getBond() [3/4]

Bond * BALL::Atom::getBond | ( | Position | index | ) |

Return a bond by its index (mutable). The reference is 0 if this instance does not have a bond with index index .

  Note: No corresponding mutator Atom::setBond exists to consider design of contract - an atom may not insert a bond in its bond table at a given index. The atom's bond table is an implementation detail that is not relevant to and should not be relied on by the client programmer. A bond must always be created via Bond::Bond or Atom::createBond .

Parameters

  index | the index of the bond to be accessed to

Returns
  Bond* - mutable pointer to the bond that is indexed in this instance's bond table, 0 if this instance does not have a bond with index index

Exceptions

  IndexOverflow | if index >= MAX_NUMBER_OF_BONDS

## getBond() [4/4]

const Bond * BALL::Atom::getBond | ( | Position | index | ) | const

Return a bond by its index (const).

Exceptions

  IndexOverflow | if index >= MAX_NUMBER_OF_BONDS

## getChain() [1/2]

Chain * BALL::Atom::getChain | ( |  | ) |

Return the chain the atom is contained in (mutable).

## getChain() [2/2]

const Chain * BALL::Atom::getChain | ( |  | ) | const

Return the chain the atom is contained in (const). A NULL pointer is returned if this atom is not part of a chain.

Returns
  Chain* - constant pointer to the chain

## getCharge()

float BALL::Atom::getCharge | ( |  | ) | const

Return the atom's (partial) charge. Charges should be assigned in multiples of the proton charge (elementary charge).

## getDistance()

float BALL::Atom::getDistance | ( | const Atom & | a | ) | const

A convenience function for computing the distance between two atoms. This is equivalent to calling this->getPosition().getDistance(a.getPosition())

Parameters

  a | the atom to which to compute the distance

## getElement()

const Element & BALL::Atom::getElement | ( |  | ) | const

Return the atom's element.

## getForce() [1/2]

Vector3 & BALL::Atom::getForce | ( |  | ) |

Return the atom's force vector (mutable).

## getForce() [2/2]

const Vector3 & BALL::Atom::getForce | ( |  | ) | const

Return the atom's force vector (const).

## getFormalCharge()

Index BALL::Atom::getFormalCharge | ( |  | ) | const

Return the atom's formal charge.

## getFragment() [1/2]

Fragment * BALL::Atom::getFragment | ( |  | ) |

Return the fragment the atom is contained in (mutable).

## getFragment() [2/2]

const Fragment * BALL::Atom::getFragment | ( |  | ) | const

Return the fragment the atom is contained in (const). A NULL pointer is returned if this atom is not part of a fragment.

  Use Fragment::insert to insert an atom into a fragment and Fragment::remove to remove it.

Returns
  Fragment* - constant pointer to the fragment

## getFullName()

String BALL::Atom::getFullName | ( | FullNameType | type = ADD_VARIANT_EXTENSIONS | ) | const

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 getFullName will return the name ILE:CA. For N terminal residues, -N is appended to the residue name, for C terminal residues -C. If the residue is a CYS involved in a disulphide bridge, an additional -S or S (for terminal residue) is appended. For single amino acids (C and N terminal) -M is added.

  If the atom is not contained in a residue, the name of the parent fragment is taken instead of the residue name. If there is no parent fragment, the name of the parent molecule is taken. If the atom is not contained in any superstructure, getFullname returns getName.

  Overview of the returned strings:

- <residue>:<atom> – if contained in a residue
- <residue>-C:<atom> – for C terminal residues
- <residue>-N:<atom> – for N terminal residues
- CYS-S:<atom> – for CYS residues involved in a SS bond
- CYS-NS:<atom> – for N terminal CYS residues involved in a SS bond
- CYS-CS:<atom> – for C terminal CYS residues involved in a SS bond
- <fragment>:atom – for atoms contained in a fragment, but not in a residue
- <molecule>:atom – for atoms contained in a molecule, but not in a fragment

Parameters

  type | if type is set to Atom::NO_VARIANT_EXTENSIONS, the variant extension (-XX) is omitted

Returns
  String the full name

## getMolecule() [1/2]

Molecule * BALL::Atom::getMolecule | ( |  | ) |

Return the molecule the atom is contained in (mutable).

## getMolecule() [2/2]

const Molecule * BALL::Atom::getMolecule | ( |  | ) | const

Return the molecule the atom is contained in (const). A NULL pointer is returned if this atom is not part of a molecule.

  Use Molecule::insert to insert an atom into a molecule and Molecule::remove to remove it.

Returns
  Molecule* - constant pointer to the parent molecule

## getName()

const String & BALL::Atom::getName | ( |  | ) | const

Return the atom name.

## getPartnerAtom() [1/2]

Atom * BALL::Atom::getPartnerAtom | ( | Position | i | ) |

Returns the Atom bound at the i-th bond. This is a convenience function for: getBond(i)->getBoundAtom(*this)

Parameters

  i | The index of the partner atom

Exceptions

  Exception::IndexOverflow | is thrown if i >= countBonds(). This exception originates from getBond(i)

## getPartnerAtom() [2/2]

const Atom * BALL::Atom::getPartnerAtom | ( | Position | i | ) | const

Returns the Atom bound at the i-th bond. This is a convenience function for: getBond(i)->getBoundAtom(*this)

Parameters

  i | The index of the partner atom

Exceptions

  Exception::IndexOverflow | is thrown if i >= countBonds(). This exception originates from getBond(i)

## getPosition() [1/2]

Vector3 & BALL::Atom::getPosition | ( |  | ) |

Return the atom coordinates (mutable).

## getPosition() [2/2]

const Vector3 & BALL::Atom::getPosition | ( |  | ) | const

Return the atom coordinates (const).

## getRadius()

float BALL::Atom::getRadius | ( |  | ) | const

Return the atom radius.

## getResidue() [1/2]

Residue * BALL::Atom::getResidue | ( |  | ) |

Return the residue the atom is contained in (mutable).

## getResidue() [2/2]

const Residue * BALL::Atom::getResidue | ( |  | ) | const

Return the residue the atom is contained in (const). A NULL pointer is returned if this atom is not part of a residue.

  Use Residue::insert to insert an atom into a residue and Residue::remove to remove it.

Returns
  Residue* - constant pointer to the residue

## getSecondaryStructure() [1/2]

SecondaryStructure * BALL::Atom::getSecondaryStructure | ( |  | ) |

Return the secondary structure the atom is contained in (mutable).

## getSecondaryStructure() [2/2]

const SecondaryStructure * BALL::Atom::getSecondaryStructure | ( |  | ) | const

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.

Returns
  SecondaryStructure* - constant pointer to the secondary structure

## getType()

Type BALL::Atom::getType | ( |  | ) | const

Return the (numerical) atom type.

## getTypeName()

String BALL::Atom::getTypeName | ( |  | ) | const

Return the atom type name.

## getVelocity() [1/2]

Vector3 & BALL::Atom::getVelocity | ( |  | ) |

Return the atom velocity. BALL uses units of for the velocity.

## getVelocity() [2/2]

const Vector3 & BALL::Atom::getVelocity | ( |  | ) | const

Return the atom velocity. BALL uses units of for the velocity.

## hasBond()

bool BALL::Atom::hasBond | ( | const Bond & | bond | ) | const

Determine whether the atom takes part in a certain bond.

Parameters

  bond | the bond in question

Returns
  bool true if the bond bond connects this instance with another atom, false otherwise

See also
  Atom::hasBond

## isAtom()

virtual bool BALL::Atom::isAtom | ( |  | ) | const

inline virtual

Test if the Composite is an Atom

Reimplemented from BALL::Composite.

Definition at line 687 of file atom.h.

## isBound()

bool BALL::Atom::isBound | ( |  | ) | const

Determine whether the atom has any bond.

Returns
  bool - true if an atom is bound to this instance, false otherwise

See also
  Atom::hasBond

## isBoundTo()

bool BALL::Atom::isBoundTo | ( | const Atom & | atom | ) | const

Determine whether there exists a bond to another atom. Calls Atom::getBond . Hydrogen bonds (type = Bond::TYPE__HYDROGEN) are ignored.

Parameters

  atom | the atom in question

Returns
  bool - true if bond connects atom with {*this atom}, false otherwise

See also
  Atom::getBond

## isGeminal()

bool BALL::Atom::isGeminal | ( | const Atom & | atom | ) | const

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.

Parameters

  atom | the second atom

Returns
  bool - true if atom is geminal to this instance

## isValid()

virtual bool BALL::Atom::isValid | ( |  | ) | const

virtual

Internal state and consistency self-validation.

Returns
  bool - true if the internal state of this instance is correct (self-validated) and consistent, false otherwise

Reimplemented from BALL::Composite.

## isVicinal()

bool BALL::Atom::isVicinal | ( | const Atom & | atom | ) | const

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.

Parameters

  atom | the second atom

Returns
  bool - true if atom is vicinal to this instance

## operator!=()

bool BALL::Atom::operator!= | ( | const Atom & | atom | ) | const

Inequality operator

See also
  operator ==

## operator=()

Atom & BALL::Atom::operator= | ( | const Atom & | atom | ) |

Assignment operator. The assignment is always deep. Calls Atom::set .

  Note: Bonds are not copied

Parameters

  atom | the atom to be copied

Returns
  Atom& - this instance

See also
  Atom::set

## operator==()

bool BALL::Atom::operator== | ( | const Atom & | atom | ) | const

Predicates Equality operator. Two atoms are equal if they have the same handle.

See also
  Object::operator ==

## persistentRead()

virtual void BALL::Atom::persistentRead | ( | PersistenceManager & | pm | ) |

virtual

Read an Atom from a persistent stream.

Parameters

  pm | the persistence manager

Reimplemented from BALL::Composite.

Reimplemented in BALL::PDBAtom.

## persistentWrite()

virtual void BALL::Atom::persistentWrite | ( | PersistenceManager & | pm,
|  | const char * | name = 0 ) const

virtual

Write an Atom to a persistent stream.

Parameters

  pm | the persistence manager

Reimplemented from BALL::Composite.

Reimplemented in BALL::PDBAtom.

## rbeginBond() [1/2]

BondReverseIterator BALL::Atom::rbeginBond | ( |  | ) |

inline

Return a reverse bond iterator pointing to the last bond.

Definition at line 922 of file atom.h.

## rbeginBond() [2/2]

BondConstReverseIterator BALL::Atom::rbeginBond | ( |  | ) | const

inline

Return a constant reverse bond iterator pointing to the first atom.

Definition at line 937 of file atom.h.

## rendBond() [1/2]

BondReverseIterator BALL::Atom::rendBond | ( |  | ) |

inline

Return a past-the-end bond iterator for reverse traversal.

Definition at line 928 of file atom.h.

## rendBond() [2/2]

BondConstReverseIterator BALL::Atom::rendBond | ( |  | ) | const

inline

Return a constant past-the-end bond iterator for reverse traversal.

Definition at line 943 of file atom.h.

## set()

void BALL::Atom::set | ( | const Atom & | atom,
|  | bool | deep = true )

Deep/shallow assignment. The assignment is either deep or shallow (default is deep). In the case of a deep assignment, all composites contained in atom are copied as well.

  Caveat: Bonds are not copied!

Parameters

  atom | the atom to be copied
  deep | make a deep (=true) or shallow (=false) copy of atom

## setCharge()

void BALL::Atom::setCharge | ( | float | charge | ) |

Set the atom's (partial) charge. Charges should be assigned in multiples of the proton charge (elementary charge).

## setElement()

void BALL::Atom::setElement | ( | const Element & | element | ) |

Assign the atom's element.

## setForce()

void BALL::Atom::setForce | ( | const Vector3 & | force | ) |

Assign the atom's force vevtor. BALL uses units of Newton (1 N = 1 J/m) as the unit of force.

## setFormalCharge()

void BALL::Atom::setFormalCharge | ( | Index | formal_charge | ) |

Set the atom's formal charge.

## setName()

void BALL::Atom::setName | ( | const String & | name | ) |

Set the atom name.

## setPosition()

void BALL::Atom::setPosition | ( | const Vector3 & | position | ) |

Assign the atom coordinates. BALL uses units of Angstrom for atom coordinates.

## setRadius()

void BALL::Atom::setRadius | ( | float | radius | ) |

Set the atom radius. BALL uses units of Angstrom for the atom radii.

## setType()

void BALL::Atom::setType | ( | Type | atom_type | ) |

Assign the numerical atom type.

## setTypeName()

void BALL::Atom::setTypeName | ( | const String & | name | ) |

Assign the atom type name.

## setVelocity()

void BALL::Atom::setVelocity | ( | const Vector3 & | velocity | ) |

Set the atom velocity BALL uses units of for the velocity.

## swap()

void BALL::Atom::swap | ( | Atom & | atom | ) |

Swap the contents of two atoms. The static attributes are swapped by exchanging the indices of the two atoms!

Parameters

  atom | the atom being swapped with this instance

## Friends And Related Symbol Documentation

## Bond

friend class Bond

friend

Definition at line 97 of file atom.h.

## BondIteratorTraits

friend class BondIteratorTraits

friend

Definition at line 881 of file atom.h.

## Member Data Documentation

## bond_

Bond* BALL::Atom::bond_[MAX_NUMBER_OF_BONDS]

protected

Definition at line 982 of file atom.h.

## charge_

float BALL::Atom::charge_

protected

Definition at line 988 of file atom.h.

## element_

const Element* BALL::Atom::element_

protected

Definition at line 974 of file atom.h.

## force_

Vector3 BALL::Atom::force_

protected

Definition at line 992 of file atom.h.

## formal_charge_

Index BALL::Atom::formal_charge_

protected

Definition at line 984 of file atom.h.

## free_list_

AtomIndexList BALL::Atom::free_list_

static protected

Definition at line 967 of file atom.h.

## interactions

MolecularInteractions* BALL::Atom::interactions

Definition at line 623 of file atom.h.

## name_

String BALL::Atom::name_

protected

Definition at line 970 of file atom.h.

## number_of_bonds_

unsigned char BALL::Atom::number_of_bonds_

protected

Definition at line 980 of file atom.h.

## position_

Vector3 BALL::Atom::position_

protected

Definition at line 986 of file atom.h.

## radius_

float BALL::Atom::radius_

protected

Definition at line 976 of file atom.h.

## store_interactions_disabled_

bool BALL::Atom::store_interactions_disabled_

Definition at line 633 of file atom.h.

## type_

Type BALL::Atom::type_

protected

Definition at line 978 of file atom.h.

## type_name_

String BALL::Atom::type_name_

protected

Definition at line 972 of file atom.h.

## velocity_

Vector3 BALL::Atom::velocity_

protected

Definition at line 990 of file atom.h.