API reference - Class Shape

Notation used in Ruby API documentation

Description: An object representing a shape in the layout database

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 indicates an invalid reference.

Shape objects are used together with the Shapes container object which stores the actual shape objects and uses Shape references as pointers inside the actual data storage. Shape references are used in various places, i.e. when removing or transforming objects inside a Shapes container.

Public constructors

new Shape ptrnewCreates a new object of this class

Public methods

[const]bool!=(const Shape other)Inequality operator
[const]bool==(const Shape other)Equality operator
void_createEnsures the C++ object is created
void_destroyExplicitly destroys the object
[const]bool_destroyed?Returns a value indicating whether the object was already destroyed
[const]bool_is_const_object?Returns a value indicating whether the reference is a const reference
void_manageMarks the object as managed by the script side.
void_unmanageMarks the object as no longer owned by the script side.
[const]longareaReturns the area of the shape
[const]Transarray_transGet the array instance member transformation
voidassign(const Shape other)Assigns another object to self
[const]BoxbboxReturns the bounding box of the shape
[const]variantboxGets the box object
voidbox=(const Box box)Replaces the shape by the given box
[const]Pointbox_centerReturns the center of the box
voidbox_center=(const Point c)Sets the center of the box
[const]intbox_heightReturns the height of the box
voidbox_height=(int h)Sets the height of the box
[const]Pointbox_p1Returns the lower left point of the box
voidbox_p1=(const Point p)Sets the lower left point of the box
[const]Pointbox_p2Returns the upper right point of the box
voidbox_p2=(const Point p)Sets the upper right point of the box
[const]intbox_widthReturns the width of the box
voidbox_width=(int w)Sets the width of the box
Cell ptrcellGets a reference to the cell the shape belongs to
voidcell=(Cell ptr cell)Moves the shape to a different cell
voiddeleteDeletes the shape
voiddelete_property(variant key)Deletes the user property with the given key
[const]new Shape ptrdupCreates a copy of self
[iter]Edgeeach_edgeIterate over the edges of the object
[iter]Edgeeach_edge(unsigned int contour)Iterate over the edges of the object
[const,iter]Pointeach_pointIterate over all points of the object
[const,iter]Pointeach_point_hole(unsigned int hole_index)Iterate over the points of a hole contour
[const,iter]Pointeach_point_hullIterate over the hull contour of the object
[const]variantedgeReturns the edge object
voidedge=(const Edge box)Replaces the shape by the given edge
[const]boolhas_prop_id?Returns true, if the shape has properties, i.e. has a properties ID
[const]unsigned intholesReturn the number of holes
[const]boolis_array_member?Returns true, if the shape is a member of a shape array
[const]boolis_box?Returns true if the shape is a box
[const]boolis_edge?Returns true, if the object is an edge
[const]boolis_null?Returns true, if the shape reference is a null reference (not referring to a shape)
[const]boolis_path?Returns true, if the shape is a path
[const]boolis_polygon?Returns true, if the shape is a polygon
[const]boolis_simple_polygon?Returns true, if the shape is a simple polygon
[const]boolis_text?Returns true, if the object is a text
[const]boolis_user_object?Returns true if the shape is a user defined object
[const]boolis_valid?Returns true, if the shape is valid
[const]unsigned intlayerReturns the layer index of the layer the shape is on
voidlayer=(unsigned int layer_index)Moves the shape to a layer given by the layer index object
[const]LayerInfolayer_infoReturns the LayerInfo object of the layer the shape is on
voidlayer_info=(const LayerInfo layer_info)Moves the shape to a layer given by a LayerInfo object
Layout ptrlayoutGets a reference to the Layout the shape belongs to
[const]variantpathReturns the path object
voidpath=(const Path box)Replaces the shape by the given path object
[const]intpath_bgnextObtain the path's starting vertex extension
voidpath_bgnext=(int e)Sets the path's starting vertex extension
[const]intpath_endextObtain the path's end vertex extension
voidpath_endext=(int e)Sets the path's end vertex extension
[const]intpath_lengthReturns the length of the path
[const]intpath_widthObtain the path width
voidpath_width=(int w)Sets the path width
[const]unsigned intperimeterReturns the perimeter of the shape
[const]variantpolygonReturns the polygon object
voidpolygon=(const Polygon box)Replaces the shape by the given polygon object
[const]unsigned longprop_idGet the properties ID associated with the shape
voidprop_id=(unsigned long arg1)Sets the properties ID of this shape
variantproperty(variant key)Gets the user property with the given key
voidround_path=(bool r)The path will be a round-ended path if this property is set to true
[const]boolround_path?Returns true, if the path has round ends
voidset_property(variant key,
variant value)
Set the user property with the given key to the given value
Shapes ptrshapesGets a reference to the Shapes container the shape lives in
[const]variantsimple_polygonReturns the simple polygon object
voidsimple_polygon=(const SimplePolygon box)Replaces the shape by the given simple polygon object
[const]varianttextReturns the text object
voidtext=(const Text box)Replaces the shape by the given text object
[const]inttext_fontGets the text's font
voidtext_font=(int font)Sets the text's font
[const]inttext_halignGets the text's horizontal alignment
voidtext_halign=(int a)Sets the text's horizontal alignment
[const]Pointtext_posGets the text's position
voidtext_pos=(const Point p)Sets the text's position
[const]inttext_rotGets the text's orientation code (see Trans)
voidtext_rot=(int o)Sets the text's orientation code (see Trans)
[const]inttext_sizeGets the text size
voidtext_size=(int size)Sets the text size
[const]stringtext_stringObtain the text string
voidtext_string=(string string)Sets the text string
[const]Transtext_transGets the text transformation
voidtext_trans=(const Trans trans)Sets the text transformation
[const]inttext_valignGets the text's vertical alignment
voidtext_valign=(int a)Sets the text's vertical alignment
[const]stringto_sCreate a string showing the contents of the reference
voidtransform(const Trans trans)Transforms the shape with the given transformation
voidtransform(const CplxTrans trans)Transforms the shape with the given complex transformation
voidtransform(const ICplxTrans trans)Transforms the shape with the given complex transformation
[const]inttypeReturn the type of the shape

