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

Curved arrows. More...

#include <bezier-arrow.h>

Inheritance diagram for gccv::BezierArrow:
gccv::LineItem gccv::Item

Public Member Functions

 BezierArrow (Canvas *canvas)
 BezierArrow (Group *parent, ItemClient *client=NULL)
virtual ~BezierArrow ()
double Distance (double x, double y, Item **item) const
void Draw (cairo_t *cr, bool is_vector) const
void Move (double x, double y)
void GetControlPoints (double &x0, double &y0, double &x1, double &y1, double &x2, double &y2, double &x3, double &y3)
void SetControlPoints (double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3)
void SetHead (ArrowHeads val)
ArrowHeads GetHead (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
void SetShowControls (bool val)
bool GetShowControls (void) const
- 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::Item
double m_x0
double m_y0
double m_x1
double m_y1

Detailed Description

Curved arrows.

Arrow composed of a Bezier cubic curve and an arrow head.

Definition at line 40 of file bezier-arrow.h.

Constructor & Destructor Documentation

gccv::BezierArrow::BezierArrow ( Canvas canvas)
Parameters
canvasa Canvas.

Creates a new BezierArrow with a full head and sets it as a child of the root Group of canvas.

gccv::BezierArrow::BezierArrow ( Group parent,
ItemClient client = NULL 
)
Parameters
parentthe Group to which the new BezierArrow will be added.
clientthe ItemClient for the new BezierArrow if any.

Creates a new BezierArrow with a full head inside parent and sets client as its associated ItemClient.

virtual gccv::BezierArrow::~BezierArrow ( )
virtual

The destructor.

Member Function Documentation

double gccv::BezierArrow::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 BezierArrow class. Sets item to this.

Reimplemented from gccv::Item.

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

Draws the BezierArrow to cr.

Reimplemented from gccv::Item.

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

Definition at line 139 of file bezier-arrow.h.

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

Definition at line 149 of file bezier-arrow.h.

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

Definition at line 158 of file bezier-arrow.h.

void gccv::BezierArrow::GetControlPoints ( double &  x0,
double &  y0,
double &  x1,
double &  y1,
double &  x2,
double &  y2,
double &  x3,
double &  y3 
)
Parameters
x0where to store the horizontal coordinate of the first control point.
y0where to store the horizontal coordinate of the first control point.
x1where to store the horizontal coordinate of the second control point.
y1where to store the horizontal coordinate of the second control point.
x2where to store the horizontal coordinate of the third control point.
y2where to store the horizontal coordinate of the third control point.
x3where to store the horizontal coordinate of the fourth control point.
y3where to store the horizontal coordinate of the fourth control point.

Retrieves the coordinates of the four control points used to build the Bezier cubic curve.

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

Definition at line 130 of file bezier-arrow.h.

gccv::BezierArrow::GetShowControls ( void  ) const
inline
Returns
whether the controlpoints are currently displayed (if the arrow is visible, see Item::SetVisible()).

Definition at line 169 of file bezier-arrow.h.

void gccv::BezierArrow::Move ( double  x,
double  y 
)
virtual
Parameters
xthe horizontal deplacement
ythe vertical deplacement

Moves the BezierArrow.

Reimplemented from gccv::Item.

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

Sets the distance from tip of arrowhead to center.

Definition at line 139 of file bezier-arrow.h.

gccv::BezierArrow::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 149 of file bezier-arrow.h.

gccv::BezierArrow::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 158 of file bezier-arrow.h.

void gccv::BezierArrow::SetControlPoints ( double  x0,
double  y0,
double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3 
)
Parameters
x0the new horizontal coordinate of the first control point.
y0the new horizontal coordinate of the first control point.
x1the new horizontal coordinate of the second control point.
y1the new horizontal coordinate of the second control point.
x2the new horizontal coordinate of the third control point.
y2the new horizontal coordinate of the third control point.
x3the new horizontal coordinate of the fourth control point.
y3the new horizontal coordinate of the fourth control point.

Sets the coordinates of the four control points used to build the Bezier cubic curve.

gccv::BezierArrow::SetHead ( ArrowHeads  Head)
inline
Parameters
Headthe ArrowHeads for the end position of the arrow.

Sets the arrow head type at the segment end position.

Definition at line 130 of file bezier-arrow.h.

gccv::BezierArrow::SetShowControls ( bool  ShowControls)
inline
Parameters
ShowControlswhether to show control points.

If set to true, the control points will be displayed as squares. Lhe size of these squares is five times the line witdth.

Definition at line 169 of file bezier-arrow.h.

void gccv::BezierArrow::UpdateBounds ( )
protectedvirtual

Evaluates the BezierArrow bounds.

Reimplemented from gccv::Item.


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