/* * Bond.hpp * * Created on: Aug 3, 2009 * Author: heber */ #ifndef BOND_HPP_ #define BOND_HPP_ using namespace std; /*********************************************** includes ***********************************/ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "types.hpp" #include "Bond/bond_observable.hpp" #include "Bond/GraphEdge.hpp" /****************************************** forward declarations *****************************/ class atom; class BondedParticle; class ParticleInfo; /********************************************** declarations *******************************/ /** Bonds between atoms. * Class incorporates bonds between atoms in a molecule. * Note that we regard bond always as something in a molecule, * as it is the glue making up the connected subgraph and * hence the molecule. Thus, bonds belong globally to the molecule * (and are free'd there) and only locally to the atom class. */ class bond : public GraphEdge, public BondObservable { public: //!> typedef for a bond ptr typedef boost::shared_ptr ptr; atom *leftatom; //!< first bond partner atom *rightatom; //!< second bond partner int HydrogenBond; //!< Number of hydrogen atoms in the bond atom * GetOtherAtom(const ParticleInfo * const Atom) const; bool Contains(const ParticleInfo * const ptr) const; bool ContainsNr(const int nr) const; bool ContainsId(const atomId_t nr) const; double GetDistance() const; double GetDistanceSquared() const; bond(); bond(atom *left, atom *right, const int degree=1); ~bond(); /** Getter for bond degree. * * \return degree */ int getDegree() const { return BondDegree; } /** Getter for bond degree. * * \param _degree new degree to set */ void setDegree(const int _degree); private: int BondDegree; //!< single, double, triple, ... bond private: //!> grant atom_bondedparticle access to unregister function friend class BondedParticle; void removeAtom(const ParticleInfo * const Atom); }; ostream & operator << (ostream &ost, const bond &b); #endif /* BOND_HPP_ */