The Gnome Chemistry Utils 0.13.3
Public Member Functions | Static Public Member Functions | Protected Member Functions
gcu::Object Class Reference

#include <gcu/object.h>

Inheritance diagram for gcu::Object:
gcp::Arrow gcp::DocPropDlg gcp::Electron gcp::MechanismArrow gcp::MechanismStep gcp::Mesomery gcp::NewFileDlg gcp::PrefsDlg gcp::Reactant gcp::Reaction gcp::ReactionOperator gcp::ReactionProp gcp::TextObject gcu::Atom gcu::Bond gcu::Chain gcu::Document gcu::Molecule

List of all members.

Public Member Functions

 Object (TypeId Id=OtherType)
virtual ~Object ()
TypeId GetType () const
void SetId (gchar const *Id)
char const * GetId () const
virtual void AddChild (Object *object)
ObjectGetMolecule () const
ObjectGetReaction () const
ObjectGetGroup () const
DocumentGetDocument () const
ApplicationGetApplication () const
ObjectGetParentOfType (TypeId Id) const
ObjectGetChild (const gchar *Id) const
ObjectGetFirstChild (std::map< std::string, Object * >::iterator &i)
ObjectGetNextChild (std::map< std::string, Object * >::iterator &i)
ObjectGetDescendant (const char *Id) const
ObjectGetParent () const
void SetParent (Object *Parent)
virtual xmlNodePtr Save (xmlDocPtr xml) const
virtual bool Load (xmlNodePtr node)
virtual bool GetCoords (double *x, double *y, double *z=NULL) const
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) const
void SaveId (xmlNodePtr node) const
xmlNodePtr GetNodeByProp (xmlNodePtr node, char const *Property, char const *Id)
xmlNodePtr GetNextNodeByProp (xmlNodePtr node, char const *Property, char const *Id)
xmlNodePtr GetNodeByName (xmlNodePtr node, char const *Name)
xmlNodePtr GetNextNodeByName (xmlNodePtr node, char const *Name)
bool HasChildren () const
unsigned GetChildrenNumber () const
virtual ObjectGetAtomAt (double x, double y, double z=0.)
virtual bool Build (std::set< Object * > const &Children) throw (std::invalid_argument)
virtual double GetYAlign ()
virtual bool BuildContextualMenu (UIManager *uim, Object *object, double x, double y)
void EmitSignal (SignalId Signal)
virtual bool OnSignal (SignalId Signal, Object *Child)
void Lock (bool state=true)
bool IsLocked ()
ObjectGetFirstLink (std::set< Object * >::iterator &i)
ObjectGetNextLink (std::set< Object * >::iterator &i)
void Link (Object *object)
void Unlink (Object *object)
virtual void OnUnlink (Object *object)
void GetPossibleAncestorTypes (std::set< TypeId > &types) const
virtual bool SetProperty (unsigned property, char const *value)
virtual std::string GetProperty (unsigned property) const
virtual void OnLoaded ()
void SetDirty (bool dirty=true)
virtual void Clear ()
virtual std::string Name ()
std::string Identity ()
virtual char const * HasPropertiesDialog () const
virtual bool CanSelect () const
virtual void NotifyEmpty ()
void ShowPropertiesDialog ()
bool GetDirty (void) const

Static Public Member Functions

static TypeId AddType (std::string TypeName, Object *(*CreateFunc)(), TypeId id=OtherType)
static void AddAlias (TypeId id, std::string TypeName)
static ObjectCreateObject (const std::string &TypeName, Object *parent=NULL)
static TypeId GetTypeId (const std::string &Name)
static std::string GetTypeName (TypeId Id)
static void AddMenuCallback (TypeId Id, BuildMenuCb cb)
static void AddRule (TypeId type1, RuleId rule, TypeId type2)
static void AddRule (const std::string &type1, RuleId rule, const std::string &type2)
static const std::set< TypeId > & GetRules (TypeId type, RuleId rule)
static const std::set< TypeId > & GetRules (const std::string &type, RuleId rule)
static void SetCreationLabel (TypeId Id, std::string Label)
static const std::string & GetCreationLabel (TypeId Id)
static const std::string & GetCreationLabel (const std::string &TypeName)
static SignalId CreateNewSignalId ()

Protected Member Functions

virtual DialogBuildPropertiesDialog ()

Detailed Description

