gcp::Atom Class Reference

Inheritance diagram for gcp::Atom:

gcu::Atom gcu::DialogOwner gcu::Object List of all members.

Public Member Functions

 Atom ()
 Atom (int Z, double x, double y, double z)
virtual ~Atom ()
virtual void SetZ (int Z)
void AddBond (gcu::Bond *pBond)
void RemoveBond (gcu::Bond *pBond)
virtual void Add (GtkWidget *w)
virtual void Update (GtkWidget *w)
int GetAttachedHydrogens ()
virtual xmlNodePtr Save (xmlDocPtr xml)
virtual bool Load (xmlNodePtr)
virtual bool LoadNode (xmlNodePtr)
virtual void SetSelected (GtkWidget *w, int state)
virtual double GetYAlign ()
virtual void Transform2D (Matrix2D &m, double x, double y)
bool BuildContextualMenu (GtkUIManager *UIManager, Object *object, double x, double y)
virtual void AddToMolecule (Molecule *Mol)
void AddElectron (Electron *electron)
void RemoveElectron (Electron *electron)
int GetCharge ()
void ForceChanged ()

Detailed Description

Definition at line 78 of file gcp/atom.h.


Constructor & Destructor Documentation

gcp::Atom::Atom (  ) 

The default constructor. Creates an atom with atomic number set to 0.

Reimplemented from gcu::Atom.

gcp::Atom::Atom ( int  Z,
double  x,
double  y,
double  z 
)

Parameters:
Z,: the atomic number of the new atom.
x,: the x coordinate of the new atom.
y,: the y coordinate of the new atom.
z,: the z coordinate of the new atom.
Creates an atom.

Reimplemented from gcu::Atom.

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

The destructor of Atom. It removes bonds but do not delete the associated Bond instances.

Reimplemented from gcu::Atom.


Member Function Documentation

virtual void gcp::Atom::SetZ ( int  Z  )  [virtual]

Parameters:
Z,: the new atomic number of the Atom.
This method might be overrided by derived class since changing the atomic number generally changes most properties. The default behavior is just to change the atomic number and nothing else.

Reimplemented from gcu::Atom.

void gcp::Atom::AddBond ( gcu::Bond pBond  )  [virtual]

Parameters:
pBond,: a pointer to the new Bond to this Atom.
Adds a Bond.

Reimplemented from gcu::Atom.

void gcp::Atom::RemoveBond ( gcu::Bond pBond  )  [virtual]

Parameters:
pBond,: a pointer to the Bond to remove from this Atom.
Removes a Bond.

Reimplemented from gcu::Atom.

virtual void gcp::Atom::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 void gcp::Atom::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 xmlNodePtr gcp::Atom::Save ( xmlDocPtr  xml  )  [virtual]

Parameters:
xml,: the xmlDoc used to save the document.
Returns:
a pointer to the xmlNode representing this Atom or NULL if an error occured.

Reimplemented from gcu::Atom.

virtual bool gcp::Atom::Load ( xmlNodePtr  node  )  [virtual]

Parameters:
node,: a pointer to the xmlNode containing the serialized Atom.
Loads an atom from an xmlNode.

Reimplemented from gcu::Atom.

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

Parameters:
node,: a pointer to the xmlNode containing the serialized Atom.
This virtual method is called at the end of the Atom::Load method. The default behavior is to do nothing. It might be overrided for derived class when it is not convenient to override the Atom::Load method.

Reimplemented from gcu::Atom.

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

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

virtual void gcp::Atom::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.
Used to move and/or transform an atom.

Reimplemented from gcu::Atom.

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

virtual void gcp::Atom::AddToMolecule ( Molecule Mol  )  [virtual]

Parameters:
Mol,: a pointer to a molecule
Adds the atom to the molecule calling gcpMolecule::AddAtom()

void gcp::Atom::AddElectron ( Electron electron  ) 

Parameters:
Electron,: a pointer to an Electron instance.
Adds the Electron (representing either a single electron or a pair) to the Atom.

void gcp::Atom::RemoveElectron ( Electron electron  ) 

Parameters:
Electron,: a pointer to an Electron instance.
Removes the Electron (representing either a single electron or a pair) from the Atom.

int gcp::Atom::GetCharge (  )  [inline]

Returns:
the formal charge of this Atom.

Reimplemented from gcu::Atom.

Definition at line 133 of file gcp/atom.h.

References gcu::Atom::m_Charge.


The documentation for this class was generated from the following file:
Generated on Thu Jun 28 09:02:02 2007 for The Gnome Chemistry Utils by  doxygen 1.5.2