#include <gcu/bond.h>
Public Member Functions | |
Bond () | |
Bond (Atom *first, Atom *last, unsigned char order) | |
virtual | ~Bond () |
virtual Atom * | GetAtom (int which) const |
virtual Atom * | GetAtom (Atom *pAtom, int which=0) const |
unsigned char | GetOrder () const |
void | SetOrder (unsigned char Order) |
virtual xmlNodePtr | Save (xmlDocPtr xml) const |
virtual bool | Load (xmlNodePtr node) |
virtual void | IncOrder (int n=1) |
virtual bool | LoadNode (xmlNodePtr node) |
virtual bool | SaveNode (xmlDocPtr xml, xmlNodePtr node) const |
virtual void | Move (double x, double y, double z=0.) |
virtual void | Transform2D (Matrix2D &m, double x, double y) |
bool | SetProperty (unsigned property, char const *value) |
std::string | GetProperty (unsigned property) const |
virtual void | AddCycle (Cycle *pCycle) |
virtual void | RemoveCycle (Cycle *pCycle) |
virtual void | RemoveAllCycles () |
unsigned | IsCyclic () |
Cycle * | GetFirstCycle (std::list< Cycle * >::iterator &i, Cycle *pCycle) |
Cycle * | GetNextCycle (std::list< Cycle * >::iterator &i, Cycle *pCycle) |
bool | IsInCycle (Cycle *pCycle) |
double | Get2DLength () |
double | GetAngle2DRad (Atom *pAtom) |
bool | ReplaceAtom (Atom *oldAtom, Atom *newAtom) |
void | OnLoaded () |
std::string | Name () |
Protected Attributes | |
unsigned char | m_order |
Atom * | m_Begin |
Atom * | m_End |
std::list< Cycle * > | m_Cycles |
Definition at line 42 of file gcu/bond.h.
gcu::Bond::Bond | ( | ) |
The default constructor. Creates a bond with order set to 0.
Reimplemented in gcp::Bond.
first | a pointer to the first Atom instance of the bond. | |
last | a pointer to the last Atom instance of the bond. | |
order | the order of the new bond. |
virtual void gcu::Bond::AddCycle | ( | Cycle * | pCycle | ) | [virtual] |
double gcu::Bond::Get2DLength | ( | ) |
double gcu::Bond::GetAngle2DRad | ( | Atom * | pAtom | ) |
pAtom | one of the atoms of the bond. |
pAtom | a pointer to an Atom instance. | |
which | an index which might be used for multicentered bonds (not supported); the default value should always be used even if the implementation does not use it in this version. |
virtual Atom* gcu::Bond::GetAtom | ( | int | which | ) | const [virtual] |
i | a C++ std::map iterator. | |
pCycle | a cycle. |
i | a C++ std::map iterator initialized by Bond::GetFirstCycle. | |
pCycle | a cycle. |
unsigned char gcu::Bond::GetOrder | ( | ) | const |
std::string gcu::Bond::GetProperty | ( | unsigned | property | ) | const [virtual] |
property | the identity of the property as defined in objprops.h. |
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
virtual void gcu::Bond::IncOrder | ( | int | n = 1 |
) | [virtual] |
n | the increment to add to the bond order |
Reimplemented in gcp::Bond.
unsigned gcu::Bond::IsCyclic | ( | ) | [inline] |
Definition at line 171 of file gcu/bond.h.
References m_Cycles.
bool gcu::Bond::IsInCycle | ( | Cycle * | pCycle | ) |
pCycle | a cycle in which the bond might be. |
virtual bool gcu::Bond::Load | ( | xmlNodePtr | node | ) | [virtual] |
node | a pointer to the xmlNode containing the serialized Bond. |
Reimplemented from gcu::Object.
virtual bool gcu::Bond::LoadNode | ( | xmlNodePtr | node | ) | [virtual] |
node | a pointer to the xmlNode containing the serialized Bond. |
Reimplemented in gcp::Bond.
virtual void gcu::Bond::Move | ( | double | x, | |
double | y, | |||
double | z = 0. | |||
) | [virtual] |
x | the x component of the transation vector. | |
y | the y component of the transation vector. | |
z | the z component of the transation vector. |
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
std::string gcu::Bond::Name | ( | ) | [virtual] |
void gcu::Bond::OnLoaded | ( | ) | [virtual] |
This method should be called when a bond has been fully loaded.
Reimplemented from gcu::Object.
virtual void gcu::Bond::RemoveAllCycles | ( | ) | [virtual] |
Clears the bond cycles list.
Reimplemented in gcp::Bond.
virtual void gcu::Bond::RemoveCycle | ( | Cycle * | pCycle | ) | [virtual] |
oldAtom | the atom to replace. | |
newAtom | the new atom. |
virtual xmlNodePtr gcu::Bond::Save | ( | xmlDocPtr | xml | ) | const [virtual] |
xml | the xmlDoc used to save the document. |
Reimplemented from gcu::Object.
virtual bool gcu::Bond::SaveNode | ( | xmlDocPtr | xml, | |
xmlNodePtr | node | |||
) | const [virtual] |
xml | the xmlDoc used to save the document. | |
node | a pointer to the xmlNode to which this Bond is serialized. |
Reimplemented in gcp::Bond.
void gcu::Bond::SetOrder | ( | unsigned char | Order | ) |
Order | the new bond order. |
bool gcu::Bond::SetProperty | ( | unsigned | property, | |
char const * | value | |||
) | [virtual] |
property | the identity of the property as defined in objprops.h. | |
value | the value of the property as a string. |
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
virtual void gcu::Bond::Transform2D | ( | Matrix2D & | m, | |
double | x, | |||
double | y | |||
) | [virtual] |
m | the 2D Matrix of the transformation. | |
x | the x component of the center of the transformation. | |
y | the y component of the center of the transformation. |
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
Atom* gcu::Bond::m_Begin [protected] |
A pointer to the first Atom instance of the Bond.
Definition at line 237 of file gcu/bond.h.
std::list<Cycle*> gcu::Bond::m_Cycles [protected] |
The gcu::Cycle instnces to which the bond pertains.
Definition at line 246 of file gcu/bond.h.
Referenced by IsCyclic().
Atom* gcu::Bond::m_End [protected] |
A pointer to the last Atom instance of the Bond.
Definition at line 241 of file gcu/bond.h.
unsigned char gcu::Bond::m_order [protected] |
The order of the bond.
Definition at line 233 of file gcu/bond.h.