This is the base class for most other objects in the gcu namespace.

Definition at line 158 of file object.h.


Constructor & Destructor Documentation

gcu::Object::Object ( TypeId  Id = OtherType)

Used to create an object of type Id. Should only be called from the constructor of a derived class.

virtual gcu::Object::~Object ( ) [virtual]

The standard destructor of Object instances. Automatically called when the object is destroyed.


Member Function Documentation

static void gcu::Object::AddAlias ( TypeId  id,
std::string  TypeName 
) [static]
Parameters:
idthe Id of an existing type.
TypeNamea new name for the type.

This method is used to add an alternative name to an existing type.

virtual void gcu::Object::AddChild ( Object object) [virtual]
Parameters:
objectthe Object instance to add as a child.

Each Object instance maintains a list of its children. If object has already a parent, it will be removed from its parent children list. The new parent Object must have a Document ancestor to ensure that Ids are unique.

Reimplemented in gcu::Molecule, and gcp::Molecule.

static void gcu::Object::AddMenuCallback ( TypeId  Id,
BuildMenuCb  cb 
) [static]
Parameters:
Idthe TypeId of the Object derived class
cbthe BuildMenuCb callback to call when building the menu.

adds a callback for modifying the contextual menu of objects of type Id.

This method is deprecated, use Application::AddMenuCallback() instead.

static void gcu::Object::AddRule ( const std::string &  type1,
RuleId  rule,
const std::string &  type2 
) [static]
Parameters:
type1the name of the first class in the rule
rulethe new rule value
type2the name of the second class in the rule

This method is deprecated, use Application::AddRule() instead.

Adds a rule.

static void gcu::Object::AddRule ( TypeId  type1,
RuleId  rule,
TypeId  type2 
) [static]
Parameters:
type1the TypeId of the first class in the rule
rulethe new rule value
type2the TypeId of the second class in the rule

This method is deprecated, use Application::AddRule() instead.

Adds a rule.

static TypeId gcu::Object::AddType ( std::string  TypeName,
Object *(*)()  CreateFunc,
TypeId  id = OtherType 
) [static]
Parameters:
TypeNamethe name of the new type.
CreateFunca pointer to a function returning a pointer to a new object of the new type.
idthe Id of the type to create if a standard one or OtherType for a new type. In this last case, this parameter can be omitted.

This method is used to register a new type derived from Object.

This method is deprecated, use Application::AddType() instead.

Returns:
the Id of the new type.
virtual bool gcu::Object::Build ( std::set< Object * > const &  Children) throw (std::invalid_argument) [virtual]
Parameters:
Childrenthe list of objects used as children to build the object

This method is called to build a parent object from its children. The object must already exist.

Returns:
true in case of success and false if failed.
virtual bool gcu::Object::BuildContextualMenu ( UIManager *  uim,
Object object,
double  x,
double  y 
) [virtual]
Parameters:
uimthe UIManager to populate.
objectthe Object on which occured the mouse click.
xx coordinate of the mouse click.
yy 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 overriden 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 in gcp::Mesomery, gcp::Molecule, gcp::Reactant, gcp::ReactionArrow, and gcp::Reaction.

virtual Dialog* gcu::Object::BuildPropertiesDialog ( ) [protected, virtual]
Returns:
the gcu::Dialog related to the object properties or NULL if none exists.
virtual bool gcu::Object::CanSelect ( ) const [inline, virtual]
Returns:
true if the object can be safely selected. Default implementation returns true.

Reimplemented in gcp::MechanismArrow.

Definition at line 576 of file object.h.

virtual void gcu::Object::Clear ( ) [virtual]

Deletes all children. Derived classes might override this method if needed.

Reimplemented in gcu::Chem3dDoc, gcu::Molecule, gcp::Document, and gcp::Molecule.

static SignalId gcu::Object::CreateNewSignalId ( ) [static]
Returns:
a new SignalId.
static Object* gcu::Object::CreateObject ( const std::string &  TypeName,
Object parent = NULL 
) [static]
Parameters:
TypeNamethe name of the new type.
parentthe parent of the newly created object or NULL. if NULL, the parameter can be omitted.

Used to create an object of type name TypeName. The Object::AddType method must have been called with the same TypeName parameter. if parent is given and not NULL, the new Object will be a child of parent. It will also be given a default Id.

This method is deprecated, use Application::CreateObject() instead.

