Class SaveLayoutOptions (version 0.16)

Description: Options for saving layouts

This class describes the various options for saving a layout to a stream file (GDS2, OASIS). There are: layers to be saved, cell or cells to be saved, scale factor, format, database unit and format specific options. Usually the default constructor provides a suitable object. The layers are specified by either selecting all layers or by defining layer by layer using the add_layer method. select_all_layers will explicitly select all layers for saving, deselect_all_layers will explicitly clear the list of layers.

Cells are selected in a similar fashion: by default, all cells are selected. Using add_cell, specific cells can be selected for saving. All these cells plus their hierarchy will then be written to the stream file.

Class overview

Index

Method Overview

[static] SaveLayoutOptions newDefault constructor
format=( string format )Select a format
[const] string formatGet the format name
add_layer( unsigned int layer_index, LayerInfo properties )Add a layer to be saved
select_all_layersSelect all layers to be saved
deselect_all_layersUnselect all layers: no layer will be saved
add_cell( unsigned int cell_index )Add a cell (plus hierarchy) to be saved
select_all_cellsSelect all cells to save
dbu=( double dbu )Set the database unit to be used in the stream file
[const] double dbuGet the explicit database unit if one is set
scale_factor=( double scale_factor )Set the scaling factor for the saving
[const] double scale_factorGet the scaling factor currently set
oasis_compression_level=( int )Set the OASIS compression level
[const] int oasis_compression_levelGet the OASIS compression level
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

add_cell( unsigned int cell_index )

Description: Add a cell (plus hierarchy) to be saved

The index of the cell must be a valid index in the context of the layout that will be saved. This method clears the 'select all cells' flag.

add_layer( unsigned int layer_index, LayerInfo properties )

Description: Add a layer to be saved

Adds the layer with the given index to the layer list that will be written. If all layers have been selected previously, this state will be cleared.

The 'properties' argument can be used to assign different layer properties than the ones present in the layout. Pass a default LayerInfo object to this argument to use the properties from the layout object. Construct a valid LayerInfo object with explicit layer, datatype and possibly a name to override the properties stored in the layout.

[const] double dbu

Description: Get the explicit database unit if one is set

dbu=( double dbu )

Description: Set the database unit to be used in the stream file

By default, the database unit of the layout is used. This method allows to explicitly use a different database unit. This effectively scales the layout.

deselect_all_layers

Description: Unselect all layers: no layer will be saved

This method will clear all layers selected with add_layer so far and clear the 'select all layers' flag. Using this method is the only way to save a layout without any layers.

destroy

Description: Explicitly destroy the object

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

[const] bool destroyed

Description: Tell, if the object was destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] string format

Description: Get the format name

format=( string format )

Description: Select a format

The format string can be either "GDS2" or "OASIS". Other formats may be available if a suitable plugin is installed.

[static] SaveLayoutOptions new

Description: Default constructor

By default, the scale factor will be 1.0, the database unit is set to "same as original" and all layers are selected as well as all cells. The default format is GDS2.

[const] int oasis_compression_level

Description: Get the OASIS compression level

See oasis_compression_level= method for a description of the OASIS compression level.

oasis_compression_level=( int )

Description: Set the OASIS compression level

The OASIS compression level is an integer number between 0 and 10. 0 basically is no compression, 1 produces shape arrays in a simple fashion. 2 and higher compression levels will use a more elaborate algorithm to find shape arrays which uses 2nd and futher neighbor distances. The higher the level, the higher the memory requirements and run times. Setting this property clears all format specific options for other formats such as GDS.

[const] double scale_factor

Description: Get the scaling factor currently set

scale_factor=( double scale_factor )

Description: Set the scaling factor for the saving

Using a scaling factor will scale all objects accordingly. Using a scaling factor can compensate implicit scaling by an explicit database unit specification. Setting and scale factor plus an explicit database unit thus allows to transcribe a layout to a different database unit without changing the layout's physical dimensions (beside potential grid snapping effects).

Be aware that rounding effects may occure if fractional scaling factors are used which are not compliant with any implicit layout grid.

By default, no scaling is applied.

select_all_cells

Description: Select all cells to save

This method will clear all cells specified with add_cells so far and set the 'select all cells' flag. This is the default.

select_all_layers

Description: Select all layers to be saved

This method will clear all layers selected with add_layer so far and set the 'select all layers' flag. This is the default.