gcp::Bond Class Reference

#include <gcp/bond.h>

Inheritance diagram for gcp::Bond:

gcu::Bond gcu::Object

List of all members.

Public Member Functions

 Bond ()
 Bond (Atom *first, Atom *last, unsigned char order)
virtual ~Bond ()
virtual Object * GetAtomAt (double x, double y, double z=0.)
BondType GetType () const
void AddCycle (gcu::Cycle *pCycle)
void RemoveCycle (gcu::Cycle *pCycle)
void RemoveAllCycles ()
virtual bool SaveNode (xmlDocPtr xml, xmlNodePtr) const
virtual bool LoadNode (xmlNodePtr node)
virtual void Update (GtkWidget *w) const
virtual void Move (double x, double y, double z=0)
virtual void Transform2D (gcu::Matrix2D &m, double x, double y)
void IncOrder (int n=1)
void SetSelected (GtkWidget *w, int state)
void Add (GtkWidget *w) const
double GetYAlign ()
bool BuildContextualMenu (GtkUIManager *UIManager, Object *object, double x, double y)
bool SetProperty (unsigned property, char const *value)


Detailed Description

This class is used to represent bonds.

Definition at line 73 of file gcp/bond.h.


Constructor & Destructor Documentation

gcp::Bond::Bond (  ) 

The default constructor.

Reimplemented from gcu::Bond.

gcp::Bond::Bond ( Atom first,
Atom last,
unsigned char  order 
)

Parameters:
first the first bonded atom.
last the last bonded atom.
order the bond order
Constructs a bond given its two terminal atoms and its order.

virtual gcp::Bond::~Bond (  )  [virtual]

The destructor.

Reimplemented from gcu::Bond.


Member Function Documentation

virtual Object* gcp::Bond::GetAtomAt ( double  x,
double  y,
double  z = 0. 
) [virtual]

Parameters:
x the x coordinate
y the y coordinate
z the z coordinate
Returns:
a pointer to a child of type Atomtype at or near position defined by the coordinates passed as parameters. Default implementation returns NULL.

Reimplemented from gcu::Object.

BondType gcp::Bond::GetType (  )  const [inline]

Returns:
the type of the object. If the type is at least equal to OtherType, it is a dynamically created type returned by the Object::AddType method.

Reimplemented from gcu::Object.

Definition at line 94 of file gcp/bond.h.

void gcp::Bond::AddCycle ( gcu::Cycle pCycle  )  [virtual]

Parameters:
pCycle a cycle to add to the list.

Reimplemented from gcu::Bond.

void gcp::Bond::RemoveCycle ( gcu::Cycle pCycle  )  [virtual]

Parameters:
pCycle a cycle to remove from the list.

Reimplemented from gcu::Bond.

void gcp::Bond::RemoveAllCycles (  )  [virtual]

Clears the bond cycles list.

Reimplemented from gcu::Bond.

virtual bool gcp::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 from gcu::Bond.

virtual bool gcp::Bond::LoadNode ( xmlNodePtr  node  )  [virtual]

Parameters:
node a pointer to the xmlNode containing the serialized Bond.
Loads properties specific to GChemPaint bonds.

Reimplemented from gcu::Bond.

virtual void gcp::Bond::Update ( GtkWidget *  w  )  const [virtual]

Parameters:
w the GtkWidget inside which the Object is displayed.
Used to update the representation of the Object in the widget. This method might be overrided for displayable Object classes unless the application uses another mechanism.

Reimplemented from gcu::Object.

virtual void gcp::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::Bond.

virtual void gcp::Bond::Transform2D ( gcu::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::Bond.

void gcp::Bond::IncOrder ( int  n = 1  )  [virtual]

Parameters:
n the bond order increment. If not given, the default is 1.
Tries to increment the bond order by n units. If something goes wrong, the bond order is set to 1.

Reimplemented from gcu::Bond.

void gcp::Bond::SetSelected ( GtkWidget *  w,
int  state 
) [virtual]

Parameters:
w the GtkWidget inside which the bond is displayed.
state the selection state of the bond.
Used to set the selection state of the bond inside the widget. The values of state might be gcp::SelStateUnselected, gcp::SelStateSelected, gcp::SelStateUpdating, or gcp::SelStateErasing.

Reimplemented from gcu::Object.

void gcp::Bond::Add ( GtkWidget *  w  )  const [virtual]

Parameters:
w the GtkWidget inside which the Object will be displayed.
Used to add a representation of the Object in the widget. This method might be overrided for displayable Object classes unless the application uses another mechanism.

Reimplemented from gcu::Object.

double gcp::Bond::GetYAlign (  )  [virtual]

Used to retrieve the y coordinate for alignment. The default implementation returns 0.0 and every derived class for which alignment has a meaning should implement this method.

Returns:
y coordinate used for objects alignment.

Reimplemented from gcu::Object.

bool gcp::Bond::BuildContextualMenu ( GtkUIManager *  UIManager,
Object *  object,
double  x,
double  y 
)

Parameters:
UIManager,: the GtkUIManager to populate.
object the atom on which occured the mouse click.
x x coordinate of the mouse click.
y y coordinate of the mouse click.
This method is called to build a contextual menu for the atom.

bool gcp::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::Bond.


The documentation for this class was generated from the following file:

Generated on Mon Aug 25 17:46:35 2008 for The Gnome Chemistry Utils by  doxygen 1.5.6