#include <chemistry/object.h>
Inheritance diagram for gcu::Object:
Public Member Functions | |
Object (TypeId Id=OtherType) | |
virtual | ~Object () |
TypeId | GetType () |
void | SetId (gchar *Id) |
const gchar * | GetId () |
void | AddChild (Object *object) |
Object * | GetMolecule () |
Object * | GetReaction () |
Object * | GetDocument () |
Object * | GetParentOfType (TypeId Id) |
Object * | GetChild (const gchar *Id) |
Object * | GetFirstChild (map< string, Object * >::iterator &i) |
Object * | GetNextChild (map< string, Object * >::iterator &i) |
Object * | GetDescendant (const gchar *Id) |
Object * | GetParent () |
void | SetParent (Object *Parent) |
virtual xmlNodePtr | Save (xmlDocPtr xml) |
virtual bool | Load (xmlNodePtr node) |
virtual void | Move (double x, double y, double z=0.) |
bool | SaveChildren (xmlDocPtr xml, xmlNodePtr node) |
void | SaveId (xmlNodePtr node) |
xmlNodePtr | GetNodeByProp (xmlNodePtr node, char *Property, char *Id) |
xmlNodePtr | GetNextNodeByProp (xmlNodePtr node, char *Property, char *Id) |
xmlNodePtr | GetNodeByName (xmlNodePtr node, char *Name) |
xmlNodePtr | GetNextNodeByName (xmlNodePtr node, char *Name) |
void | ShowContextualMenu (unsigned button, unsigned time) |
virtual void | Add (GtkWidget *w) |
virtual void | Print (GnomePrintContext *pc) |
virtual void | Update (GtkWidget *w) |
virtual void | SetSelected (GtkWidget *w, int state) |
bool | HasChildren () |
void | EmptyTranslationTable () |
virtual Object * | GetAtomAt (double x, double y, double z=0.) |
Static Public Member Functions | |
unsigned | AddType (string TypeName, Object *(*CreateFunc)(), TypeId id=OtherType) |
Object * | CreateObject (string &TypeName, Object *parent=NULL) |
Protected Member Functions | |
virtual void | BuildContextualMenu () |
Definition at line 89 of file object.h.
|
Used to create an object of type Id. Shold only be called from the constructor of a derived class. |
|
The standard destructor of Object instances. Automatically called when the object is destroyed. |
|
|
|
|
|
|
|
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. |
|
|
|
When pasting, objects added to the document might have the same Id as objects already existing. In such cases, the document maintains a table to update links using Ids as identifiers. The EmptyTranslationTable method should be called then to reinitialize the table to avoid errors on the next paste event. |
|
|
|
|
|
|
|
Used to get the Document in the Object instances ancestors.
|
|
|
|
|
|
Used to get the Molecule in the Object instances ancestors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Used to get the Reaction in the Object instances ancestors.
|
|
Definition at line 105 of file object.h. References gcu::TypeId. |
|
|
|
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 in gcu::Atom. |
|
|
|
|
|
|
|
|
|
|
|
Parent->AddChild(this);
|
|
|
|
|
|
|