Logo Search packages:      
Sourcecode: ball version File versions

BALL::Atom Class Reference

#include <atom.h>

Inheritance diagram for BALL::Atom:

BALL::Composite BALL::PropertyManager BALL::PersistentObject BALL::Selectable BALL::Object BALL::AutoDeletable BALL::PDBAtom

List of all members.


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:

Definition at line 88 of file atom.h.


Efficient handling of atom attributes

typedef std::list< PositionAtomIndexList
typedef std::list< Atom * > AtomPtrList
const StaticAtomAttributes * getAttributePtr () const
StaticAtomAttributes * getAttributePtr ()
Position getIndex () const
static Position compact (const AtomIndexList &indices) throw (Exception::OutOfRange)
static AttributeVector & getAttributes ()
static const PreciseTimegetAttributesModificationTime ()

External iteration

typedef
ConstRandomAccessIterator
< Atom, Bond,
BondIteratorPosition,
BondIteratorTraits > 
BondConstIterator
 Constant random access iterator for bonds.
typedef std::reverse_iterator
< BondConstIterator
BondConstReverseIterator
 Constant reverse random access iterator for bonds.
typedef RandomAccessIterator
< Atom, Bond,
BondIteratorPosition,
BondIteratorTraits > 
BondIterator
typedef Index BondIteratorPosition
typedef std::reverse_iterator
< BondIterator
BondReverseIterator
 Reverse random access iterator for bonds.
class BondIteratorTraits
BondConstIterator beginBond () const
 Return a constant bond iterator pointing to the first bond.
BondIterator beginBond ()
 Return a bond iterator pointing to the first bond of the atom.
BondConstIterator endBond () const
 Return a constant past-the-end bond iterator.
BondIterator endBond ()
 Return a past-the-end bond iterator.
BondConstReverseIterator rbeginBond () const
 Return a constant reverse bond iterator pointing to the first atom.
BondReverseIterator rbeginBond ()
 Return a reverse bond iterator pointing to the last bond.
BondConstReverseIterator rendBond () const
 Return a constant past-the-end bond iterator for reverse traversal.
BondReverseIterator rendBond ()
 Return a past-the-end bond iterator for reverse traversal.

Class friends



typedef short Type
class Bond

Attributes

static PreciseTime attributes_changed_time_
 time of the last resize of the attributes vector
static AtomIndexList free_list_
static AttributeVector static_attributes_
Bondbond_ [MAX_NUMBER_OF_BONDS]
const Elementelement_
Position index_
String name_
unsigned char number_of_bonds_
float radius_
String type_name_

Modifying and Accessing the Tree

void appendChild (Composite &composite)
Size count (const KernelPredicateType &predicate) const
Size countDescendants () const
virtual void deselect ()
void get (Composite &composite, bool deep=true) const
template<typename T>
const T * getAncestor (const T &) const
template<typename T>
T * getAncestor (const T &)
const CompositegetChild (Index index) const
CompositegetChild (Index index)
Size getDegree () const
Size getDepth () const
const CompositegetFirstChild () const
CompositegetFirstChild ()
Size getHeight () const
const CompositegetLastChild () const
CompositegetLastChild ()
const CompositegetLowestCommonAncestor (const Composite &composite) const
CompositegetLowestCommonAncestor (const Composite &composite)
const PreciseTimegetModificationTime () const
template<typename T>
const T * getNext (const T &dummy) const
template<typename T>
T * getNext (const T &)
const CompositegetParent () const
CompositegetParent ()
Size getPathLength (const Composite &composite) const
template<typename T>
const T * getPrevious (const T &dummy) const
template<typename T>
T * getPrevious (const T &)
const CompositegetRoot () const
CompositegetRoot ()
const PreciseTimegetSelectionTime () const
const CompositegetSibling (Index index) const
CompositegetSibling (Index index)
void insertAfter (Composite &composite)
void insertBefore (Composite &composite)
void prependChild (Composite &composite)
bool removeChild (Composite &child)
Size removeSelected ()
Size removeUnselected ()
void replace (Composite &composite)
virtual void select ()
void set (const Composite &composite, bool deep=true)
void splice (Composite &composite)
void spliceAfter (Composite &composite)
void spliceBefore (Composite &composite)
void stamp (StampType stamp=BOTH)
void swap (Composite &composite)
static bool insertParent (Composite &parent, Composite &first, Composite &last, bool destroy_parent=true)

