Class LayoutView (version 0.18)

Description: The view object presenting one or more layout objects

The visual part of the view is the tab panel in the main window. The non-visual part are the redraw thread, the layout handles, cell lists, layer view lists etc. This object controls these aspects of the view and controls the appearance of the data.

Class overview

Index

Method Overview

stop_redrawStop the redraw thread
set_title( string title )Set the title of the view
reset_titleReset the title to the standard title
[const] string titleReturn the view's title string
save_layer_props( string fn )Save the layer properties
load_layer_props( string fn )Load the layer properties
min_hier_levels=( int level )Set the minimum hierarchy level at which to display geometries
[const] int min_hier_levels?Query the minimum hierarchy level at which to display geometries
max_hier_levels=( int level )Set the maximum hierarchy level up to which to display geometries
[const] int max_hier_levels?Query the maximum hierarchy level up to which to display geometries
reload_layout( unsigned int cv )Reload the given cellview
unsigned int create_layout( bool add_cellview )Create a new, empty layout
erase_cellview( unsigned int index )Erase the cellview with the given index
rename_cellview( string name, int index )Rename the cellview with the given index
unsigned int load_layout( string filename, LoadLayoutOptions options, bool add_cellview )Load a (new) file into the layout view
unsigned int load_layout( string filename, bool add_cellview )Load a (new) file into the layout view
[const] int active_cellview_indexGet the index of the active cellview (shown in hierarchy browser)
set_active_cellview_index( int index )Make the cellview with the given index the active one (shown in hierarchy browser)
[const] unsigned int[ ] get_current_cell_path( int cv_index )Cell path of the current cell
set_current_cell_path( int cv_index, unsigned int[ ] )Set the path to the current cell
[const] unsigned int cellviewsGet the number of cellviews
[const] const ref CellView cellview( unsigned int cv_index )Get the cellview object for a given index
zoom_fitFit the contents of the current view into the window
zoom_box( DBox box )Set the viewport to the given box
zoom_inZoom in somewhat
zoom_outZoom out somewhat
pan_upPan upward
pan_downPan down
pan_leftPan to the left
pan_rightPan to the right
pan_center( DPoint p )Pan to the given point
[const] DBox boxReturn the displayed box in micron space
[const] DCplxTrans viewport_transReturn the transformation that converts micron coordinates to pixels
[const] int viewport_widthReturn the viewport width in pixels
[const] int viewport_heightReturn the viewport height in pixels
bookmark_view( string name )Bookmark the current view under the given name
cancelCancel all edit operations
stopStop redraw thread and close any browsers
enable_edits( bool enable )Enable or disable editing
select_cell_path( unsigned int cell_index[ ], int cv_index )Select a cell by cell index for a certain cell view
select_cell( unsigned int cell_index, int cv_index )Select a cell by index for a certain cell view
descend( InstElement path[ ], int index )Descend further into the hierarchy.
InstElement ascend( int index )Ascend upwards in the hierarchy.
[const] bool is_cell_hidden( unsigned int cell_index, int cv_index )Tell, if the cell is hidden
hide_cell( unsigned int cell_index, int cv_index )Hide the given cell for the given cellview
show_cell( unsigned int cell_index, int cv_index )Show the given cell for the given cellview (cancel effect of hide_cell)
show_all_cellsMake all cells shown (cancel effects of hide_cell)
update_contentUpdate the layout view to the current state
max_hierSelect all hierarchy levels available
save_screenshot( string filename )Save a screenshot to the given file
save_image( string filename, unsigned int width, unsigned int height )Save the layout as an image to the given file
save_as( unsigned int index, string filename, bool gzip, SaveLayoutOptions options )Save a layout to the given stream file
set_layer_properties( LayerPropertiesIterator iter, LayerProperties props )Set the layer properties of the layer pointed to by the iterator
replace_layer_node( LayerPropertiesIterator iter, LayerPropertiesNode node )Replace the layer node at the position given by "iter" with a new one
const ref LayerPropertiesNode insert_layer( LayerPropertiesIterator iter, LayerPropertiesNode node )Insert the given layer properties node into the list before the given position
delete_layer( ref LayerPropertiesIterator iter )Delete the layer properties node
[const] LayerPropertiesIterator begin_layersBegin iterator for the layers
[const] LayerPropertiesIterator end_layersEnd iterator for the layers
clear_layersClear all layers
remove_stipple( unsigned int index )Remove the stipple pattern with the given index
clear_stipplesRemove all stipple pattern
unsigned int add_stipple( string name, unsigned int data[ ], unsigned int bits )Add a stipple pattern
[const] LayerPropertiesIterator current_layerGet the current layer view
[const] LayerPropertiesIterator[ ] selected_layersGet the selected layers
add_cellview_list_observer( ref ObserverBase observer )Add a cellview list observer
remove_cellview_list_observer( ref ObserverBase observer )Remove a cellview list observer
add_cellview_observer( ref ObserverBase observer )Add a cellview observer
remove_cellview_observer( ref ObserverBase observer )Remove a cellview observer
add_file_open_observer( ref ObserverBase observer )Add a file open observer
remove_file_open_observer( ref ObserverBase observer )Remove a file open observer
add_viewport_changed_observer( ref ObserverBase observer )Add a viewport changed observer
remove_viewport_changed_observer( ref ObserverBase observer )Remove a viewport changed observer
add_layer_list_observer( ref ObserverBase observer )Add a layer list observer
remove_layer_list_observer( ref ObserverBase observer )Remove a layer list observer
add_cell_visibility_observer( ref ObserverBase observer )Add a cell visibility observer
remove_cell_visibility_observer( ref ObserverBase observer )Remove a cell visibility observer
add_transient_selection_changed_observer( ref ObserverBase observer )Add a transient selection observer
remove_transient_selection_changed_observer( ref ObserverBase observer )Remove a transient selection observer
add_selection_changed_observer( ref ObserverBase observer )Add a selection observer
remove_selection_changed_observer( ref ObserverBase observer )Remove a selection observer
clear_configClear the local configuration parameters
[const] string get_config( string name )Query a local configuration parameter
set_config( string name, string value )Set a local configuration parameter with the given name to the given value
transaction( string description )Begin a transaction
commitEnd a transaction
bool transactingTell if a transaction is ongoing
clear_transactionsClear all transactions
clear_annotationsClear all annotations on this view
insert_annotation( Annotation obj )Insert an annotation object into the given view
yield const ref Annotation each_annotationIterate over all annotations attached to this view
[const] bool has_object_selection?Returns true, if geometrical objects (shapes or cell instances) are selected in this view
[const] yield const ref ObjectInstPath each_object_selectedIterate over each selected geometrical object, yielding a ObjectInstPath object for each of them
[const] bool has_transient_object_selection?Returns true, if geometrical objects (shapes or cell instances) are selected in this view in the transient selection
[const] yield const ref ObjectInstPath each_object_selected_transientIterate over each geometrical objects in the transient selection, yielding a ObjectInstPath object for each of them
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

