#include <gcu/bond.h>
List of all members.
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 |
Detailed Description
This class is used to represent bonds.
Definition at line 42 of file gcu/bond.h.
Constructor & Destructor Documentation
The default constructor. Creates a bond with order set to 0.
Reimplemented in gcp::Bond, and gcr::Bond.
gcu::Bond::Bond |
( |
Atom * |
first, |
|
|
Atom * |
last, |
|
|
unsigned char |
order |
|
) |
| |
- Parameters:
-
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. |
The distinction between first and last is important mostly for stereobonds. The Bond instance is created and adds itself to the two atoms calling Atom::AddBond.
virtual gcu::Bond::~Bond |
( |
| ) |
[virtual] |
Member Function Documentation
virtual void gcu::Bond::AddCycle |
( |
Cycle * |
pCycle | ) |
[virtual] |
- Parameters:
-
pCycle | a cycle to add to the list. |
Reimplemented in gcp::Bond.
double gcu::Bond::Get2DLength |
( |
| ) |
|
- Returns:
- the length of the bond when projected to the xy plane.
double gcu::Bond::GetAngle2DRad |
( |
Atom * |
pAtom | ) |
|
- Parameters:
-
pAtom | one of the atoms of the bond. |
- Returns:
- the direction of the bond starting from the atom.
virtual Atom* gcu::Bond::GetAtom |
( |
Atom * |
pAtom, |
|
|
int |
which = 0 |
|
) |
| const [virtual] |
- Parameters:
-
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. |
- Returns:
- the last atom if pAtom is the first, the first if pAtom is the last or NULL if pAtom is not concerned by this Bond.
virtual Atom* gcu::Bond::GetAtom |
( |
int |
which | ) |
const [virtual] |
- Parameters:
-
which | the index of the Atom instance to be returned. |
- Returns:
- a pointer to the Atom instance: first Atom if which is 0, last if which is 1 or NULL.
Cycle* gcu::Bond::GetFirstCycle |
( |
std::list< Cycle * >::iterator & |
i, |
|
|
Cycle * |
pCycle |
|
) |
| |
- Parameters:
-
i | a C++ std::map iterator. |
pCycle | a cycle. |
- Returns:
- the first cycle to which the bond belongs, excluding the one passed as second argument.
Cycle* gcu::Bond::GetNextCycle |
( |
std::list< Cycle * >::iterator & |
i, |
|
|
Cycle * |
pCycle |
|
) |
| |
- Parameters:
-
- Returns:
- the next cycle to which the bond belongs, excluding the one passed as second argument.
unsigned char gcu::Bond::GetOrder |
( |
| ) |
const |
std::string gcu::Bond::GetProperty |
( |
unsigned |
property | ) |
const [virtual] |
- Parameters:
-
property | the identity of the property as defined in objprops.h. |
Used by the gcu::Loader mechanism to retrieve properties of bonds.
- Returns:
- the value of the property as a string.
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
virtual void gcu::Bond::IncOrder |
( |
int |
n = 1 | ) |
[virtual] |
- Parameters:
-
n | the increment to add to the bond order |
If the resulting bond order is greater than 4, the remainder of the division by 4 is retained.
Reimplemented in gcp::Bond.
unsigned gcu::Bond::IsCyclic |
( |
| ) |
[inline] |
- Returns:
- the number of cycles to which the bond belongs.
Definition at line 172 of file gcu/bond.h.
References m_Cycles.
bool gcu::Bond::IsInCycle |
( |
Cycle * |
pCycle | ) |
|
- Parameters:
-
pCycle | a cycle in which the bond might be. |
- Returns:
- true if the bond is in the cycle.
virtual bool gcu::Bond::Load |
( |
xmlNodePtr |
node | ) |
[virtual] |
- Parameters:
-
node | a pointer to the xmlNode containing the serialized Bond. |
Loads a bond from an xmlNode.
Reimplemented from gcu::Object.
Reimplemented in gcr::Bond.
virtual bool gcu::Bond::LoadNode |
( |
xmlNodePtr |
node | ) |
[virtual] |
- Parameters:
-
node | a pointer to the xmlNode containing the serialized Bond. |
This virtual method is called at the end of the Bond::Load method. The default behavior is to do nothing. It might be overrided for derived class when it is not convenient to override the Bond::Load method.
Reimplemented in gcp::Bond.
virtual void gcu::Bond::Move |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
z = 0. |
|
) |
| [virtual] |
- Parameters:
-
x | the x component of the transation vector. |
y | the y component of the transation vector. |
z | the z component of the transation vector. |
Does nothing. Just a slight optimization to avoid execution of Object::Move
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond, and gcr::Bond.
std::string gcu::Bond::Name |
( |
| ) |
[virtual] |
- Returns:
- the localized object generic name.
Reimplemented from gcu::Object.
void gcu::Bond::OnLoaded |
( |
| ) |
[virtual] |
This method should be called when a bond has been fully loaded.
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
virtual void gcu::Bond::RemoveAllCycles |
( |
| ) |
[virtual] |
Clears the bond cycles list.
Reimplemented in gcp::Bond.
virtual void gcu::Bond::RemoveCycle |
( |
Cycle * |
pCycle | ) |
[virtual] |
- Parameters:
-
pCycle | a cycle to remove from the list. |
Reimplemented in gcp::Bond.
bool gcu::Bond::ReplaceAtom |
( |
Atom * |
oldAtom, |
|
|
Atom * |
newAtom |
|
) |
| |
- Parameters:
-
oldAtom | the atom to replace. |
newAtom | the new atom. |
To sucess, this needs that the new atom can accept all the bonds from the old one.
- Returns:
- true on success.
virtual xmlNodePtr gcu::Bond::Save |
( |
xmlDocPtr |
xml | ) |
const [virtual] |
- Parameters:
-
xml | the xmlDoc used to save the document. |
- Returns:
- a pointer to the xmlNode representing this Bond or NULL if an error occured.
Reimplemented from gcu::Object.
virtual bool gcu::Bond::SaveNode |
( |
xmlDocPtr |
xml, |
|
|
xmlNodePtr |
node |
|
) |
| const [virtual] |
- Parameters:
-
xml | the xmlDoc used to save the document. |
node | a pointer to the xmlNode to which this Bond is serialized. |
This virtual method is called at the end of the Bond::Save method. The default behavior is to do nothing. It might be overrided for derived class when it is not convenient to override the Bond::Save method.
Reimplemented in gcp::Bond.
void gcu::Bond::SetOrder |
( |
unsigned char |
Order | ) |
|
- Parameters:
-
The value used is not checked. Should be a significant value (1 to 3, exceptionally 4).
bool gcu::Bond::SetProperty |
( |
unsigned |
property, |
|
|
char const * |
value |
|
) |
| [virtual] |
- Parameters:
-
property | the identity of the property as defined in objprops.h. |
value | the value of the property as a string. |
Used by the gcu::Loader mechanism to load properties of bonds.
- Returns:
- true on success.
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
virtual void gcu::Bond::Transform2D |
( |
Matrix2D & |
m, |
|
|
double |
x, |
|
|
double |
y |
|
) |
| [virtual] |
- Parameters:
-
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. |
Does nothing. Just a slight optimization to avoid execution of Object::Transform2D
Reimplemented from gcu::Object.
Reimplemented in gcp::Bond.
Member Data Documentation
The order of the bond.
Definition at line 234 of file gcu/bond.h.
The documentation for this class was generated from the following file: