#include <BALL/KERNEL/bond.h>
Classes | |
class | NotBound |
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 } |
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 } |
enum | Property { IS_AROMATIC = 0, NUMBER_OF_PROPERTIES } |
Type definitions | |
typedef short | Order |
typedef short | Type |
Public Member Functions | |
Persistence | |
void | persistentWrite (PersistenceManager &pm, const char *name=0) const throw (Exception::GeneralException) |
void | persistentRead (PersistenceManager &pm) throw (Exception::GeneralException) |
void | finalize () throw (Exception::GeneralException) |
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. | |
bool | isBondOf (const Atom &atom) const |
bool | isBound () const |
bool | isInterBond () const |
bool | isInterBondOf (const AtomContainer &atom_container) const |
bool | isIntraBond () const |
bool | isIntraBondOf (const AtomContainer &atom_container) const |
Assignment methods | |
Bond & | operator= (const Bond &bond) |
void | swap (Bond &bond) |
Accessors | |
void | setFirstAtom (Atom *atom) |
void | setSecondAtom (Atom *atom) |
const Atom * | getFirstAtom () const |
Return a pointer to the first atom. | |
Atom * | getFirstAtom () |
Return a pointer to the first atom. | |
const Atom * | getSecondAtom () const |
Return a pointer to the second atom. | |
Atom * | getSecondAtom () |
Return a pointer to the second atom. | |
Atom * | getPartner (const Atom &atom) const |
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 |
void | setType (Type bond_type) |
Set the bond type. | |
Type | getType () const |
Return the bond type. | |
float | getLength () const throw (NotBound) |
const Atom * | getBoundAtom (const Atom &atom) const |
Atom * | getBoundAtom (const Atom &atom) |
Debugging and diagnostics | |
virtual bool | isValid () const |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const |
Protected Attributes | |
Atributes | |
Atom * | first_ |
Atom * | second_ |
String | name_ |
Order | bond_order_ |
Type | bond_type_ |
Private Member Functions | |
void | arrangeBonds_ () |
void | clear_ () |
Friends | |
class | Atom |
Constructors and Destructors | |
| |
Bond () | |
Bond (const Bond &bond, bool deep=true) | |
Bond (const String &name, Atom &first, Atom &second, Order order=BALL_BOND_DEFAULT_ORDER, Type type=BALL_BOND_DEFAULT_TYPE) throw (Exception::TooManyBonds) | |
virtual | ~Bond () |
virtual void | clear () |
virtual void | destroy () |
static Bond * | createBond (Bond &bond, Atom &first, Atom &second) throw (Exception::TooManyBonds) |
Bond class. 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.
Definition at line 56 of file bond.h.
typedef short BALL::Bond::Order |
typedef short BALL::Bond::Type |
Predefined constants for the bond order
ORDER__UNKNOWN |
Default value. |
ORDER__SINGLE |
Single bond. |
ORDER__DOUBLE |
Double bond. |
ORDER__TRIPLE | |
ORDER__QUADRUPLE |
Quadruple bond. |
ORDER__AROMATIC |
Aromatic bonds. |
ORDER__ANY |
Any bond orders (useful for predicates). |
NUMBER_OF_BOND_ORDERS |
The number of bond orders. |
enum BALL::Bond::BondType |
enum BALL::Bond::Property |
BALL::Bond::Bond | ( | ) |
Default constructor. The state of this bond is:
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.
void BALL::Bond::arrangeBonds_ | ( | ) | [private] |
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.
void BALL::Bond::clear_ | ( | ) | [private] |
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. |
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.
Return the partner of the atom in this bond.
atom | an atom |
Return the partner of the atom in this bond.
atom | an atom |
Atom* BALL::Bond::getFirstAtom | ( | ) |
Return a pointer to the first atom.
const Atom* BALL::Bond::getFirstAtom | ( | ) | const |
Return a pointer to the first atom.
Return the bond length
NotBound | if the bond has not two atoms |
const String& BALL::Bond::getName | ( | ) | const |
Return the atom name.
Order BALL::Bond::getOrder | ( | ) | const |
Return the bond order.
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 |
Atom* BALL::Bond::getSecondAtom | ( | ) |
Return a pointer to the second atom.
const Atom* BALL::Bond::getSecondAtom | ( | ) | const |
Return a pointer to the second atom.
Type BALL::Bond::getType | ( | ) | const |
Return the bond type.
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
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
otherwise bool BALL::Bond::isBound | ( | ) | const |
Determine whether this bond contains any atom.
true
if bond connects the atom atom with another atom, false
otherwise bool 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
otherwise bool 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
otherwise bool 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
otherwise bool 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
otherwise virtual 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
otherwise Reimplemented from BALL::Composite.
Inequality operator. Two bonds are not equal, if they are different instances.
Equality operator. Two bonds are equal, if they are identical instances.
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.
void BALL::Bond::setName | ( | const String & | name | ) |
Assign the atom name.
void BALL::Bond::setOrder | ( | Order | bond_order | ) |
Assign the bond order.
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.
void BALL::Bond::setType | ( | Type | bond_type | ) |
Set the bond type.
void BALL::Bond::swap | ( | Bond & | bond | ) |
Swap the contents of two bonds
bond | the bond this is being swapped with |
Order BALL::Bond::bond_order_ [protected] |
Type BALL::Bond::bond_type_ [protected] |
Atom* BALL::Bond::first_ [protected] |
String BALL::Bond::name_ [protected] |
Atom* BALL::Bond::second_ [protected] |