[const] int active_cellview_index

Description: Get the index of the active cellview (shown in hierarchy browser)

add_cell_visibility_observer( ref ObserverBase observer )

Description: Add a cell visibility observer

If a cell is hidden or shown, this observer is triggered.

add_cellview_list_observer( ref ObserverBase observer )

Description: Add a cellview list observer

If a cellview is added or removed, this observer is triggered.

add_cellview_observer( ref ObserverBase observer )

Description: Add a cellview observer

If a cellview is changed (i.e. the cell is changed) this event is sent. The integer argument slot ("signal_int") of the observer will be triggered as well with the index of the cellview that has changed.

add_file_open_observer( ref ObserverBase observer )

Description: Add a file open observer

If a new file is loaded, this observer is triggered.

add_layer_list_observer( ref ObserverBase observer )

Description: Add a layer list observer

If the layer list changes, the observer's "signal_int" and "signal" slot is triggered. The int's bit 0 is set, if the properties have changed. If the arguments bit 1 is set, the hierarchy has changed.

add_selection_changed_observer( ref ObserverBase observer )

Description: Add a selection observer

If the selection is changed, this observer is triggered.

This method was added in version 0.18.

unsigned int add_stipple( string name, unsigned int data[ ], unsigned int bits )

Description: Add a stipple pattern