Public static methods and constants

intTBox
intTBoxArray
intTBoxArrayMember
intTEdge
intTNull
intTPath
intTPathPtrArray
intTPathPtrArrayMember
intTPathRef
intTPolygon
intTPolygonPtrArray
intTPolygonPtrArrayMember
intTPolygonRef
intTShortBox
intTShortBoxArray
intTShortBoxArrayMember
intTSimplePolygon
intTSimplePolygonPtrArray
intTSimplePolygonPtrArrayMember
intTSimplePolygonRef
intTText
intTTextPtrArray
intTTextPtrArrayMember
intTTextRef
intTUserObject

Deprecated methods (protected, public, static, non-static and constructors)

voidcreateUse of this method is deprecated. Use _create instead
voiddestroyUse of this method is deprecated. Use _destroy instead
[const]booldestroyed?Use of this method is deprecated. Use _destroyed? instead
[const]boolis_const_object?Use of this method is deprecated. Use _is_const_object? instead
[static]intt_boxUse of this method is deprecated. Use TBox instead
[static]intt_box_arrayUse of this method is deprecated. Use TBoxArray instead
[static]intt_box_array_memberUse of this method is deprecated. Use TBoxArrayMember instead
[static]intt_edgeUse of this method is deprecated. Use TEdge instead
[static]intt_nullUse of this method is deprecated. Use TNull instead
[static]intt_pathUse of this method is deprecated. Use TPath instead
[static]intt_path_ptr_arrayUse of this method is deprecated. Use TPathPtrArray instead
[static]intt_path_ptr_array_memberUse of this method is deprecated. Use TPathPtrArrayMember instead
[static]intt_path_refUse of this method is deprecated. Use TPathRef instead
[static]intt_polygonUse of this method is deprecated. Use TPolygon instead
[static]intt_polygon_ptr_arrayUse of this method is deprecated. Use TPolygonPtrArray instead
[static]intt_polygon_ptr_array_memberUse of this method is deprecated. Use TPolygonPtrArrayMember instead
[static]intt_polygon_refUse of this method is deprecated. Use TPolygonRef instead
[static]intt_short_boxUse of this method is deprecated. Use TShortBox instead
[static]intt_short_box_arrayUse of this method is deprecated. Use TShortBoxArray instead
[static]intt_short_box_array_memberUse of this method is deprecated. Use TShortBoxArrayMember instead
[static]intt_simple_polygonUse of this method is deprecated. Use TSimplePolygon instead
[static]intt_simple_polygon_ptr_arrayUse of this method is deprecated. Use TSimplePolygonPtrArray instead
[static]intt_simple_polygon_ptr_array_memberUse of this method is deprecated. Use TSimplePolygonPtrArrayMember instead
[static]intt_simple_polygon_refUse of this method is deprecated. Use TSimplePolygonRef instead
[static]intt_textUse of this method is deprecated. Use TText instead
[static]intt_text_ptr_arrayUse of this method is deprecated. Use TTextPtrArray instead
[static]intt_text_ptr_array_memberUse of this method is deprecated. Use TTextPtrArrayMember instead
[static]intt_text_refUse of this method is deprecated. Use TTextRef instead
[static]intt_user_objectUse of this method is deprecated. Use TUserObject instead

