Class Shapes (version 0.18)

Description: A collection of shapes

A shapes collection is a collection of geometrical objects, such as polygons, boxes, paths, edges or text objects.

Class overview

Index

Method Overview

Shape insert( Shape shape )Insert a shape from a shape reference into the shapes list
Shape transform( Shape shape, Trans trans )Transform the shape given by the reference with the given transformation
Shape transform( Shape shape, CplxTrans trans )Transform the shape given by the reference with the given complex transformation
Shape replace( Shape shape, Box box )Replace the given shape with a box
Shape replace( Shape shape, Path path )Replace the given shape with a path
Shape replace( Shape shape, Edge edge )Replace the given shape with an edge object
Shape replace( Shape shape, Text text )Replace the given shape with a text object
Shape replace( Shape shape, SimplePolygon simple_polygon )Replace the given shape with a simple polygon
Shape replace( Shape shape, Polygon polygon )Replace the given shape with a polygon
Shape insert( Box box )Insert a box into the shapes list
Shape insert( Path path )Insert a path into the shapes list
Shape insert( Edge edge )Insert a edge into the shapes list
Shape insert( Text text )Insert a text into the shapes list
Shape insert( SimplePolygon simple_polygon )Insert a simple polygon into the shapes list
Shape insert( Polygon polygon )Insert a polygon into the shapes list
Shape insert( Box box, unsigned int property_id )Insert a box with properties into the shapes list
Shape insert( Path path, unsigned int property_id )Insert a path with properties into the shapes list
Shape insert( Edge edge, unsigned int property_id )Insert a edge with properties into the shapes list
Shape insert( Text text, unsigned int property_id )Insert a text with properties into the shapes list
Shape insert( SimplePolygon simple_polygon, unsigned int property_id )Insert a simple polygon with properties into the shapes list
Shape insert( Polygon polygon, unsigned int property_id )Insert a polygon with properties into the shapes list
[const] yield Shape each( unsigned int flags )Get all shapes
[const] yield Shape eachGet all shapes
[const] yield Shape each_touching( unsigned int flags, Box region )Get all shapes that touch the search box (region)
[const] yield Shape each_touching( Box region )Get all shapes that touch the search box (region)
[const] yield Shape each_overlapping( unsigned int flags, Box region )Get all shapes that overlap the search box (region)
[const] yield Shape each_overlapping( Box region )Get all shapes that overlap the search box (region)
erase( Shape shape )Erase the shape pointed to by the given Shape object
[const] bool is_valid?( Shape shape )Test if the given Shape object is still pointing to a valid object
clearClear the shape container
[const] unsigned int sizeReport the number of shapes in this container
Shape replace_prop_id( Shape shape, unsigned int property_id )Replace (or install) the properties of a shape
[static] unsigned int s_all
[static] unsigned int s_all_with_properties
[static] unsigned int s_polygons
[static] unsigned int s_boxes
[static] unsigned int s_edges
[static] unsigned int s_paths
[static] unsigned int s_texts
[static] unsigned int s_user_objects
[static] unsigned int s_properties
assign( Shapes other )Assign the contents of another object to self
[const] Shapes dupCreates a copy of self.
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

