Class Layout (version 0.20)Description: The layout object The layout object basically wraps the cell graphs and adds functionality for managing cell names and layer names. The cell graph is a container for the cells and their hierarchical arrangement. The cell graph is constructed by creating cells and adding child instances to it.
Method Overview
unsigned int add_cell( string name )Description: Add a cell with the given name
assign( Layout 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] RecursiveShapeIterator begin_shapes( unsigned int cell_index, unsigned int layer )Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer For details see the description of the RecursiveShapeIterator class. This method has been added in version 0.18.
[const] RecursiveShapeIterator begin_shapes_overlapping( unsigned int cell_index, unsigned int layer, Box region )Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box overlaps the given region. This method has been added in version 0.18.
[const] RecursiveShapeIterator begin_shapes_touching( unsigned int cell_index, unsigned int layer, Box region )Description: Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search For details see the description of the RecursiveShapeIterator class. This version gives an iterator delivering shapes whose bounding box touches the given region. This method has been added in version 0.18.
ref Cell cell( unsigned int i )Description: Address a cell by index
unsigned int cell_by_name( string name )Description: Get the cell index for a given name Returns the cell index for the cell with the given name. If no cell with this name exists, an exception is thrown.
[const] string cell_name( unsigned int index )Description: Get the name for a cell with the given index
[const] unsigned int cellsDescription: Return the number of cells
clearDescription: Clears the layout Clears the layout completely.
clear_layer( unsigned int layer_index )Description: Clear a layer Clears the layer: removes all shapes. This method was introduced in version 0.19.
copy_layer( unsigned int src, unsigned int dest )Description: Copy a layer This method was introduced in version 0.19. Copy a layer from the source to the target. The target is not cleared before, so that this method merges shapes from the source with the target layer.
[const] double dbuDescription: Database unit read accessor
dbu=( double dbu )Description: Database unit write accessor
delete_cell( unsigned int cell_index )Description: Delete a cell This deletes a cell but not the sub cells of the cell. These subcells will likely become new top cells unless they are used otherwise. All instances of this cell are deleted as well. Hint: to delete multiple cells, use "delete_cells" which is far more efficient in this case. This method has been introduced in version 0.20.
delete_cell_rec( unsigned int cell_index )Description: Delete a cell plus all subcells This deletes a cell and also all sub cells of the cell. In contrast to prune_cell, all cells are deleted together with their instances even if they are used otherwise. This method has been introduced in version 0.20.
delete_cells( unsigned int cell_index_list[ ] )Description: Delete multiple cells This deletes the cells but not the sub cells of these cells. These subcells will likely become new top cells unless they are used otherwise. All instances of these cells are deleted as well. This method has been introduced in version 0.20.
delete_layer( unsigned int layer_index )Description: Delete a layer This does free the shapes of the cells and remembers the layer's index for recycling.
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 destroyedDescription: 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] Layout dupDescription: Creates a copy of self.
yield ref Cell each_cellDescription: Iterate the unsorted cell list
yield unsigned int each_cell_bottom_upDescription: Iterate the bottom-up sorted cell list In bottom-up traversal a cell is not delivered before the last child cell of this cell has been delivered. The bottom-up iterator does not deliver cells but cell indices actually.
yield unsigned int each_cell_top_downDescription: Iterate of the top-down sorted cell list The top-down cell list has the property of delivering all cells before they are instantiated. In addition the first cells are all top cells. There is at least one top cell. The top-down iterator does not deliver cells but cell indices actually.
yield unsigned int each_top_cellDescription: Iterate the top cells A layout may have an arbitrary number of top cells. The usual case however is that there is one top cell.
end_changesDescription: Cancel the "in changes" state (see "start_changes")
flatten( unsigned int cell_index, int levels, bool prune )Description: Flatten the given cell This method propagates all shapes from the specified number of hierarchy levels below into the given cell. It also removes the instances of the cells from which the shapes came from, but does not remove the cells themselves if prune is set to false. If prune is set to true, these cells are removed if not used otherwise. This method has been introduced in version 0.20.
[const] const ref LayerInfo get_info( unsigned int index )Description: Get the info structure for a specified layer
bool has_cell?( string name )Description: Tell, if the cell with a given name exists Returns true, if the layout has a cell with the given name
unsigned int insert_layer( LayerInfo props )Description: Insert a new layer with the given properties
insert_layer_at( unsigned int index, LayerInfo props )Description: Insert a new layer with the given properties at the given index
unsigned int insert_special_layer( LayerInfo props )Description: Insert a new special layer with the given properties Special layers can be used to represent objects that should not participate in normal viewing or other related operations. Special layers are not reported as valid layers.
insert_special_layer_at( unsigned int index, LayerInfo props )Description: Insert a new special layer with the given properties at the given index See insert_special_layer for a description of special layers.
[const] bool is_special_layer?( unsigned int layer_index )Description: Tell, if a layer index is a special layer index
[const] bool is_valid_cell_index?( unsigned int cell_index )Description: Tell, if a cell index is a valid index This method has been added in version 0.20.
[const] bool is_valid_layer?( unsigned int layer_index )Description: Tell, if a layer index is a valid index
[const] unsigned int[ ] layer_indicesDescription: Return a list of valid layer indices This method returns an array with layer indices representing valid layers. This method was introduced in version 0.19.
[const] unsigned int layersDescription: Return the number of layers The number of layers reports the maximum (plus 1) layer index used so far. Not all of the layers with an index in the range of 0 to layers-1 needs to be a valid layer. These layers can be either valid, special or unused. Use is_valid_layer? and is_special_layer? to test for the first two states.
move_layer( unsigned int src, unsigned int dest )Description: Move a layer This method was introduced in version 0.19. Move a layer from the source to the target. The target is not cleared before, so that this method merges shapes from the source with the target layer. The source layer is empty after that operation.
[static] Layout newDescription: Create a layout object
[static] Layout new( ref Manager )Description: Create a layout object attached to a manager This method was introduced in version 0.19.
[const] [ ] properties( unsigned int properties_id )Description: Get the properties set for a given properties ID Basically performs the backward conversion of the 'properties_id' method. Given a properties ID, returns the properties set as an array of pairs of variants. In this array, each key and the value are stored as pairs (arrays with two elements). If the properties ID is not valid, an empty array is returned.
unsigned int properties_id( properties[ ] )Description: Get the properties ID for a given properties set Before a set of properties can be attached to a shape, it must be converted into an ID that is unique for that set. The properties set must be given as a list of pairs of variants, each pair describing a name and a value. The name acts as the key for the property and does not need to be a string (it can be an integer or double value as well). The backward conversion can be performed with the 'properties' method.
prune_cell( unsigned int cell_index, int levels )Description: Delete a cell plus subcells not used otherwise This deletes a cell and also all sub cells of the cell which are not used otherwise. The number of hierarchy levels to consider can be specified as well. One level of hierarchy means that only the direct children of the cell are deleted with the cell itself. All instances of this cell are deleted as well. This method has been introduced in version 0.20.
prune_subcells( unsigned int cell_index, int levels )Description: Delete all sub cells of the cell which are not used otherwise down to the specified level of hierarchy This deletes all sub cells of the cell which are not used otherwise. All instances of the deleted cells are deleted as well. It is possible to specify how many levels of hierarchy below the given root cell are considered. This method has been introduced in version 0.20.
LayerMap read( string filename )Description: Load the layout from the given file The format of the file is determined automatically and automatic unzipping is provided. No particular options can be specified. This method has been added in version 0.18.
LayerMap read( string filename, LoadLayoutOptions options )Description: Load the layout from the given file with options The format of the file is determined automatically and automatic unzipping is provided. In this version, some reader options can be specified. This method has been added in version 0.18.
rename_cell( unsigned int index, string name )Description: name
set_info( unsigned int index, LayerInfo props )Description: Set the info structure for a specified layer
start_changesDescription: Signal the start of an operation bringing the layout into invalid state This method should be called whenever the layout is about to be brought into an invalid state. After calling this method, under_construction returns false which tells foreign code (such as update which might be called asynchronously for example because of a repaint event) not to use this layout object. This state is cancelled by the end_changes method. The start_changes method can be called multiple times and must be cancelled the same number of times. Using this method is only required currently if a repaint event may happen while the layout object is in an invalid state.
swap_layers( unsigned int a, unsigned int b )Description: Swap layers Swaps the shapes of both layers. This method was introduced in version 0.19.
[const] bool under_constructionDescription: Tell if the layout object is under construction A layout object is either under construction if a transaction is ongoing or the layout is brought into invalid state by "start_changes".
updateDescription: Update the internals of the layout This method updates the internal state of the layout. Usually this is done automatically This method is provided to ensure this state explicitly.
[const] write( string filename, bool gzip, SaveLayoutOptions options )Description: Write the layout to a stream file
[const] write( string filename )Description: Write the layout to a stream file
|