#include <gcu/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 * | GetGroup () |
Document * | 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.) |
virtual void | Transform2D (Matrix2D &m, double x, double y) |
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 () |
virtual Object * | GetAtomAt (double x, double y, double z=0.) |
virtual bool | Build (list< Object * > &Children) throw (invalid_argument) |
virtual double | GetYAlign () |
void | GetPossibleAncestorTypes (set< TypeId > &types) |
Static Public Member Functions | |
TypeId | AddType (string TypeName, Object *(*CreateFunc)(), TypeId id=OtherType) |
Object * | CreateObject (const string &TypeName, Object *parent=NULL) |
TypeId | GetTypeId (const string &Name) |
string | GetTypeName (TypeId Id) |
void | AddRule (TypeId type1, RuleId rule, TypeId type2) |
void | AddRule (const string &type1, RuleId rule, const string &type2) |
const set< TypeId > & | GetRules (TypeId type, RuleId rule) |
const set< TypeId > & | GetRules (const string &type, RuleId rule) |
void | SetCreationLabel (TypeId Id, string Label) |
const string & | GetCreationLabel (TypeId Id) |
const string & | GetCreationLabel (const string &TypeName) |
Protected Member Functions | |
virtual void | BuildContextualMenu () |
Definition at line 118 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. |
|
|
|
|
|
|
|
|
|
|
|
|
|
Used to get the Document in the Object instances ancestors.
|
|
|
|
Used to get the highest ancestor just before 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 134 of file object.h. References gcu::TypeId. |
|
|
|
|
|
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.
|
|
|
|
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, gcu::Bond, and gcu::CrystalBond. |
|
Reimplemented in gcu::Atom, gcu::Bond, and gcu::CrystalBond. |
|
|
|
Reimplemented in gcu::Atom, gcu::Bond, and gcu::CrystalBond. |
|
|
|
|
|
|
|
|
|
Parent->AddChild(this);
|
|
|
|
|
|
|
|
|