#include <bond.h>
Classes |
||||
class | NotBound | |||
Not bound to two atoms. More... |
||||
Public Types |
||||
Enumerations
|
||||
enum |
BondOrder { ORDER__UNKNOWN = 0, ORDER__SINGLE = 1, ORDER__DOUBLE = 2, ORDER__TRIPLE = 3, ORDER__QUADRUPLE = 4, ORDER__AROMATIC = 5, ORDER__ANY = 6, NUMBER_OF_BOND_ORDERS } |
|||
Predefined constants for the bond
order. More... |
||||
enum |
BondType { TYPE__UNKNOWN = 0, TYPE__COVALENT = 1, TYPE__HYDROGEN = 2, TYPE__DISULPHIDE_BRIDGE = 3, TYPE__SALT_BRIDGE = 4, TYPE__PEPTIDE = 5, NUMBER_OF_BOND_TYPES } |
|||
Predefined constants for the bond
type. More... |
||||
enum | Property { IS_AROMATIC = 0, NUMBER_OF_PROPERTIES } | |||
Predefined properties. More... |
||||
Type definitions
|
||||
typedef short | Order | |||
Bond
type. |
||||
typedef short | Type | |||
Public Member Functions |
||||
Persistence
|
||||
void | persistentWrite (PersistenceManager &pm, const char *name=0) const throw (Exception::GeneralException) | |||
Write a bond to a persistent stream.
|
||||
void | persistentRead (PersistenceManager &pm) throw (Exception::GeneralException) | |||
Read a bond from a persistent
stream. |
||||
void | finalize () throw (Exception::GeneralException) | |||
Finalize the deserialization.
|
||||
Predicates
|
||||
bool | operator== (const Bond &bond) const | |||
Equality operator. Two bonds are
equal, if they are identical instances. |
||||
bool | operator!= (const Bond &bond) const | |||
Inequality operator. Two bonds are
not equal, if they are different instances. |
||||
Assignment methods
|
||||
Bond & | operator= (const Bond &bond) | |||
Assignment operator. |
||||
void | swap (Bond &bond) | |||
Swap the contents of two bonds.
|
||||
Accessors
|
||||
void | setFirstAtom (Atom *atom) | |||
Set the first atom. |
||||
void | setSecondAtom (Atom *atom) | |||
Set the second atom. |
||||
const Atom * | getFirstAtom () const | |||
Return a pointer to the first
atom. |
||||
const Atom * | getSecondAtom () const | |||
Return a pointer to the second
atom. |
||||
Atom * | getPartner (const Atom &atom) const | |||
Return the partner atom of an atom.
|
||||
void | setName (const String &name) | |||
Assign the atom name. |
||||
const String & | getName () const | |||
Return the atom name. |
||||
void | setOrder (Order bond_order) | |||
Assign the bond order. |
||||
Order | getOrder () const | |||
Return the bond order. |
||||
bool | isAromatic () const | |||
Returns true if this bond is
aromatic. |
||||
void | setType (Type bond_type) | |||
Set the bond type. |
||||
Type | getType () const | |||
Return the bond type. |
||||
float | getLength () const throw (NotBound) | |||
Return the bond length
|
||||
const Atom * | getBoundAtom (const Atom &atom) const | |||
Return the partner of the atom in
this bond. |
||||
Atom * | getBoundAtom (const Atom &atom) | |||
Return the partner of the atom in
this bond. |
||||
Predicates
|
||||
bool | isBondOf (const Atom &atom) const | |||
Determine whether the bond belongs
to an atom. |
||||
bool | isBound () const | |||
Determine whether this bond contains
any atom. |
||||
bool | isInterBond () const | |||
Determine whether the bond connects
two fragments. |
||||
bool | isInterBondOf (const AtomContainer &atom_container) const | |||
Request for the intermolecular
bonding of this bond within {atom_container}.
|
||||
bool | isIntraBond () const | |||
Request for the intramolecular
bonding of this bond. |
||||
bool | isIntraBondOf (const AtomContainer &atom_container) const | |||
Request for the intramolecular
bonding of this bond within {atom_container}.
|
||||
Debugging and diagnostics
|
||||
virtual bool | isValid () const | |||
Internal state and consistency
self-validation. |
||||
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const | |||
Internal state dump. |
||||
Protected Attributes |
||||
Atributes
|
||||
Atom * | first_ | |||
Atom * | second_ | |||
String | name_ | |||
Order | bond_order_ | |||
Type | bond_type_ | |||
Friends |
||||
class | Atom | |||
Constructors and Destructors |
||||
Bond () | ||||
Default constructor. |
||||
Bond (const Bond &bond, bool deep=true) | ||||
Copy constructor. |
||||
Bond (const String &name, Atom &first, Atom &second, Order order=BALL_BOND_DEFAULT_ORDER, Type type=BALL_BOND_DEFAULT_TYPE) throw (Exception::TooManyBonds) | ||||
Detailed constructor. |
||||
virtual | ~Bond () | |||
Destructor. |
||||
virtual void | clear () | |||
Disconnect and reset to default
state. |
||||
virtual void | destroy () | |||
Explicit destructor. |
||||
static Bond * | createBond (Bond &bond, Atom &first, Atom &second) throw (Exception::TooManyBonds) | |||
Create a bond. |
An instance of Bond represents a bond between two atoms. There can be only one bond between two atoms (double, triple, etc. bonds are represented using just one bond and an appropriate value for the bond order attribute, see setBondOrder ).
Bond equality is defined as bond identity. A linear ordering of bonds is defined as the linear order of the Object::Handle s.
Predefined constants for the bond order.
enum BALL::Bond::BondType |
Predefined constants for the bond type.
Those are just defined for convenience but they are not used right now.
enum BALL::Bond::Property |
Predefined properties.
Enumeration of all properties that are used by Bond.
BALL::Bond::Bond | ( | ) |
Default constructor.
The state of this bond is:
BALL::Bond::Bond | ( | const Bond & | bond, | |
bool | deep =
true |
|||
) |
Copy constructor.
Calls Bond::createBond . The state of this bond is initialized to the state of bond.
deep
is therefore ignored. The
use of this method is not recommended because it may
result in inconcistencies of the whole the kernel data
structure. This if for internal use only!bond | the bond to be copied | |
deep | ignored |
BALL::Bond::Bond | ( | const String & | name, | |
Atom & | first, | |||
Atom & | second, | |||
Order | order =
BALL_BOND_DEFAULT_ORDER , |
|||
Type | type =
BALL_BOND_DEFAULT_TYPE |
|||
) | throw (Exception::TooManyBonds) |
Detailed constructor.
Calls createBond to create a new bond between the two atoms
name | name of the constructed bond | |
first | first atom of the constructed bond | |
second | second atom of the constructed bond | |
order | order of the constructed bond | |
type | type of the constructed bond |
TooManyBonds | if one of the atom already possesses Atom::MAX_NUMBER_OF_BONDS bonds. |
virtual BALL::Bond::~Bond | ( | ) | [virtual] |
Destructor.
If the bond is connecting two atoms, they are disconnected.
virtual void BALL::Bond::clear | ( | ) | [virtual] |
Disconnect and reset to default state.
Reset the bond attributes to their default values. The state of this bond is:
Reimplemented from BALL::Composite.
static Bond* BALL::Bond::createBond | ( | Bond & | bond, | |
Atom & | first, | |||
Atom & | second | |||
) | throw (Exception::TooManyBonds)
[static] |
Create a bond.
Connect the two atoms first
and
second
via a bond.
bond | the instantiated bond that connects the first
atom first to the second atom
second |
|
first | the first atom of the bond | |
second | the second atom of the bond |
this
TooManyBonds | if one of the atom already possesses Atom::MAX_NUMBER_OF_BONDS bonds. |
Referenced by BALL::cloneBonds().
virtual void BALL::Bond::destroy | ( | ) | [virtual] |
Explicit destructor.
Destroy this bond explicitly without releasing its heap memory thus this bond may exist further. Calls Bond::clear . Set the state of this bond to the default values. Note: Destroy is equivalent to Bond::clear .
Reimplemented from BALL::Composite.
virtual void BALL::Bond::dump | ( | std::ostream & | s =
std::cout , |
|
Size | depth =
0 |
|||
) | const [virtual] |
Internal state dump.
Dump the current internal state of this bond to the output ostream s with dumping depth depth .
s | output stream where to output the internal state of this bond | |
depth | the dumping depth |
Reimplemented from BALL::Composite.
void BALL::Bond::finalize | ( | ) | throw (Exception::GeneralException)
[virtual] |
Finalize the deserialization.
Bond might have to swap
first_
and second_
to ensure the
correct order (see Bond ).
Reimplemented from BALL::PersistentObject.
Referenced by BALL::cloneBonds().
Return the partner of the atom in this bond.
atom | an atom |
Return the partner of the atom in this bond.
atom | an atom |
float BALL::Bond::getLength | ( | ) | const throw (NotBound) |
Return the bond length
NotBound | if the bond has not two atoms. |
Return the partner atom of an atom.
If the given atom
is part of this bond, the
other atom of the bond is returned. 0 is returned if
atom
is not one of the bond's atoms.
atom | one of the bond's atoms |
bool BALL::Bond::isAromatic | ( | ) | const |
Returns true if this bond is aromatic.
A bond is defined as aromatic, if it has the property Bond::IS_AROMATIC or if it has the order Bond::ORDER__AROMATIC
bool BALL::Bond::isBondOf | ( | const Atom & | atom | ) | const |
Determine whether the bond belongs to an atom.
Calls Atom::hasBond .
atom | the atom that is queried to connect this bond to another atom |
true
if bond connects the atom
atom with another atom, false
otherwisebool BALL::Bond::isBound | ( | ) | const |
Determine whether this bond contains any atom.
true
if bond connects the atom
atom with another atom, false
otherwisebool BALL::Bond::isInterBond | ( | ) | const |
Determine whether the bond connects two fragments.
If both atoms have no roots, the result is false. Calls Composite::getRoot .
true
if this bond is
intermolecular, false
otherwisebool BALL::Bond::isInterBondOf | ( | const AtomContainer & | atom_container | ) | const |
Request for the intermolecular bonding of this bond within {atom_container}.
Query, if this bond connects a atom within {atom_container} instance with an atom outside. Calls Composite::isDescendantOf .
atom_container | the queried parent fragment. |
true
if this bond is
intermolecular, false
otherwisebool BALL::Bond::isIntraBond | ( | ) | const |
Request for the intramolecular bonding of this bond.
Query, if this bond connects its two atoms within a common parent Composite instance. If both atoms have no roots, the result is true. Calls Composite::getRoot .
true
if this bond is
intramolecular, false
otherwisebool BALL::Bond::isIntraBondOf | ( | const AtomContainer & | atom_container | ) | const |
Request for the intramolecular bonding of this bond within {atom_container}.
Query, if this bond connects its two atoms within the common parent {atom_container} instance. Calls Composite::isDescendantOf .
atom_container | the queried parent fragment. |
true
if this bond is
intramolecular, false
otherwisevirtual bool BALL::Bond::isValid | ( | ) | const [virtual] |
Internal state and consistency self-validation.
true
if the internal state of
this bond is correct (self-validated) and consistent,
false
otherwiseReimplemented from BALL::Composite.
void BALL::Bond::persistentRead | ( | PersistenceManager & | pm | ) | throw (Exception::GeneralException)
[virtual] |
Read a bond from a persistent stream.
pm | the persistence manager |
Reimplemented from BALL::Composite.
void BALL::Bond::persistentWrite | ( | PersistenceManager & | pm, | |
const char * | name =
0 |
|||
) | const throw (Exception::GeneralException)
[virtual] |
Write a bond to a persistent stream.
pm | the persistence manager |
Reimplemented from BALL::Composite.
void BALL::Bond::setFirstAtom | ( | Atom * | atom | ) |
Set the first atom.
This method does not ensure the correct order of atoms (see Bond ), so its use is recommended for internal purposes only.
Referenced by BALL::cloneBonds().
void BALL::Bond::setSecondAtom | ( | Atom * | atom | ) |
Set the second atom.
This method does not ensure the correct order of atoms (see Bond ), so its use is recommended for internal purposes only.
Referenced by BALL::cloneBonds().
void BALL::Bond::swap | ( | Bond & | bond | ) |
Swap the contents of two bonds.
bond | the bond this is being swapped
with |