'data' is an array of unsigned integers describing the bits that make up the stipple pattern. If the array has less than 32 entries, the pattern will be repeated vertically. The number of bits used can be less than 32 bit which can be specified by the 'bits' parameter. Logically, the pattern will be put at the end of the list.

name:The name under which this pattern will appear in the stipple editor
data:See above
bits:See above
returns:The index of the newly created stipple pattern, which can be used as the dither pattern index of LayerProperties.

add_transient_selection_changed_observer( ref ObserverBase observer )

Description: Add a transient selection observer

If the transient selection is changed, this observer is triggered.

This method was added in version 0.18.

add_viewport_changed_observer( ref ObserverBase observer )

Description: Add a viewport changed observer

If the viewport (the rectangle that is shown) changes, this observer is triggered.

InstElement ascend( int index )

Description: Ascend upwards in the hierarchy.

Removes one element from the specific path of the cellview with the given index. Returns the element removed.

[const] LayerPropertiesIterator begin_layers

Description: Begin iterator for the layers

This iterator delivers the layers of this view, either in a recursive or non-recursive fashion, depending which iterator increment methods are used. The iterator delivered by end_layers is the past-the-end iterator. It can be compared agains a current iterator to check, if there are no further elements.

bookmark_view( string name )

Description: Bookmark the current view under the given name

name:The name under which to bookmark the current state

[const] DBox box

Description: Return the displayed box in micron space

cancel

Description: Cancel all edit operations

[const] const ref CellView cellview( unsigned int cv_index )

Description: Get the cellview object for a given index

cv_index:The cellview index for which to get the object for

[const] unsigned int cellviews

Description: Get the number of cellviews

clear_annotations

Description: Clear all annotations on this view

clear_config

Description: Clear the local configuration parameters

See set_config for a description of the local configuration parameters.

clear_layers

Description: Clear all layers

clear_stipples

Description: Remove all stipple pattern

All stipple pattern except the fixed ones are removed. If any of the custom stipple pattern is still used by the layers displayed, the results will not be predictable.

clear_transactions

Description: Clear all transactions

Discard all actions in the undo buffer. After clearing that buffer, no undo is available. It is important to clear the buffer when making database modifications outside transactions, i.e after that modifications have been done. If failing to do so, 'undo' operations are likely to produce invalid results. This method was introduced in version 0.16.

commit

Description: End a transaction

See transaction for a detailed description of transactions. This method was introduced in version 0.16.

unsigned int create_layout( bool add_cellview )

Description: Create a new, empty layout

The add_cellview parameter controls whether to create a new cellview (true) or clear all cellviews before.

returns:The index of the cellview created.

[const] LayerPropertiesIterator current_layer

Description: Get the current layer view

Returns the LayerPropertiesIterator pointing to the current layer view (the one that has the focus). If no layer view is active currently, a null iterator is returned.

delete_layer( ref LayerPropertiesIterator iter )

Description: Delete the layer properties node

This method deletes the object that the iterator points to and invalidates the iterator since the object that the iterator points to is no longer valid.

descend( InstElement path[ ], int index )

Description: Descend further into the hierarchy.

Adds the given path (given as an array of InstElement objects) to the specific path of the cellview with the given index. In effect, the cell addressed by the terminal of the new path components can be shown in the context of the upper cells, if the minimum hierarchy level is set to a negative value. The path is assumed to originate from the current cell and contain specific instances sorted from top to bottom.

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.

yield const ref Annotation each_annotation

