API reference - Class LayoutNotation used in Ruby API documentation Description: The layout object
This object represents a layout. The layout object contains the cell hierarchy and adds functionality for managing cell names and layer names. The cell hierarchy can be changed by adding cells and cell instances. Cell instances will virtually put the content of a cell into another cell. Many cell instances can be put into a cell thus forming repetitions of the cell content. This process can be repeated over multiple levels. In effect a cell graphs is created with parent cells and child cells. The graph must not be recursive, so there is at least one top cell, which does not have a parent cell. Multiple top cells can be present. Layout is the very basic class of the layout database. It has a rich set of methods to manipulate and query the layout hierarchy, the geometrical objects, the meta information and other features of the layout database. For a discussion of the basic API and the related classes see The Database API. Usually layout objects have already been created by KLayout's application core. You can address such a layout via the CellView object inside the LayoutView class. For example: active_layout = RBA::CellView::active.layout puts "Top cell of current layout is #{active_layout.top_cell.name}" However, a layout can also be used standalone: layout = RBA::Layout::new cell = layout.create_cell("TOP") layer = layout.layer(RBA::LayerInfo::new(1, 0)) cell.shapes(layer).insert(RBA::Box::new(0, 0, 1000, 1000)) layout.write("single_rect.gds") Public constructors
Public methods
Deprecated methods (protected, public, static, non-static and constructors)
Detailed descriptionvoid _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 _destroyDescription: 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 _manageDescription: 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 _unmanageDescription: 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. unsigned int add_cell(string name)Description: Adds a cell with the given name
Use of this method is deprecated unsigned int add_lib_cell(Library ptr library,unsigned int lib_cell_index)Description: Imports a cell from the library
This method imports the given cell from the library and creates a new proxy cell. The proxy cell acts as a pointer to the actual cell which still resides in the library (precisely: in library.layout). The name of the new cell will be the name of library cell. This method has been introduced in version 0.22. unsigned int add_pcell_variant(unsigned long pcell_id,map<string,variant> parameters)Description: Creates a PCell variant for the given PCell ID with the parameters given as a name/value dictionary
This method will create a PCell variant proxy for a local PCell definition. It will create the PCell variant for the given parameters. Note that this method does not allow to create PCell instances for PCell's located in a library. Use add_pcell_variant with the library parameter for that purpose. Unlike the variant using a list of parameters, this version allows specification of the parameters with a key/value dictionary. The keys are the parameter names as given by the PCell declaration. The parameters are a sequence of variants which correspond to the parameters declared by the PCellDeclaration object. The name of the new cell will be the name of the PCell. If a cell with that name already exists, a new unique name is generated. This method has been introduced in version 0.22. unsigned int add_pcell_variant(unsigned long pcell_id,variant[] parameters)Description: Creates a PCell variant for the given PCell ID with the given parameters
This method will create a PCell variant proxy for a local PCell definition. It will create the PCell variant for the given parameters. Note that this method does not allow to create PCell instances for PCell's located in a library. Use add_pcell_variant with the library parameter for that purpose. The parameters are a sequence of variants which correspond to the parameters declared by the PCellDeclaration object. The name of the new cell will be the name of the PCell. If a cell with that name already exists, a new unique name is generated. This method has been introduced in version 0.22. unsigned int add_pcell_variant(Library ptr library,unsigned long pcell_id,map<string,variant> parameters)Description: Creates a PCell variant for a PCell located in an external library with the parameters given as a name/value dictionary
This method will import a PCell from a library and create a variant for the given parameter set. Technically, this method creates a proxy to the library and creates the variant inside that library. Unlike the variant using a list of parameters, this version allows specification of the parameters with a key/value dictionary. The keys are the parameter names as given by the PCell declaration. The parameters are a sequence of variants which correspond to the parameters declared by the PCellDeclaration object. The name of the new cell will be the name of the PCell. If a cell with that name already exists, a new unique name is generated. This method has been introduced in version 0.22. unsigned int add_pcell_variant(Library ptr library,unsigned long pcell_id,variant[] parameters)Description: Creates a PCell variant for a PCell located in an external library
This method will import a PCell from a library and create a variant for the given parameter set. Technically, this method creates a proxy to the library and creates the variant inside that library. The parameters are a sequence of variants which correspond to the parameters declared by the PCellDeclaration object. The name of the new cell will be the name of the PCell. If a cell with that name already exists, a new unique name is generated. This method has been introduced in version 0.22. void assign(const Layout other)Description: Assigns another object to self [const] RecursiveShapeIterator begin_shapes(const Cell ptr cell,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 version is convenience overload which takes a cell object instead of a cell index. This method has been added in version 0.24. [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_overlapping(const Cell ptr 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. It is convenience overload which takes a cell object instead of a cell index. This method has been added in version 0.24. [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. [const] RecursiveShapeIterator begin_shapes_touching(const Cell ptr cell,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. It is convenience overload which takes a cell object instead of a cell index. This method has been added in version 0.24. Cell ptr cell(string name)Description: Gets a cell object from the cell name
If name is not a valid cell name, this method will return "nil". This method has been introduced in version 0.23 and replaces cell_by_name. Cell ptr cell(unsigned int i)Description: Gets a cell object from the cell index
If the cell index is not a valid cell index, this method will raise an error. Use is_valid_cell_index? to test whether a given cell index is valid. unsigned int cell_by_name(string name)Description: Gets the cell index for a given name Use of this method is deprecated [const] string cell_name(unsigned int index)Description: Gets the name for a cell with the given index [const] unsigned int cellsDescription: Returns the number of cells
void clearDescription: Clears the layout Clears the layout completely. void clear_layer(unsigned int layer_index)Description: Clears a layer
Clears the layer: removes all shapes. This method was introduced in version 0.19. unsigned int clip(unsigned int cell,const Box box)Description: Clips the given cell by the given rectangle and produce a new cell with the clip
This method will cut a rectangular region given by the box from the given cell. The clip will be stored in a new cell whose index is returned. The clip will be performed hierarchically. The resulting cell will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This method has been added in version 0.21. [const] unsigned int clip_into(unsigned int cell,Layout ptr target,const Box box)Description: Clips the given cell by the given rectangle and produce a new cell with the clip
This method will cut a rectangular region given by the box from the given cell. The clip will be stored in a new cell in the target layout. The clip will be performed hierarchically. The resulting cell will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. Please note that it is important that the database unit of the target layout is identical to the database unit of the source layout to achieve the desired results.This method also assumes that the target layout holds the same layers than the source layout. It will copy shapes to the same layers than they have been on the original layout. This method has been added in version 0.21. unsigned int convert_cell_to_static(unsigned int cell_index)Description: Converts a PCell or library cell to a usual (static) cell
This method will create a new cell which contains the static representation of the PCell or library proxy given by "cell_index". If that cell is not a PCell or library proxy, it won't be touched and the input cell index is returned. This method has been added in version 0.23. void copy_layer(unsigned int src,unsigned int dest)Description: Copies 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. void createDescription: Ensures the C++ object is created Use of this method is deprecated. Use _create instead Cell ptr create_cell(string name)Description: Creates a cell with the given name
If a cell with that name already exists, the unique name will be chosen for the new cell consisting of the given name plus a suitable suffix. This method has been introduce in version 0.23 and replaces add_cell. Cell ptr create_cell(string name,map<string,variant> params)Description: Creates a cell as a PCell variant with the given name
This method will look up the PCell by the given name and create a new PCell variant with the given parameters. The parameters are specified as a key/value dictionary with the names being the ones from the PCell declaration. If no PCell with the given name exists, nil is returned. This method has been introduce in version 0.24. Cell ptr create_cell(string name,string lib_name)Description: Creates a cell with the given name
This method will look up the cell by the given name in the specified library and create a new library proxy to this cell. If the library name is not valid, nil is returned. This method has been introduce in version 0.24. Cell ptr create_cell(string name,string lib_name,map<string,variant> params)Description: Creates a cell with the given name
This method will look up the PCell by the given name in the specified library and create a new PCell variant with the given parameters. The parameters are specified as a key/value dictionary with the names being the ones from the PCell declaration. If no PCell with the given name exists or the library name is not valid, nil is returned. This method has been introduce in version 0.24. [const] double dbuDescription: Gets the database unit The database unit is the value of one units distance in micrometers. For numerical reasons and to be compliant with the GDS2 format, the database objects use integer coordinates. The basic unit of these coordinates is the database unit. You can convert coordinates to micrometers by multiplying the integer value with the database unit. Typical values for the database unit are 0.001 micrometer (one nanometer). Python specific notes:The object exposes a readable attribute 'dbu'. This is the getter. void dbu=(double dbu)Description: Sets the database unit See dbu for a description of the database unit. Python specific notes:The object exposes a writable attribute 'dbu'. This is the setter. void delete_cell(unsigned int cell_index)Description: Deletes 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. void delete_cell_rec(unsigned int cell_index)Description: Deletes 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. void delete_cells(unsigned int[] cell_index_list)Description: Deletes 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. void delete_layer(unsigned int layer_index)Description: Deletes a layer
This method frees the memory allocated for the shapes of this layer and remembers the layer's index for reuse when the next layer is allocated. 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. This method has been introduced in version 0.24. void destroyDescription: 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 Layout ptr dupDescription: Creates a copy of self [iter] Cell each_cellDescription: Iterates the unsorted cell list [iter] unsigned int each_cell_bottom_upDescription: Iterates 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. [iter] unsigned int each_cell_top_downDescription: begin iterator 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. [iter] unsigned int each_top_cellDescription: Iterates the top cells A layout may have an arbitrary number of top cells. The usual case however is that there is one top cell. void end_changesDescription: Cancels the "in changes" state (see "start_changes") variant find_layer(const LayerInfo info)Description: Finds a layer with the given properties If a layer with the given properties already exists, this method will return the index of that layer.If no such layer exists, it will return nil. This method has been introduced in version 0.23. variant find_layer(string name)Description: Finds a layer with the given name If a layer with the given name already exists, this method will return the index of that layer.If no such layer exists, it will return nil. This method has been introduced in version 0.23. variant find_layer(int layer,int datatype)Description: Finds a layer with the given layer and datatype number If a layer with the given layer/datatype already exists, this method will return the index of that layer.If no such layer exists, it will return nil. This method has been introduced in version 0.23. variant find_layer(int layer,int datatype,string name)Description: Finds a layer with the given layer and datatype number and name If a layer with the given layer/datatype/name already exists, this method will return the index of that layer.If no such layer exists, it will return nil. This method has been introduced in version 0.23. void flatten(unsigned int cell_index,int levels,bool prune)Description: Flattens the given cell
This method propagates all shapes and instances 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. void flatten_into(unsigned int source_cell_index,unsigned int target_cell_index,const CplxTrans trans,int levels)Description: Flattens the given cell into another cell
This method works like 'flatten', but allows specification of a target cell which can be different from the source cell plus a transformation which is applied for all shapes and instances in the target cell. In contrast to the 'flatten' method, the source cell is not modified. This method has been introduced in version 0.24. [const] LayerInfo get_info(unsigned int index)Description: Gets the info structure for a specified layer [const] unsigned int guiding_shape_layerDescription: Returns the index of the guiding shape layer The guiding shape layer is used to store guiding shapes for PCells. This method has been added in version 0.22. bool has_cell?(string name)Description: Returns true if a cell with a given name exists Returns true, if the layout has a cell with the given name [const] bool has_prop_id?Description: Returns true, if the layout has user properties This method has been introduced in version 0.24. unsigned int insert_layer(const LayerInfo props)Description: Inserts a new layer with the given properties
void insert_layer_at(unsigned int index,const LayerInfo props)Description: Inserts a new layer with the given properties at the given index This method will associate the given layer info with the given layer index. If a layer with that index already exists, this method will change the properties of the layer with that index. Otherwise a new layer is created. unsigned int insert_special_layer(const LayerInfo props)Description: Inserts 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. void insert_special_layer_at(unsigned int index,const LayerInfo props)Description: Inserts 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_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_editable?Description: Returns a value indicating whether the layout is editable.
If a layout is editable, in general manipulation methods are enabled and some optimisations are disabled (i.e. shape arrays are expanded). This method has been introduced in version 0.22. [const] bool is_special_layer?(unsigned int layer_index)Description: Returns true, if a layer index is a special layer index
[const] bool is_valid_cell_index?(unsigned int cell_index)Description: Returns true, 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: Returns true, if a layer index is a valid index
unsigned int layer(const LayerInfo info)Description: Finds or creates a layer with the given properties If a layer with the given properties already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned. If "info" is anonymous (info.anonymous? is true), a new layer will always be created. This method has been introduced in version 0.23. unsigned int layer(string name)Description: Finds or creates a layer with the given name If a layer with the given name already exists, this method will return the index of that layer.If no such layer exists, a new one with theis name will be created and its index will be returned. This method has been introduced in version 0.23. unsigned int layer(int layer,int datatype)Description: Finds or creates a layer with the given layer and datatype number If a layer with the given layer/datatype already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned. This method has been introduced in version 0.23. unsigned int layer(int layer,int datatype,string name)Description: Finds or creates a layer with the given layer and datatype number and name If a layer with the given layer/datatype/name already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned. This method has been introduced in version 0.23. [const] unsigned int[] layer_indicesDescription: Returns a list of valid layer indices This method returns an array with layer indices representing valid layers. This method has been introduced in version 0.19. [const] unsigned int layersDescription: Returns 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. void move_layer(unsigned int src,unsigned int dest)Description: Moves 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. unsigned int[] multi_clip(unsigned int cell,Box[] boxes)Description: Clips the given cell by the given rectangles and produce new cells with the clips, one for each rectangle.
This method will cut rectangular regions given by the boxes from the given cell. The clips will be stored in a new cells whose indexed are returned. The clips will be performed hierarchically. The resulting cells will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This version is somewhat more efficient than doing individual clips because the clip cells may share clipped versions of child cells. This method has been added in version 0.21. unsigned int[] multi_clip_into(unsigned int cell,Layout ptr target,Box[] boxes)Description: Clips the given cell by the given rectangles and produce new cells with the clips, one for each rectangle.
This method will cut rectangular regions given by the boxes from the given cell. The clips will be stored in a new cells in the given target layout. The clips will be performed hierarchically. The resulting cells will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This version is somewhat more efficient than doing individual clips because the clip cells may share clipped versions of child cells. Please note that it is important that the database unit of the target layout is identical to the database unit of the source layout to achieve the desired results. This method also assumes that the target layout holds the same layers than the source layout. It will copy shapes to the same layers than they have been on the original layout. This method has been added in version 0.21. [static] new Layout ptr new(Manager manager)Description: Creates a layout object attached to a manager This constructor specifies a manager object which is used to store undo information for example. A layout created with this constructor inherits the editable mode from the application. This method was introduced in version 0.19. Python specific notes:This method is the default initializer of the object [static] new Layout ptr newDescription: Creates a layout object A layout created with this constructor inherits the editable mode from the application. Python specific notes:This method is the default initializer of the object [static] new Layout ptr new(bool editable,Manager manager)Description: Creates a layout object attached to a manager This constructor specifies a manager object which is used to store undo information for example. It also allows to specify whether the layout is editable. In editable mode, some optimisations are disabled and the layout can be manipulated through a variety of methods. This method was introduced in version 0.22. Python specific notes:This method is the default initializer of the object [static] new Layout ptr new(bool editable)Description: Creates a layout object This constructor specifies whether the layout is editable. In editable mode, some optimisations are disabled and the layout can be manipulated through a variety of methods. This method was introduced in version 0.22. Python specific notes:This method is the default initializer of the object [const] const PCellDeclaration ptr pcell_declaration(string name)Description: Gets a reference to the PCell declaration for the PCell with the given name Returns a reference to the local PCell declaration with the given name. If the name is not a valid PCell name, this method returns nil. Usually this method is used on library layouts that define PCells. Note that this method cannot be used on the layouts using the PCell from a library. This method has been introduced in version 0.22. [const] const PCellDeclaration ptr pcell_declaration(unsigned long pcell_id)Description: Gets a reference to the PCell declaration for the PCell with the given PCell ID. Returns a reference to the local PCell declaration with the given PCell id. If the parameter is not a valid PCell ID, this method returns nil. The PCell ID is the number returned by register_pcell for example. Usually this method is used on library layouts that define PCells. Note that this method cannot be used on the layouts using the PCell from a library. This method has been introduced in version 0.22. [const] unsigned long pcell_id(string name)Description: Gets the ID of the PCell with the given name This method is equivalent to 'pcell_declaration(name).id'. This method has been introduced in version 0.22. [const] unsigned long[] pcell_idsDescription: Gets the IDs of the PCells registered in the layout Returns an array of PCell IDs. This method has been introduced in version 0.24. [const] string[] pcell_namesDescription: Gets the names of the PCells registered in the layout Returns an array of PCell names. This method has been introduced in version 0.24. [const] unsigned long prop_idDescription: Gets the properties ID associated with the layout This method has been introduced in version 0.24. Python specific notes:The object exposes a readable attribute 'prop_id'. This is the getter. void prop_id=(unsigned long id)Description: Sets the properties ID associated with the layout This method is provided, if a properties ID has been derived already. Usually it's more convenient to use delete_property, set_property or property. This method has been introduced in version 0.24. Python specific notes:The object exposes a writable attribute 'prop_id'. This is the setter. [const] variant[] properties(unsigned long properties_id)Description: Gets 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 long properties_id(variant[] properties)Description: Gets 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. 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 exists, it will return nil. Using that method is more convenient than using the properties ID to retrieve the property value. This method has been introduced in version 0.24. void prune_cell(unsigned int cell_index,int levels)Description: Deletes 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. void prune_subcells(unsigned int cell_index,int levels)Description: Deletes 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,const 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. unsigned long register_pcell(string name,PCellDeclaration ptr declaration)Description: Registers a PCell declaration under the given name Registers a local PCell in the current layout. If a declaration with that name alreay exists, it is replaced with the new declaration. This method has been introduced in version 0.22. void rename_cell(unsigned int index,string name)Description: name void set_info(unsigned int index,const LayerInfo props)Description: Sets the info structure for a specified layer 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. This method has been introduced in version 0.24. void start_changesDescription: Signals 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 true which tells foreign code (i.e. the asynchronous painter or the cell tree view) 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. This method can be used to speed up certain operations. For example iterating over the layout with a RecursiveShapeIterator while modifying other layers of the layout can be very inefficient, because inside the loop the layout's state is invalidate and updated frequently. Putting a update and start_changes sequence before the loop (use both methods in that order!) and a end_changes call after the loop can improve the performance dramatically. In addition, it can be necessary to prevent redraw operations in certain cases by using start_changes .. end_changes, in particular when it is possible to put a layout object into an invalid state temporarily. While the layout is under construction update can be called to update the internal state explicitly if required. This for example might be necessary to update the cell bounding boxes or to redo the sorting for region queries. void swap_layers(unsigned int a,unsigned int b)Description: Swap two layers
Swaps the shapes of both layers. This method was introduced in version 0.19. Cell ptr top_cellDescription: Returns the top cell object
If the layout has a single top cell, this method returns the top cell's Cell object. If the layout does not have a top cell, this method returns "nil". If the layout has multiple top cells, this method raises an error. This method has been introduced in version 0.23. Cell ptr[] top_cellsDescription: Returns the top cell objects
This method returns and array of Cell objects representing the top cells of the layout. This array can be empty, if the layout does not have a top cell (i.e. no cell at all). This method has been introduced in version 0.23. void transform(const Trans trans)Description: Transforms the layout with the given transformation This method has been introduced in version 0.23. void transform(const ICplxTrans trans)Description: Transforms the layout with the given complex integer transformation This method has been introduced in version 0.23. [const] bool under_construction?Description: Returns true 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". void updateDescription: Updates 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 explicitly. This can be useful while using start_changes and end_changes to wrap a performance-critical operation. See start_changes for more details. [const] void write(string filename,bool gzip,const SaveLayoutOptions options)Description: Writes the layout to a stream file
Use of this method is deprecated [const] void write(string filename,const SaveLayoutOptions options)Description: Writes the layout to a stream file
This version automatically determines the compression mode from the file name. The file is written with zlib compression if the suffix is ".gz" or ".gzip". This variant has been introduced in version 0.23. [const] void write(string filename)Description: Writes the layout to a stream file
|