Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

gcu::Bond Class Reference

#include <chemistry/bond.h>

Inheritance diagram for gcu::Bond:

gcu::Object List of all members.

Public Member Functions

 Bond ()
 Bond (Atom *first, Atom *last, unsigned char order)
virtual ~Bond ()
virtual AtomGetAtom (int which)
virtual AtomGetAtom (Atom *pAtom, int which=0)
unsigned char GetOrder ()
void SetOrder (unsigned char Order)
virtual xmlNodePtr Save (xmlDocPtr xml)
virtual bool Load (xmlNodePtr node)
virtual void IncOrder (int n=1)
virtual bool LoadNode (xmlNodePtr node)
virtual bool SaveNode (xmlDocPtr xml, xmlNodePtr node)

Protected Attributes

unsigned char m_order
Atomm_Begin
Atomm_End

Detailed Description

This class is used to represent bonds.

Definition at line 44 of file bond.h.


Constructor & Destructor Documentation

gcu::Bond::Bond  ) 
 

The default constructor. Creates a bond with order set to 0.

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]
 

The destructor of Bond.


Member Function Documentation

virtual Atom* gcu::Bond::GetAtom Atom pAtom,
int  which = 0
[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  )  [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.

unsigned char gcu::Bond::GetOrder  ) 
 

Returns:
the Bond order.

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.

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.

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.

virtual xmlNodePtr gcu::Bond::Save xmlDocPtr  xml  )  [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
[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.

void gcu::Bond::SetOrder unsigned char  Order  ) 
 

Parameters:
Order: the new bond order.
The value used is not checked. Should be a significant value (1 to 3, exceptionally 4).


Member Data Documentation

Atom* gcu::Bond::m_Begin [protected]
 

A pointer to the first Atom instance of the Bond.

Definition at line 130 of file bond.h.

Atom* gcu::Bond::m_End [protected]
 

A pointer to the last Atom instance of the Bond.

Definition at line 134 of file bond.h.

unsigned char gcu::Bond::m_order [protected]
 

The order of the bond.

Definition at line 126 of file bond.h.


The documentation for this class was generated from the following file:
Generated on Sat Feb 7 21:47:56 2004 for The Gnome Chemistry Utils by doxygen 1.3.3