Detailed description

[const] bool !=(const Shape other)

Description: Inequality operator

[const] bool ==(const Shape other)

Description: Equality operator

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

[static] int TBox

Description:

[static] int TBoxArray

Description:

[static] int TBoxArrayMember

Description:

[static] int TEdge

Description:

[static] int TNull

Description:

[static] int TPath

Description:

[static] int TPathPtrArray

Description:

[static] int TPathPtrArrayMember

Description:

[static] int TPathRef

Description:

[static] int TPolygon

Description:

[static] int TPolygonPtrArray

Description:

[static] int TPolygonPtrArrayMember

Description:

[static] int TPolygonRef

Description:

[static] int TShortBox

Description:

[static] int TShortBoxArray

Description:

[static] int TShortBoxArrayMember

Description:

[static] int TSimplePolygon

Description:

[static] int TSimplePolygonPtrArray

Description:

[static] int TSimplePolygonPtrArrayMember

Description:

[static] int TSimplePolygonRef

Description:

[static] int TText

Description:

[static] int TTextPtrArray

Description:

[static] int TTextPtrArrayMember

Description:

[static] int TTextRef

Description:

[static] int TUserObject

Description:

void _create

Description: Ensures the C++ object is created

Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created.

void _destroy

Description: Explicitly destroys the object

Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing.

[const] bool _destroyed?

Description: Returns a value indicating whether the object was already 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] bool _is_const_object?

Description: Returns a value indicating whether the reference is a const reference

This method returns true, if self is a const reference. In that case, only const methods may be called on self.

void _manage

Description: Marks the object as managed by the script side.

After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required.

Usually it's not required to call this method. It has been introduced in version 0.24.

void _unmanage

Description: Marks the object as no longer owned by the script side.

Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur.

Usually it's not required to call this method. It has been introduced in version 0.24.

[const] long area

Description: Returns the area of the shape

This method has been added in version 0.22.

[const] 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.

void assign(const Shape other)

Description: Assigns another object to self

[const] Box bbox

Description: Returns the bounding box of the shape

[const] variant box

Description: Gets the box object

Starting with version 0.23, this method returns nil, if the shape does not represent a box.

Python specific notes:

The object exposes a readable attribute 'box'. This is the getter.

void box=(const Box box)

Description: Replaces the shape by the given box

This method replaces the shape by the given box. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

Python specific notes:

The object exposes a writable attribute 'box'. This is the setter.

[const] Point box_center

Description: Returns the center of the box

Applies to boxes only. Returns the center of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a readable attribute 'box_center'. This is the getter.

void box_center=(const Point c)

Description: Sets the center of the box

Applies to boxes only. Changes the center of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'box_center'. This is the setter.

[const] int box_height

Description: Returns the height of the box

Applies to boxes only. Returns the height of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a readable attribute 'box_height'. This is the getter.

void box_height=(int h)

Description: Sets the height of the box

Applies to boxes only. Changes the height of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'box_height'. This is the setter.

[const] Point box_p1

Description: Returns the lower left point of the box

Applies to boxes only. Returns the lower left point of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a readable attribute 'box_p1'. This is the getter.

void box_p1=(const Point p)

Description: Sets the lower left point of the box

Applies to boxes only. Changes the lower left point of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'box_p1'. This is the setter.

[const] Point box_p2

Description: Returns the upper right point of the box

Applies to boxes only. Returns the upper right point of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a readable attribute 'box_p2'. This is the getter.

void box_p2=(const Point p)

Description: Sets the upper right point of the box

Applies to boxes only. Changes the upper right point of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'box_p2'. This is the setter.

[const] int box_width

Description: Returns the width of the box

Applies to boxes only. Returns the width of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a readable attribute 'box_width'. This is the getter.

void box_width=(int w)

Description: Sets the width of the box

Applies to boxes only. Changes the width of the box and throws an exception if the shape is not a box.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'box_width'. This is the setter.

Cell ptr cell

Description: Gets a reference to the cell the shape belongs to

This reference can be nil, if the Shape object is not living inside a cell

This method has been introduced in version 0.22.

Python specific notes:

The object exposes a readable attribute 'cell'. This is the getter.

void cell=(Cell ptr cell)

Description: Moves the shape to a different cell

Both the current and the target cell must reside in the same layout.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'cell'. This is the setter.

void create

Description: Ensures the C++ object is created

Use of this method is deprecated. Use _create instead

void delete

Description: Deletes the shape

After the shape is deleted, the shape object is emptied and points to nothing.

This method has been introduced in version 0.23.

void delete_property(variant key)

Description: Deletes the user property with the given key

This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

void destroy

Description: Explicitly destroys the object

Use of this method is deprecated. Use _destroy instead

[const] bool destroyed?

Description: Returns a value indicating whether the object was already destroyed

Use of this method is deprecated. Use _destroyed? instead

[const] new Shape ptr dup

Description: Creates a copy of self

[iter] Edge each_edge

Description: Iterate over the edges of the object

This method applies to polygons and simple polygons and delivers all edges that form the polygon's contours. Hole edges are oriented counterclockwise while hull egdes are oriented clockwise.

It will throw an exception if the object is not a polygon.

[iter] Edge each_edge(unsigned int contour)

Description: Iterate over the edges of the object

contour:The contour number (0 for hull, 1 for first hole ...)

This method applies to polygons and simple polygons and delivers all edges that form the given contour of the polygon. The hull has contour number 0, the first hole has contour 1 etc. Hole edges are oriented counterclockwise while hull egdes are oriented clockwise.

It will throw an exception if the object is not a polygon.

This method was introduced in version 0.24.

[const,iter] Point each_point

Description: Iterate over all points of the object

This method applies to paths and delivers all points of the path's center line. It will throw an exception for other objects.

[const,iter] Point each_point_hole(unsigned int hole_index)

Description: Iterate over the points of a hole contour

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

This method applies to polygons and delivers all points of the respective hole contour. It will throw an exception for other objects. Simple polygons deliver an empty sequence.

[const,iter] Point each_point_hull

Description: Iterate over the hull contour of the object

This method applies to polygons and delivers all points of the polygon hull contour. It will throw an exception for other objects.

[const] variant edge

Description: Returns the edge object

Starting with version 0.23, this method returns nil, if the shape does not represent an edge.

Python specific notes:

The object exposes a readable attribute 'edge'. This is the getter.

void edge=(const Edge box)

Description: Replaces the shape by the given edge

This method replaces the shape by the given edge. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

Python specific notes:

The object exposes a writable attribute 'edge'. This is the setter.

[const] bool has_prop_id?

Description: Returns true, if the shape has properties, i.e. has a properties ID

[const] unsigned int holes

Description: Return the number of holes

This method applies to polygons and will throw an exception for other objects.. Simple polygons deliver a value of zero.

[const] bool is_array_member?

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

[const] bool is_box?

Description: Returns true if the shape is a box

[const] bool is_const_object?

Description: Returns a value indicating whether the reference is a const reference

Use of this method is deprecated. Use _is_const_object? instead

[const] bool is_edge?

Description: Returns true, if the object is an edge

[const] bool is_null?

Description: Returns true, if the shape reference is a null reference (not referring to a shape)

[const] bool is_path?

Description: Returns true, if the shape is a path

[const] bool is_polygon?

Description: Returns true, if the shape is a polygon