Returns:
a pointer to the newly created Object or NULL if the Object could not be created.
void gcu::Object::EmitSignal ( SignalId  Signal)
Parameters:
Signalthe appropriate SignalId

Sends a signal to the object parent. The signal may be propagated to the ancestors (see Object::OnSignal ()).

Application* gcu::Object::GetApplication ( ) const

Used to get the Application owning the Object.

Returns:
the Application owning the Object or NULL.
virtual Object* gcu::Object::GetAtomAt ( double  x,
double  y,
double  z = 0. 
) [virtual]
Parameters:
xthe x coordinate
ythe y coordinate
zthe 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 in gcp::Bond, gcp::Fragment, and gcp::Molecule.

Object* gcu::Object::GetChild ( const gchar *  Id) const
Parameters:
Idthe Id of the child searched.

To search the Object in lower shells of the tree, use the Object::GetDescendant method.

Returns:
the Object instance of type Id if found in the children list or NULL if not found.
unsigned gcu::Object::GetChildrenNumber ( ) const [inline]
Returns:
the children number of the Object.

Definition at line 398 of file object.h.

virtual bool gcu::Object::GetCoords ( double *  x,
double *  y,
double *  z = NULL 
) const [virtual]
Parameters:
xa pointer to the double value which will receive the x coordinate of the Object.
ya pointer to the double value which will receive the y coordinate of the Object.
za pointer to the double value which will receive the z coordinate of the Object or NULL for 2D representations.

Retrieves the coordinates of this Object if relevant.

Returns:
true if successful and false if an error occurs (if x or y is NULL).

Reimplemented in gcu::Atom, gcp::Arrow, gcp::Fragment, gcp::ReactionOperator, and gcp::Text.

static const std::string& gcu::Object::GetCreationLabel ( TypeId  Id) [static]
Parameters:
Idthe TypeId of a class

This method is deprecated, use Application::GetCreationLabel() instead.

Returns:
the string defined by SetCreationLabel.
static const std::string& gcu::Object::GetCreationLabel ( const std::string &  TypeName) [static]
Parameters:
TypeNamethe name of a class

This method is deprecated, use Application::GetCreationLabel() instead.

Returns:
the string defined by SetCreationLabel.
Object* gcu::Object::GetDescendant ( const char *  Id) const
Parameters:
Idthe Id of the descendant searched.

This method searches the Object in its children and if not found calls the GetDescendant method for its children.

Returns:
the Object instance of type Id if found in the decendants or NULL if not found.
gcu::Object::GetDirty ( void  ) const [inline]
Returns:
true if the document has changed since it was opened or last saved, false otherwise.

Definition at line 752 of file object.h.

Document* gcu::Object::GetDocument ( ) const

Used to get the Document in the Object instances ancestors.

Returns:
the first Object of type DocumentType encountered when exploring the Objects tree (only one should be found) or NULL if none is found.
Object* gcu::Object::GetFirstChild ( std::map< std::string, Object * >::iterator &  i)
Parameters:
ia C++ std::map iterator.

Use this function to retrieve the first child of the object and initialize the iterator.

Returns:
the first child of the object or NULL.
Object* gcu::Object::GetFirstLink ( std::set< Object * >::iterator &  i)
Parameters:
ia C++ std::set<Object*> iterator.

Use this function to retrieve the first object linked to the object and initialize the iterator. Links can be used when the relation between the objects is not a parent to child one.

Returns:
the first object linked to the object or NULL.
Object* gcu::Object::GetGroup ( ) const

Used to get the highest ancestor just before the document in the Object instances ancestors.

Returns:
the last Object encountered before the document when exploring the Objects tree or NULL if the object's parent is the document itself.
char const* gcu::Object::GetId ( ) const [inline]
Returns:
the Id of the Object instance.

Definition at line 185 of file object.h.

Referenced by gcp::Molecule::GetAlignmentId().

Object* gcu::Object::GetMolecule ( ) const

Used to get the Molecule in the Object instances ancestors. Overloaded methods should call the base class Object::AddChild.

Returns:
the first Object of type MoleculeType encountered when exploring the Objects tree or NULL if none is found.
Object* gcu::Object::GetNextChild ( std::map< std::string, Object * >::iterator &  i)
Parameters:
ia C++ std::map iterator initialized by Object::GetFirstChild.

