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

Mechanism curved arrows. More...

#include <mechanism-arrow.h>

Inheritance diagram for gcp::MechanismArrow:
gcu::Object gccv::ItemClient

Public Member Functions

 MechanismArrow ()
virtual ~MechanismArrow ()
void SetSource (gcu::Object *source)
void SetSourceAux (gcu::Object *aux)
void SetTarget (gcu::Object *target)
void SetControlPoint (int num, double dx, double dy)
void SetShowControls (bool show)
void SetPair (bool is_pair)
void SetEndAtNewBondCenter (bool end_at_new_bond_center)
xmlNodePtr Save (xmlDocPtr xml) const
bool Load (xmlNodePtr node)
void Transform2D (gcu::Matrix2D &m, double x, double y)
void AddItem ()
void SetSelected (int state)
void OnUnlink (Object *object)
void OnLoaded ()
std::string Name ()
bool CanSelect () const
gcu::ObjectGetSource (void) const
gcu::ObjectGetSourceAux (void) const
gcu::ObjectGetTarget (void) const
bool GetShowControls (void) const
bool GetPair (void) const
bool GetEndAtNewBondCenter (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)
virtual bool GetCoords (double *x, double *y, double *z=NULL) const
virtual void Move (double x, double y, double z=0.)
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
void SetDirty (bool dirty=true)
virtual void Clear ()
std::string Identity ()
virtual char const * HasPropertiesDialog () const
virtual void NotifyEmpty ()
void ShowPropertiesDialog ()
bool GetDirty (void) const
- Public Member Functions inherited from gccv::ItemClient
 ItemClient ()
virtual ~ItemClient ()
virtual void UpdateItem ()
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 gcu::Object
virtual DialogBuildPropertiesDialog ()
- Protected Attributes inherited from gccv::ItemClient
Itemm_Item

Detailed Description

Mechanism curved arrows.

Curved arrows used to represent electrons movements during a mechanim step.

Definition at line 45 of file mechanism-arrow.h.

Constructor & Destructor Documentation

gcp::MechanismArrow::MechanismArrow ( )

Constructs a new MechanismArrow.

virtual gcp::MechanismArrow::~MechanismArrow ( )
virtual

The destructor.

Member Function Documentation

void gcp::MechanismArrow::AddItem ( )
virtual

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

Reimplemented from gccv::ItemClient.

bool gcp::MechanismArrow::CanSelect ( ) const
virtual
Returns
true if the MechanismArrow can be safely selected.

Reimplemented from gcu::Object.

gcp::MechanismArrow::GetEndAtNewBondCenter ( void  ) const
inline
Returns
whether to end the arrow at the center of the new bond. The value is not significant when no new bond is created.

Definition at line 197 of file mechanism-arrow.h.

gcp::MechanismArrow::GetPair ( void  ) const
inline
Returns
whether the elctron movement concerns a pair or a single electron.

Definition at line 192 of file mechanism-arrow.h.

gcp::MechanismArrow::GetShowControls ( void  ) const
inline
Returns
whether to show the control points.

Definition at line 188 of file mechanism-arrow.h.

gcp::MechanismArrow::GetSource ( void  ) const
inline
Returns
the initial owner, atom or bond, of the electrons. Might be an Electron instance.

Definition at line 176 of file mechanism-arrow.h.

gcp::MechanismArrow::GetSourceAux ( void  ) const
inline
Returns
the auxilliary source, see SetSourceAux() for details.

Definition at line 180 of file mechanism-arrow.h.

gcp::MechanismArrow::GetTarget ( void  ) const
inline
Returns
the target of the electron move.

Definition at line 184 of file mechanism-arrow.h.

bool gcp::MechanismArrow::Load ( xmlNodePtr  node)
virtual
Parameters
nodea pointer to the xmlNode containing the serialized arrow.

Used to load a mechanism arrow in memory. The arrow must already exist.

Returns
true on succes, false otherwise.

Reimplemented from gcu::Object.

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

Reimplemented from gcu::Object.

void gcp::MechanismArrow::OnLoaded ( )
virtual

Ensure that links are correctly set.

Reimplemented from gcu::Object.

void gcp::MechanismArrow::OnUnlink ( Object object)
Parameters
objectthe object just unlinked by Object::Unlink.
xmlNodePtr gcp::MechanismArrow::Save ( xmlDocPtr  xml) const
virtual
Parameters
xmlthe xmlDoc used to save the document.

Used to save the mechanism arrow to the xmlDoc.

Returns
the xmlNode containing the serialized arrow.

Reimplemented from gcu::Object.

void gcp::MechanismArrow::SetControlPoint ( int  num,
double  dx,
double  dy 
)
Parameters
numthe control point numbre, should be 1 or 2.
dxthe x coordinate of the vector.
dythe y coordinate of the vector.

Sets the position of the intermediate control points used to construct a Bezier cubic curve for the arrow. If num is 1, the vector starts at the start point of the arrow, and if num is 2 it starts at the arrow end.

void gcp::MechanismArrow::SetEndAtNewBondCenter ( bool  end_at_new_bond_center)
Parameters
end_at_new_bond_centerthe position of the arrow end for new bonds.

For arrows representing an electrons pair movement creating a new bond, the might end either at the target atom or at the centeer of the created bond.

void gcp::MechanismArrow::SetPair ( bool  is_pair)
Parameters
is_pairwhether the arrow represents an electrons pair move or a single electron move.

Sets the type of electron move.

void gcp::MechanismArrow::SetSelected ( int  state)
virtual
Parameters
statethe selection state of the text.

Used to set the selection state of text inside. The values of state might be gcp::SelStateUnselected, gcp::SelStateSelected, gcp::SelStateUpdating, or gcp::SelStateErasing.

Reimplemented from gccv::ItemClient.

void gcp::MechanismArrow::SetShowControls ( bool  show)
Parameters
showwhether to show the control points.

Show or hide the control points. Showing the control points is useful when editing.

void gcp::MechanismArrow::SetSource ( gcu::Object source)
Parameters
sourcethe source of the electrons.

Sets the initial owner, atom or bond, of the electrons. An Electron instance is also allowed there.

void gcp::MechanismArrow::SetSourceAux ( gcu::Object aux)
Parameters
auxan object.

Used when a new bond is created by the electron move, using initially bonding electrons. In that case the source is the initial bond, the target, the not bonded atom of the new bond, and the auxilliary source, the atom of the initial bond which will be bonded to the target.

void gcp::MechanismArrow::SetTarget ( gcu::Object target)
Parameters
targetthe target of the electron move.

Sets where the arrow ends. Might be an atom or a bond.

void gcp::MechanismArrow::Transform2D ( gcu::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 a mechanism arrow.

Reimplemented from gcu::Object.


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