Loading...
Searching...
No Matches
bond.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_KERNEL_BOND_H
#define BALL_KERNEL_BOND_H
#ifndef BALL_CONCEPT_PROPERTY_H
# include <BALL/CONCEPT/property.h>
#endif
#ifndef BALL_CONCEPT_COMPOSITE_H
# include <BALL/CONCEPT/composite.h>
#endif
#ifndef BALL_CONCEPT_ATOMCONTAINER_H
# include <BALL/KERNEL/atomContainer.h>
#endif
#define BALL_BOND_DEFAULT_FIRST_ATOM 0
#define BALL_BOND_DEFAULT_SECOND_ATOM 0
#define BALL_BOND_DEFAULT_NAME ""
#define BALL_BOND_DEFAULT_ORDER ORDER__UNKNOWN
#define BALL_BOND_DEFAULT_TYPE TYPE__UNKNOWN
namespace BALL
{
class Atom;
class Fragment;
class System;
class BALL_EXPORT Bond
: public Composite,
public PropertyManager
{
public:
friend class Atom;
BALL_CREATE_DEEP(Bond)
class BALL_EXPORT NotBound
: public Exception::GeneralException
{
public:
NotBound(const char* file, int line);
};
typedef short Order;
typedef short Type;
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
};
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);
static Bond* createBond(Bond& bond, Atom& first, Atom& second);
virtual ~Bond();
virtual void clear();
virtual void destroy();
void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
void persistentRead(PersistenceManager& pm);
void finalize();
bool operator == (const Bond& bond) const;
bool operator != (const Bond& bond) const;
Bond& operator = (const Bond& bond);
void swap(Bond& bond);
void setFirstAtom(Atom* atom);
void setSecondAtom(Atom* atom);
const Atom* getFirstAtom() const;
Atom* getFirstAtom();
const Atom* getSecondAtom() const;
Atom* getSecondAtom();
Atom* getPartner(const Atom& atom) const;
void setName(const String& name);
const String& getName() const;
void setOrder(Order bond_order);
Order getOrder() const;
bool isAromatic() const;
void setType(Type bond_type);
Type getType() const;
float getLength() const;
const Atom* getBoundAtom(const Atom& atom) const;
Atom* getBoundAtom(const Atom& atom);
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;
virtual bool isValid() const;
virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
protected:
// First atom of the bond (bond owner)
Atom* first_;
// Second atom
Atom* second_;
// Bond name
String name_;
// Bond order
Order bond_order_;
// Bond type
Type bond_type_;
private:
void arrangeBonds_();
void clear_();
};
# ifndef BALL_NO_INLINE_FUNCTIONS
# include <BALL/KERNEL/bond.iC>
# endif
} // namespace BALL
#endif // BALL_KERNEL_BOND_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
atomContainer.h
BALL_BOND_DEFAULT_TYPE
#define BALL_BOND_DEFAULT_TYPE
Definition bond.h:24
BALL_BOND_DEFAULT_ORDER
#define BALL_BOND_DEFAULT_ORDER
Definition bond.h:23
BALL::AtomContainer
Definition atomContainer.h:32
BALL::Bond::NotBound::NotBound
NotBound(const char *file, int line)
BALL::Bond::getFirstAtom
const Atom * getFirstAtom() const
Return a pointer to the first atom.
BALL::Bond::setSecondAtom
void setSecondAtom(Atom *atom)
BALL::Bond::getSecondAtom
Atom * getSecondAtom()
Return a pointer to the second atom.
BALL::Bond::name_
String name_
Definition bond.h:452
BALL::Bond::Bond
Bond(const Bond &bond, bool deep=true)
BALL::Bond::first_
Atom * first_
Definition bond.h:446
BALL::Bond::isIntraBondOf
bool isIntraBondOf(const AtomContainer &atom_container) const
BALL::Bond::persistentWrite
void persistentWrite(PersistenceManager &pm, const char *name=0) const
BALL::Bond::isAromatic
bool isAromatic() const
BALL::Bond::Type
short Type
Definition bond.h:87
BALL::Bond::getType
Type getType() const
Return the bond type.
BALL::Bond::setType
void setType(Type bond_type)
Set the bond type.
BALL::Bond::bond_type_
Type bond_type_
Definition bond.h:458
BALL::Bond::Property
Property
Definition bond.h:142
BALL::Bond::IS_AROMATIC
@ IS_AROMATIC
This property can be used to store aromaticity information without overwriting bond orders.
Definition bond.h:144
BALL::Bond::NUMBER_OF_PROPERTIES
@ NUMBER_OF_PROPERTIES
Definition bond.h:146
BALL::Bond::isInterBond
bool isInterBond() const
BALL::Bond::getFirstAtom
Atom * getFirstAtom()
Return a pointer to the first atom.
BALL::Bond::persistentRead
void persistentRead(PersistenceManager &pm)
BALL::Bond::getName
const String & getName() const
Return the atom name.
BALL::Bond::Bond
Bond(const String &name, Atom &first, Atom &second, Order order=BALL_BOND_DEFAULT_ORDER, Type type=BALL_BOND_DEFAULT_TYPE)
BALL::Bond::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::Bond::~Bond
virtual ~Bond()
BALL::Bond::finalize
void finalize()
BALL::Bond::isValid
virtual bool isValid() const
BALL::Bond::createBond
static Bond * createBond(Bond &bond, Atom &first, Atom &second)
BALL::Bond::BondType
BondType
Definition bond.h:121
BALL::Bond::TYPE__DISULPHIDE_BRIDGE
@ TYPE__DISULPHIDE_BRIDGE
Definition bond.h:129
BALL::Bond::NUMBER_OF_BOND_TYPES
@ NUMBER_OF_BOND_TYPES
Definition bond.h:135
BALL::Bond::TYPE__COVALENT
@ TYPE__COVALENT
Definition bond.h:125
BALL::Bond::TYPE__SALT_BRIDGE
@ TYPE__SALT_BRIDGE
Definition bond.h:131
BALL::Bond::TYPE__UNKNOWN
@ TYPE__UNKNOWN
Definition bond.h:123
BALL::Bond::TYPE__HYDROGEN
@ TYPE__HYDROGEN
Definition bond.h:127
BALL::Bond::TYPE__PEPTIDE
@ TYPE__PEPTIDE
Definition bond.h:133
BALL::Bond::isIntraBond
bool isIntraBond() const
BALL::Bond::getPartner
Atom * getPartner(const Atom &atom) const
BALL::Bond::getLength
float getLength() const
BALL::Bond::getOrder
Order getOrder() const
Return the bond order.
BALL::Bond::setFirstAtom
void setFirstAtom(Atom *atom)
BALL::Bond::swap
void swap(Bond &bond)
BALL::Bond::getSecondAtom
const Atom * getSecondAtom() const
Return a pointer to the second atom.
BALL::Bond::second_
Atom * second_
Definition bond.h:449
BALL::Bond::Atom
friend class Atom
Definition bond.h:61
BALL::Bond::getBoundAtom
const Atom * getBoundAtom(const Atom &atom) const
BALL::Bond::clear
virtual void clear()
BALL::Bond::Bond
Bond()
BALL::Bond::isInterBondOf
bool isInterBondOf(const AtomContainer &atom_container) const
BALL::Bond::isBondOf
bool isBondOf(const Atom &atom) const
BALL::Bond::BondOrder
BondOrder
Definition bond.h:97
BALL::Bond::ORDER__QUADRUPLE
@ ORDER__QUADRUPLE
Quadruple bond.
Definition bond.h:107
BALL::Bond::ORDER__DOUBLE
@ ORDER__DOUBLE
Double bond.
Definition bond.h:103
BALL::Bond::ORDER__TRIPLE
@ ORDER__TRIPLE
Triple Bond.
Definition bond.h:105
BALL::Bond::ORDER__SINGLE
@ ORDER__SINGLE
Single bond.
Definition bond.h:101
BALL::Bond::ORDER__AROMATIC
@ ORDER__AROMATIC
Aromatic bonds.
Definition bond.h:109
BALL::Bond::ORDER__ANY
@ ORDER__ANY
Any bond orders (useful for predicates).
Definition bond.h:111
BALL::Bond::ORDER__UNKNOWN
@ ORDER__UNKNOWN
Default value.
Definition bond.h:99
BALL::Bond::NUMBER_OF_BOND_ORDERS
@ NUMBER_OF_BOND_ORDERS
The number of bond orders.
Definition bond.h:113
BALL::Bond::setName
void setName(const String &name)
Assign the atom name.
BALL::Bond::bond_order_
Order bond_order_
Definition bond.h:455
BALL::Bond::isBound
bool isBound() const
BALL::Bond::destroy
virtual void destroy()
BALL::Bond::setOrder
void setOrder(Order bond_order)
Assign the bond order.
BALL::Bond::Order
short Order
Definition bond.h:86
BALL::Bond::getBoundAtom
Atom * getBoundAtom(const Atom &atom)
BALL::Composite::Composite
Composite()
BALL::Exception::GeneralException::GeneralException
GeneralException()
Default constructor.
BALL::PersistenceManager
Definition persistenceManager.h:73
BALL::PropertyManager::PropertyManager
BALL_INLINE PropertyManager()
Default constructor.
BALL::String
Definition string.h:57
composite.h
BALL_CREATE_DEEP
#define BALL_CREATE_DEEP(name)
Definition create.h:26
BALL::Exception
Definition COMMON/exception.h:33
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
property.h