BALL 1.5.0
Loading...
Searching...
No Matches
BALL::Molecule Class Reference

#include <BALL/KERNEL/molecule.h>

Inheritance diagram for BALL::Molecule:
BALL::AtomContainer BALL::Composite BALL::PropertyManager BALL::PersistentObject BALL::Selectable BALL::Object BALL::AutoDeletable BALL::NucleicAcid BALL::Protein

Public Types

Enums
enum  Property { IS_SOLVENT = AtomContainer::NUMBER_OF_PROPERTIES , NUMBER_OF_PROPERTIES }
Public Types inherited from BALL::AtomContainer
enum  Property { NUMBER_OF_PROPERTIES = 0 }
 The number of predefined properties for AtomContainer. More...
Public Types inherited from BALL::Composite
enum  StampType { MODIFICATION = 1 , SELECTION = 2 , BOTH = 3 }
typedef UnaryPredicate< CompositeKernelPredicateType
typedef ForwardIterator< Composite, Composite, Composite *, AncestorIteratorTraitsAncestorIterator
typedef ConstForwardIterator< Composite, Composite, Composite *, AncestorIteratorTraitsAncestorConstIterator
typedef BidirectionalIterator< Composite, Composite, Composite *, ChildCompositeIteratorTraitsChildCompositeIterator
typedef ConstBidirectionalIterator< Composite, Composite, Composite *, ChildCompositeIteratorTraitsChildCompositeConstIterator
typedef std::reverse_iterator< ChildCompositeIteratorChildCompositeReverseIterator
typedef std::reverse_iterator< ChildCompositeConstIteratorChildCompositeConstReverseIterator
typedef BidirectionalIterator< Composite, Composite, Composite *, CompositeIteratorTraitsCompositeIterator
typedef ConstBidirectionalIterator< Composite, Composite, Composite *, CompositeIteratorTraitsCompositeConstIterator
typedef std::reverse_iterator< CompositeIteratorCompositeReverseIterator
typedef std::reverse_iterator< CompositeConstIteratorCompositeConstReverseIterator

Public Member Functions

Constructors and Destructors
 Molecule ()
 Molecule (const Molecule &molecule, bool deep=true)
 Molecule (const AtomContainer &atomContainer, bool deep=true)
 Molecule (const String &name)
virtual ~Molecule ()
Persistence
void persistentWrite (PersistenceManager &pm, const char *name=0) const
void persistentRead (PersistenceManager &pm)
Assignment
void set (const Molecule &molecule, bool deep=true)
Moleculeoperator= (const Molecule &molecule)
void get (Molecule &molecule, bool deep=true) const
void swap (Molecule &molecule)
Accessors
SystemgetSystem ()
const SystemgetSystem () const
void prepend (Atom &atom)
void append (Atom &atom)
void insert (Atom &atom)
void insertBefore (Atom &atom, Composite &before)
void insertAfter (Atom &atom, Composite &after)
bool remove (Atom &atom)
void prepend (AtomContainer &atom_container)
void append (AtomContainer &atom_container)
void insert (AtomContainer &atom_container)
void insertBefore (AtomContainer &atom_container, Composite &before)
void insertAfter (AtomContainer &atom_container, Composite &after)
void spliceBefore (AtomContainer &atom_container)
void spliceAfter (AtomContainer &atom_container)
void splice (AtomContainer &atom_container)
bool remove (AtomContainer &atom_container)
Type predicates
virtual bool isMolecule () const
Public Member Functions inherited from BALL::AtomContainer
 AtomContainer ()
 AtomContainer (const AtomContainer &atom_container, bool deep=true)
 AtomContainer (const String &name)