Description: Iterate over all annotations attached to this view

[const] yield const ref ObjectInstPath each_object_selected

Description: Iterate over each selected geometrical object, yielding a ObjectInstPath object for each of them

[const] yield const ref ObjectInstPath each_object_selected_transient

Description: Iterate over each geometrical objects in the transient selection, yielding a ObjectInstPath object for each of them

This method was introduced in version 0.18.

enable_edits( bool enable )

Description: Enable or disable editing

enable:True to enable edits

[const] LayerPropertiesIterator end_layers

Description: End iterator for the layers

See begin_layers for a description about this iterator

erase_cellview( unsigned int index )

Description: Erase the cellview with the given index

This closes the given cellview and unloads the layout associated with it, unless referred to by another cellview.

[const] string get_config( string name )

Description: Query a local configuration parameter

See set_config for a description of the local configuration parameters.

name:The name of the configuration parameter whose value shall be obtained (a string)
returns:The value of the parameter

[const] unsigned int[ ] get_current_cell_path( int cv_index )

Description: Cell path of the current cell

The current cell is the one highlighted in the browser with the focus rectangle. The current path is returned for the cellview given by cv_index. The cell path is a list of cell indices from the top cell to the current cell.

cv_index:The cellview index for which to get the current path from (usally this will be the active cellview index)

[const] bool has_object_selection?

Description: Returns true, if geometrical objects (shapes or cell instances) are selected in this view

[const] bool has_transient_object_selection?

Description: Returns true, if geometrical objects (shapes or cell instances) are selected in this view in the transient selection

The transient selection represents the objects selected when the mouse hovers over the layout windows. This selection is not used for operations but rather to indicate which object would be selected if the mouse is clicked.

This method was introduced in version 0.18.

hide_cell( unsigned int cell_index, int cv_index )

Description: Hide the given cell for the given cellview

insert_annotation( Annotation obj )

Description: Insert an annotation object into the given view

Insert the annotation object given by obj into the view.

const ref LayerPropertiesNode insert_layer( LayerPropertiesIterator iter, LayerPropertiesNode node )

Description: Insert the given layer properties node into the list before the given position

This method inserts the new properties node before the position given by "iter" and returns a const reference to the element created.

[const] bool is_cell_hidden( unsigned int cell_index, int cv_index )

Description: Tell, if the cell is hidden

returns:True, if the cell with "cell_index" is hidden for the cellview "cv_index"

load_layer_props( string fn )

Description: Load the layer properties

Load the layer properties from the file given in "fn"

unsigned int load_layout( string filename, LoadLayoutOptions options, bool add_cellview )

Description: Load a (new) file into the layout view

Loads the file given by the "filename" parameter. The options specify various options for reading the file. The add_cellview param controls whether to create a new cellview (true) or clear all cellviews before (false). This method has been introduced in version 0.18.

returns:The index of the cellview loaded.

unsigned int load_layout( string filename, bool add_cellview )

Description: Load a (new) file into the layout view

Loads the file given by the "filename" parameter. The add_cellview param controls whether to create a new cellview (true) or clear all cellviews before (false).

returns:The index of the cellview loaded.

max_hier

Description: Select all hierarchy levels available

Show the layout in full depth down to the deepest level of hierarchy. This method may cause a redraw.

max_hier_levels=( int level )

Description: Set the maximum hierarchy level up to which to display geometries

This methods allows to set the maximum hierarchy below which to display geometries.This method may cause a redraw if required.

level:The maximum level below which to display something

[const] int max_hier_levels?

Description: Query the maximum hierarchy level up to which to display geometries

returns:The maximum level up to which to display geometries

min_hier_levels=( int level )

Description: Set the minimum hierarchy level at which to display geometries

This methods allows to set the minimum hierarchy level above which to display geometries.This method may cause a redraw if required.

level:The minimum level above which to display something

[const] int min_hier_levels?

Description: Query the minimum hierarchy level at which to display geometries