This method returns true only if the object is a polygon or a simple polygon. Other objects can convert to polygons, for example paths, so it may be possible to use the polygon method also if is_polygon? does not return true.

[const] bool is_simple_polygon?

Description: Returns true, if the shape is a simple polygon

This method returns true only if the object is a simple polygon. The simple polygon identity is contained in the polygon identity, so usually it is sufficient to use is_polygon? and polygon instead of specifically handle simply polygons. This method is provided only for specific optimisation purposes.

[const] bool is_text?

Description: Returns true, if the object is a text

[const] bool is_user_object?

Description: Returns true if the shape is a user defined object

[const] bool is_valid?

Description: Returns true, if the shape is valid

After the shape is deleted, the shape object is no longer valid and this method returns false.

This method has been introduced in version 0.23.

[const] unsigned int layer

Description: Returns the layer index of the layer the shape is on

Throws an exception if the shape does not reside inside a cell.

This method has been added in version 0.23.

Python specific notes:

The object exposes a readable attribute 'layer'. This is the getter.

void layer=(unsigned int layer_index)

Description: Moves the shape to a layer given by the layer index object

This method has been added in version 0.23.

Python specific notes:

The object exposes a writable attribute 'layer'. This is the setter.

[const] LayerInfo layer_info

Description: Returns the LayerInfo object of the layer the shape is on

If the shape does not reside inside a cell, an empty layer is returned.

This method has been added in version 0.23.

Python specific notes:

The object exposes a readable attribute 'layer_info'. This is the getter.

void layer_info=(const LayerInfo layer_info)

Description: Moves the shape to a layer given by a LayerInfo object

If no layer with the given properties exists, an exception is thrown.

This method has been added in version 0.23.

Python specific notes:

The object exposes a writable attribute 'layer_info'. This is the setter.

Layout ptr layout

Description: Gets a reference to the Layout the shape belongs to

This reference can be nil, if the Shape object is not living inside a layout.

This method has been introduced in version 0.22.

[static] new Shape ptr new

Description: Creates a new object of this class

Python specific notes:

This method is the default initializer of the object

[const] variant path

Description: Returns the path object

Starting with version 0.23, this method returns nil, if the shape does not represent a path.

Python specific notes:

The object exposes a readable attribute 'path'. This is the getter.

void path=(const Path box)

Description: Replaces the shape by the given path object

This method replaces the shape by the given path object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

Python specific notes:

The object exposes a writable attribute 'path'. This is the setter.

[const] int path_bgnext

Description: Obtain the path's starting vertex extension

Applies to paths only. Will throw an exception if the object is not a path.

Python specific notes:

The object exposes a readable attribute 'path_bgnext'. This is the getter.

void path_bgnext=(int e)

Description: Sets the path's starting vertex extension

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'path_bgnext'. This is the setter.

[const] int path_endext

Description: Obtain the path's end vertex extension

Applies to paths only. Will throw an exception if the object is not a path.

Python specific notes:

The object exposes a readable attribute 'path_endext'. This is the getter.

void path_endext=(int e)

Description: Sets the path's end vertex extension

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'path_endext'. This is the setter.

[const] int path_length

Description: Returns the length of the path

Applies to paths only. Will throw an exception if the object is not a path. This method returns the length of the spine plus extensions if present.

This method has been added in version 0.23.

[const] int path_width

Description: Obtain the path width

Applies to paths only. Will throw an exception if the object is not a path.

Python specific notes:

The object exposes a readable attribute 'path_width'. This is the getter.

void path_width=(int w)

Description: Sets the path width

Applies to paths only. Will throw an exception if the object is not a path.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'path_width'. This is the setter.

[const] unsigned int perimeter

Description: Returns the perimeter of the shape

This method will return an approximation of the perimeter for paths.

This method has been added in version 0.23.

[const] variant polygon

Description: Returns the polygon object

Returns the polygon object that this shape refers to or converts the object to a polygon. Paths, boxes and simple polygons are converted to polygons. For paths this operation renders the path's hull contour.

Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a polygon.

Python specific notes:

The object exposes a readable attribute 'polygon'. This is the getter.

void polygon=(const Polygon box)

Description: Replaces the shape by the given polygon object

This method replaces the shape by the given polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

Python specific notes:

The object exposes a writable attribute 'polygon'. This is the setter.