Use this method to iterate through the list of the Object children.

Returns:
the next child of the object or NULL.
Object* gcu::Object::GetNextLink ( std::set< Object * >::iterator &  i)
Parameters:
ia C++ std::set<Object*> iterator initialized by Object::GetFirstLink.

Use this method to iterate through the list of Object instances linked to the object.

Returns:
the next object linked to the object or NULL.
xmlNodePtr gcu::Object::GetNextNodeByName ( xmlNodePtr  node,
char const *  Name 
)
Parameters:
nodethe xmlNodePtr returned by Object::GetNodeByName or the last call to Object::GetNextNodeByName.
Namethe name of the xmlNode searched.

Helper method used to iterate through a list of xmlNodePtr searching for nodes whose name is Name. Generally, the iteration is initialized by a call to Object::GetNodeByName.

Returns:
the next matching node.
xmlNodePtr gcu::Object::GetNextNodeByProp ( xmlNodePtr  node,
char const *  Property,
char const *  Id 
)
Parameters:
nodethe xmlNodePtr returned by Object::GetNodeByProp or the last call to Object::GetNextNodeByProp.
Propertythe name of the property used in the search.
Idthe value to match to the property.

Helper method used to iterate through a list of xmlNodePtr searching for a special value of a property. Generally, the iteration is initialized by a call to Object::GetNodeByProp.

Returns:
the next matching node.
xmlNodePtr gcu::Object::GetNodeByName ( xmlNodePtr  node,
char const *  Name 
)
Parameters:
nodethe node where the search is to be done.
Namethe name of the xmlNode searched.

Helper method used in conjunction with Object::GetNextNodeByProp to search xmlNode instances of name Name in the children of node.

Returns:
the node corresponding to the first match. This value is to be passed to Object::GetNextNodeByName to iterate in the list.
xmlNodePtr gcu::Object::GetNodeByProp ( xmlNodePtr  node,
char const *  Property,
char const *  Id 
)
Parameters:
nodethe node where the search is to be done.
Propertythe name of the property used in the search.
Idthe value to match to the property.

Helper method used in conjunction with Object::GetNextNodeByProp to search xmlNode instances having a property Property whose value is Id in the children of node.

Returns:
the node corresponding to the first match. This value is to be passed to Object::GetNextNodeByProp to iterate in the list
Object* gcu::Object::GetParent ( ) const [inline]
Returns:
the parent of the Object.

Definition at line 272 of file object.h.

Object* gcu::Object::GetParentOfType ( TypeId  Id) const
Parameters:
Idthe type of the ancestor searched.

Used to get the first ancestor of type Id in the Object instances ancestors. GetDocument, GetMolecule and GetReaction are special cases of this method.

Returns:
the first Object of type Id encountered when exploring the Objects tree (only one should be found) or NULL if none is found.
void gcu::Object::GetPossibleAncestorTypes ( std::set< TypeId > &  types) const
Parameters:
typesthe list of TypeId values to fill

Fills types with all valid ancestor types for the object as defined by rules created with AddRule

virtual std::string gcu::Object::GetProperty ( unsigned  property) const [virtual]
Parameters:
propertythe property id as defined in objprops.h

Used when saving to get properties from various objects. All classes supporting the mechanism must overload this method.

Reimplemented in gcu::Atom, gcu::Bond, gcp::Bond, gcp::Document, gcp::TextObject, gcr::Atom, and gcr::Document.

Object* gcu::Object::GetReaction ( ) const

Used to get the Reaction in the Object instances ancestors.

Returns:
the first Object of type ReactionType encountered when exploring the Objects tree or NULL if none is found.
static const std::set<TypeId>& gcu::Object::GetRules ( const std::string &  type,
RuleId  rule 
) [static]
Parameters:
typethe name of a class
rulea RuleId value

This method is deprecated, use Application::GetRules() instead.

Returns:
the set of rules correponding to the RuleId value for this class.
static const std::set<TypeId>& gcu::Object::GetRules ( TypeId  type,
RuleId  rule 
) [static]
Parameters:
typethe TypeId of a class
rulea RuleId value

This method is deprecated, use Application::GetRules() instead.

