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

Polygon. More...

#include <polygon.h>

Inheritance diagram for gccv::Polygon:
gccv::FillItem gccv::LineItem gccv::Item

Public Member Functions

 Polygon (Canvas *canvas, std::list< Point > &points)
 Polygon (Group *parent, std::list< Point > &points, ItemClient *client=NULL)
virtual ~Polygon ()
void SetPoints (std::list< Point > &points)
void AddPoint (double x, double y)
double Distance (double x, double y, Item **item) const
void Draw (cairo_t *cr, bool is_vector) const
virtual void BuildPath (cairo_t *cr) const
void Move (double x, double y)
- Public Member Functions inherited from gccv::FillItem
 FillItem (Canvas *canvas)
 FillItem (Group *parent, ItemClient *client=NULL)
virtual ~FillItem ()
void SetFillColor (GOColor val)
GOColor GetFillColor (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 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

std::list< Pointm_Points

Detailed Description

Polygon.

Polygon item.

Definition at line 41 of file polygon.h.

Constructor & Destructor Documentation

gccv::Polygon::Polygon ( Canvas canvas,
std::list< Point > &  points 
)
Parameters
canvasa Canvas.
pointsthe vertices positions.

Creates a new Polygon and sets it as a child of the root Group of canvas.

gccv::Polygon::Polygon ( Group parent,
std::list< Point > &  points,
ItemClient client = NULL 
)
Parameters
parentthe Group to which the new PolyLine will be added.
pointsthe vertices positions.
clientthe ItemClient for the new PolyLine if any.

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

virtual gccv::Polygon::~Polygon ( )
virtual

The destructor.

Member Function Documentation

void gccv::Polygon::AddPoint ( double  x,
double  y 
)
Parameters
xhorizontal position of the new vertex.
yvertical position of the new vertex.

Apends a new vrtex to the vertices list.

virtual void gccv::Polygon::BuildPath ( cairo_t *  cr) const
virtual
Parameters
cra cairo_t.

Builds the cairo path corresponding to the Polygon bounds. Don't draw anything.

Reimplemented from gccv::Item.

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

Reimplemented from gccv::Item.

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

Draws the Polygon to cr.

Reimplemented from gccv::Item.

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

Moves the Polygon.

Reimplemented from gccv::Item.

void gccv::Polygon::SetPoints ( std::list< Point > &  points)
Parameters
pointsthe new vertices positions.

Sets the vertices for the Polygon instance.

void gccv::Polygon::UpdateBounds ( )
protectedvirtual

Evaluates the Polygon bounds.

Reimplemented from gccv::Item.

Member Data Documentation

std::list<Point> gccv::Polygon::m_Points
protected

The Polygon vertices.

Definition at line 119 of file polygon.h.


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