The Gnome Chemistry Utils  0.13.7
Public Member Functions | Protected Member Functions | Protected Attributes
gcp::Arrow Class Reference
Inheritance diagram for gcp::Arrow:
gcu::Object gccv::ItemClient gcp::MesomeryArrow gcp::ReactionArrow

List of all members.

Public Member Functions

 Arrow (gcu::TypeId Type)
virtual ~Arrow ()
bool Load (xmlNodePtr node)
void SetSelected (int state)
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 Move (double x, double y, double z=0)
void Transform2D (gcu::Matrix2D &m, double x, double y)
double GetYAlign ()
bool SetProperty (unsigned property, char const *value)
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

Protected Member Functions

bool Save (xmlDocPtr xml, xmlNodePtr node) const
std::string Name ()
void OnLoaded ()

Protected Attributes

double m_x
double m_y
double m_width
double m_height

Detailed Description

Definition at line 57 of file gcp/arrow.h.


Constructor & Destructor Documentation

Parameters:
Typean arrow type id.

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

virtual gcp::Arrow::~Arrow ( ) [virtual]

The destructor.


Member Function Documentation

bool gcp::Arrow::GetCoords ( double *  xstart,
double *  ystart,
double *  xend,
double *  yend 
) const
Parameters:
xstartwhere to store the x coordinate of the start point.
ystartwhere to store the y coordinate of the start point.
xendwhere to store the x coordinate of the end point.
yendwhere to store the y coordinate of the end point.

Retrieves the position of the arrow.

bool gcp::Arrow::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 Arrow.
ya pointer to the double value which will receive the y coordinate of the Arrow.
za pointer to the double value which will receive the z coordinate of the Arrow or NULL for 2D representations.

Retrieves the coordinates of this Arrow.

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

Reimplemented from gcu::Object.

Step* gcp::Arrow::GetEndStep ( ) const [inline]
Returns:
the Step at last end of the arrow.

Definition at line 172 of file gcp/arrow.h.

Returns:
a pointer to the Step at last end of the arrow.

Definition at line 176 of file gcp/arrow.h.

gcp::Arrow::GetLength ( void  ) const [inline]
Returns:
the arrow length.

Definition at line 233 of file gcp/arrow.h.

Step* gcp::Arrow::GetStartStep ( ) const [inline]
Returns:
the Step at first end of the arrow.

Definition at line 161 of file gcp/arrow.h.

Returns:
a pointer to the Step at first end of the arrow.

Definition at line 157 of file gcp/arrow.h.

double gcp::Arrow::GetYAlign ( ) [virtual]

Used to retrieve the y coordinate for alignment.

Returns:
y coordinate used for arrows alignment.

Reimplemented from gcu::Object.

bool gcp::Arrow::Load ( xmlNodePtr  node) [virtual]
Parameters:
node,:a pointer to the xmlNode containing the serialized arrow.

Used to load an Arrow in memory. This method must be called from derived classes overloaded Load methods.

Returns:
true on succes, false otherwise.

Reimplemented from gcu::Object.

Reimplemented in gcp::ReactionArrow, and gcp::MesomeryArrow.

void gcp::Arrow::Move ( double  x,
double  y,
double  z = 0 
) [virtual]
Parameters:
x,:the x component of the transation vector.
y,:the y component of the transation vector.
z,:the z component of the transation vector (unused).

Used to move an arrow. The third parameter is not taken into account.

Reimplemented from gcu::Object.

Reimplemented in gcp::ReactionArrow.

std::string gcp::Arrow::Name ( ) [protected, virtual]
Returns:
"Arrow" (actually it is localized).

Reimplemented from gcu::Object.

Reimplemented in gcp::ReactionArrow, and gcp::MesomeryArrow.

void gcp::Arrow::OnLoaded ( ) [protected, virtual]

This method should be called when an arrow has been fully loaded.

Reimplemented from gcu::Object.

void gcp::Arrow::RemoveStep ( Step step)
Parameters:
stepthe Step to remove from the Scheme

Removes the Step, which might be either the initial or final step. If it not one of these, nothing is done.

Exchange both ends or the arrow and their associated steps.

Reimplemented in gcp::MesomeryArrow.

bool gcp::Arrow::Save ( xmlDocPtr  xml,
xmlNodePtr  node 
) const [protected]
Parameters:
xml,:the xmlDoc used to save the document.
node,:the node representing the Object.

This method must be called from derived classes overloaded Save methods.

Returns:
true on succes, false otherwise.
void gcp::Arrow::SetCoords ( double  xstart,
double  ystart,
double  xend,
double  yend 
)
Parameters:
xstartthe x coordinate of the start point.
ystartthe y coordinate of the start point.
xendthe x coordinate of the end point.
yendthe y coordinate of the end point.

Sets the position and length of an arrow.

void gcp::Arrow::SetEndStep ( Step step) [inline]
Parameters:
stepa Step

Sets step at last end of the arrow. This does not affect coordinates, alignment is dealt with elsewhere.

Definition at line 168 of file gcp/arrow.h.

bool gcp::Arrow::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_ARROW_COORDS.

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

Reimplemented from gcu::Object.

Reimplemented in gcp::ReactionArrow.

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

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

Reimplemented from gccv::ItemClient.

Reimplemented in gcp::ReactionArrow.

void gcp::Arrow::SetStartStep ( Step step) [inline]
Parameters:
stepa Step

Sets step at first end of the arrow. This does not affect coordinates, alignment is dealt with elsewhere.

Definition at line 153 of file gcp/arrow.h.

void gcp::Arrow::Transform2D ( gcu::Matrix2D m,
double  x,
double  y 
) [virtual]
Parameters:
m,:the Matrix2D 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 arrow.

Reimplemented from gcu::Object.


Member Data Documentation

double gcp::Arrow::m_height [protected]

The y coordinate difference between tail and head.

Definition at line 225 of file gcp/arrow.h.

double gcp::Arrow::m_width [protected]

The x coordinate difference between tail and head.

Definition at line 221 of file gcp/arrow.h.

double gcp::Arrow::m_x [protected]

The x coordinate of the start point.

Definition at line 213 of file gcp/arrow.h.

double gcp::Arrow::m_y [protected]

The y coordinate of the start point.

Definition at line 217 of file gcp/arrow.h.


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