[const] unsigned long prop_id

Description: Get the properties ID associated with the shape

The Layout object can be used to retrieve the actual properties associated with the ID.

Python specific notes:

The object exposes a readable attribute 'prop_id'. This is the getter.

void prop_id=(unsigned long arg1)

Description: Sets the properties ID of this shape

The Layout object can be used to retrieve an ID for a given set of properties. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

Python specific notes:

The object exposes a writable attribute 'prop_id'. This is the setter.

variant property(variant key)

Description: Gets the user property with the given key

This method is a convenience method that gets the property with the given key. If no property with that key does not exist, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value. This method has been introduced in version 0.22.

void round_path=(bool r)

Description: The path will be a round-ended path if this property is set to true

Applies to paths only. Will throw an exception if the object is not a path. Please note that the extensions will apply as well. To get a path with circular ends, set the begin and end extensions to half the path's width.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'round_path'. This is the setter.

[const] bool round_path?

Description: Returns true, if the path has round ends

Applies to paths only. Will throw an exception if the object is not a path.

Python specific notes:

The object exposes a readable attribute 'round_path'. This is the getter.

void set_property(variant key,variant value)

Description: Set the user property with the given key to the given value

This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. This method may change the properties ID. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

Shapes ptr shapes

Description: Gets a reference to the Shapes container the shape lives in

This reference can be nil, if the Shape object is not referring to an actual shape.

This method has been introduced in version 0.22.

[const] variant simple_polygon

Description: Returns the simple polygon object

Returns the simple polygon object that this shape refers to or converts the object to a simple polygon. Paths, boxes and polygons are converted to simple polygons. Polygons with holes will have their holes removed but introducing cut lines that connect the hole contours with the outer contour. Starting with version 0.23, this method returns nil, if the shape does not represent a geometrical primitive that can be converted to a simple polygon.

Python specific notes:

The object exposes a readable attribute 'simple_polygon'. This is the getter.

void simple_polygon=(const SimplePolygon box)

Description: Replaces the shape by the given simple polygon object

This method replaces the shape by the given simple polygon object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

Python specific notes:

The object exposes a writable attribute 'simple_polygon'. This is the setter.

[static] int t_box

Description:

Use of this method is deprecated. Use TBox instead

[static] int t_box_array

Description:

Use of this method is deprecated. Use TBoxArray instead

[static] int t_box_array_member

Description:

Use of this method is deprecated. Use TBoxArrayMember instead

[static] int t_edge

Description:

Use of this method is deprecated. Use TEdge instead

[static] int t_null

Description:

Use of this method is deprecated. Use TNull instead

[static] int t_path

Description:

Use of this method is deprecated. Use TPath instead

[static] int t_path_ptr_array

Description:

Use of this method is deprecated. Use TPathPtrArray instead

[static] int t_path_ptr_array_member

Description:

Use of this method is deprecated. Use TPathPtrArrayMember instead

[static] int t_path_ref

Description:

Use of this method is deprecated. Use TPathRef instead

[static] int t_polygon

Description:

Use of this method is deprecated. Use TPolygon instead

[static] int t_polygon_ptr_array

Description:

Use of this method is deprecated. Use TPolygonPtrArray instead

[static] int t_polygon_ptr_array_member

Description:

Use of this method is deprecated. Use TPolygonPtrArrayMember instead

[static] int t_polygon_ref

Description:

Use of this method is deprecated. Use TPolygonRef instead

[static] int t_short_box

Description:

Use of this method is deprecated. Use TShortBox instead

[static] int t_short_box_array

Description:

Use of this method is deprecated. Use TShortBoxArray instead

[static] int t_short_box_array_member

Description:

Use of this method is deprecated. Use TShortBoxArrayMember instead

[static] int t_simple_polygon

Description:

Use of this method is deprecated. Use TSimplePolygon instead

[static] int t_simple_polygon_ptr_array

Description:

Use of this method is deprecated. Use TSimplePolygonPtrArray instead

[static] int t_simple_polygon_ptr_array_member

Description:

Use of this method is deprecated. Use TSimplePolygonPtrArrayMember instead

[static] int t_simple_polygon_ref

Description:

Use of this method is deprecated. Use TSimplePolygonRef instead

