The Gnome Chemistry Utils  0.14.0
Public Member Functions | List of all members
gcp::ReactionArrow Class Reference

#include <gcp/reaction-arrow.h>

Inheritance diagram for gcp::ReactionArrow:
gcp::Arrow gcu::Object gccv::ItemClient

Public Member Functions

virtual ~ReactionArrow ()
xmlNodePtr Save (xmlDocPtr xml) const
bool Load (xmlNodePtr node)
void AddItem ()
void UpdateItem ()
bool BuildContextualMenu (gcu::UIManager *UIManager, gcu::Object *object, double x, double y)
void Move (double x, double y, double z=0)
void SetSelected (int state)
void AddProp (gcu::Object *object)
void PositionChild (ReactionProp *prop)
bool OnSignal (gcu::SignalId Signal, gcu::Object *Child)
bool SetProperty (unsigned property, char const *value)
std::string Name ()
char GetSymbolicPosition (double x, double y)
- Public Member Functions inherited from gcp::Arrow
 Arrow (gcu::TypeId Type)
virtual ~Arrow ()
void SetCoords (double xstart, double ystart, double xend, double yend)
bool GetCoords (double *xstart, double *ystart, double *xend, double *yend) const
bool GetCoords (double *x, double *y, double *z=NULL) const
void Transform2D (gcu::Matrix2D &m, double x, double y)
double GetYAlign ()
void SetStartStep (Step *step)
Step ** GetStartStepPtr ()
StepGetStartStep () const
void SetEndStep (Step *step)
StepGetEndStep () const
Step ** GetEndStepPtr ()
void Reverse ()
void RemoveStep (Step *step)
double GetLength (void) const
- Public Member Functions inherited from gcu::Object
 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)
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)
void EmitSignal (SignalId Signal)
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 std::string GetProperty (unsigned property) const
void SetDirty (bool dirty=true)
virtual void Clear ()
std::string Identity ()
virtual char const * HasPropertiesDialog () const
virtual bool CanSelect () const
virtual void NotifyEmpty ()
void ShowPropertiesDialog ()
bool GetDirty (void) const
- Public Member Functions inherited from gccv::ItemClient
 ItemClient ()
virtual ~ItemClient ()
ItemGetItem (void)

Additional Inherited Members

- Static Public Member Functions inherited from gcu::Object
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 inherited from gcp::Arrow
bool Save (xmlDocPtr xml, xmlNodePtr node) const
void OnLoaded ()
- Protected Attributes inherited from gcp::Arrow
double m_x
double m_y
double m_width
double m_height

Detailed Description

Arrow class for arrows used in chemical reactions.

Definition at line 44 of file reaction-arrow.h.

Constructor & Destructor Documentation

virtual gcp::ReactionArrow::~ReactionArrow ( )
virtual

The destructor.

Member Function Documentation

void gcp::ReactionArrow::AddItem ( )
virtual

Used to add a representation of the arrow in the view.

Reimplemented from gccv::ItemClient.

void gcp::ReactionArrow::AddProp ( gcu::Object object)
Parameters
objectthe object to attach to the arrow.

Attach an object to the arrow and pops up the reaction property dialog box.

bool gcp::ReactionArrow::BuildContextualMenu ( gcu::UIManager UIManager,
gcu::Object object,
double  x,
double  y 
)
virtual
Parameters
UIManagerthe gcu::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 arrow.

Returns
true if something is added to the UIManager, false otherwise.

Reimplemented from gcu::Object.

char gcp::ReactionArrow::GetSymbolicPosition ( double  x,
double  y 
)
Returns
a character corresponding to where the point lies relative to the arrow. 't' means on tail side, 'h' on head side, and 'o' for other.
bool gcp::ReactionArrow::Load ( xmlNodePtr  node)
virtual
Parameters
node,:a pointer to the xmlNode containing the serialized arrow.

Used to load an arrow in memory.

Returns
true on succes, false otherwise.

Reimplemented from gcp::Arrow.

void gcp::ReactionArrow::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 a reaction arrow. It will also move the objects attached to the arrow if any.

Reimplemented from gcp::Arrow.

std::string gcp::ReactionArrow::Name ( )
virtual
Returns
the localized object generic name.

Reimplemented from gcp::Arrow.

bool gcp::ReactionArrow::OnSignal ( gcu::SignalId  Signal,
gcu::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 arrow, such as when an attached object size changed. 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.

void gcp::ReactionArrow::PositionChild ( ReactionProp prop)
Parameters
propthe attached property to position.

Position an object at the right place near the arrow.

xmlNodePtr gcp::ReactionArrow::Save ( xmlDocPtr  xml) const
virtual
Parameters
xmlthe xmlDoc used to save the document.

Used to save the arrow to the xmlDoc.

Returns
the xmlNode containing the serialized arrow.

Reimplemented from gcu::Object.

bool gcp::ReactionArrow::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 common properties to arrows. Only one property is currently supported: gcu::GCU_PROP_REACTION_ARROW_TYPE.

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

Reimplemented from gcp::Arrow.

void gcp::ReactionArrow::SetSelected ( int  state)
virtual
Parameters
state,:the selection state of the arrow.

Used to set the selection state of the arrow inside the widget. The values of state might be gcp::SelStateUnselected, gcp::SelStateSelected, gcp::SelStateUpdating, or gcp::SelStateErasing. Children will be selected too.

Reimplemented from gcp::Arrow.

void gcp::ReactionArrow::UpdateItem ( )
virtual

Used to update the representation of the arrow in the view.

Reimplemented from gccv::ItemClient.


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