#include <gcp/molecule.h>
Public Member Functions | |
Molecule (gcu::TypeId Type=gcu::MoleculeType) | |
virtual | ~Molecule () |
void | AddChild (gcu::Object *object) |
void | AddAtom (gcu::Atom *pAtom) |
void | AddBond (gcu::Bond *pBond) |
void | Add (GtkWidget *w) const |
void | Remove (gcu::Object *pObject) |
bool | Load (xmlNodePtr) |
xmlNodePtr | Save (xmlDocPtr xml) const |
void | SetSelected (GtkWidget *w, int state) |
void | Transform2D (gcu::Matrix2D &m, double x, double y) |
Object * | GetAtomAt (double x, double y, double z=0.) |
double | GetYAlign () |
bool | BuildContextualMenu (GtkUIManager *UIManager, gcu::Object *object, double x, double y) |
bool | OnSignal (gcu::SignalId Signal, gcu::Object *Child) |
void | OnLoaded () |
unsigned | GetAtomsNumber () const |
Definition at line 40 of file gcp/molecule.h.
gcp::Molecule::Molecule | ( | gcu::TypeId | Type = gcu::MoleculeType |
) |
Type | the type id of a derived class |
Reimplemented from gcu::Molecule.
virtual gcp::Molecule::~Molecule | ( | ) | [virtual] |
The destructor.
Reimplemented from gcu::Molecule.
void gcp::Molecule::AddChild | ( | gcu::Object * | object | ) | [virtual] |
object | an object, generally an atom or a bond. |
Reimplemented from gcu::Molecule.
void gcp::Molecule::AddAtom | ( | gcu::Atom * | pAtom | ) | [virtual] |
void gcp::Molecule::AddBond | ( | gcu::Bond * | pBond | ) | [virtual] |
void gcp::Molecule::Add | ( | GtkWidget * | w | ) | const [virtual] |
w | the GtkWidget inside which the Object will be displayed. |
Reimplemented from gcu::Object.
void gcp::Molecule::Remove | ( | gcu::Object * | pObject | ) | [virtual] |
pObject | an atom or a bond in the molecule. |
Reimplemented from gcu::Molecule.
bool gcp::Molecule::Load | ( | xmlNodePtr | node | ) | [virtual] |
node | a pointer to the xmlNode containing the serialized object. |
Example:
std::string str = (const char*)node->name; Object* pObject = Object::CreateObject(str, this); if (pObject) { if (!pObject->Load(node)) delete Object; } else cerr << "Warning: unknown object: " << str << endl;
Reimplemented from gcu::Object.
xmlNodePtr gcp::Molecule::Save | ( | xmlDocPtr | xml | ) | const [virtual] |
xml | the xmlDoc used to save the document. |
Reimplemented from gcu::Object.
void gcp::Molecule::SetSelected | ( | GtkWidget * | w, | |
int | state | |||
) | [virtual] |
w | the GtkWidget inside which the Object is displayed. | |
state | the selection state of the Object. |
Reimplemented from gcu::Object.
void gcp::Molecule::Transform2D | ( | gcu::Matrix2D & | m, | |
double | x, | |||
double | y | |||
) | [virtual] |
m | the Matrix2D of the transformation. | |
x | the x component of the center of the transformation. | |
y | the y component of the center of the transformation. |
Reimplemented from gcu::Object.
Object* gcp::Molecule::GetAtomAt | ( | double | x, | |
double | y, | |||
double | z = 0. | |||
) | [virtual] |
x | the x coordinate | |
y | the y coordinate | |
z | the z coordinate |
Reimplemented from gcu::Object.
double gcp::Molecule::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.
Reimplemented from gcu::Object.
bool gcp::Molecule::BuildContextualMenu | ( | GtkUIManager * | UIManager, | |
gcu::Object * | object, | |||
double | x, | |||
double | y | |||
) | [virtual] |
UIManager | the GtkUIManager 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. |
Reimplemented from gcu::Object.
bool gcp::Molecule::OnSignal | ( | gcu::SignalId | Signal, | |
gcu::Object * | Child | |||
) | [virtual] |
Signal | the appropriate SignalId | |
Child | the child which emitted the signal or NULL |
Reimplemented from gcu::Object.
void gcp::Molecule::OnLoaded | ( | ) | [virtual] |
This method should be called when an object has been fully loaded. The default method doesn't do anything.
Reimplemented from gcu::Object.
unsigned gcp::Molecule::GetAtomsNumber | ( | ) | const [virtual] |