Gnome::Canvas::PathDef Class Reference

#include <path-def.h>

List of all members.

Public Member Functions

void reference () const
void unreference () const
GnomeCanvasPathDef * gobj ()
 Provides access to the underlying C instance.
const GnomeCanvasPathDef * gobj () const
 Provides access to the underlying C instance.
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.
Glib::RefPtr< PathDefopen_parts ()
 This function creates a new GnomeCanvasPathDef that contains all of the open segments on the passed path.
Glib::RefPtr< PathDefclosed_parts ()
 This function returns a new GnomeCanvasPathDef that contains the all of close parts of passed path.
Glib::RefPtr< PathDefclose_all ()
 This function closes all of the open segments in the passed path and returns a new GnomeCanvasPathDef.
void finish ()
 Trims dynamic point array to exact length of path.
void ensure_space (int space)
 This function ensures that enough space for space points is allocated at the end of the path.
void reset ()
 This function clears the contents of the passed path.
void moveto (double x, double y)
 This function adds starts new subpath on path, and sets its starting point to x and y.
void lineto (double x, double y)
 This function add a line segment to the passed path with the specified x and y coordinates.
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.
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.
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.
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.
Gnome::Art::Point currentpoint () const
ArtBpath * get_bpath () const
 This function returns a ArtBpath that consists of the path definition.
ArtBpath * first_bpath () const
 This function returns the first ArtBpath point in the definition.
ArtBpath * last_bpath () const
 This function returns pointer to the last ArtBpath segment in the path definition.
bool is_empty () const
 This function is a boolean test to see if the path is empty, meaning containing no line segments.
int length () const
 This function returns the length of the path definition.
bool has_currentpoint () const
 This function is a boolean test checking to see if the path has a current point defined.
bool any_open () const
 This function returns a boolean value indicating if the path has any open segments.
bool all_open () const
 This function returns a boolean value indicating if the path only contains open segments.
bool any_closed () const
 This function returns a boolean valid indicating if the path has any closed segements.
bool all_closed () const
 This function returns a boolean value indicating if the path only contains closed segments.

Static Public Member Functions

static Glib::RefPtr< PathDefcreate ()
static Glib::RefPtr< PathDefcreate (int length)
 This funtion creates a new gnome_canvas_path_def with length number of points allocated.
static Glib::RefPtr< PathDefcreate (ArtBpath &bpath)
 This function constructs a new gnome_canvas_path_def and uses the passed bpath as the contents.

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.


Constructor & Destructor Documentation

Gnome::Canvas::PathDef::PathDef (  )  [protected]


Member Function Documentation

bool Gnome::Canvas::PathDef::all_closed (  )  const

This function returns a boolean value indicating if the path only contains closed segments.

Returns:
Boolean, indicating if the path has all closed segments.

bool Gnome::Canvas::PathDef::all_open (  )  const

This function returns a boolean value indicating if the path only contains open segments.

Returns:
Boolean, indicating if the path has all open segments.

bool Gnome::Canvas::PathDef::any_closed (  )  const

This function returns a boolean valid indicating if the path has any closed segements.

Returns:
Boolean, indicating if the path has any closed segments.

bool Gnome::Canvas::PathDef::any_open (  )  const

This function returns a boolean value indicating if the path has any open segments.

Returns:
Boolean, 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.

Returns:
A GnomeCanvasPathDef that contains the contents of path but has modified the path is fully closed.

Glib::RefPtr<PathDef> Gnome::Canvas::PathDef::closed_parts (  ) 

This function returns a new GnomeCanvasPathDef that contains the all of close parts of passed path.

Returns:
A new GnomeCanvasPathDef that contains all of the closed 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 Glib::RefPtr<PathDef> Gnome::Canvas::PathDef::create ( ArtBpath &  bpath  )  [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.

Parameters:
bpath Libart bezier path.
Returns:
The new canvas path definition that is populated with the passed bezier path, if the bpath is bad 0 is returned.

static Glib::RefPtr<PathDef> Gnome::Canvas::PathDef::create ( int  length  )  [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.

Parameters:
length Number of points to allocate for the path.
Returns:
The new canvas path definition.

static Glib::RefPtr<PathDef> Gnome::Canvas::PathDef::create (  )  [static]

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.

Parameters:
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.

Parameters:
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.

Returns:
ArtBpath being the first point in the path definition or null if no points are defined.

ArtBpath* Gnome::Canvas::PathDef::get_bpath (  )  const

This function returns a ArtBpath that consists of the path definition.

Returns:
ArtBpath.

const GnomeCanvasPathDef* Gnome::Canvas::PathDef::gobj (  )  const

Provides access to the underlying C instance.

GnomeCanvasPathDef* Gnome::Canvas::PathDef::gobj (  ) 

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.

Returns:
Boolean, indicating if the path has a current point defined.

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.

Returns:
Boolean, indicating if the path is empty.

ArtBpath* Gnome::Canvas::PathDef::last_bpath (  )  const

This function returns pointer to the last ArtBpath segment in the path definition.

Returns:
ArtBpath, being the last segment in the path definition or null if no line segments have been defined.

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.

Returns:
Integer, 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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Returns:
A new GnomeCanvasPathDef that contains all of the open segemtns in path.

void Gnome::Canvas::PathDef::operator delete ( void *  ,
size_t   
) [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


Friends And Related Function Documentation

Glib::RefPtr< Gnome::Canvas::PathDef > wrap ( GnomeCanvasPathDef *  object,
bool  take_copy = false 
) [related]

A Glib::wrap() method for this object.

Parameters:
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.
Returns:
A C++ instance that wraps this C instance.


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

Generated on Wed Sep 2 16:27:12 2009 for libgnomecanvasmm by  doxygen 1.5.9