[static] int t_text

Description:

Use of this method is deprecated. Use TText instead

[static] int t_text_ptr_array

Description:

Use of this method is deprecated. Use TTextPtrArray instead

[static] int t_text_ptr_array_member

Description:

Use of this method is deprecated. Use TTextPtrArrayMember instead

[static] int t_text_ref

Description:

Use of this method is deprecated. Use TTextRef instead

[static] int t_user_object

Description:

Use of this method is deprecated. Use TUserObject instead

[const] variant text

Description: Returns the text object

Starting with version 0.23, this method returns nil, if the shape does not represent a text.

Python specific notes:

The object exposes a readable attribute 'text'. This is the getter.

void text=(const Text box)

Description: Replaces the shape by the given text object

This method replaces the shape by the given text object. This method can only be called for editable layouts. It does not change the user properties of the shape. Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes.

This method has been introduced in version 0.22.

Python specific notes:

The object exposes a writable attribute 'text'. This is the setter.

[const] int text_font

Description: Gets the text's font

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

Python specific notes:

The object exposes a readable attribute 'text_font'. This is the getter.

void text_font=(int font)

Description: Sets the text's font

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

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'text_font'. This is the setter.

[const] int text_halign

Description: Gets the text's horizontal alignment

Applies to texts only. Will throw an exception if the object is not a text. The return value is 0 for left alignment, 1 for center alignment and 2 to right alignment.

This method has been introduced in version 0.22.

Python specific notes:

The object exposes a readable attribute 'text_halign'. This is the getter.

void text_halign=(int a)

Description: Sets the text's horizontal alignment

Applies to texts only. Will throw an exception if the object is not a text. See text_halign for a description of that property.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'text_halign'. This is the setter.

[const] Point text_pos

Description: Gets the text's position

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

Python specific notes:

The object exposes a readable attribute 'text_pos'. This is the getter.

void text_pos=(const Point p)

Description: Sets the text's position

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

Python specific notes:

The object exposes a writable attribute 'text_pos'. This is the setter.

[const] int text_rot

Description: Gets the text's orientation code (see Trans)

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

Python specific notes:

The object exposes a readable attribute 'text_rot'. This is the getter.

void text_rot=(int o)

Description: Sets the text's orientation code (see Trans)

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

Python specific notes:

The object exposes a writable attribute 'text_rot'. This is the setter.

[const] int text_size

Description: Gets the text size

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

Python specific notes:

The object exposes a readable attribute 'text_size'. This is the getter.

void text_size=(int size)

Description: Sets the text size

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

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'text_size'. This is the setter.

[const] string text_string

Description: Obtain the text string

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

Python specific notes:

The object exposes a readable attribute 'text_string'. This is the getter.

void text_string=(string string)

Description: Sets the text string

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

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'text_string'. This is the setter.

[const] Trans text_trans

Description: Gets the text transformation

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

Python specific notes:

The object exposes a readable attribute 'text_trans'. This is the getter.

void text_trans=(const Trans trans)

Description: Sets the text transformation

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

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'text_trans'. This is the setter.

[const] int text_valign

Description: Gets the text's vertical alignment

Applies to texts only. Will throw an exception if the object is not a text. The return value is 0 for top alignment, 1 for center alignment and 2 to bottom alignment.

This method has been introduced in version 0.22.

Python specific notes:

The object exposes a readable attribute 'text_valign'. This is the getter.

void text_valign=(int a)

Description: Sets the text's vertical alignment

Applies to texts only. Will throw an exception if the object is not a text. See text_valign for a description of that property.

This method has been introduced in version 0.23.

Python specific notes:

The object exposes a writable attribute 'text_valign'. This is the setter.

[const] string to_s

Description: Create a string showing the contents of the reference

This method has been introduced with version 0.16.

Python specific notes:

This method is also available as 'str(object)'

void transform(const Trans trans)

Description: Transforms the shape with the given transformation

This method has been introduced in version 0.23.

void transform(const CplxTrans trans)

Description: Transforms the shape with the given complex transformation

This method has been introduced in version 0.23.

void transform(const ICplxTrans trans)

Description: Transforms the shape with the given complex transformation

This method has been introduced in version 0.23.

[const] int type

Description: Return the type of the shape

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