The Gnome Chemistry Utils  0.14.0
Public Member Functions | Protected Member Functions | List of all members
gccv::Arrow Class Reference

Simple arrows class. More...

#include <arrow.h>

Inheritance diagram for gccv::Arrow:
gccv::Line gccv::LineItem gccv::Item

Public Member Functions

 Arrow (Canvas *canvas, double xstart, double ystart, double xend, double yend)
 Arrow (Group *parent, double xstart, double ystart, double xend, double yend, ItemClient *client=NULL)
virtual ~Arrow ()
double Distance (double x, double y, Item **item) const
void Draw (cairo_t *cr, bool is_vector) const
void SetStartHead (ArrowHeads val)
ArrowHeads GetStartHead (void) const
void SetEndHead (ArrowHeads val)
ArrowHeads GetEndHead (void) const
void SetA (double val)
double GetA (void) const
void SetB (double val)
double GetB (void) const
void SetC (double val)
double GetC (void) const
- Public Member Functions inherited from gccv::Line
 Line (Canvas *canvas, double xstart, double ystart, double xend, double yend)
 Line (Group *parent, double xstart, double ystart, double xend, double yend, ItemClient *client=NULL)
virtual ~Line ()
void SetPosition (double xstart, double ystart, double xend, double yend)
void Move (double x, double y)
- Public Member Functions inherited from gccv::LineItem
 LineItem (Canvas *canvas)
 LineItem (Group *parent, ItemClient *client=NULL)
virtual ~LineItem ()
GOColor GetEffectiveLineColor () const
void ApplyLine (cairo_t *cr) const
void SetDashes (double const *dashes, int num_dashes, double offset)
void SetLineWidth (double val)
double GetLineWidth (void) const
void SetLineColor (GOColor val)
GOColor GetLineColor (void) const
void SetAutoColor (bool val)
bool GetAutoColor (void) const
- Public Member Functions inherited from gccv::Item
 Item (Canvas *canvas)
 Item (Group *parent, ItemClient *client=NULL)
virtual ~Item ()
void GetBounds (double &x0, double &y0, double &x1, double &y1) const
void Invalidate () const
void SetVisible (bool visible)
virtual void BuildPath (cairo_t *cr) const
virtual bool Draw (cairo_t *cr, double x0, double y0, double x1, double y1, bool is_vector) const
bool IsTopLevel () const
void SetClient (ItemClient *val)
ItemClientGetClient (void)
Group const * GetParent (void) const
bool GetVisible (void) const
void SetOperator (cairo_operator_t val)
cairo_operator_t GetOperator (void) const

Protected Member Functions

void UpdateBounds ()

Additional Inherited Members

- Protected Attributes inherited from gccv::Line
double m_xstart
double m_ystart
double m_xend
double m_yend

Detailed Description

Simple arrows class.

Item class for arrows composed of a straight line with one or both ends decorated with an arrow head.

Definition at line 41 of file gccv/arrow.h.

Constructor & Destructor Documentation

gccv::Arrow::Arrow ( Canvas canvas,
double  xstart,
double  ystart,
double  xend,
double  yend 
)
Parameters
canvasa Canvas.
xstartthe horizontal start position.
ystartthe vertical start position.
xendthe horizontal end position.
yendthe vertical end position.

Creates a new Arrow with a full head at end and no head at start and sets it as a child of the root Group of canvas.

gccv::Arrow::Arrow ( Group parent,
double  xstart,
double  ystart,
double  xend,
double  yend,
ItemClient client = NULL 
)
Parameters
parentthe Group to which the new Arrow will be added.
xstartthe horizontal start position.
ystartthe vertical start position.
xendthe horizontal end position.
yendthe vertical end position.
clientthe ItemClient for the new Arrow if any.

Creates a new Arrow with a full head at end and no head at start inside parent and sets client as its associated ItemClient.

virtual gccv::Arrow::~Arrow ( )
virtual

The destructor.

Member Function Documentation

double gccv::Arrow::Distance ( double  x,
double  y,
Item **  item 
) const
virtual
Parameters
xhorizontal position
yvertical position
itemwhere to store the Item.

Implementation of Item::Distance() for the Arrow class. Sets item to this.

Reimplemented from gccv::Line.

void gccv::Arrow::Draw ( cairo_t *  cr,
bool  is_vector 
) const
virtual
Parameters
cra cairo_t.
is_vectorwhether the cairo_t is a vectorial context.

Draws the Arrow to cr.

Reimplemented from gccv::Line.

gccv::Arrow::GetA ( void  ) const
inline
Returns
the distance from tip of arrowhead to center.

Definition at line 123 of file gccv/arrow.h.

gccv::Arrow::GetB ( void  ) const
inline
Returns
the distance from tip of arrowhead to trailing point, measured along shaft.

Definition at line 133 of file gccv/arrow.h.

gccv::Arrow::GetC ( void  ) const
inline
Returns
the distance of arrowhead trailing points from outside edge of shaft.

Definition at line 142 of file gccv/arrow.h.

gccv::Arrow::GetEndHead ( void  ) const
inline
Returns
the ArrowHeads for the end position of the arrow.

Definition at line 114 of file gccv/arrow.h.

gccv::Arrow::GetStartHead ( void  ) const
inline
Returns
the ArrowHeads for the start position of the arrow.

Definition at line 105 of file gccv/arrow.h.

gccv::Arrow::SetA ( double  A)
inline
Parameters
Anew arrow head size parameter.

Sets the distance from tip of arrowhead to center.

Definition at line 123 of file gccv/arrow.h.

gccv::Arrow::SetB ( double  B)
inline
Parameters
Bnew arrow head size parameter.

Sets the distance from tip of arrowhead to trailing point, measured along shaft.

Definition at line 133 of file gccv/arrow.h.

gccv::Arrow::SetC ( double  C)
inline
Parameters
Cnew arrow head size parameter.

Sets the distance of arrowhead trailing points from outside edge of shaft.

Definition at line 142 of file gccv/arrow.h.

gccv::Arrow::SetEndHead ( ArrowHeads  EndHead)
inline
Parameters
EndHeadthe ArrowHeads for the end position of the arrow.

Sets the arrow head type at the segment end position.

Definition at line 114 of file gccv/arrow.h.

gccv::Arrow::SetStartHead ( ArrowHeads  StartHead)
inline
Parameters
StartHeadthe ArrowHeads for the start position of the arrow.

Sets the arrow head type at the segment start position.

Definition at line 105 of file gccv/arrow.h.

void gccv::Arrow::UpdateBounds ( )
protectedvirtual

Evaluates the Arrow bounds.

Reimplemented from gccv::Line.


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