returns:The minimum level at which to display geometries

pan_center( DPoint p )

Description: Pan to the given point

The window is positioned such that "p" becomes the new center

pan_down

Description: Pan down

pan_left

Description: Pan to the left

pan_right

Description: Pan to the right

pan_up

Description: Pan upward

reload_layout( unsigned int cv )

Description: Reload the given cellview

cv:The index of the cellview to reload

remove_cell_visibility_observer( ref ObserverBase observer )

Description: Remove a cell visibility observer

remove_cellview_list_observer( ref ObserverBase observer )

Description: Remove a cellview list observer

remove_cellview_observer( ref ObserverBase observer )

Description: Remove a cellview observer

remove_file_open_observer( ref ObserverBase observer )

Description: Remove a file open observer

remove_layer_list_observer( ref ObserverBase observer )

Description: Remove a layer list observer

remove_selection_changed_observer( ref ObserverBase observer )

Description: Remove a selection observer

This method was added in version 0.18.

remove_stipple( unsigned int index )

Description: Remove the stipple pattern with the given index

The pattern with an index less than 16 cannot be removed. If a stipple pattern is removed that is still used, the results are not predictable.

remove_transient_selection_changed_observer( ref ObserverBase observer )

Description: Remove a transient selection observer

This method was added in version 0.18.

remove_viewport_changed_observer( ref ObserverBase observer )

Description: Remove a viewport changed observer

rename_cellview( string name, int index )

Description: Rename the cellview with the given index

If the name is not unique, a unique name will be constructed from the name given. The name may be different from the filename but is associated with the layout object. If a layout is shared between multiple cellviews (which may happen due to a clone of the layout view for example), both cellviews are renamed.

replace_layer_node( LayerPropertiesIterator iter, LayerPropertiesNode node )

Description: Replace the layer node at the position given by "iter" with a new one

reset_title

Description: Reset the title to the standard title

See set_title and title for a description about how titles are handled.

save_as( unsigned int index, string filename, bool gzip, SaveLayoutOptions options )

Description: Save a layout to the given stream file

The given layout (with the given index) is written to the stream file with the given options. 'options' is a SaveLayoutOptions object that specifies which format to write and further options such as scaling factor etc. Calling this method is equivalent to calling 'write' on the respective layout object.

index:The cellview index of the layout to save.
filename:The file to write.
gzip:True, if the file should be gzipped.
options:Writer options.

save_image( string filename, unsigned int width, unsigned int height )

Description: Save the layout as an image to the given file

The image contains the current scene (layout, annotations etc.). The image is written as a PNG file to the given file. The image is drawn synchroneously with the given width and height. Drawing may take some time.

filename:The file to which to write the screenshot to.
width:The width of the image to render in pixel.
height:The height of the image to render in pixel.

save_layer_props( string fn )

Description: Save the layer properties

Save the layer properties to the file given in "fn"

save_screenshot( string filename )

Description: Save a screenshot to the given file

The screenshot is written as a PNG file to the given file. This requires the drawing to be complete. Ideally, synchroneous mode is switched on for the application to guarantee this condition. The image will have the size of the viewport showing the current layout.

filename:The file to which to write the screenshot to.

select_cell( unsigned int cell_index, int cv_index )

Description: Select a cell by index for a certain cell view

Select the current (top) cell by specifying a path (a list of cell indices from top to the actual cell) and the cellview index for which this cell should become the currently shown one. This method selects the cell to be drawn. In constrast, the set_current_cell_path method selects the cell that is highlighted in the cell tree (but not necessarily drawn).

select_cell_path( unsigned int cell_index[ ], int cv_index )

Description: Select a cell by cell index for a certain cell view

Select the current (top) cell by specifying a cell indexand the cellview index for which this cell should become the currently shown one. The path to the cell is constructed by selecting one that leads to a top cell. This method selects the cell to be drawn. In constrast, the set_current_cell_path method selects the cell that is highlighted in the cell tree (but not necessarily drawn).

