# gcp::Arrow Class Reference

Inheritance diagram for gcp::Arrow:

List of all members.

## Public Member Functions

| Arrow (gcu::TypeId Type)
virtual | ~Arrow ()
bool | Load (xmlNodePtr node)
void | SetSelected (GtkWidget *w, int state)
void | SetCoords (double xstart, double ystart, double xend, double yend)
bool | GetCoords (double *xstart, double *ystart, double *xend, double *yend)
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)

## Protected Member Functions

bool | Save (xmlDocPtr xml, xmlNodePtr node) const

## Protected Attributes

double | m_x
double | m_y
double | m_width
double | m_height

## Detailed Description

Definition at line 54 of file arrow.h.

## Constructor & Destructor Documentation

gcp::Arrow::Arrow | ( | gcu::TypeId | Type | ) |

Parameters:

  | Type | an 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::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::MesomeryArrow, and gcp::ReactionArrow.

void gcp::Arrow::SetSelected | ( | GtkWidget * | w,
|  | int | state |
| ) |  |  | `[virtual]`

Parameters:

  | w,: | the GtkWidget inside which the Object is displayed.
  | 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.

Reimplemented from gcu::Object.

Reimplemented in gcp::ReactionArrow.

void gcp::Arrow::SetCoords | ( | double | xstart,
|  | double | ystart,
|  | double | xend,
|  | double | yend |
| ) |  |  |

Parameters:

  | xstart | the x coordinate of the start point.
  | ystart | the y coordinate of the start point.
  | xend | the x coordinate of the end point.
  | yend | the y coordinate of the end point.

Sets the position and length of an arrow.

bool gcp::Arrow::GetCoords | ( | double * | xstart,
|  | double * | ystart,
|  | double * | xend,
|  | double * | yend |
| ) |  |  |

Parameters:

  | xstart | where to store the x coordinate of the start point.
  | ystart | where to store the y coordinate of the start point.
  | xend | where to store the x coordinate of the end point.
  | yend | where to store the y coordinate of the end point.

Retrieves the position of the arrow.

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.

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.

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::SetProperty | ( | unsigned | property,
|  | char const * | value |
| ) |  |  | `[virtual]`

Parameters:

  | property | the property id as defined in objprops.h
  | value | the 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.

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.

## Member Data Documentation

double gcp::Arrow::m_x `[protected]`

The x coordinate to the start point.

Definition at line 151 of file arrow.h.

double gcp::Arrow::m_y `[protected]`

The y coordinate to the start point.

Definition at line 155 of file arrow.h.

double gcp::Arrow::m_width `[protected]`

The x coordinate to the end point.

Definition at line 159 of file arrow.h.

double gcp::Arrow::m_height `[protected]`

The y coordinate to the end point.

Definition at line 163 of file arrow.h.

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

- arrow.h