gcp::Bond Class Reference

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 ObjectGetAtomAt (double x, double y, double z=0.)
BondType GetType ()
unsigned IsCyclic ()
virtual bool SaveNode (xmlDocPtr xml, xmlNodePtr)
virtual bool LoadNode (xmlNodePtr)
virtual void Update (GtkWidget *w)
virtual void Move (double x, double y, double z=0)
virtual void Transform2D (Matrix2D &m, double x, double y)
void IncOrder (int n=1)
virtual void SetSelected (GtkWidget *w, int state)
void Add (GtkWidget *w)
virtual double GetYAlign ()
bool BuildContextualMenu (GtkUIManager *UIManager, Object *object, double x, double y)

Protected Attributes

BondType m_type
double m_coords [16]
bool m_CoordsCalc
list< Cycle * > m_Cycles
map< Bond *,
BondCrossing
m_Crossing
int m_level


Detailed Description

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


Constructor & Destructor Documentation

gcp::Bond::Bond (  ) 

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

Reimplemented from gcu::Bond.

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

Reimplemented from gcu::Bond.

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

The destructor of Bond.

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 (  )  [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 62 of file gcp/bond.h.

References m_type.

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

Reimplemented from gcu::Bond.

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

virtual void gcp::Bond::Update ( GtkWidget *  w  )  [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 ( 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 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 from gcu::Bond.

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

Parameters:
w,: the GtkWidget inside which the Object is displayed.
state,: the selection state of the Object.
Used to set the selection state of the Object inside the widget. The values of state are application dependant and have no default value.

Reimplemented from gcu::Object.

void gcp::Bond::Add ( GtkWidget *  w  )  [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.

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

Used to retreive 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 
) [virtual]

Parameters:
UIManager,: the GtkUIanager to populate.
object,: the Object 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 object. It is called by Object::ShowContextualMenu, so it should not be necessary to call it directly. It should be overrided by derived classes when a contextual menu is needed. Typically, each class adds a submenu and calls the same method for its parent. Default implementation calls registered BuildMenuCb callbacks and the parent's method. Derived classes should call Object::BuildContextualMenu before returning.
Returns:
true if something is added to the UIManager, false otherwise.

Reimplemented from gcu::Object.


The documentation for this class was generated from the following file:
Generated on Sun Sep 16 14:21:56 2007 for The Gnome Chemistry Utils by  doxygen 1.5.3