The Gnome Chemistry Utils 0.13.3
Public Member Functions
gcp::MechanismArrow Class Reference

Mechanism curved arrows. More...

#include <mechanism-arrow.h>

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

List of all members.

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

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: