Class Shape (version 0.18)

Description: A shape proxy

The shape proxy is basically a pointer to a shape of different kinds. No copy of the shape is created: if the shape proxy is copied the copy still points to the original shape. If the original shape is modified or deleted, the shape proxy will also point to a modified or invalid shape. The proxy can be "null" which decribes an invalid reference.

Class overview

Index

Method Overview

[const] unsigned int prop_idGet the properties Id associated with the shape
[const] bool has_prop_id?Check, if the shape is associated with a properties Id
[const] yield Point each_pointIterate over all points of the object
[const] yield Point each_point_hullIterate over the hull contour of the object
[const] yield Point each_point_hole( unsigned int hole_index )Iterate over the points of a hole contour
[const] unsigned int holesReturn the number of holes
yield Edge each_edgeIterate over the edges of the object
[const] int typeReturn the type of the shape reference
[const] bool is_null?Test if the shape proxy is a null object
[const] bool is_polygon?Test if the shape proxy points to a polygon
[const] Polygon polygonInstantiate the polygon object
[const] bool is_simple_polygon?Test if the shape proxy points to a simple polygon
[const] SimplePolygon simple_polygonInstantiate the simple polygon object
[const] bool is_path?Test if the shape proxy points to a path
[const] int path_widthObtain the path width
[const] bool round_path?Returns true, if the path has round ends
[const] int path_bgnextObtain the path's "begin" extension
[const] int path_endextObtain the path's "end" extension
[const] Path pathInstantiate the path object
[const] bool is_edge?Test if the shape proxy points to a edge
[const] Edge edgeInstantiate the edge object
[const] bool is_text?Test if the shape proxy points to a text
[const] Text textInstantiate the text object
[const] string text_stringObtain the text string
[const] Trans text_transObtain the text transformation
[const] int text_sizeObtain the text size
[const] int text_fontObtain the text's font
[const] bool is_box?Test if the shape proxy points to a box
[const] Box boxInstantiate the box object
[const] bool is_user_object?Test if the shape proxy points to a user object
[const] bool is_array_member?Returns true, if the shape referenced is a member of a shape array
[const] const ref Trans array_transGet the array instance member transformation
[const] Box bboxCompute the bounding box of the shape that is referenced
[const] bool !=( Shape )Inequality
[const] bool ==( Shape )Equality
[const] string to_sCreate a string showing the contents of the reference
[static] int t_null
[static] int t_polygon
[static] int t_polygon_ref
[static] int t_polygon_ptr_array
[static] int t_polygon_ptr_array_member
[static] int t_simple_polygon
[static] int t_simple_polygon_ref
[static] int t_simple_polygon_ptr_array
[static] int t_simple_polygon_ptr_array_member
[static] int t_edge
[static] int t_path
[static] int t_path_ref
[static] int t_path_ptr_array
[static] int t_path_ptr_array_member
[static] int t_box
[static] int t_box_array
[static] int t_box_array_member
[static] int t_short_box
[static] int t_short_box_array
[static] int t_short_box_array_member
[static] int t_text
[static] int t_text_ref
[static] int t_text_ptr_array
[static] int t_text_ptr_array_member
[static] int t_user_object
assign( Shape other )Assign the contents of another object to self
[const] Shape dupCreates a copy of self.
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

[const] bool !=( Shape )

Description: Inequality

[const] bool ==( Shape )

Description: Equality

Equality of shapes is not specified by the identity of the objects but by the identity of the pointers - both shapes must reference the same object.

[const] const ref Trans array_trans

Description: Get the array instance member transformation

This attribute is valid only if is_array_member? is true. The transformation returned describes the relative transformation of the array member addressed.

assign( Shape 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: Compute the bounding box of the shape that is referenced

[const] Box box

Description: Instantiate the box object

If a box is referenced, this object is instantiated by this method.

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] Shape dup

Description: Creates a copy of self.

yield Edge each_edge

Description: Iterate over the edges of the object

This method applies to polygons and simple polygons.

[const] yield Point each_point

Description: Iterate over all points of the object

This method applies to paths.

[const] yield Point each_point_hole( unsigned int hole_index )

Description: Iterate over the points of a hole contour

This method applies to polygons. Simple polygons deliver an empty sequence.

hole:The hole index (see holes () method)

[const] yield Point each_point_hull

Description: Iterate over the hull contour of the object

This method applies to polygons.

[const] Edge edge

Description: Instantiate the edge object

If a edge is referenced, this object is instantiated by this method.

[const] bool has_prop_id?

Description: Check, if the shape is associated with a properties Id

[const] unsigned int holes

Description: Return the number of holes

This method applies to polygons. Simple polygons deliver a zero value.

[const] bool is_array_member?

Description: Returns true, if the shape referenced is a member of a shape array

[const] bool is_box?

Description: Test if the shape proxy points to a box

[const] bool is_edge?

Description: Test if the shape proxy points to a edge

[const] bool is_null?

Description: Test if the shape proxy is a null object

[const] bool is_path?

Description: Test if the shape proxy points to a path

[const] bool is_polygon?

Description: Test if the shape proxy points to a polygon

[const] bool is_simple_polygon?

Description: Test if the shape proxy points to a simple polygon

[const] bool is_text?

Description: Test if the shape proxy points to a text

[const] bool is_user_object?

Description: Test if the shape proxy points to a user object

[const] Path path

Description: Instantiate the path object

If a path is referenced, this object is instantiated by this method.

[const] int path_bgnext

Description: Obtain the path's "begin" extension

Applies to paths only.

[const] int path_endext

Description: Obtain the path's "end" extension

Applies to paths only.

[const] int path_width

Description: Obtain the path width

Applies to paths only.

[const] Polygon polygon

Description: Instantiate the polygon object

If a polygon is referenced, this object is instantiated by this method. Paths and boxes are converted to polygons.

[const] unsigned int prop_id

Description: Get the properties Id associated with the shape

[const] bool round_path?

Description: Returns true, if the path has round ends

Applies to paths only.

[const] SimplePolygon simple_polygon

Description: Instantiate the simple polygon object

If a simple polygon is referenced, this object is instantiated by this method. Paths and boxes are converted to polygons.

[static] int t_box

Description:

[static] int t_box_array

Description:

[static] int t_box_array_member

Description:

[static] int t_edge

Description:

[static] int t_null

Description:

[static] int t_path

Description:

[static] int t_path_ptr_array

Description:

[static] int t_path_ptr_array_member

Description:

[static] int t_path_ref

Description:

[static] int t_polygon

Description:

[static] int t_polygon_ptr_array

Description:

[static] int t_polygon_ptr_array_member

Description:

[static] int t_polygon_ref

Description:

[static] int t_short_box

Description:

[static] int t_short_box_array

Description:

[static] int t_short_box_array_member

Description:

[static] int t_simple_polygon

Description:

[static] int t_simple_polygon_ptr_array

Description:

[static] int t_simple_polygon_ptr_array_member

Description:

[static] int t_simple_polygon_ref

Description:

[static] int t_text

Description:

[static] int t_text_ptr_array

Description:

[static] int t_text_ptr_array_member

Description:

[static] int t_text_ref

Description:

[static] int t_user_object

Description:

[const] Text text

Description: Instantiate the text object

If a text is referenced, this object is instantiated by this method.

[const] int text_font

Description: Obtain the text's font

Applies to texts only. Will throw an exception if not a text.

[const] int text_size

Description: Obtain the text size

Applies to texts only. Will throw an exception if not a text.

[const] string text_string

Description: Obtain the text string

Applies to texts only. Will throw an exception if not a text.

[const] Trans text_trans

Description: Obtain the text transformation

Applies to texts only. Will throw an exception if not a text.

[const] string to_s

Description: Create a string showing the contents of the reference

This method has been introduced with version 0.16.

[const] int type

Description: Return the type of the shape reference

The returned values are the t_... constants available through the corresponding class members.