Class Path (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.

Class overview

Index

Method Overview

[static] Path newDefault constructor: creates an empty (invalid) path with width 0
[static] Path new( Point pts[ ], int width )Constructor given the points of the path's spine and the width
[static] Path new( Point pts[ ], int width, int bgn_ext, int end_ext )Constructor given the points of the path's spine, the width and the extensions
[static] Path new( Point pts[ ], int width, int bgn_ext, int end_ext, bool round )Constructor given the points of the path's spine, the width, the extensions and the round end flag
[const] bool <( Path p )Less operator
[const] bool ==( Path p )Equality test
[const] bool !=( Path p )Inequality test
points=( Point p[ ] )Set the points of the path
[const] yield Point each_pointGet the points that make up the path's spine
[const] unsigned int pointsGet the number of points
width=( int )Set the width
[const] int widthGet the width
bgn_ext=( int )Set the begin extension
[const] int bgn_extGet the begin extension
end_ext=( int )Set the end extension
[const] int end_extGet the end extension
round=( bool )Set the 'round ends' flag
[const] bool is_round?Tell, if the path has round ends
ref Path move( Point p )Moves the path.
[const] Path moved( Point p )Returns the moved path
[const] Path transformed( Trans t )Transform the path.
[const] DPath transformed_cplx( CplxTrans t )Transform the path.
[const] string to_sConvert to a string
[const] SimplePolygon simple_polygonConvert the path to a simple polygon
[const] Polygon polygonConvert the path to a polygon
[const] Box bboxReturn the bounding box of the path
[static] Path from_dpath( DPath double_path )Construct an integer-coordinate path from a floating-point coordinate one
[const] Path transformed_cplx( ICplxTrans t )Transform the path.
assign( Path other )Assign the contents of another object to self
[const] Path dupCreates a copy of self.
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

[const] bool !=( Path p )

Description: Inequality test

p:The object to compare against

[const] bool <( Path p )

Description: Less operator

This operator is provided to establish some, not necessarily a certain sorting order

p:The object to compare against

[const] bool ==( Path p )

Description: Equality test

p:The object to compare against

assign( Path 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] Box bbox

Description: Return the bounding box of the path

[const] int bgn_ext

Description: Get the begin extension

bgn_ext=( int )

Description: Set the begin extension

destroy

Description: 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 destroyed

Description: 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] Path dup

Description: Creates a copy of self.

[const] yield Point each_point

Description: Get the points that make up the path's spine

[const] int end_ext

Description: Get the end extension

end_ext=( int )

Description: Set the end extension

[static] Path from_dpath( DPath double_path )

Description: Construct an integer-coordinate path from a floating-point coordinate one

This method has been added in version 0.15.

[const] bool is_round?

Description: Tell, if the path has round ends

ref Path move( Point p )

Description: Moves the path.

Moves the path by the given offset and returns the moved path. The path is overwritten.

p:The distance to move the path.
returns:The moved path.

[const] Path moved( Point p )

Description: Returns the moved path

Moves the path by the given offset and returns the moved path. The path is not modified.

p:The distance to move the path.
returns:The moved path.

[static] Path new( Point pts[ ], int width )
synonym: [static] Path new_pw( Point pts[ ], int width )

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

[static] Path new( Point pts[ ], int width, int bgn_ext, int end_ext, bool round )
synonym: [static] Path new_pwxr( Point pts[ ], int width, int bgn_ext, int end_ext, bool round )

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

[static] Path new( Point pts[ ], int width, int bgn_ext, int end_ext )
synonym: [static] Path new_pwx( Point pts[ ], int width, int bgn_ext, int end_ext )

Description: Constructor given the points of the path's spine, the width and the extensions

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

[static] Path new

Description: Default constructor: creates an empty (invalid) path with width 0

[const] unsigned int points

Description: Get the number of points

points=( Point p[ ] )

Description: Set the points of the path

p:An array of points to assign to the path's spine

[const] Polygon polygon

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.

round=( bool )

Description: Set the 'round ends' flag

[const] SimplePolygon simple_polygon

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.

[const] string to_s

Description: Convert to a string

[const] Path transformed( Trans t )

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.

[const] Path transformed_cplx( ICplxTrans t )

Description: Transform the path.

Transforms the path with the given complex transformation. Does not modify the path but returns the transformed path.

This method has been introduced in version 0.18.

t:The transformation to apply.
returns:The transformed path (in this case an integer coordinate path).

[const] DPath transformed_cplx( CplxTrans t )

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.

[const] int width

Description: Get the width

width=( int )

Description: Set the width