KLayout Manual: Main Index » Class Index » API reference - Class ShapeAPI reference - Class ShapeNotation used in Ruby API documentation 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 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
Public methods
Public static methods and constantsDeprecated methods (protected, public, static, non-static and constructors)
Detailed description[const] bool !=(const Shape arg1)Description: Inequality operator [const] bool ==(const Shape arg1)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 TBoxDescription: [static] int TBoxArrayDescription: [static] int TBoxArrayMemberDescription: [static] int TEdgeDescription: [static] int TNullDescription: [static] int TPathDescription: [static] int TPathPtrArrayDescription: [static] int TPathPtrArrayMemberDescription: [static] int TPathRefDescription: [static] int TPolygonDescription: [static] int TPolygonPtrArrayDescription: [static] int TPolygonPtrArrayMemberDescription: [static] int TPolygonRefDescription: [static] int TShortBoxDescription: [static] int TShortBoxArrayDescription: [static] int TShortBoxArrayMemberDescription: [static] int TSimplePolygonDescription: [static] int TSimplePolygonPtrArrayDescription: [static] int TSimplePolygonPtrArrayMemberDescription: [static] int TSimplePolygonRefDescription: [static] int TTextDescription: [static] int TTextPtrArrayDescription: [static] int TTextPtrArrayMemberDescription: [static] int TTextRefDescription: [static] int TUserObjectDescription: [const] long long areaDescription: Returns the area of the shape. This method has been added in version 0.22. [const] Trans array_transDescription: 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. [const] void assign(const 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 bboxDescription: Returns the bounding box of the shape. [const] Box boxDescription: Gets the box object Applies to boxes only. Will throw an exception if the object is not a box. 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. Cell ptr cellDescription: 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. void createDescription: 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 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 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 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] Shape dupDescription: Creates a copy of self [iter] Edge each_edgeDescription: 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. It will throw an exception if the object is not an edge. [const,iter] Point each_pointDescription: 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
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_hullDescription: 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] Edge edgeDescription: Returns the edge object Applies to edges only. Will throw an exception if the object is not an edge. 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. [const] bool has_prop_id?Description: Returns true, if the shape has properties, i.e. has a properties ID. [const] unsigned int holesDescription: 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 This method returns true, if self is a const reference. In that case, only const methods may be called on self. [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. Will throw an exception if the object is not 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 Layout ptr layoutDescription: 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] Shape newDescription: Creates a new object of this class [const] Path pathDescription: Returns the path object Applies to paths only. Will throw an exception if the object is not a path. 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. [const] int path_bgnextDescription: Obtain the path's starting vertex extension Applies to paths only. Will throw an exception if the object is not a path. [const] int path_endextDescription: Obtain the path's end vertex extension Applies to paths only. Will throw an exception if the object is not a path. [const] int path_widthDescription: Obtain the path width Applies to paths only. Will throw an exception if the object is not a path. [const] Polygon polygonDescription: 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. This method will throw an exception if the Shape object represents other primitives. 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. [const] unsigned int prop_idDescription: Get the properties ID associated with the shape The Layout object can be used to retrieve the actual properties associated with the ID. void prop_id=(unsigned int 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. 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. [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. 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 shapesDescription: 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] SimplePolygon simple_polygonDescription: 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. This method will throw an exception if the Shape object represents other primitives. 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. [static] int t_boxDescription: This method is deprecated. Use method 'TBox' instead [static] int t_box_arrayDescription: This method is deprecated. Use method 'TBoxArray' instead [static] int t_box_array_memberDescription: This method is deprecated. Use method 'TBoxArrayMember' instead [static] int t_edgeDescription: This method is deprecated. Use method 'TEdge' instead [static] int t_nullDescription: This method is deprecated. Use method 'TNull' instead [static] int t_pathDescription: This method is deprecated. Use method 'TPath' instead [static] int t_path_ptr_arrayDescription: This method is deprecated. Use method 'TPathPtrArray' instead [static] int t_path_ptr_array_memberDescription: This method is deprecated. Use method 'TPathPtrArrayMember' instead [static] int t_path_refDescription: This method is deprecated. Use method 'TPathRef' instead [static] int t_polygonDescription: This method is deprecated. Use method 'TPolygon' instead [static] int t_polygon_ptr_arrayDescription: This method is deprecated. Use method 'TPolygonPtrArray' instead [static] int t_polygon_ptr_array_memberDescription: This method is deprecated. Use method 'TPolygonPtrArrayMember' instead [static] int t_polygon_refDescription: This method is deprecated. Use method 'TPolygonRef' instead [static] int t_short_boxDescription: This method is deprecated. Use method 'TShortBox' instead [static] int t_short_box_arrayDescription: This method is deprecated. Use method 'TShortBoxArray' instead [static] int t_short_box_array_memberDescription: This method is deprecated. Use method 'TShortBoxArrayMember' instead [static] int t_simple_polygonDescription: This method is deprecated. Use method 'TSimplePolygon' instead [static] int t_simple_polygon_ptr_arrayDescription: This method is deprecated. Use method 'TSimplePolygonPtrArray' instead [static] int t_simple_polygon_ptr_array_memberDescription: This method is deprecated. Use method 'TSimplePolygonPtrArrayMember' instead [static] int t_simple_polygon_refDescription: This method is deprecated. Use method 'TSimplePolygonRef' instead [static] int t_textDescription: This method is deprecated. Use method 'TText' instead [static] int t_text_ptr_arrayDescription: This method is deprecated. Use method 'TTextPtrArray' instead [static] int t_text_ptr_array_memberDescription: This method is deprecated. Use method 'TTextPtrArrayMember' instead [static] int t_text_refDescription: This method is deprecated. Use method 'TTextRef' instead [static] int t_user_objectDescription: This method is deprecated. Use method 'TUserObject' instead [const] Text textDescription: Returns the text object Applies to texts only. 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. [const] int text_fontDescription: Obtain the text's font Applies to texts only. Will throw an exception if the object is not a text. [const] int text_halignDescription: Obtain 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. [const] int text_sizeDescription: Obtain the text size Applies to texts only. Will throw an exception if the object is not a text. [const] string text_stringDescription: Obtain the text string Applies to texts only. Will throw an exception if the object is not a text. [const] Trans text_transDescription: Obtain the text transformation Applies to texts only. Will throw an exception if the object is not a text. [const] int text_valignDescription: Obtain 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. [const] string to_sDescription: Create a string showing the contents of the reference This method has been introduced with version 0.16. [const] int typeDescription: Return the type of the shape The returned values are the t_... constants available through the corresponding class members. |