Class DPath (version 0.18)Description: An path class A path consists of an sequence of line segments forming the 'spine' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the 'begin extension') and the end point can be pulled forward somewhat (by the 'end extension'). A path may have round ends for special purposes.
Method Overview
[const] bool !=( DPath p )Description: Inequality test
[const] bool <( DPath p )Description: Less operator This operator is provided to establish some, not necessarily a certain sorting order
[const] bool ==( DPath p )Description: Equality test
assign( DPath other )Description: Assign the contents of another object to self This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.
[const] DBox bboxDescription: Return the bounding box of the path
[const] double bgn_extDescription: Get the begin extension
bgn_ext=( double )Description: Set the begin extension
destroyDescription: Explicitly destroy the object Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.
[const] bool destroyedDescription: Tell, if the object was destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.
[const] DPath dupDescription: Creates a copy of self.
[const] yield DPoint each_pointDescription: Get the points that make up the path's spine
[const] double end_extDescription: Get the end extension
end_ext=( double )Description: Set the end extension
[static] DPath from_ipath( Path int_path )Description: Construct a floating-point coordinate path from an integer coordinate one This method has been added in version 0.15.
[const] bool is_round?Description: Tell, if the path has round ends
ref DPath move( DPoint p )Description: Moves the path. Moves the path by the given offset and returns the moved path. The path is overwritten.
[const] DPath moved( DPoint p )Description: Returns the moved path Moves the path by the given offset and returns the moved path. The path is not modified.
[static] DPath new( DPoint pts[ ], double width, double bgn_ext, double end_ext )
|
pts: | The points forming the spine of the path |
width: | The width of the path |
bgn_ext: | The begin extension of the path |
end_ext: | The end extension of the path |
Description: Constructor given the points of the path's spine and the width
pts: | The points forming the spine of the path |
width: | The width of the path |
Description: Default constructor: creates an empty (invalid) path with width 0
Description: Constructor given the points of the path's spine, the width, the extensions and the round end flag
pts: | The points forming the spine of the path |
width: | The width of the path |
bgn_ext: | The begin extension of the path |
end_ext: | The end extension of the path |
round: | If this flag is true, the path will get rounded ends |
Description: Get the number of points
Description: Set the points of the path
p: | An array of points to assign to the path's spine |
Description: Convert the path to a polygon
The returned polygon is not guaranteed to be non-selfoverlapping. This may happen if the path overlaps itself or contains very short segments.
Description: Set the 'round ends' flag
Description: Convert the path to a simple polygon
The returned polygon is not guaranteed to be non-selfoverlapping. This may happen if the path overlaps itself or contains very short segments.
Description: Convert to a string
Description: Transform the path.
Transforms the path with the given transformation. Does not modify the path but returns the transformed path.
t: | The transformation to apply. |
returns: | The transformed path. |
Description: Transform the path.
Transforms the path with the given complex transformation. Does not modify the path but returns the transformed path.
t: | The transformation to apply. |
returns: | The transformed path. |
Description: Get the width
Description: Set the width