Returns:
the set of rules correponding to the RuleId value for this class.
TypeId gcu::Object::GetType ( void  ) const [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 in gcp::Bond.

Definition at line 175 of file object.h.

static TypeId gcu::Object::GetTypeId ( const std::string &  Name) [static]
Parameters:
Namethe name of the Object derived class
Returns:
the TypeId corresponding to Name
static std::string gcu::Object::GetTypeName ( TypeId  Id) [static]
Parameters:
Idthe TypeId of the Object derived class
Returns:
the name of the type.
virtual double gcu::Object::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.

Returns:
y coordinate used for objects alignment.

Reimplemented in gcp::Arrow, gcp::Atom, gcp::Bond, gcp::Document, gcp::Fragment, gcp::MechanismStep, gcp::Mesomer, gcp::Mesomery, gcp::Molecule, gcp::Reactant, gcp::ReactionOperator, gcp::ReactionStep, gcp::Reaction, and gcp::Text.

bool gcu::Object::HasChildren ( ) const [inline]
Returns:
true if the Object has at least a child an false if it has none.

Definition at line 393 of file object.h.

virtual char const* gcu::Object::HasPropertiesDialog ( ) const [virtual]
Returns:
the name of the properties dialog for this object if one exists, or NULL.
std::string gcu::Object::Identity ( )
Returns:
the object identity composed of the object name as returned by gcu::Object::Name() concatenated with its unique Id as returned by gcu::Object::GetId().
bool gcu::Object::IsLocked ( ) [inline]
Returns:
true if signals are locked, false otherwise

Since 0.4.2

Reimplemented in gcp::TextObject.

Definition at line 474 of file object.h.

void gcu::Object::Link ( Object object)
Parameters:
objectthe object to link.

Adds a link to object.

virtual bool gcu::Object::Load ( xmlNodePtr  node) [virtual]
Parameters:
nodea pointer to the xmlNode containing the serialized object.

Used to load an Object in memory. The Object must already exist.

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;
Returns:
true on succes, false otherwise.

Reimplemented in gcu::Atom, gcu::Bond, gcp::Arrow, gcp::Atom, gcp::Document, gcp::Electron, gcp::FragmentAtom, gcp::FragmentResidue, gcp::Fragment, gcp::MechanismArrow, gcp::MechanismStep, gcp::Mesomer, gcp::MesomeryArrow, gcp::Mesomery, gcp::Molecule, gcp::Reactant, gcp::ReactionArrow, gcp::ReactionProp, gcp::ReactionStep, gcp::Reaction, gcp::TextObject, gcp::Text, and gcr::Bond.

void gcu::Object::Lock ( bool  state = true)
Parameters:
statewhether to block signals or not

Blocks signals if State is true and unblocs if state is false.

Since 0.4.2

virtual void gcu::Object::Move ( double  x,
double  y,
double  z = 0. 
) [virtual]
Parameters:
xthe x component of the transation vector.
ythe y component of the transation vector.
zthe z component of the transation vector.

Used to move an object. This virtual method should most often be overrided by Object derived classes for which it makes sense. The base Object class has no coordinates and the default method only loads its id and children.

Reimplemented in gcu::Atom, gcu::Bond, gcp::Arrow, gcp::Atom, gcp::Bond, gcp::Fragment, gcp::ReactionArrow, gcp::ReactionOperator, gcp::TextObject, and gcr::Bond.

virtual std::string gcu::Object::Name ( ) [virtual]
virtual void gcu::Object::NotifyEmpty ( ) [inline, virtual]

Called by Object::Destructor() when the parent becomes empty. Default implementation does nothing.

Reimplemented in gcp::MechanismStep.

Definition at line 582 of file object.h.

virtual void gcu::Object::OnLoaded ( ) [virtual]

This method should be called when an object has been fully loaded. The default method doesn't do anything.

Reimplemented in gcu::Bond, gcp::Bond, gcp::MechanismArrow, gcp::Molecule, gcp::ReactionArrow, and gcp::ReactionStep.

virtual bool gcu::Object::OnSignal ( SignalId  Signal,
Object Child 
) [virtual]
Parameters:
Signalthe appropriate SignalId
Childthe child which emitted the signal or NULL

This function is called by the framework when a signal has been emitted for the object. It should not be called by a program; call Object::EmitSignal instead.

Returns:
true if the signal should be propagated to the parent, false otherwise.

Reimplemented in gcp::Document, gcp::Electron, gcp::MechanismStep, gcp::Mesomer, gcp::Mesomery, gcp::Molecule, gcp::Reactant, gcp::ReactionArrow, gcp::ReactionProp, gcp::ReactionStep, and gcp::Reaction.

virtual void gcu::Object::OnUnlink ( Object object) [virtual]
Parameters:
objectthe object just unlinked by Object::Unlink.

Virtual method called when an object has been unlinked. Programs should not call it directly, but should call Object::OnUnlink instead.

virtual xmlNodePtr gcu::Object::Save ( xmlDocPtr  xml) const [virtual]
Parameters:
xmlthe xmlDoc used to save the document.

Used to save the Object to the xmlDoc. Each serializable Object should implement this virtual method.

Returns:
the xmlNode containing the serialized object. The name of the node should be the name of the corresponding type used as first parameter to the Object::AddType method. The default method just saves the id and children.

Reimplemented in gcu::Atom, gcu::Bond, gcp::Atom, gcp::Electron, gcp::FragmentAtom, gcp::FragmentResidue, gcp::Fragment, gcp::MechanismArrow, gcp::MechanismStep, gcp::MesomeryArrow, gcp::Molecule, gcp::Reactant, gcp::ReactionArrow, gcp::ReactionStep, and gcp::Text.

bool gcu::Object::SaveChildren ( xmlDocPtr  xml,
xmlNodePtr  node 
) const
Parameters:
xmlthe xmlDoc used to save the document.
nodethe node representing the Object.

This method calls Object::Save fo each child of the Object instance and add the xmlNode returned to the children of node. It might be called from the Save method of objects having serializable children.

Returns:
true on succes, false otherwise.
void gcu::Object::SaveId ( xmlNodePtr  node) const
Parameters:
nodethe node representing the Object.

This helper method saves the Id of the node as a property of the xmlNode.

static void gcu::Object::SetCreationLabel ( TypeId  Id,
std::string  Label 
) [static]
Parameters:
Idthe TypeId of a class
Labelthe string to display in a contextual menu

Used to give a label for contextual menus used when the creation of an instance of the class seems possible.

This method is deprecated, use Application::SetCreationLabel() instead.

void gcu::Object::SetDirty ( bool  dirty = true)
Parameters:
dirtyshould be true if the object needs some update, false otherwise. For a document, it means that the document has been changed.

Reimplemented in gcp::Document.

void gcu::Object::SetId ( gchar const *  Id)
Parameters:
Idthe id of the Object instance.

Every object must have an Id, since searches in the document tree uses it.

void gcu::Object::SetParent ( Object Parent)
Parameters:
Parentthe new parent of the Object or NULL.

When Parent is not NULL, this is equivalent to

 Parent->AddChild(this);

Otherwise, it removes the Object from the Document tree.

virtual bool gcu::Object::SetProperty ( unsigned  property,
char const *  value 
) [virtual]
Parameters:
propertythe property id as defined in objprops.h
valuethe property value as a string

Used when loading to set properties to various objects. If the method returns false, the property should be set again later. This might happen if an atom does not exists when one of its bonds is loaded. All classes supporting the mechanism must overload this method.

Returns:
true if the property could be set, or if the property is not relevant, false otherwise.

Reimplemented in gcu::Atom, gcu::Bond, gcp::Arrow, gcp::Atom, gcp::Bond, gcp::Document, gcp::Fragment, gcp::ReactionArrow, gcp::Text, gcr::Atom, and gcr::Document.

void gcu::Object::ShowPropertiesDialog ( )

Exposes the gcu::Dialog related to the object properties if it exists.

virtual void gcu::Object::Transform2D ( Matrix2D m,
double  x,
double  y 
) [virtual]
Parameters:
mthe Matrix2D of the transformation.
xthe x component of the center of the transformation.
ythe y component of the center of the transformation.

Used to move and/or transform an object. This virtual method must be overrided by Object derived classes for which it makes sense. The base Object class has no coordinates and the default method calls the corresponding method for every child.

Reimplemented in gcu::Atom, gcu::Bond, gcp::Arrow, gcp::Atom, gcp::Bond, gcp::Electron, gcp::Fragment, gcp::MechanismArrow, gcp::Mesomery, gcp::Molecule, gcp::Reaction, and gcp::Text.

void gcu::Object::Unlink ( Object object)
Parameters:
objectthe object to unlink.

Unlinks object and calls Object::OnUnlink.


The documentation for this class was generated from the following file: