|
The Gnome Chemistry Utils
0.12.11
|
A drop or leaf item. More...
#include <leaf.h>
Public Member Functions | |
| Leaf (Canvas *canvas, double x, double y, double radius) | |
| Leaf (Group *parent, double x, double y, double radius, ItemClient *client=NULL) | |
| virtual | ~Leaf () |
| void | SetPosition (double x, double y) |
| void | GetPosition (double &x, double &y) |
| void | SetWidthFactor (double factor) |
| 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 | SetRadius (double val) |
| double | GetRadius (void) const |
| void | SetRotation (double val) |
| double | GetRotation (void) const |
| double | GetWidthFactor (void) const |
Protected Member Functions | |
| void | UpdateBounds () |
| gccv::Leaf::Leaf | ( | Canvas * | canvas, |
| double | x, | ||
| double | y, | ||
| double | radius | ||
| ) |
| gccv::Leaf::Leaf | ( | Group * | parent, |
| double | x, | ||
| double | y, | ||
| double | radius, | ||
| ItemClient * | client = NULL |
||
| ) |
| parent | the Group to which the new Leaf will be added. |
| x | the leaf origin horizontal position. |
| y | the leaf origin vertical position. |
| radius | the leaf radius. |
| client | the ItemClient for the new Leaf if any. |
Creates a new Leaf inside parent and sets client as its associated ItemClient. The origin is the angular point, and the radius the distance between the origin and the opposite point.
| virtual gccv::Leaf::~Leaf | ( | ) | [virtual] |
The destructor.
| double gccv::Leaf::Distance | ( | double | x, |
| double | y, | ||
| Item ** | item | ||
| ) | const [virtual] |
| x | horizontal position |
| y | vertical position |
| item | where to store the Item. |
Implementation of Item::Distance() for the Leaf class. Sets item to this.
Reimplemented from gccv::Item.
| void gccv::Leaf::Draw | ( | cairo_t * | cr, |
| bool | is_vector | ||
| ) | const [virtual] |
| cr | a cairo_t. |
| is_vector | whether the cairo_t is a vectorial context. |
Draws the Leaf to cr.
Reimplemented from gccv::Item.
| void gccv::Leaf::GetPosition | ( | double & | x, |
| double & | y | ||
| ) |
| x | where to store the leaf originhorizontal position. |
| y | where to store the leaf origin vertical position. |
Retrieves the position of the leaf origin.
| gccv::Leaf::GetRadius | ( | void | ) | const [inline] |
| gccv::Leaf::GetRotation | ( | void | ) | const [inline] |
| gccv::Leaf::GetWidthFactor | ( | void | ) | const [inline] |
| void gccv::Leaf::Move | ( | double | x, |
| double | y | ||
| ) | [virtual] |
| x | the horizontal deplacement |
| y | the vertical deplacement |
Moves the Leaf.
Reimplemented from gccv::Item.
| void gccv::Leaf::SetPosition | ( | double | x, |
| double | y | ||
| ) |
| x | the new leaf origin horizontal position. |
| y | the new leaf origin vertical position. |
Sets the position of the leaf origin.
| gccv::Leaf::SetRadius | ( | double | radius | ) | [inline] |
| gccv::Leaf::SetRotation | ( | double | rotation | ) | [inline] |
| void gccv::Leaf::SetWidthFactor | ( | double | factor | ) |
| factor | the new width factor. |
Sets the width of the leaf relative to its radius. Actually, the width is 0.8 * factor * radius.
| void gccv::Leaf::UpdateBounds | ( | ) | [protected, virtual] |
Evaluates the Leaf bounds.
Reimplemented from gccv::Item.
1.7.6.1