assign( Shapes 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.

clear

Description: Clear the shape container

This method has been introduced in version 0.16. It can only be used in editable mode.

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

Description: Creates a copy of self.

[const] yield Shape each( unsigned int flags )

Description: Get all shapes

flags:An "or"-ed combination of the s_... constants

[const] yield Shape each

Description: Get all shapes

This call is equivalent to each(s_all). This convenience method has been introduced in version 0.16

[const] yield Shape each_overlapping( Box region )

Description: Get all shapes that overlap the search box (region)

This call is equivalent to each_overlapping(s_all,region). This convenience method has been introduced in version 0.16

region:The rectangular search region

[const] yield Shape each_overlapping( unsigned int flags, Box region )

Description: Get all shapes that overlap the search box (region)

This method was introduced in version 0.16

flags:An "or"-ed combination of the s_... constants
region:The rectangular search region

[const] yield Shape each_touching( Box region )

Description: Get all shapes that touch the search box (region)

This call is equivalent to each_touching(s_all,region). This convenience method has been introduced in version 0.16

region:The rectangular search region

[const] yield Shape each_touching( unsigned int flags, Box region )

Description: Get all shapes that touch the search box (region)

This method was introduced in version 0.16

flags:An "or"-ed combination of the s_... constants
region:The rectangular search region

erase( Shape shape )

Description: Erase the shape pointed to by the given Shape object

This method has been introduced in version 0.16. It can only be used in editable mode. Erasing a shape will invalidate the shape reference. Access to this reference may then render invalid results.

shape:The shape which to destroy

Shape insert( Edge edge, unsigned int property_id )
synonym: Shape insert_edge_with_properties( Edge edge, unsigned int property_id )

Description: Insert a edge with properties into the shapes list

The property Id must be obtained from the Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( SimplePolygon simple_polygon )
synonym: Shape insert_simple_polygon( SimplePolygon simple_polygon )

Description: Insert a simple polygon into the shapes list

Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( Polygon polygon )
synonym: Shape insert_polygon( Polygon polygon )

Description: Insert a polygon into the shapes list

Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( Path path )
synonym: Shape insert_path( Path path )

Description: Insert a path into the shapes list

Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( Path path, unsigned int property_id )
synonym: Shape insert_path_with_properties( Path path, unsigned int property_id )

Description: Insert a path with properties into the shapes list

The property Id must be obtained from the Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( Text text )
synonym: Shape insert_text( Text text )

Description: Insert a text into the shapes list

Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( Text text, unsigned int property_id )
synonym: Shape insert_text_with_properties( Text text, unsigned int property_id )

Description: Insert a text with properties into the shapes list

The property Id must be obtained from the Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( SimplePolygon simple_polygon, unsigned int property_id )
synonym: Shape insert_simple_polygon_with_properties( SimplePolygon simple_polygon, unsigned int property_id )

Description: Insert a simple polygon with properties into the shapes list

The property Id must be obtained from the Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( Polygon polygon, unsigned int property_id )
synonym: Shape insert_polygon_with_properties( Polygon polygon, unsigned int property_id )

Description: Insert a polygon with properties into the shapes list

The property Id must be obtained from the Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( Box box )
synonym: Shape insert_box( Box box )

Description: Insert a box into the shapes list

Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( Edge edge )
synonym: Shape insert_edge( Edge edge )

Description: Insert a edge into the shapes list

Starting with version 0.16, this method returns a reference to the newly created shape

Shape insert( Box box, unsigned int property_id )
synonym: Shape insert_box_with_properties( Box box, unsigned int property_id )

Description: Insert a box with properties into the shapes list

The property Id must be obtained from the Layout object's property_id method which associates a property set with a property Id. Starting with version 0.16, this method returns a reference to the newly created shape

returns:A reference to the new shape (a Shape object)

Shape insert( Shape shape )

Description: Insert a shape from a shape reference into the shapes list

This method has been introduced in version 0.16.

returns:A reference (a Shape object) to the newly created shape

[const] bool is_valid?( Shape shape )

Description: Test if the given Shape object is still pointing to a valid object

This method has been introduced in version 0.16. If the shape represented by the given reference has been deleted, this method returns false. If however, another shape has been inserted already that occupies the original shape's position, this method will return true again.

Shape replace( Shape shape, Edge edge )

Description: Replace the given shape with an edge object

This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. This method is permitted in editable mode only.

Shape replace( Shape shape, Polygon polygon )

Description: Replace the given shape with a polygon

This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. This method is permitted in editable mode only.

returns:A reference to the new shape (a Shape object)

Shape replace( Shape shape, Text text )

Description: Replace the given shape with a text object

This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. This method is permitted in editable mode only.

returns:A reference to the new shape (a Shape object)

Shape replace( Shape shape, Path path )

Description: Replace the given shape with a path

This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. This method is permitted in editable mode only.

returns:A reference to the new shape (a Shape object)

Shape replace( Shape shape, Box box )

Description: Replace the given shape with a box

This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. This method is permitted in editable mode only.

returns:A reference to the new shape (a Shape object)

Shape replace( Shape shape, SimplePolygon simple_polygon )

Description: Replace the given shape with a simple polygon

This method has been introduced with version 0.16. It replaces the given shape with the object specified. It does not change the property Id. To change the property Id, use the replace_prop_id method. To replace a shape and discard the property Id, erase the shape and insert a new shape. This method is permitted in editable mode only.

returns:A reference to the new shape (a Shape object)

Shape replace_prop_id( Shape shape, unsigned int property_id )

Description: Replace (or install) the properties of a shape

This method has been introduced in version 0.16. It can only be used in editable mode. Changes the properties Id of the given shape or install a properties Id on that shape if it does not have one yet. The property Id must be obtained from the Layout object's property_id method which associates a property set with a property Id. This method will potentially invalidate the shape reference passed to it. Use the reference returned for future references.

returns:A Shape object representing the new shape

[static] unsigned int s_all

Description:

[static] unsigned int s_all_with_properties

Description:

[static] unsigned int s_boxes

Description:

[static] unsigned int s_edges

Description:

[static] unsigned int s_paths

Description:

[static] unsigned int s_polygons

Description:

[static] unsigned int s_properties

Description:

[static] unsigned int s_texts

Description:

[static] unsigned int s_user_objects

Description:

[const] unsigned int size

Description: Report the number of shapes in this container

This method was introduced in version 0.16

returns:The number of shapes in this container

Shape transform( Shape shape, Trans trans )

Description: Transform the shape given by the reference with the given transformation

This method has been introduced in version 0.16. The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. It is permitted in editable mode only.

returns:A reference (a Shape object) to the new shape

Shape transform( Shape shape, CplxTrans trans )

Description: Transform the shape given by the reference with the given complex transformation

This method has been introduced in version 0.16. The original shape may be deleted and re-inserted by this method. Therefore, a new reference is returned. It is permitted in editable mode only.

returns:A reference (a Shape object) to the new shape