Container and functions for manipulating ArtBpaths
Convenient container and functions for manipulating ArtBpaths, which are paths defined by line and curve segments.
<gnome-canvas-path-def>
)This function creates a new empty
<gnome-canvas-path-def>
.
- ret
- the new canvas path definition.
int
) ⇒ (ret <gnome-canvas-path-def>
)This function 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
- ret
- the new canvas path definition
<gnome-canvas-path-def>
)Trims dynamic point array to exact length of path.
- path
- a GnomeCanvasPathDef
<gnome-canvas-path-def>
) (space int
)This function ensures that enough space for space points is allocated at the end of the path.
- path
- a GnomeCanvasPathDef
- space
- number of points to guarantee are allocated at the end of the path.
<gnome-canvas-path-def>
) ⇒ (ret <gnome-canvas-path-def>
)This function duplicates the passed path. The new path is marked as non-static regardless of the state of original.
- path
- a GnomeCanvasPathDef to duplicate
- ret
- a GnomeCanvasPathDef which is a duplicate of path.
gslist-of
) ⇒ (ret <gnome-canvas-path-def>
)This function concatenates a list of GnomeCanvasPathDefs into one newly created GnomeCanvasPathDef.
- list
- a GSList of GnomeCanvasPathDefs to concatenate into one new path.
- ret
- a new GnomeCanvasPathDef
<gnome-canvas-path-def>
) ⇒ (ret gslist-of
)This function splits the passed path into a list of GnomeCanvasPathDefs which represent each segment of the origional path. The path is split when ever an ART_MOVETO or ART_MOVETO_OPEN is encountered. The closedness of resulting paths is set accordingly to closedness of corresponding segment.
- path
- a GnomeCanvasPathDef
- ret
- a list of GnomeCanvasPathDef(s).
<gnome-canvas-path-def>
) ⇒ (ret <gnome-canvas-path-def>
)This function creates a new GnomeCanvasPathDef that contains all of the open segments on the passed path.
- path
- a GnomeCanvasPathDef
- ret
- a new GnomeCanvasPathDef that contains all of the open segemtns in path.
<gnome-canvas-path-def>
) ⇒ (ret <gnome-canvas-path-def>
)This function returns a new GnomeCanvasPathDef that contains the all of close parts of passed path.
- path
- a GnomeCanvasPathDef
- ret
- a new GnomeCanvasPathDef that contains all of the closed parts of passed path.
<gnome-canvas-path-def>
) ⇒ (ret <gnome-canvas-path-def>
)This function closes all of the open segments in the passed path and returns a new GnomeCanvasPathDef.
- path
- a GnomeCanvasPathDef
- ret
- a GnomeCanvasPathDef that contains the contents of path but has modified the path is fully closed
<gnome-canvas-path-def>
)This function clears the contents of the passed path.
- path
- a GnomeCanvasPathDef
<gnome-canvas-path-def>
) (x double
) (y double
)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.
- path
- a GnomeCanvasPathDef
- x
- x coordinate
- y
- y coordinate
<gnome-canvas-path-def>
) (x double
) (y double
)This function add a line segment to the passed path with the specified x and y coordinates.
- path
- a GnomeCanvasPathDef
- x
- x coordinate
- y
- y coordinate
<gnome-canvas-path-def>
) (x double
) (y double
)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.
- path
- a GnomeCanvasPathDef
- x
- x coordinate
- y
- y coordinate
<gnome-canvas-path-def>
) (x0 double
) (y0 double
) (x1 double
) (y1 double
) (x2 double
) (y2 double
)This function adds a bezier curve segment to the path definition.
- path
- a GnomeCanvasPathDef
- 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
<gnome-canvas-path-def>
)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
- path
- a GnomeCanvasPathDef
<gnome-canvas-path-def>
) ⇒ (ret int
)This function returns the length of the path definition. Not Euclidian length of the path but rather the number of points on the path.
- path
- a GnomeCanvasPathDef
- ret
- integer, number of points on the path.
<gnome-canvas-path-def>
) ⇒ (ret bool
)This function is a boolean test to see if the path is empty, meaning containing no line segments.
- path
- a GnomeCanvasPathDef
- ret
- boolean, indicating if the path is empty.
<gnome-canvas-path-def>
) ⇒ (ret bool
)This function returns a boolean value indicating if the path has any open segments.
- path
- a GnomeCanvasPathDef
- ret
- boolean, indicating if the path has any open segments.
<gnome-canvas-path-def>
) ⇒ (ret bool
)This function returns a boolean value indicating if the path only contains open segments.
- path
- a GnomeCanvasPathDef
- ret
- boolean, indicating if the path has all open segments.