virtual ~AtomContainer ()
virtual void clear ()
virtual void destroy ()
void set (const AtomContainer &atom_container, bool deep=true)
AtomContaineroperator= (const AtomContainer &atom_container)
void get (AtomContainer &atom_container, bool deep=true) const
void swap (AtomContainer &atom_container)
bool operator== (const AtomContainer &atom_container) const
bool operator!= (const AtomContainer &atom_container) const
bool isSubAtomContainerOf (const AtomContainer &atom_container) const
bool isSuperAtomContainerOf (const AtomContainer &atom_container) const
virtual bool isValid () const
void setName (const String &name)
const StringgetName () const
AtomContainergetSuperAtomContainer ()
const AtomContainergetSuperAtomContainer () const
AtomContainergetAtomContainer (Position position)
const AtomContainergetAtomContainer (Position position) const
AtomgetAtom (Position position)
const AtomgetAtom (Position position) const
AtomgetAtom (const String &name)
const AtomgetAtom (const String &name) const
Size countAtomContainers () const
Size countAtoms () const
Size countBonds () const
Size countInterBonds () const
Size countIntraBonds () const
void prepend (Atom &atom)
void append (Atom &atom)
void insert (Atom &atom)
void insertBefore (Atom &atom, Composite &before)
void insertAfter (Atom &atom, Composite &after)
bool remove (Atom &atom)
Size removeHavingProperty (BALL::Property p)
Size removeNotHavingProperty (BALL::Property p)
Size removeHavingProperty (const string &name)
Size removeNotHavingProperty (const string &name)
void prepend (AtomContainer &atom_container)
void append (AtomContainer &atom_container)
void insert (AtomContainer &atom_container)
void insertBefore (AtomContainer &atom_container, Composite &before)
void insertAfter (AtomContainer &atom_container, Composite &after)
void spliceBefore (AtomContainer &atom_container)
void spliceAfter (AtomContainer &atom_container)
void splice (AtomContainer &atom_container)
bool remove (AtomContainer &atom_container)
void destroyBonds ()
bool applyIntraBond (UnaryProcessor< Bond > &processor)
 Apply to all bonds connecting two atoms inside this AtomContainer.
bool applyInterBond (UnaryProcessor< Bond > &processor)
 Apply to all bonds connected to atoms outside this AtomContainer.
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 isAtom () 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)
Compositeoperator= (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
CompositegetRoot ()
const CompositegetRoot () const
CompositegetLowestCommonAncestor (const Composite &composite)
const CompositegetLowestCommonAncestor (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
CompositegetParent ()
const CompositegetParent () const
CompositegetChild (Index index)
const CompositegetChild (Index index) const
CompositegetSibling (Index index)
const CompositegetSibling (Index index) const
CompositegetFirstChild ()
const CompositegetFirstChild () const
CompositegetLastChild ()
const CompositegetLastChild () const
const PreciseTimegetModificationTime () const
const PreciseTimegetSelectionTime () 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 ()
PersistenceManageroperator>> (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 Objectoperator= (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 Selectableoperator= (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 PropertyManageroperator= (const PropertyManager &property_manager)
void get (PropertyManager &property_manager) const
void swap (PropertyManager &property_manager)
BitVectorgetBitVector ()
const BitVectorgetBitVector () const
 operator BitVector & ()
void setProperty (Property property)
void clearProperty (Property property)
void toggleProperty (Property property)
Size countProperties () const
const NamedPropertygetNamedProperty (Position index) const
NamedPropertygetNamedProperty (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 NamedPropertygetProperty (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

Debugging and Diagnostics

virtual void dump (std::ostream &s=std::cout, Size depth=0) const
bool operator== (const Molecule &molecule) const
bool operator!= (const Molecule &molecule) const
MoleculegetMolecule ()
const MoleculegetMolecule () const
AtomContainergetSuperAtomContainer ()
const AtomContainergetSuperAtomContainer () const
void prepend (Molecule &molecule)
void append (Molecule &molecule)
void insert (Molecule &molecule)
void insertBefore (Molecule &molecule, Composite &composite)
void insertAfter (Molecule &molecule, Composite &composite)
bool remove (Molecule &molecule)
bool isSubAtomContainerOf (const AtomContainer &atom_container) const

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< CompositeDEFAULT_PROCESSOR
static KernelPredicateType DEFAULT_UNARY_PREDICATE
 AutoDeletable ()
 AutoDeletable (const AutoDeletable &auto_deletable, bool deep=false)
bool selected_

Detailed Description

Molecule class. Used to represent general molecules without specific properties.

Definition at line 29 of file molecule.h.

Member Enumeration Documentation

◆ Property

Properties

Enumerator
IS_SOLVENT 
NUMBER_OF_PROPERTIES 

Definition at line 42 of file molecule.h.

Constructor & Destructor Documentation

◆ Molecule() [1/4]

BALL::Molecule::Molecule ( )

Default constructor.

◆ Molecule() [2/4]

BALL::Molecule::Molecule ( const Molecule & molecule,
bool deep = true )

Copy constructor.

◆ Molecule() [3/4]

BALL::Molecule::Molecule ( const AtomContainer & atomContainer,
bool deep = true )

Constructor using an AtomContainer.

◆ Molecule() [4/4]

BALL::Molecule::Molecule ( const String & name)

Detailled constructor.

◆ ~Molecule()

virtual BALL::Molecule::~Molecule ( )
virtual

Destructor.

Member Function Documentation

◆ append() [1/3]

void BALL::Molecule::append ( Atom & atom)

Insert an atom as the last child.

Parameters
atomthe atom to add

◆ append() [2/3]

void BALL::Molecule::append ( AtomContainer & atom_container)

Append an AtomContainer as the last child.

Parameters
atom_containerthe AtomContainer to add

◆ append() [3/3]

void BALL::Molecule::append ( Molecule & molecule)
protected

◆ dump()

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

Internal state dump. Dump the current internal state to the output ostream s with dumping depth depth .

Parameters
soutput stream where to output the internal state
depththe dumping depth

Reimplemented from BALL::AtomContainer.

Reimplemented in BALL::NucleicAcid, and BALL::Protein.

◆ get()

void BALL::Molecule::get ( Molecule & molecule,
bool deep = true ) const

Assign to another Molecule.

Parameters
moleculethe Molecule to be assigned to
deepmake a deep (=true) or shallow (=false) copy

◆ getMolecule() [1/2]

Molecule * BALL::Molecule::getMolecule ( )
protected

◆ getMolecule() [2/2]

const Molecule * BALL::Molecule::getMolecule ( ) const
protected

◆ getSuperAtomContainer() [1/2]

AtomContainer * BALL::Molecule::getSuperAtomContainer ( )
protected

◆ getSuperAtomContainer() [2/2]

const AtomContainer * BALL::Molecule::getSuperAtomContainer ( ) const
protected

◆ getSystem() [1/2]

System * BALL::Molecule::getSystem ( )

Access the parent System.

Returns
System* pointer to the parent System

◆ getSystem() [2/2]

const System * BALL::Molecule::getSystem ( ) const

Get a const pointer to the parent System.

Returns
System* pointer to the parent System

◆ insert() [1/3]

void BALL::Molecule::insert ( Atom & atom)

Insert an atom as the last child.

Parameters
atomthe atom to add

◆ insert() [2/3]

void BALL::Molecule::insert ( AtomContainer & atom_container)

Insert an AtomContainer as the last child.

Parameters
atom_containerthe AtomContainer to add

◆ insert() [3/3]

void BALL::Molecule::insert ( Molecule & molecule)
protected

◆ insertAfter() [1/3]

void BALL::Molecule::insertAfter ( Atom & atom,
Composite & after )

Insert an atom after a Composite object.

Parameters
atomthe atom to insert
afterthe Composite object to insert after

◆ insertAfter() [2/3]

void BALL::Molecule::insertAfter ( AtomContainer & atom_container,
Composite & after )

Insert an AtomContainer after a given Composite object.

Parameters
atom_containerthe AtomContainer to insert
afterthe Composite object to insert after

◆ insertAfter() [3/3]

void BALL::Molecule::insertAfter ( Molecule & molecule,
Composite & composite )
protected

◆ insertBefore() [1/3]

void BALL::Molecule::insertBefore ( Atom & atom,
Composite & before )

Insert an atom before a Composite object.

Parameters
atomthe atom to insert
beforethe Composite object to insert before

◆ insertBefore() [2/3]

void BALL::Molecule::insertBefore ( AtomContainer & atom_container,
Composite & before )

Insert an AtomContainer before a given Composite object.

Parameters
atom_containerthe AtomContainer to insert
beforethe Composite object to insert before

◆ insertBefore() [3/3]

void BALL::Molecule::insertBefore ( Molecule & molecule,
Composite & composite )
protected

◆ isMolecule()

virtual bool BALL::Molecule::isMolecule ( ) const
inlinevirtual

Test if the Composite is a Molecule

Reimplemented from BALL::Composite.

Definition at line 216 of file molecule.h.

◆ isSubAtomContainerOf()

bool BALL::Molecule::isSubAtomContainerOf ( const AtomContainer & atom_container) const
protected

◆ operator!=()

bool BALL::Molecule::operator!= ( const Molecule & molecule) const

Inequality operator

See also
operator ==

◆ operator=()

Molecule & BALL::Molecule::operator= ( const Molecule & molecule)

Assignment operator.

Parameters
moleculethe Molecule to assign from

◆ operator==()

bool BALL::Molecule::operator== ( const Molecule & molecule) const

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

See also
Object::operator ==.

◆ persistentRead()

void BALL::Molecule::persistentRead ( PersistenceManager & pm)
virtual

Reads a Molecule object from a persistent stream.

Parameters
pmthe persistence manager

Reimplemented from BALL::AtomContainer.

Reimplemented in BALL::NucleicAcid, and BALL::Protein.

◆ persistentWrite()

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

Writes a Molecule object to a persistent stream.

Parameters
pmthe persistence manager

Reimplemented from BALL::AtomContainer.

Reimplemented in BALL::NucleicAcid, and BALL::Protein.

◆ prepend() [1/3]

void BALL::Molecule::prepend ( Atom & atom)

Insert an atom as the first child.

Parameters
atomthe atom to add

◆ prepend() [2/3]

void BALL::Molecule::prepend ( AtomContainer & atom_container)

Insert an AtomContainer as the first child.

Parameters
atom_containerthe AtomContainer to add

◆ prepend() [3/3]

void BALL::Molecule::prepend ( Molecule & molecule)
protected

◆ remove() [1/3]

bool BALL::Molecule::remove ( Atom & atom)

Remove an atom.

Parameters
atomthe atom to remove

◆ remove() [2/3]

bool BALL::Molecule::remove ( AtomContainer & atom_container)

Remove an AtomContainer.

Parameters
atom_containerthe AtomContainer to remove

◆ remove() [3/3]

bool BALL::Molecule::remove ( Molecule & molecule)
protected

◆ set()

void BALL::Molecule::set ( const Molecule & molecule,
bool deep = true )

Assign from another Molecule.

Parameters
moleculethe Molecule object to assign from
deepmake a deep (=true) or shallow (=false) copy

◆ splice()

void BALL::Molecule::splice ( AtomContainer & atom_container)

Move the children of atom_container into this molecule. The children of atom_container are inserted at the position of atom_container if it is a child of this. Otherwise the children are inserted using spliceBefore .

◆ spliceAfter()

void BALL::Molecule::spliceAfter ( AtomContainer & atom_container)

Cut all children of atom_container and append them after the children of this molecule.

Parameters
atom_containerthe AtomContainer to access

◆ spliceBefore()

void BALL::Molecule::spliceBefore ( AtomContainer & atom_container)

Cut all children of atom_container and prepend them before the children of this molecule.

Parameters
atom_containerthe AtomContainer to access

◆ swap()

void BALL::Molecule::swap ( Molecule & molecule)

Swap the contents of two molecules.

Parameters
moleculethe Molecule to swap contents with