Handle Management



Handle getHandle () const
static Handle getNewHandle ()
static Handle getNextHandle ()

Mutators

void setAutoDeletable (bool enable)
static void clearLastPtr ()

Public Types

typedef ConstForwardIterator
< Composite, Composite,
Composite
*, AncestorIteratorTraits > 
AncestorConstIterator
typedef ForwardIterator
< Composite, Composite,
Composite
*, AncestorIteratorTraits > 
AncestorIterator
typedef
ConstBidirectionalIterator
< Composite, Composite,
Composite
*, ChildCompositeIteratorTraits > 
ChildCompositeConstIterator
typedef std::reverse_iterator
< ChildCompositeConstIterator
ChildCompositeConstReverseIterator
typedef BidirectionalIterator
< Composite, Composite,
Composite
*, ChildCompositeIteratorTraits > 
ChildCompositeIterator
typedef std::reverse_iterator
< ChildCompositeIterator
ChildCompositeReverseIterator
typedef
ConstBidirectionalIterator
< Composite, Composite,
Composite
*, CompositeIteratorTraits > 
CompositeConstIterator
typedef std::reverse_iterator
< CompositeConstIterator
CompositeConstReverseIterator
typedef BidirectionalIterator
< Composite, Composite,
Composite
*, CompositeIteratorTraits > 
CompositeIterator
typedef std::reverse_iterator
< CompositeIterator
CompositeReverseIterator
Enumerations
enum  { UNKNOWN_TYPE = -1, ANY_TYPE = 0, MAX_NUMBER_OF_BONDS = 12 }
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
}
enum  Property { NUMBER_OF_PROPERTIES = 0 }
Type Definitions and Enums
typedef UnaryPredicate< CompositeKernelPredicateType
enum  StampType { MODIFICATION = 1, SELECTION = 2, BOTH = 3 }

Public Member Functions

AncestorConstIterator beginAncestor () const
AncestorIterator beginAncestor ()
ChildCompositeConstIterator beginChildComposite () const
ChildCompositeIterator beginChildComposite ()
CompositeConstIterator beginComposite () const
CompositeIterator beginComposite ()
void deleteChildrenList_ (std::list< Composite * > &composites)
AncestorConstIterator endAncestor () const
AncestorIterator endAncestor ()
ChildCompositeConstIterator endChildComposite () const
ChildCompositeIterator endChildComposite ()
CompositeConstIterator endComposite () const
CompositeIterator endComposite ()
ChildCompositeConstReverseIterator rbeginChildComposite () const
ChildCompositeReverseIterator rbeginChildComposite ()
CompositeConstReverseIterator rbeginComposite () const
CompositeReverseIterator rbeginComposite ()
ChildCompositeConstReverseIterator rendChildComposite () const
ChildCompositeReverseIterator rendChildComposite ()
CompositeConstReverseIterator rendComposite () const
CompositeReverseIterator rendComposite ()
Application and Hosting


template<typename T>
bool apply (UnaryProcessor< T > &processor) throw (Exception::GeneralException)
template<typename T>
bool applyAncestor (UnaryProcessor< T > &processor) throw (Exception::GeneralException)
template<typename T>
bool applyChild (UnaryProcessor< T > &processor) throw (Exception::GeneralException)
template<typename T>
bool applyDescendant (UnaryProcessor< T > &processor) throw (Exception::GeneralException)
template<typename T>
bool applyDescendantPostorder (UnaryProcessor< T > &processor) throw (Exception::GeneralException)
template<typename T>
bool applyDescendantPreorder (UnaryProcessor< T > &processor) throw (Exception::GeneralException)
template<typename T>
bool applyLevel (UnaryProcessor< T > &processor, long level) throw (Exception::GeneralException)
template<typename T>
bool applyPostorder (UnaryProcessor< T > &processor) throw (Exception::GeneralException)
template<typename T>
bool applyPreorder (UnaryProcessor< T > &processor) throw (Exception::GeneralException)
void host (Visitor< Composite > &visitor) throw (Exception::GeneralException)
Internal iteration
bool applyBonds (UnaryProcessor< Bond > &processor)
Constructors
 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)
 Atom (const Atom &atom, bool deep=true)
 Atom ()
