The Gnome Chemistry Utils 0.13.3
Public Member Functions | Protected Member Functions
gccv::Rectangle Class Reference

Rectangles. More...

#include <rectangle.h>

Inheritance diagram for gccv::Rectangle:
gccv::FillItem gccv::LineItem gccv::Item gccv::Text

List of all members.

Public Member Functions

 Rectangle (Canvas *canvas, double x, double y, double width, double height)
 Rectangle (Group *parent, double x, double y, double width, double height, ItemClient *client=NULL)
virtual ~Rectangle ()
void SetPosition (double x, double y, double width, double height)
void GetPosition (double &x, double &y) const
void GetPosition (double &x, double &y, double &width, double &height) const
double Distance (double x, double y, Item **item) const
void Draw (cairo_t *cr, bool is_vector) const
void Move (double x, double y)

Protected Member Functions

void UpdateBounds ()

Detailed Description

Rectangles.

Implements rectangular, optionally filled, items.

Definition at line 39 of file rectangle.h.


Constructor & Destructor Documentation

gccv::Rectangle::Rectangle ( Canvas canvas,
double  x,
double  y,
double  width,
double  height 
)
Parameters:
canvasa Canvas.
xthe top left corner horizontal position.
ythe top left corner vertical position.
widththe rectangle width.
heightthe rectangle height.

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

gccv::Rectangle::Rectangle ( Group parent,
double  x,
double  y,
double  width,
double  height,
ItemClient client = NULL 
)
Parameters:
parentthe Group to which the new Text will be added.
xthe top left corner horizontal position.
ythe top left corner vertical position.
widththe rectangle width.
heightthe rectangle height.
clientthe ItemClient for the new Text if any.

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

virtual gccv::Rectangle::~Rectangle ( ) [virtual]

The destructor.


Member Function Documentation

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

Reimplemented from gccv::Item.

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

Draws the Rectangle to cr.

Reimplemented from gccv::Item.

Reimplemented in gccv::Text.

void gccv::Rectangle::GetPosition ( double &  x,
double &  y 
) const
Parameters:
xwhere to store the top left corner horizontal position.
ywhere to store the top left corner vertical position.

Retrieves the position the Rectangle.

void gccv::Rectangle::GetPosition ( double &  x,
double &  y,
double &  width,
double &  height 
) const
Parameters:
xwhere to store the top left corner horizontal position.
ywhere to store the top left corner vertical position.
widthwhere to store the rectangle width.
heightwhere to store the rectangle height.

Retrieves the position and size of the Rectangle.

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

Moves the Rectangle.

Reimplemented from gccv::Item.

Reimplemented in gccv::Text.

void gccv::Rectangle::SetPosition ( double  x,
double  y,
double  width,
double  height 
)
Parameters:
xthe top left corner new horizontal position.
ythe top left corner new vertical position.
widththe rectangle new width.
heightthe rectangle new height.

Sets the position and size of the Rectangle.

void gccv::Rectangle::UpdateBounds ( ) [protected, virtual]

Evaluates the Rectangle bounds.

Reimplemented from gccv::Item.


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