libgnomecanvasmm
|
#include <path-def.h>
Public Member Functions | |
void | reference () const |
void | unreference () const |
GnomeCanvasPathDef * | gobj () |
Provides access to the underlying C instance. More... | |
const GnomeCanvasPathDef * | gobj () const |
Provides access to the underlying C instance. More... | |
GnomeCanvasPathDef * | gobj_copy () const |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
Glib::RefPtr< PathDef > | open_parts () |
This function creates a new GnomeCanvasPathDef that contains all of the open segments on the passed path. More... | |
Glib::RefPtr< PathDef > | closed_parts () |
This function returns a new GnomeCanvasPathDef that contains the all of close parts of passed path. More... | |
Glib::RefPtr< PathDef > | close_all () |
This function closes all of the open segments in the passed path and returns a new GnomeCanvasPathDef. More... | |
void | finish () |
Trims dynamic point array to exact length of path. More... | |
void | ensure_space (int space) |
This function ensures that enough space for space points is allocated at the end of the path. More... | |
void | reset () |
This function clears the contents of the passed path. More... | |
void | moveto (double x, double y) |
This function adds starts new subpath on path, and sets its starting point to x and y. More... | |
void | lineto (double x, double y) |
This function add a line segment to the passed path with the specified x and y coordinates. More... | |
void | lineto_moving (double x, double y) |
This functions adds a new line segment with loose endpoint to the path, or if endpoint is already loose, changes its coordinates to x, y. More... | |
void | curveto (double x1, double y1, double x2, double y2, double x3, double y3) |
This function adds a bezier curve segment to the path definition. More... | |
void | closepath () |
This function closes the last subpath of path, adding a ART_LINETO to subpath starting point, if needed and changing starting pathcode to ART_MOVETO. More... | |
void | closepath_current () |
This function closes the last subpath by setting the coordinates of the endpoint of the last segment (line or curve) to starting point. More... | |
Gnome::Art::Point | currentpoint () const |
ArtBpath * | get_bpath () const |
This function returns a ArtBpath that consists of the path definition. More... | |
ArtBpath * | first_bpath () const |
This function returns the first ArtBpath point in the definition. More... | |
ArtBpath * | last_bpath () const |
This function returns pointer to the last ArtBpath segment in the path definition. More... | |
bool | is_empty () const |
This function is a boolean test to see if the path is empty, meaning containing no line segments. More... | |
int | length () const |
This function returns the length of the path definition. More... | |
bool | has_currentpoint () const |
This function is a boolean test checking to see if the path has a current point defined. More... | |
bool | any_open () const |
This function returns a boolean value indicating if the path has any open segments. More... | |
bool | all_open () const |
This function returns a boolean value indicating if the path only contains open segments. More... | |
bool | any_closed () const |
This function returns a boolean valid indicating if the path has any closed segements. More... | |
bool | all_closed () const |
This function returns a boolean value indicating if the path only contains closed segments. More... | |
Static Public Member Functions | |
static Glib::RefPtr< PathDef > | create () |
static Glib::RefPtr< PathDef > | create (int length) |
This funtion creates a new #gnome_canvas_path_def with length number of points allocated. More... | |
static Glib::RefPtr< PathDef > | create (ArtBpath &bpath) |
This function constructs a new #gnome_canvas_path_def and uses the passed bpath as the contents. More... | |
Protected Member Functions | |
PathDef () | |
void | operator delete (void *, size_t) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr < Gnome::Canvas::PathDef > | wrap (GnomeCanvasPathDef *object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
|
protected |
bool Gnome::Canvas::PathDef::all_closed | ( | ) | const |
This function returns a boolean value indicating if the path only contains closed segments.
bool Gnome::Canvas::PathDef::all_open | ( | ) | const |
This function returns a boolean value indicating if the path only contains open segments.
bool Gnome::Canvas::PathDef::any_closed | ( | ) | const |
This function returns a boolean valid indicating if the path has any closed segements.
bool Gnome::Canvas::PathDef::any_open | ( | ) | const |
This function returns a boolean value indicating if the path has any open segments.
Glib::RefPtr<PathDef> Gnome::Canvas::PathDef::close_all | ( | ) |
This function closes all of the open segments in the passed path and returns a new GnomeCanvasPathDef.
Glib::RefPtr<PathDef> Gnome::Canvas::PathDef::closed_parts | ( | ) |
This function returns a new GnomeCanvasPathDef that contains the all of close parts of passed path.
void Gnome::Canvas::PathDef::closepath | ( | ) |
This function closes the last subpath of path, adding a ART_LINETO to subpath starting point, if needed and changing starting pathcode to ART_MOVETO.
void Gnome::Canvas::PathDef::closepath_current | ( | ) |
This function closes the last subpath by setting the coordinates of the endpoint of the last segment (line or curve) to starting point.
|
static |
|
static |
This funtion creates a new #gnome_canvas_path_def with length number of points allocated.
It is useful, if you know the exact number of points in path, so you can avoid automatic point array reallocation.
length | Number of points to allocate for the path. |
|
static |
This function constructs a new #gnome_canvas_path_def and uses the passed bpath as the contents.
The passed bpath should not be static as the path definition is editable when constructed with this function. Also, passed bpath will be freed with art_free, if path is destroyed, so use it with caution. For constructing a #gnome_canvas_path_def from (non-modifiable) bpath use #gnome_canvas_path_def_new_from_static_bpath.
bpath | Libart bezier path. |
0
is returned. Gnome::Art::Point Gnome::Canvas::PathDef::currentpoint | ( | ) | const |
void Gnome::Canvas::PathDef::curveto | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
double | x3, | ||
double | y3 | ||
) |
This function adds a bezier curve segment to the path definition.
x0 | First control point x coordinate. |
y0 | First control point y coordinate. |
x1 | Second control point x coordinate. |
y1 | Second control point y coordinate. |
x2 | End of curve x coordinate. |
y2 | End of curve y coordinate. |
void Gnome::Canvas::PathDef::ensure_space | ( | int | space | ) |
This function ensures that enough space for space points is allocated at the end of the path.
space | Number of points to guarantee are allocated at the end of the path. |
void Gnome::Canvas::PathDef::finish | ( | ) |
Trims dynamic point array to exact length of path.
ArtBpath* Gnome::Canvas::PathDef::first_bpath | ( | ) | const |
This function returns the first ArtBpath point in the definition.
ArtBpath* Gnome::Canvas::PathDef::get_bpath | ( | ) | const |
This function returns a ArtBpath that consists of the path definition.
GnomeCanvasPathDef* Gnome::Canvas::PathDef::gobj | ( | ) |
Provides access to the underlying C instance.
const GnomeCanvasPathDef* Gnome::Canvas::PathDef::gobj | ( | ) | const |
Provides access to the underlying C instance.
GnomeCanvasPathDef* Gnome::Canvas::PathDef::gobj_copy | ( | ) | const |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool Gnome::Canvas::PathDef::has_currentpoint | ( | ) | const |
This function is a boolean test checking to see if the path has a current point defined.
Current point will be set by line operators, and cleared by closing subpath.
bool Gnome::Canvas::PathDef::is_empty | ( | ) | const |
This function is a boolean test to see if the path is empty, meaning containing no line segments.
ArtBpath* Gnome::Canvas::PathDef::last_bpath | ( | ) | const |
This function returns pointer to the last ArtBpath segment in the path definition.
int Gnome::Canvas::PathDef::length | ( | ) | const |
This function returns the length of the path definition.
Not Euclidian length of the path but rather the number of points on the path.
void Gnome::Canvas::PathDef::lineto | ( | double | x, |
double | y | ||
) |
This function add a line segment to the passed path with the specified x and y coordinates.
x | X coordinate. |
y | Y coordinate. |
void Gnome::Canvas::PathDef::lineto_moving | ( | double | x, |
double | y | ||
) |
This functions adds a new line segment with loose endpoint to the path, or if endpoint is already loose, changes its coordinates to x, y.
You can change the coordinates of loose endpoint as many times as you want, the last ones set will be fixed, if you continue line. This is useful for handling drawing with mouse.
x | X coordinate. |
y | Y coordinate. |
void Gnome::Canvas::PathDef::moveto | ( | double | x, |
double | y | ||
) |
This function adds starts new subpath on path, and sets its starting point to x and y.
If current subpath is empty, it simply changes its starting coordinates to new values.
x | X coordinate. |
y | Y coordinate. |
Glib::RefPtr<PathDef> Gnome::Canvas::PathDef::open_parts | ( | ) |
This function creates a new GnomeCanvasPathDef that contains all of the open segments on the passed path.
|
protected |
void Gnome::Canvas::PathDef::reference | ( | ) | const |
void Gnome::Canvas::PathDef::reset | ( | ) |
This function clears the contents of the passed path.
void Gnome::Canvas::PathDef::unreference | ( | ) | const |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |