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

Straight lines. More...

#include <line.h>

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

Public Member Functions

 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)
double Distance (double x, double y, Item **item) const
void Draw (cairo_t *cr, bool is_vector) const
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 ()

Protected Attributes

double m_xstart
double m_ystart
double m_xend
double m_yend

Detailed Description

Straight lines.

Implements one segment straight lines.

Definition at line 39 of file gccv/line.h.

Constructor & Destructor Documentation

gccv::Line::Line ( 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 Line sets it as a child of the root Group of canvas.

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

Creates a new Line inside parent and sets client as its associated ItemClient.

virtual gccv::Line::~Line ( )
virtual

The destructor.

Member Function Documentation

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

Reimplemented from gccv::Item.

Reimplemented in gccv::Arrow.

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

Draws the Line to cr.

Reimplemented from gccv::Item.

Reimplemented in gccv::Arrow.

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

Moves the Line.

Reimplemented from gccv::Item.

void gccv::Line::SetPosition ( double  xstart,
double  ystart,
double  xend,
double  yend 
)
Parameters
xstartthe new horizontal start position.
ystartthe new vertical start position.
xendthe new horizontal end position.
yendthe new vertical end position.

Sets the Line position.

void gccv::Line::UpdateBounds ( )
protectedvirtual

Evaluates the Line bounds.

Reimplemented from gccv::Item.

Reimplemented in gccv::Arrow.

Member Data Documentation

double gccv::Line::m_xend
protected

The horizontal end position.

Definition at line 120 of file gccv/line.h.

double gccv::Line::m_xstart
protected

The horizontal start position.

Definition at line 112 of file gccv/line.h.

double gccv::Line::m_yend
protected

The vertical end position.

Definition at line 124 of file gccv/line.h.

double gccv::Line::m_ystart
protected

The vertical start position.

Definition at line 116 of file gccv/line.h.


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