[const] LayerPropertiesIterator[ ] selected_layers

Description: Get the selected layers

Returns an array of LayerPropertiesIterator objects pointing to the currently selected layers. If no layer view is selected currently, an empty array is returned.

set_active_cellview_index( int index )

Description: Make the cellview with the given index the active one (shown in hierarchy browser)

See active_cellview_index.

set_config( string name, string value )

Description: Set a local configuration parameter with the given name to the given value

This method sets a local configuration parameter with the given name to the given value. Values can only be strings. Numerical values have to be converted into strings first. Local configuration parameters override global configurations for this specific view. This allows for example to override global settings of background colors. Any local settings are not written to the configuration file.

name:The name of the configuration parameter to set
value:The value to which to set the configuration parameter

set_current_cell_path( int cv_index, unsigned int[ ] )

Description: Set the path to the current cell

The current cell is the one highlighted in the browser with the focus rectangle. The cell given by the path is hightlighted and scrolled into view. To select the cell to be drawn, use the select_cell or select_cell_path method.

cv_index:The cellview index for which to set the current path for (usally this will be the active cellview index)
path:The path to the current cell

set_layer_properties( LayerPropertiesIterator iter, LayerProperties props )

Description: Set the layer properties of the layer pointed to by the iterator

This method replaces the layer properties of the element pointed to by "iter" by the properties given by "props". It will not change the hierarchy but just the properties of the given node.

set_title( string title )

Description: Set the title of the view

Override the standard title of the view indicating the file names loaded by the specified title string. The title string can be reset with reset_title to the standard title again.

title:The title string to use

show_all_cells

Description: Make all cells shown (cancel effects of hide_cell)

show_cell( unsigned int cell_index, int cv_index )

Description: Show the given cell for the given cellview (cancel effect of hide_cell)

stop

Description: Stop redraw thread and close any browsers

This method usually does not need to be called explicitly. The redraw thread is stopped automatically.

stop_redraw

Description: Stop the redraw thread

It is very important to stop the redraw thread before applying changes to the layout or the cell views and the LayoutView configuration. This is usually done automatically. For rare cases, where this is not the case, this method is provided.

[const] string title

Description: Return the view's title string

The title string is either a string composed of the file names loaded (in some "readable" manner) or a customized title string set by set_title.

returns:The title string

bool transacting

Description: Tell if a transaction is ongoing

See transaction for a detailed description of transactions. This method was introduced in version 0.16.

transaction( string description )

Description: Begin a transaction

A transaction brackets a sequence of database modifications that appear as a single undo action. Only modifications that are wrapped inside a transaction..commit call pair can be undone. Each transaction must be terminated with a commit method call, even if some error occured. It is advisable therefore to catch errors and issue a commit call in this case.

This method was introduced in version 0.16.

description:A text that appears in the 'undo' description

update_content

Description: Update the layout view to the current state

This method triggers an update of the hierarchy tree and layer view tree. Usually, this method does not need to be called. The widgets are updated automatically in most cases.

Currently, this method MUST be called however, after the layer view tree has been changed by the insert_layer, replace_layer_node or delete_layer methods.

[const] int viewport_height

Description: Return the viewport height in pixels

This method was introduced in version 0.18.

[const] DCplxTrans viewport_trans

Description: Return the transformation that converts micron coordinates to pixels

Hint: the transformation returned will convert any point in micron coordinate space into a pixel coordinate. Contrary to usual convention, the y pixel coordinate is given in a mathematically oriented space - which means the bottom coordinate is 0. This method was introduced in version 0.18.

[const] int viewport_width

Description: Return the viewport width in pixels

This method was introduced in version 0.18.

zoom_box( DBox box )

Description: Set the viewport to the given box

box:The box to which to set the view in micron coordinates

zoom_fit

Description: Fit the contents of the current view into the window

zoom_in

Description: Zoom in somewhat

zoom_out

Description: Zoom out somewhat