gcp::Reaction Class Reference

Inheritance diagram for gcp::Reaction:

gcu::Object

List of all members.

Public Member Functions

virtual bool Build (list< Object * > &Children) throw (invalid_argument)
virtual void Transform2D (Matrix2D &m, double x, double y)
virtual bool BuildContextualMenu (GtkUIManager *UIManager, Object *object, double x, double y)
virtual bool OnSignal (SignalId Signal, Object *Child)
virtual bool Load (xmlNodePtr)
virtual double GetYAlign ()


Detailed Description

Definition at line 35 of file reaction.h.


Member Function Documentation

virtual bool gcp::Reaction::Build ( list< Object * > &  Children  )  throw (invalid_argument) [virtual]

Parameters:
Children,: the 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.

Reimplemented from gcu::Object.

virtual void gcp::Reaction::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 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 from gcu::Object.

virtual bool gcp::Reaction::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 bool gcp::Reaction::OnSignal ( SignalId  Signal,
Object Child 
) [virtual]

Parameters:
Signal,: the appropriate SignalId
Child,: the 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 from gcu::Object.

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

Parameters:
node,: a 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 from gcu::Object.

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


The documentation for this class was generated from the following file:
Generated on Sun Sep 16 14:21:56 2007 for The Gnome Chemistry Utils by  doxygen 1.5.3