Destructors
virtual void clear ()
virtual void destroy ()
virtual ~Atom ()
Handling named properties
PropertyManager contains an vector of NamedProperty objects. Each of the NamedProeprty objects has to have a unique name. The setProperty methods ensure the uniqueness of this name. If a setProperty method is called for an existing name, the existing object is destructed prior to the insertion of the new object.

void clearProperty (const string &name)
Size countNamedProperties () const
NamedPropertygetNamedProperty (Position index) throw (Exception::IndexOverflow)
const NamedPropertygetNamedProperty (Position index) const throw (Exception::IndexOverflow)
const NamedPropertygetProperty (const string &name) const
void setProperty (const string &name, const PersistentObject &value)
void setProperty (const string &name, const string &value)
void setProperty (const string &name, double value)
void setProperty (const string &name, float value)
void setProperty (const string &name, unsigned int value)
void setProperty (const string &name, int value)
void setProperty (const string &name, bool value)
void setProperty (const string &name)
void setProperty (const NamedProperty &property)
Handling unnamed bit properties
void clearProperty (Property property)
Size countProperties () const
void setProperty (Property property)
void toggleProperty (Property property)
Construction and Destruction
void * clone (Composite &root) const
void destroy (bool virtual_destroy)
Miscellaneous
BondcloneBond (Bond &bond, Atom &atom)
BondcreateBond (Bond &bond, Atom &atom) throw (Exception::TooManyBonds)
BondcreateBond (Atom &atom) throw (Exception::TooManyBonds)
bool destroyBond (const Atom &atom)
void destroyBonds ()
float getDistance (const Atom &a) const
const AtomgetPartnerAtom (Position i) const throw (Exception::IndexOverflow)
AtomgetPartnerAtom (Position i) throw (Exception::IndexOverflow)
Comparison operators


int compare (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
bool operator>= (const Object &object) const
Predicates


bool containsSelection () const
template<typename T>
bool hasAncestor (const T &dummy) const
bool hasChild () const
bool hasNextSibling () const
bool hasParent () const
bool hasPreviousSibling () const
bool hasSibling () const
bool isAncestorOf (const Composite &composite) const
bool isChildOf (const Composite &composite) const
bool isDescendantOf (const Composite &composite) const
bool isEmpty () const
bool isFirstChild () const
bool isFirstChildOf (const Composite &composite) const
bool isHomomorph (const Composite &composite) const
bool isInterior () const
bool isLastChild () const
bool isLastChildOf (const Composite &composite) const
bool isNextSiblingOf (const Composite &composite) const
bool isParentOf (const Composite &composite) const
bool isPreviousSiblingOf (const Composite &composite) const
bool isRelatedWith (const Composite &composite) const
bool isRoot () const
bool isRootOf (const Composite &composite) const
bool isSiblingOf (const Composite &composite) const
bool operator!= (const Composite &composite) const
bool operator== (const Composite &composite) const
Accessors
Size countBonds () const
 Return the number of bonds.
const BondgetBond (const Atom &atom) const
BondgetBond (const Atom &atom)
const BondgetBond (Position index) const throw (Exception::IndexOverflow)
BondgetBond (Position index) throw (Exception::IndexOverflow)
ChaingetChain ()
 Return the chain the atom is contained in (mutable).
const ChaingetChain () const
float getCharge () const
const ElementgetElement () const
 Return the atom's element.
Vector3getForce ()
 Return the atom's force vector (mutable).
const Vector3getForce () const
 Return the atom's force vector (const).
Index getFormalCharge () const
 Return the atom's formal charge.
FragmentgetFragment ()
 Return the fragment the atom is contained in (mutable).
const FragmentgetFragment () const
String getFullName (FullNameType type=ADD_VARIANT_EXTENSIONS) const
MoleculegetMolecule ()
 Return the molecule the atom is contained in (mutable).
const MoleculegetMolecule () const
const StringgetName () const
 Return the atom name.
const Vector3getPosition () const
 Return the atom coordinates (const).
Vector3getPosition ()
 Return the atom coordinates (mutable).
float getRadius () const
 Return the atom radius.
ResiduegetResidue ()
 Return the residue the atom is contained in (mutable).
const ResiduegetResidue () const
SecondaryStructuregetSecondaryStructure ()
 Return the secondary structure the atom is contained in (mutable).
const SecondaryStructuregetSecondaryStructure () const
Type getType () const
 Return the (numerical) atom type.
String getTypeName () const
 Return the atom type name.
const Vector3getVelocity () const
void setCharge (float charge)
void setElement (const Element &element)
 Assign the atom's element.
void setForce (const Vector3 &force)
void setFormalCharge (Index formal_charge)
 Set the atom's formal charge.
void setName (const String &name)
 Set the atom name.
void setPosition (const Vector3 &position)
void setRadius (float radius)
void setType (Type atom_type)
 Assign the numerical atom type.
void setTypeName (const String &name)
 Assign the atom type name.
void setVelocity (const Vector3 &velocity)
Debugging and Diagnostics
virtual void dump (::std::ostream &s=std::cout, Size depth=0) const
Debugging and Diagnostics
virtual void dump (::std::ostream &s=std::cout, Size depth=0) const
Debuggers and diagnostics
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
virtual bool isValid () const
Persistent Writing and Reading
virtual void finalize () throw (Exception::GeneralException)
PersistenceManageroperator>> (PersistenceManager &pm) const throw (Exception::GeneralException)
Assignment
void get (PropertyManager &property_manager) const
void set (const PropertyManager &property_manager)
void swap (PropertyManager &property_manager)
Assignment
void get (Selectable &selectable, bool deep=true) const
void set (const Selectable &selectable, bool deep=true)
void swap (Selectable &selectable)
Assignment methods
void get (Atom &atom, bool deep=true) const
Atomoperator= (const Atom &atom)
void set (const Atom &atom, bool deep=true)
void swap (Atom &atom)
Accessors
const BitVectorgetBitVector () const
BitVectorgetBitVector ()
Predicates
bool hasBond (const Bond &bond) const
bool isBound () const
bool isBoundTo (const Atom &atom) const
bool isGeminal (const Atom &atom) const
bool isVicinal (const Atom &atom) const
Predicates
bool hasProperty (const string &name) const
 Query for a named property.
bool hasProperty (Property property) const
 Query for an unnamed property.
bool operator!= (const PropertyManager &pm) const
 Inequality operator.
bool operator== (const PropertyManager &pm) const
Predicates
bool isAutoDeletable () const
Predicates
bool isSelected () const
bool operator!= (const Selectable &selectable) const
bool operator== (const Selectable &selectable) const
Converters
 operator BitVector & ()
Constructors and Destructors
The constructors of this class are protected.

void operator delete (void *ptr, void *)
void operator delete (void *ptr)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size)
bool operator!= (const Atom &atom) const
bool operator== (const Atom &atom) const
Persistence
virtual void persistentRead (PersistenceManager &pm) throw (Exception::GeneralException)
virtual void persistentWrite (PersistenceManager &pm, const char *name=0) const throw (Exception::GeneralException)
Storable Interface
bool read (PersistenceManager &pm)
 Persistent stream reading.
void write (PersistenceManager &pm) const
 Persistent stream writing.
Storable interface.
bool read (PersistenceManager &pm)
void write (PersistenceManager &pm) const
virtual void setSelected (bool selected)

Static Public Attributes

static UnaryProcessor< CompositeDEFAULT_PROCESSOR
static KernelPredicateType DEFAULT_UNARY_PREDICATE

Protected Attributes

bool selected_

Private Member Functions

void clear_ ()
void swapLastBond_ (const Atom *atom)

Static Private Member Functions

static void freeIndex_ (Position index)
 Free an index in the static attribute array.
static Position nextIndex_ ()
 Return the next unallocated index in the static attribute array.

Friends

class AncestorIteratorTraits
class ChildCompositeIteratorTraits
class CompositeIteratorTraits

Classes

class  AttributeVector
class  BondIteratorTraits
class  StaticAtomAttributes

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index