laycore
KLayout core module 'lay'
__all__
module
__all__ = ['__doc__', '__version__', 'PixelBuffer', 'BitmapBuffer', 'LayerProperties', 'LayerPropertiesNode', 'LayerPropertiesNodeRef', 'LayerPropertiesIterator', 'LayoutViewBase', 'CellView', 'Marker', 'AbstractMenu', 'ActionBase', 'Action', 'PluginFactory', 'Plugin', 'Cursor', 'ButtonState', 'KeyCode', 'Dispatcher', 'MacroExecutionContext', 'MacroInterpreter', 'Macro', 'LayoutView', 'ObjectInstPath', 'EditorHooks', 'ImageDataMapping', 'BasicImage', 'Image', 'BasicAnnotation', 'Annotation']
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
__doc__
module
__doc__ = "KLayout core module 'lay'"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__file__
module
__file__ = '/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/klayout/laycore.cpython-311-x86_64-linux-gnu.so'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__name__
module
__name__ = 'klayout.laycore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__package__
module
__package__ = 'klayout'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__version__
module
__version__ = '0.29.8'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
AbstractMenu
@brief An abstraction for the application menus
The abstract menu is a class that stores a main menu and several popup menus in a generic form such that they can be manipulated and converted into GUI objects.
Each item can be associated with a Action, which delivers a title, enabled/disable state etc. The Action is either provided when new entries are inserted or created upon initialisation.
The abstract menu class provides methods to manipulate the menu structure (the state of the menu items, their title and shortcut key is provided and manipulated through the Action object).
Menu items and submenus are referred to by a "path". The path is a string with this interpretation:
@
"" @ | @is the root@ | @
"[ | @is an element of the submenu given by | @
"[ | @refers to the item past the last item of the submenu given by | @
"[ | @refers to the first item of the submenu given by | @
"[ | @refers to the nth item of the submenu given by | @
Menu items can be put into groups. The path strings of each group can be obtained with the
"group" method. An item is put into a group by appending ":
Detached menus (i.e. for use in context menus) can be created as virtual top-level submenus
with a name of the form "@@
__doc__
class
__doc__ = '@brief An abstraction for the application menus\n\nThe abstract menu is a class that stores a main menu and several popup menus\nin a generic form such that they can be manipulated and converted into GUI objects.\n\nEach item can be associated with a Action, which delivers a title, enabled/disable state etc.\nThe Action is either provided when new entries are inserted or created upon initialisation.\n\nThe abstract menu class provides methods to manipulate the menu structure (the state of the\nmenu items, their title and shortcut key is provided and manipulated through the Action object). \n\nMenu items and submenus are referred to by a "path". The path is a string with this interpretation:\n\n@<table>\n @<tr>@<td>"" @</td>@<td>is the root@</td>@</tr> \n @<tr>@<td>"[<path>.]<name>" @</td>@<td>is an element of the submenu given by <path>. If <path> is omitted, this refers to an element in the root@</td>@</tr> \n @<tr>@<td>"[<path>.]end" @</td>@<td>refers to the item past the last item of the submenu given by <path> or root@</td>@</tr>\n @<tr>@<td>"[<path>.]begin" @</td>@<td>refers to the first item of the submenu given by <path> or root@</td>@</tr>\n @<tr>@<td>"[<path>.]#<n>" @</td>@<td>refers to the nth item of the submenu given by <path> or root (n is an integer number)@</td>@</tr>\n@</table>\n\nMenu items can be put into groups. The path strings of each group can be obtained with the \n"group" method. An item is put into a group by appending ":<group-name>" to the item\'s name.\nThis specification can be used several times.\n\nDetached menus (i.e. for use in context menus) can be created as virtual top-level submenus\nwith a name of the form "@@<name>". A special detached menu is "@toolbar" which represents the tool bar of the main window. \nMenus are closely related to the \\Action class. Actions are used to represent selectable items inside menus, provide the title and other configuration settings. Actions also link the menu items with code. See the \\Action class description for further details.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 413
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'AbstractMenu' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> AbstractMenu
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> AbstractMenu
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@hide
action
method descriptor
action() -> ActionBase
@brief Gets the reference to a Action object associated with the given path
@param path The path to the item. @return A reference to a Action object associated with this path or nil if the path is not valid
assign
method descriptor
assign() -> None
@brief Assigns another object to self
clear_menu
method descriptor
clear_menu() -> None
@brief Deletes the children of the item given by the path
@param path The path to the item whose children to delete
This method has been introduced in version 0.28.
create
method descriptor
create() -> None
@brief 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.
delete_item
method descriptor
delete_item() -> None
@brief Deletes the item given by the path
@param path The path to the item to delete
This method will also delete all children of the given item. To clear the children only, use \clear_menu.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> AbstractMenu
@brief Creates a copy of self
group
method descriptor
group() -> List[str]
@brief Gets the group members
@param group The group name @param A vector of all members (by path) of the group
insert_item
method descriptor
insert_item() -> None
@brief Inserts a new item before the one given by the path
The Action object passed as the third parameter references the handler which both implements the action to perform and the menu item's appearance such as title, icon and keyboard shortcut.
@param path The path to the item before which to insert the new item @param name The name of the item to insert @param action The Action object to insert
insert_menu
method descriptor
insert_menu(path: str, name: str, action: ActionBase) -> None
insert_menu(path: str, name: str, title: str) -> None
insert_menu()
@brief Inserts a new submenu before the item given by the path
@param path The path to the item before which to insert the submenu @param name The name of the submenu to insert @param action The action object of the submenu to insert
This method variant has been added in version 0.28.
insert_separator
method descriptor
insert_separator() -> None
@brief Inserts a new separator before the item given by the path
@param path The path to the item before which to insert the separator @param name The name of the separator to insert
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_menu
method descriptor
is_menu() -> bool
@brief Returns true if the item is a menu
@param path The path to the item @return false if the path is not valid or is not a menu
is_separator
method descriptor
is_separator() -> bool
@brief Returns true if the item is a separator
@param path The path to the item @return false if the path is not valid or is not a separator
This method has been introduced in version 0.19.
is_valid
method descriptor
is_valid() -> bool
@brief Returns true if the path is a valid one
@param path The path to check @return false if the path is not a valid path to an item
items
method descriptor
items() -> List[str]
@brief Gets the subitems for a given submenu
@param path The path to the submenu @return A vector or path strings for the child items or an empty vector if the path is not valid or the item does not have children
new
builtin
new() -> AbstractMenu
@hide
pack_key_binding
builtin
pack_key_binding() -> str
@brief Serializes a key binding definition into a single string The serialized format is used by the 'key-bindings' config key. This method will take an array of path/key definitions (including the \Action#NoKeyBound option) and convert it to a single string suitable for assigning to the config key.
This method has been introduced in version 0.26.
pack_menu_items_hidden
builtin
pack_menu_items_hidden() -> str
@brief Serializes a menu item visibility definition into a single string The serialized format is used by the 'menu-items-hidden' config key. This method will take an array of path/visibility flag definitions and convert it to a single string suitable for assigning to the config key.
This method has been introduced in version 0.26.
unpack_key_binding
builtin
unpack_key_binding() -> Dict[str, str]
@brief Deserializes a key binding definition This method is the reverse of \pack_key_binding.
This method has been introduced in version 0.26.
unpack_menu_items_hidden
builtin
unpack_menu_items_hidden() -> Dict[str, bool]
@brief Deserializes a menu item visibility definition This method is the reverse of \pack_menu_items_hidden.
This method has been introduced in version 0.26.
Action
Bases: klayout.pyacore.ActionBase
@brief The abstraction for an action (i.e. used inside menus)
Actions act as a generalization of menu entries. The action provides the appearance of a menu entry such as title, key shortcut etc. and dispatches the menu events. The action can be manipulated to change to appearance of a menu entry and can be attached an observer that receives the events when the menu item is selected.
Multiple action objects can refer to the same action internally, in which case the information and event handler is copied between the incarnations. This way, a single implementation can be provided for multiple places where an action appears, for example inside the toolbar and in addition as a menu entry. Both actions will shared the same icon, text, shortcut etc.
Actions are mainly used for providing new menu items inside the \AbstractMenu class. This is some sample Ruby code for that case:
@code a = RBA::Action.new a.title = "Push Me!" a.on_triggered do puts "I was pushed!" end
app = RBA::Application.instance mw = app.main_window
menu = mw.menu menu.insert_separator("@toolbar.end", "name") menu.insert_item("@toolbar.end", "my_action", a) @/code
This code will register a custom action in the toolbar. When the toolbar button is pushed a message is printed. The toolbar is addressed by a path starting with the pseudo root "@toolbar".
In Version 0.23, the Action class has been merged with the ActionBase class.
__doc__
class
__doc__ = '@brief The abstraction for an action (i.e. used inside menus)\n\nActions act as a generalization of menu entries. The action provides the appearance of a menu entry such as title, key shortcut etc. and dispatches the menu events. The action can be manipulated to change to appearance of a menu entry and can be attached an observer that receives the events when the menu item is selected.\n\nMultiple action objects can refer to the same action internally, in which case the information and event handler is copied between the incarnations. This way, a single implementation can be provided for multiple places where an action appears, for example inside the toolbar and in addition as a menu entry. Both actions will shared the same icon, text, shortcut etc.\n\nActions are mainly used for providing new menu items inside the \\AbstractMenu class. This is some sample Ruby code for that case:\n\n@code\na = RBA::Action.new\na.title = "Push Me!"\na.on_triggered do \n puts "I was pushed!"\nend\n\napp = RBA::Application.instance\nmw = app.main_window\n\nmenu = mw.menu\nmenu.insert_separator("@toolbar.end", "name")\nmenu.insert_item("@toolbar.end", "my_action", a)\n@/code\n\nThis code will register a custom action in the toolbar. When the toolbar button is pushed a message is printed. The toolbar is addressed by a path starting with the pseudo root "@toolbar".\n\nIn Version 0.23, the Action class has been merged with the ActionBase class.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 415
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
ActionBase
@hide @alias Action
NoKeyBound
class
NoKeyBound: str = 'none'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__doc__
class
__doc__ = '@hide\n@alias Action\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 414
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ActionBase' objects>
list of weak references to the object
checkable
class
checkable: bool = <attribute 'checkable' of 'ActionBase' objects>
@brief Gets a value indicating whether the item is checkable
@brief Makes the item(s) checkable or not
@param checkable true to make the item checkable
checked
class
checked: bool = <attribute 'checked' of 'ActionBase' objects>
@brief Gets a value indicating whether the item is checked
@brief Checks or unchecks the item
@param checked true to make the item checked
default_shortcut
class
default_shortcut: str = <attribute 'default_shortcut' of 'ActionBase' objects>
@brief Gets the default keyboard shortcut @return The default keyboard shortcut as a string
This attribute has been introduced in version 0.25.
@brief Sets the default keyboard shortcut
The default shortcut is used, if \shortcut is empty.
This attribute has been introduced in version 0.25.
enabled
class
enabled: bool = <attribute 'enabled' of 'ActionBase' objects>
@brief Gets a value indicating whether the item is enabled
@brief Enables or disables the action
@param enabled true to enable the item
hidden
class
hidden: bool = <attribute 'hidden' of 'ActionBase' objects>
@brief Gets a value indicating whether the item is hidden If an item is hidden, it's always hidden and \is_visible? does not have an effect. This attribute has been introduced in version 0.25.
@brief Sets a value that makes the item hidden always See \is_hidden? for details.
This attribute has been introduced in version 0.25
icon
class
icon: None = <attribute 'icon' of 'ActionBase' objects>
@brief Sets the icon to the given image file
@param file The image file to load for the icon
Passing an empty string will reset the icon.
icon_text
class
icon_text: str = <attribute 'icon_text' of 'ActionBase' objects>
@brief Gets the icon's text
@brief Sets the icon's text
If an icon text is set, this will be used for the text below the icon. If no icon text is set, the normal text will be used for the icon. Passing an empty string will reset the icon's text.
on_menu_opening
class
on_menu_opening: None = <attribute 'on_menu_opening' of 'ActionBase' objects>
@brief This event is called if the menu item is a sub-menu and before the menu is opened.
This event provides an opportunity to populate the menu before it is opened.
This event has been introduced in version 0.28.
@brief This event is called if the menu item is a sub-menu and before the menu is opened.
This event provides an opportunity to populate the menu before it is opened.
This event has been introduced in version 0.28.
on_triggered
class
on_triggered: None = <attribute 'on_triggered' of 'ActionBase' objects>
@brief This event is called if the menu item is selected.
This event has been introduced in version 0.21 and moved to the ActionBase class in 0.28.
@brief This event is called if the menu item is selected.
This event has been introduced in version 0.21 and moved to the ActionBase class in 0.28.
separator
class
separator: bool = <attribute 'separator' of 'ActionBase' objects>
@brief Gets a value indicating whether the item is a separator This method has been introduced in version 0.25.
@brief Makes an item a separator or not
@param separator true to make the item a separator This method has been introduced in version 0.25.
shortcut
class
shortcut: str = <attribute 'shortcut' of 'ActionBase' objects>
@brief Gets the keyboard shortcut @return The keyboard shortcut as a string
@brief Sets the keyboard shortcut If the shortcut string is empty, the default shortcut will be used. If the string is equal to \Action#NoKeyBound, no keyboard shortcut will be assigned.
@param shortcut The keyboard shortcut in Qt notation (i.e. "Ctrl+C")
The NoKeyBound option has been added in version 0.26.
title
class
title: str = <attribute 'title' of 'ActionBase' objects>
@brief Gets the title
@return The current title string
@brief Sets the title
@param title The title string to set (just the title)
tool_tip
class
tool_tip: str = <attribute 'tool_tip' of 'ActionBase' objects>
@brief Gets the tool tip text.
This method has been added in version 0.22.
@brief Sets the tool tip text
The tool tip text is displayed in the tool tip window of the menu entry. This is in particular useful for entries in the tool bar. This method has been added in version 0.22.
visible
class
visible: bool = <attribute 'visible' of 'ActionBase' objects>
@brief Gets a value indicating whether the item is visible The visibility combines with \is_hidden?. To get the true visiblity, use \is_effective_visible?.
@brief Sets the item's visibility
@param visible true to make the item visible
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
effective_shortcut
method descriptor
effective_shortcut() -> str
@brief Gets the effective keyboard shortcut @return The effective keyboard shortcut as a string
The effective shortcut is the one that is taken. It's either \shortcut or \default_shortcut.
This attribute has been introduced in version 0.25.
is_checkable
method descriptor
is_checkable() -> bool
@brief Gets a value indicating whether the item is checkable
is_checked
method descriptor
is_checked() -> bool
@brief Gets a value indicating whether the item is checked
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_effective_enabled
method descriptor
is_effective_enabled() -> bool
@brief Gets a value indicating whether the item is really enabled This is the combined value from \is_enabled? and dynamic value (\wants_enabled). This attribute has been introduced in version 0.28.
is_effective_visible
method descriptor
is_effective_visible() -> bool
@brief Gets a value indicating whether the item is really visible This is the combined visibility from \is_visible? and \is_hidden? and dynamic visibility (\wants_visible). This attribute has been introduced in version 0.25.
is_enabled
method descriptor
is_enabled() -> bool
@brief Gets a value indicating whether the item is enabled
is_hidden
method descriptor
is_hidden() -> bool
@brief Gets a value indicating whether the item is hidden If an item is hidden, it's always hidden and \is_visible? does not have an effect. This attribute has been introduced in version 0.25.
is_separator
method descriptor
is_separator() -> bool
@brief Gets a value indicating whether the item is a separator This method has been introduced in version 0.25.
is_visible
method descriptor
is_visible() -> bool
@brief Gets a value indicating whether the item is visible The visibility combines with \is_hidden?. To get the true visiblity, use \is_effective_visible?.
new
builtin
new() -> ActionBase
@brief Creates a new object of this class
trigger
method descriptor
trigger() -> None
@brief Triggers the action programmatically
Annotation
Bases: klayout.pyacore.BasicAnnotation
@brief A layout annotation (i.e. ruler)
Annotation objects provide a way to attach measurements or descriptive information to a layout view. Annotation objects can appear as rulers for example. Annotation objects can be configured in different ways using the styles provided. By configuring an annotation object properly, it can appear as a rectangle or a plain line for example. See @Ruler properties@ for more details about the appearance options.
Annotations are inserted into a layout view using \LayoutView#insert_annotation. Here is some sample code in Ruby:
@code app = RBA::Application.instance mw = app.main_window view = mw.current_view
ant = RBA::Annotation::new ant.p1 = RBA::DPoint::new(0, 0) ant.p2 = RBA::DPoint::new(100, 0) ant.style = RBA::Annotation::StyleRuler view.insert_annotation(ant) @/code
Annotations can be retrieved from a view with \LayoutView#each_annotation and all annotations can be cleared with \LayoutView#clear_annotations.
Starting with version 0.25, annotations are 'live' objects once they are inserted into the view. Changing properties of annotations will automatically update the view (however, that is not true the other way round).
Here is some sample code of changing the style of all rulers to two-sided arrows:
@code view = RBA::LayoutView::current
begin
view.transaction("Restyle annotations")
view.each_annotation do |a| a.style = RBA::Annotation::StyleArrowBoth end
ensure view.commit end @/code
AlignAuto
class
AlignAuto: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AlignBottom
class
AlignBottom: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AlignCenter
class
AlignCenter: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AlignDown
class
AlignDown: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AlignLeft
class
AlignLeft: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AlignRight
class
AlignRight: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AlignTop
class
AlignTop: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AlignUp
class
AlignUp: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AngleAny
class
AngleAny: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AngleDiagonal
class
AngleDiagonal: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AngleGlobal
class
AngleGlobal: int = 5
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AngleHorizontal
class
AngleHorizontal: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AngleOrtho
class
AngleOrtho: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
AngleVertical
class
AngleVertical: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
OutlineAngle
class
OutlineAngle: int = 7
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
OutlineBox
class
OutlineBox: int = 5
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
OutlineDiag
class
OutlineDiag: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
OutlineDiagXY
class
OutlineDiagXY: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
OutlineDiagYX
class
OutlineDiagYX: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
OutlineEllipse
class
OutlineEllipse: int = 6
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
OutlineRadius
class
OutlineRadius: int = 8
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
OutlineXY
class
OutlineXY: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
OutlineYX
class
OutlineYX: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PositionAuto
class
PositionAuto: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PositionCenter
class
PositionCenter: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PositionP1
class
PositionP1: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PositionP2
class
PositionP2: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
RulerModeAutoMetric
class
RulerModeAutoMetric: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
RulerModeAutoMetricEdge
class
RulerModeAutoMetricEdge: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
RulerModeNormal
class
RulerModeNormal: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
RulerModeSingleClick
class
RulerModeSingleClick: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
RulerMultiSegment
class
RulerMultiSegment: int = 5
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
RulerThreeClicks
class
RulerThreeClicks: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
StyleArrowBoth
class
StyleArrowBoth: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
StyleArrowEnd
class
StyleArrowEnd: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
StyleArrowStart
class
StyleArrowStart: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
StyleCrossBoth
class
StyleCrossBoth: int = 7
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
StyleCrossEnd
class
StyleCrossEnd: int = 5
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
StyleCrossStart
class
StyleCrossStart: int = 6
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
StyleLine
class
StyleLine: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
StyleRuler
class
StyleRuler: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief A layout annotation (i.e. ruler)\n\nAnnotation objects provide a way to attach measurements or descriptive information to a layout view. Annotation objects can appear as rulers for example. Annotation objects can be configured in different ways using the styles provided. By configuring an annotation object properly, it can appear as a rectangle or a plain line for example.\nSee @<a href="/manual/ruler_properties.xml">Ruler properties@</a> for more details about the appearance options.\n\nAnnotations are inserted into a layout view using \\LayoutView#insert_annotation. Here is some sample code in Ruby:\n\n@code\napp = RBA::Application.instance\nmw = app.main_window\nview = mw.current_view\n\nant = RBA::Annotation::new\nant.p1 = RBA::DPoint::new(0, 0)\nant.p2 = RBA::DPoint::new(100, 0)\nant.style = RBA::Annotation::StyleRuler\nview.insert_annotation(ant)\n@/code\n\nAnnotations can be retrieved from a view with \\LayoutView#each_annotation and all annotations can be cleared with \\LayoutView#clear_annotations.\n\nStarting with version 0.25, annotations are \'live\' objects once they are inserted into the view. Changing properties of annotations will automatically update the view (however, that is not true the other way round).\n\nHere is some sample code of changing the style of all rulers to two-sided arrows:\n\n@code\nview = RBA::LayoutView::current\n\nbegin\n\n view.transaction("Restyle annotations")\n\n view.each_annotation do |a|\n a.style = RBA::Annotation::StyleArrowBoth\n end\n \nensure\n view.commit\nend\n@/code\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 441
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
angle_constraint
class
angle_constraint: int = <attribute 'angle_constraint' of 'Annotation' objects>
@brief Returns the angle constraint attribute See \angle_constraint= for a more detailed description.
@brief Sets the angle constraint attribute This attribute controls if an angle constraint is applied when moving one of the ruler's points. The Angle... values can be used for this purpose.
category
class
category: str = <attribute 'category' of 'Annotation' objects>
@brief Gets the category string See \category= for details.
This method has been introduced in version 0.25
@brief Sets the category string of the annotation The category string is an arbitrary string that can be used by various consumers or generators to mark 'their' annotation.
This method has been introduced in version 0.25
fmt
class
fmt: str = <attribute 'fmt' of 'Annotation' objects>
@brief Returns the format used for the label @return The format string Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details.
@brief Sets the format used for the label @param format The format string Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details.
fmt_x
class
fmt_x: str = <attribute 'fmt_x' of 'Annotation' objects>
@brief Returns the format used for the x-axis label @return The format string Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details.
@brief Sets the format used for the x-axis label X-axis labels are only used for styles that have a horizontal component. @param format The format string Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details.
fmt_y
class
fmt_y: str = <attribute 'fmt_y' of 'Annotation' objects>
@brief Returns the format used for the y-axis label @return The format string Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details.
@brief Sets the format used for the y-axis label Y-axis labels are only used for styles that have a vertical component. @param format The format string Format strings can contain placeholders for values and formulas for computing derived values. See @Ruler properties@ for more details.
main_position
class
main_position: int = <attribute 'main_position' of 'Annotation' objects>
@brief Gets the position of the main label See \main_position= for details.
This method has been introduced in version 0.25
@brief Sets the position of the main label This method accepts one of the Position... constants.
This method has been introduced in version 0.25
main_xalign
class
main_xalign: int = <attribute 'main_xalign' of 'Annotation' objects>
@brief Gets the horizontal alignment type of the main label See \main_xalign= for details.
This method has been introduced in version 0.25
@brief Sets the horizontal alignment type of the main label This method accepts one of the Align... constants.
This method has been introduced in version 0.25
main_yalign
class
main_yalign: int = <attribute 'main_yalign' of 'Annotation' objects>
@brief Gets the vertical alignment type of the main label See \main_yalign= for details.
This method has been introduced in version 0.25
@brief Sets the vertical alignment type of the main label This method accepts one of the Align... constants.
This method has been introduced in version 0.25
outline
class
outline: int = <attribute 'outline' of 'Annotation' objects>
@brief Returns the outline style of the annotation object
@brief Sets the outline style used for drawing the annotation object The Outline... values can be used for defining the annotation object's outline. The outline style determines what components are drawn.
p1
class
p1: DPoint = <attribute 'p1' of 'Annotation' objects>
@brief Gets the first point of the ruler or marker The points of the ruler or marker are always given in micron units in floating-point coordinates.
This method is provided for backward compatibility. Starting with version 0.28, rulers can be multi-segmented. Use \points or \seg_p1 to retrieve the points of the ruler segments.
@return The first point
@brief Sets the first point of the ruler or marker The points of the ruler or marker are always given in micron units in floating-point coordinates.
This method is provided for backward compatibility. Starting with version 0.28, rulers can be multi-segmented. Use \points= to specify the ruler segments.
p2
class
p2: DPoint = <attribute 'p2' of 'Annotation' objects>
@brief Gets the second point of the ruler or marker The points of the ruler or marker are always given in micron units in floating-point coordinates.
This method is provided for backward compatibility. Starting with version 0.28, rulers can be multi-segmented. Use \points or \seg_p1 to retrieve the points of the ruler segments.
@return The second point
@brief Sets the second point of the ruler or marker The points of the ruler or marker are always given in micron units in floating-point coordinates.
This method is provided for backward compatibility. Starting with version 0.28, rulers can be multi-segmented. Use \points= to specify the ruler segments.
points
class
points: List[DPoint] = <attribute 'points' of 'Annotation' objects>
@brief Gets the points of the ruler A single-segmented ruler has two points. Rulers with more points have more segments correspondingly. Note that the point list may have one point only (single-point ruler) or may even be empty.
Use \points= to set the segment points. Use \segments to get the number of segments and \seg_p1 and \seg_p2 to get the first and second point of one segment.
Multi-segmented rulers have been introduced in version 0.28
@brief Sets the points for a (potentially) multi-segmented ruler See \points for a description of multi-segmented rulers. The list of points passed to this method is cleaned from duplicates before being stored inside the ruler.
This method has been introduced in version 0.28.
snap
class
snap: bool = <attribute 'snap' of 'Annotation' objects>
@brief Returns the 'snap to objects' attribute
@brief Sets the 'snap to objects' attribute If this attribute is set to true, the ruler or marker snaps to other objects when moved.
style
class
style: int = <attribute 'style' of 'Annotation' objects>
@brief Returns the style of the annotation object
@brief Sets the style used for drawing the annotation object The Style... values can be used for defining the annotation object's style. The style determines if ticks or arrows are drawn.
xlabel_xalign
class
xlabel_xalign: int = <attribute 'xlabel_xalign' of 'Annotation' objects>
@brief Gets the horizontal alignment type of the x axis label See \xlabel_xalign= for details.
This method has been introduced in version 0.25
@brief Sets the horizontal alignment type of the x axis label This method accepts one of the Align... constants.
This method has been introduced in version 0.25
xlabel_yalign
class
xlabel_yalign: int = <attribute 'xlabel_yalign' of 'Annotation' objects>
@brief Gets the vertical alignment type of the x axis label See \xlabel_yalign= for details.
This method has been introduced in version 0.25
@brief Sets the vertical alignment type of the x axis label This method accepts one of the Align... constants.
This method has been introduced in version 0.25
ylabel_xalign
class
ylabel_xalign: int = <attribute 'ylabel_xalign' of 'Annotation' objects>
@brief Gets the horizontal alignment type of the y axis label See \ylabel_xalign= for details.
This method has been introduced in version 0.25
@brief Sets the horizontal alignment type of the y axis label This method accepts one of the Align... constants.
This method has been introduced in version 0.25
ylabel_yalign
class
ylabel_yalign: int = <attribute 'ylabel_yalign' of 'Annotation' objects>
@brief Gets the vertical alignment type of the y axis label See \ylabel_yalign= for details.
This method has been introduced in version 0.25
@brief Sets the vertical alignment type of the y axis label This method accepts one of the Align... constants.
This method has been introduced in version 0.25
__eq__
method descriptor
__eq__() -> bool
@brief Equality operator
__ne__
method descriptor
__ne__() -> bool
@brief Inequality operator
__repr__
method descriptor
__repr__() -> str
@brief Returns the string representation of the ruler This method was introduced in version 0.19.
__str__
method descriptor
__str__() -> str
@brief Returns the string representation of the ruler This method was introduced in version 0.19.
box
method descriptor
box() -> db.DBox
@brief Gets the bounding box of the object (not including text) @return The bounding box
delete
method descriptor
delete() -> None
@brief Deletes this annotation from the view If the annotation is an "active" one, this method will remove it from the view. This object will become detached and can still be manipulated, but without having an effect on the view. This method has been introduced in version 0.25.
detach
method descriptor
detach() -> None
@brief Detaches the annotation object from the view If the annotation object was inserted into the view, property changes will be reflected in the view. To disable this feature, 'detach' can be called after which the annotation object becomes inactive and changes will no longer be reflected in the view.
This method has been introduced in version 0.25.
from_s
builtin
from_s() -> Annotation
@brief Creates a ruler from a string representation This function creates a ruler from the string returned by \to_s.
This method was introduced in version 0.28.
id
method descriptor
id() -> int
@brief Returns the annotation's ID The annotation ID is an integer that uniquely identifies an annotation inside a view. The ID is used for replacing an annotation (see \LayoutView#replace_annotation).
This method was introduced in version 0.24.
is_valid
method descriptor
is_valid() -> bool
@brief Returns a value indicating whether the object is a valid reference. If this value is true, the object represents an annotation on the screen. Otherwise, the object is a 'detached' annotation which does not have a representation on the screen.
This method was introduced in version 0.25.
register_template
builtin
register_template() -> None
@brief Registers the given annotation as a template globally @annotation The annotation to use for the template (positions are ignored) @param title The title to use for the ruler template @param mode The mode the ruler will be created in (see Ruler... constants)
In order to register a system template, the category string of the annotation has to be a unique and non-empty string. The annotation is added to the list of annotation templates and becomes available as a new template in the ruler drop-down menu.
The new annotation template is registered on all views.
NOTE: this setting is persisted and the the application configuration is updated.
This method has been added in version 0.25.
seg_p1
method descriptor
seg_p1() -> db.DPoint
@brief Gets the first point of the given segment. The segment is indicated by the segment index which is a number between 0 and \segments-1.
This method has been introduced in version 0.28.
seg_p2
method descriptor
seg_p2() -> db.DPoint
@brief Gets the second point of the given segment. The segment is indicated by the segment index which is a number between 0 and \segments-1. The second point of a segment is also the first point of the following segment if there is one.
This method has been introduced in version 0.28.
segments
method descriptor
segments() -> int
@brief Gets the number of segments. This method returns the number of segments the ruler is made up. Even though the ruler can be one or even zero points, the number of segments is at least 1.
This method has been introduced in version 0.28.
text
method descriptor
text() -> str
@brief Returns the formatted text for the main label The index parameter indicates which segment to use (0 is the first one). It has been added in version 0.28.
text_x
method descriptor
text_x() -> str
@brief Returns the formatted text for the x-axis label The index parameter indicates which segment to use (0 is the first one). It has been added in version 0.28.
text_y
method descriptor
text_y() -> str
@brief Returns the formatted text for the y-axis label The index parameter indicates which segment to use (0 is the first one). It has been added in version 0.28.
to_s
method descriptor
to_s() -> str
@brief Returns the string representation of the ruler This method was introduced in version 0.19.
transformed
method descriptor
transformed(t: db.DCplxTrans) -> Annotation
transformed(t: db.DTrans) -> Annotation
transformed(t: db.ICplxTrans) -> Annotation
transformed()
@brief Transforms the ruler or marker with the given complex transformation @param t The magnifying transformation to apply @return The transformed object (in this case an integer coordinate object)
This method has been introduced in version 0.18.
Starting with version 0.25, all overloads all available as 'transform'.
transformed_cplx
method descriptor
transformed_cplx(t: db.DCplxTrans) -> Annotation
transformed_cplx(t: db.ICplxTrans) -> Annotation
transformed_cplx()
@brief Transforms the ruler or marker with the given complex transformation @param t The magnifying transformation to apply @return The transformed object (in this case an integer coordinate object)
This method has been introduced in version 0.18.
Starting with version 0.25, all overloads all available as 'transform'.
unregister_templates
builtin
unregister_templates() -> None
@brief Unregisters the template or templates with the given category string globally
This method will remove all templates with the given category string. If the category string is empty, all templates are removed.
NOTE: this setting is persisted and the the application configuration is updated.
This method has been added in version 0.28.
BasicAnnotation
@hide @alias Annotation
__doc__
class
__doc__ = '@hide\n@alias Annotation'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 440
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'BasicAnnotation' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> BasicAnnotation
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> BasicAnnotation
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> BasicAnnotation
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> BasicAnnotation
@brief Creates a new object of this class
BasicImage
@hide @alias Image
__doc__
class
__doc__ = '@hide\n@alias Image'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 438
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'BasicImage' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> BasicImage
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> BasicImage
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> BasicImage
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> BasicImage
@brief Creates a new object of this class
BitmapBuffer
@brief A simplistic pixel buffer representing monochrome image
This object is mainly provided for offline rendering of layouts in Qt-less environments. It supports a rectangular pixel space with color values encoded in single bits.
This class supports basic operations such as initialization, single-pixel access and I/O to PNG.
This class has been introduced in version 0.28.
__doc__
class
__doc__ = '@brief A simplistic pixel buffer representing monochrome image\n\nThis object is mainly provided for offline rendering of layouts in Qt-less environments.\nIt supports a rectangular pixel space with color values encoded in single bits.\n\nThis class supports basic operations such as initialization, single-pixel access and I/O to PNG.\n\nThis class has been introduced in version 0.28.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 228
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'BitmapBuffer' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> BitmapBuffer
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> BitmapBuffer
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Returns a value indicating whether self is identical to the other image
__init__
method descriptor
__init__() -> None
@brief Creates a pixel buffer object
@param width The width in pixels @param height The height in pixels
The pixels are basically uninitialized. You will need to use \fill to initialize them to a certain value.
__ne__
method descriptor
__ne__() -> bool
@brief Returns a value indicating whether self is not identical to the other image
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> BitmapBuffer
@brief Creates a copy of self
fill
method descriptor
fill() -> None
@brief Fills the pixel buffer with the given pixel value
from_png_data
builtin
from_png_data() -> BitmapBuffer
@brief Reads the pixel buffer from a PNG byte stream This method may not be available if PNG support is not compiled into KLayout.
height
method descriptor
height() -> int
@brief Gets the height of the pixel buffer in pixels
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> BitmapBuffer
@brief Creates a pixel buffer object
@param width The width in pixels @param height The height in pixels
The pixels are basically uninitialized. You will need to use \fill to initialize them to a certain value.
pixel
method descriptor
pixel() -> bool
@brief Gets the value of the pixel at position x, y
read_png
builtin
read_png() -> BitmapBuffer
@brief Reads the pixel buffer from a PNG file This method may not be available if PNG support is not compiled into KLayout.
set_pixel
method descriptor
set_pixel() -> None
@brief Sets the value of the pixel at position x, y
swap
method descriptor
swap() -> None
@brief Swaps data with another BitmapBuffer object
to_png_data
method descriptor
to_png_data() -> bytes
@brief Converts the pixel buffer to a PNG byte stream This method may not be available if PNG support is not compiled into KLayout.
width
method descriptor
width() -> int
@brief Gets the width of the pixel buffer in pixels
write_png
method descriptor
write_png() -> None
@brief Writes the pixel buffer to a PNG file This method may not be available if PNG support is not compiled into KLayout.
ButtonState
@brief The namespace for the button state flags in the mouse events of the Plugin class. This class defines the constants for the button state. In the event handler, the button state is indicated by a bitwise combination of these constants. See \Plugin for further details. This class has been introduced in version 0.22.
AltKey
class
AltKey: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
ControlKey
class
ControlKey: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LeftButton
class
LeftButton: int = 8
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
MidButton
class
MidButton: int = 16
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
RightButton
class
RightButton: int = 32
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
ShiftKey
class
ShiftKey: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief The namespace for the button state flags in the mouse events of the Plugin class.\nThis class defines the constants for the button state. In the event handler, the button state is indicated by a bitwise combination of these constants. See \\Plugin for further details.\nThis class has been introduced in version 0.22.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 419
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ButtonState' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> ButtonState
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> ButtonState
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> ButtonState
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> ButtonState
@brief Creates a new object of this class
CellView
@brief A class describing what is shown inside a layout view
The cell view points to a specific cell within a certain layout and a hierarchical context. For that, first of all a layout pointer is provided. The cell itself is addressed by an cell_index or a cell object reference. The layout pointer can be nil, indicating that the cell view is invalid.
The cell is not only identified by its index or object but also by the path leading to that cell. This path indicates how to find the cell in the hierarchical context of its parent cells.
The path is in fact composed of two parts: first in an unspecific fashion, just describing which parent cells are used. The target of this path is called the "context cell". It is accessible by the \ctx_cell_index or \ctx_cell methods. In the viewer, the unspecific part of the path is the location of the cell in the cell tree.
Additionally the path's second part may further identify a specific instance of a certain subcell in the context cell. This is done through a set of \InstElement objects. The target of this specific path is the actual cell addressed by the cellview. This target cell is accessible by the \cell_index or \cell methods. In the viewer, the target cell is shown in the context of the context cell. The hierarchy levels are counted from the context cell, which is on level 0. If the context path is empty, the context cell is identical with the target cell.
Starting with version 0.25, the cellview can be modified directly. This will have an immediate effect on the display. For example, the following code will select a different cell:
@code cv = RBA::CellView::active cv.cell_name = "TOP2" @/code
See @The Application API@ for more details about the cellview objects.
__doc__
class
__doc__ = '@brief A class describing what is shown inside a layout view\n\nThe cell view points to a specific cell within a certain layout and a hierarchical context.\nFor that, first of all a layout pointer is provided. The cell itself\nis addressed by an cell_index or a cell object reference.\nThe layout pointer can be nil, indicating that the cell view is invalid.\n\nThe cell is not only identified by its index or object but also \nby the path leading to that cell. This path indicates how to find the\ncell in the hierarchical context of its parent cells. \n\nThe path is in fact composed of two parts: first in an unspecific fashion,\njust describing which parent cells are used. The target of this path\nis called the "context cell". It is accessible by the \\ctx_cell_index\nor \\ctx_cell methods. In the viewer, the unspecific part of the path is\nthe location of the cell in the cell tree.\n\nAdditionally the path\'s second part may further identify a specific instance of a certain\nsubcell in the context cell. This is done through a set of \\InstElement\nobjects. The target of this specific path is the actual cell addressed by the\ncellview. This target cell is accessible by the \\cell_index or \\cell methods.\nIn the viewer, the target cell is shown in the context of the context cell.\nThe hierarchy levels are counted from the context cell, which is on level 0.\nIf the context path is empty, the context cell is identical with the target cell.\n\nStarting with version 0.25, the cellview can be modified directly. This will have an immediate effect on the display. For example, the following code will select a different cell:\n\n@code\ncv = RBA::CellView::active\ncv.cell_name = "TOP2"\n@/code\n\nSee @<a href="/programming/application_api.xml">The Application API@</a> for more details about the cellview objects.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 411
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'CellView' objects>
list of weak references to the object
cell
class
cell: Cell = <attribute 'cell' of 'CellView' objects>
@brief Gets the reference to the target cell currently addressed
@brief Sets the cell by reference to a Cell object Setting the cell reference to nil invalidates the cellview. This method will construct any path to this cell, not a particular one. It will clear the context path and update the context and target cell.
cell_index
class
cell_index: int = <attribute 'cell_index' of 'CellView' objects>
@brief Gets the target cell's index
@brief Sets the path to the given cell
This method will construct any path to this cell, not a particular one. It will clear the context path and update the context and target cell. Note that the cell is specified by its index.
cell_name
class
cell_name: str = <attribute 'cell_name' of 'CellView' objects>
@brief Gets the name of the target cell currently addressed
@brief Sets the cell by name
If the name is not a valid one, the cellview will become invalid. This method will construct any path to this cell, not a particular one. It will clear the context path and update the context and target cell.
context_path
class
context_path: List[InstElement] = <attribute 'context_path' of 'CellView' objects>
@brief Gets the cell's context path The context path leads from the context cell to the target cell in a specific fashion, i.e. describing each instance in detail, not just by cell indexes. If the context and target cell are identical, the context path is empty.
@brief Sets the context path explicitly
This method assumes that the unspecific part of the path is established already and that the context path starts from the context cell.
name
class
name: str = <attribute 'name' of 'CellView' objects>
@brief Gets the unique name associated with the layout behind the cellview
@brief sets the unique name associated with the layout behind the cellview
this method has been introduced in version 0.25.
on_technology_changed
class
on_technology_changed: None = <attribute 'on_technology_changed' of 'CellView' objects>
@brief An event indicating that the technology has changed This event is triggered when the CellView is attached to a different technology.
This event has been introduced in version 0.27.
@brief An event indicating that the technology has changed This event is triggered when the CellView is attached to a different technology.
This event has been introduced in version 0.27.
path
class
path: List[int] = <attribute 'path' of 'CellView' objects>
@brief Gets the cell's unspecific part of the path leading to the context cell
@brief Sets the unspecific part of the path explicitly
Setting the unspecific part of the path will clear the context path component and update the context and target cell.
technology
class
technology: str = <attribute 'technology' of 'CellView' objects>
@brief Returns the technology name for the layout behind the given cell view This method has been added in version 0.23.
@brief Sets the technology for the layout behind the given cell view According to the specification of the technology, new layer properties may be loaded or the net tracer may be reconfigured. If the layout is shown in multiple views, the technology is updated for all views. This method has been added in version 0.22.
__copy__
method descriptor
__copy__() -> CellView
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> CellView
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality: indicates whether the cellviews refer to the same one In version 0.25, the definition of the equality operator has been changed to reflect identity of the cellview. Before that version, identity of the cell shown was implied.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
active
builtin
active() -> CellView
@brief Gets the active CellView The active CellView is the one that is selected in the current layout view. This method is equivalent to @code RBA::LayoutView::current.active_cellview @/code If no CellView is active, this method returns nil.
This method has been introduced in version 0.23.
ascend
method descriptor
ascend() -> None
@brief Ascends upwards in the hierarchy. Removes one element from the specific path of the cellview with the given index. Returns the element removed. This method has been added in version 0.25.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
close
method descriptor
close() -> None
@brief Closes this cell view
This method will close the cellview - remove it from the layout view. After this method was called, the cellview will become invalid (see \is_valid?).
This method was introduced in version 0.25.
context_dtrans
method descriptor
context_dtrans() -> db.DCplxTrans
@brief Gets the accumulated transformation of the context path in micron unit space This is the transformation applied to the target cell before it is shown in the context cell Technically this is the product of all transformations over the context path. See \context_trans for a version delivering an integer-unit space transformation.
This method has been introduced in version 0.27.3.
context_trans
method descriptor
context_trans() -> db.ICplxTrans
@brief Gets the accumulated transformation of the context path This is the transformation applied to the target cell before it is shown in the context cell Technically this is the product of all transformations over the context path. See \context_dtrans for a version delivering a micron-unit space transformation.
This method has been introduced in version 0.27.3.
create
method descriptor
create() -> None
@brief 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.
ctx_cell
method descriptor
ctx_cell() -> db.Cell
@brief Gets the reference to the context cell currently addressed
ctx_cell_index
method descriptor
ctx_cell_index() -> int
@brief Gets the context cell's index
descend
method descriptor
descend() -> None
@brief Descends 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. This method has been added in version 0.25.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> CellView
@brief Creates a copy of self
filename
method descriptor
filename() -> str
@brief Gets filename associated with the layout behind the cellview
hide_cell
method descriptor
hide_cell() -> None
@brief Hides the given cell
This method has been added in version 0.25.
index
method descriptor
index() -> int
@brief Gets the index of this cellview in the layout view The index will be negative if the cellview is not a valid one. This method has been added in version 0.25.
is_cell_hidden
method descriptor
is_cell_hidden() -> bool
@brief Returns true, if the given cell is hidden
This method has been added in version 0.25.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_dirty
method descriptor
is_dirty() -> bool
@brief Gets a flag indicating whether the layout needs saving A layout is 'dirty' if it is modified and needs saving. This method returns true in this case.
This method has been introduced in version 0.24.10.
is_valid
method descriptor
is_valid() -> bool
@brief Returns true, if the cellview is valid A cellview may become invalid if the corresponding tab is closed for example.
layout
method descriptor
layout() -> db.Layout
@brief Gets the reference to the layout object addressed by this view
new
builtin
new() -> CellView
@brief Creates a new object of this class
reset_cell
method descriptor
reset_cell() -> None
@brief Resets the cell
The cellview will become invalid. The layout object will still be attached to the cellview, but no cell will be selected.
set_cell
method descriptor
set_cell() -> None
@brief Sets the path to the given cell
This method will construct any path to this cell, not a particular one. It will clear the context path and update the context and target cell. Note that the cell is specified by its index.
set_cell_name
method descriptor
set_cell_name() -> None
@brief Sets the cell by name
If the name is not a valid one, the cellview will become invalid. This method will construct any path to this cell, not a particular one. It will clear the context path and update the context and target cell.
set_context_path
method descriptor
set_context_path() -> None
@brief Sets the context path explicitly
This method assumes that the unspecific part of the path is established already and that the context path starts from the context cell.
set_path
method descriptor
set_path() -> None
@brief Sets the unspecific part of the path explicitly
Setting the unspecific part of the path will clear the context path component and update the context and target cell.
show_all_cells
method descriptor
show_all_cells() -> None
@brief Makes all cells shown (cancel effects of \hide_cell) for the specified cell view
This method has been added in version 0.25.
show_cell
method descriptor
show_cell() -> None
@brief Shows the given cell (cancels the effect of \hide_cell)
This method has been added in version 0.25.
view
method descriptor
view() -> LayoutView
@brief Gets the view the cellview resides in This reference will be nil if the cellview is not a valid one. This method has been added in version 0.25.
Cursor
@brief The namespace for the cursor constants This class defines the constants for the cursor setting (for example for class \Plugin, method set_cursor). This class has been introduced in version 0.22.
Arrow
class
Arrow: int = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Blank
class
Blank: int = 10
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Busy
class
Busy: int = 16
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
ClosedHand
class
ClosedHand: int = 18
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Cross
class
Cross: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Forbidden
class
Forbidden: int = 14
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
IBeam
class
IBeam: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
None_
class
None_: int = -1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
OpenHand
class
OpenHand: int = 17
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PointingHand
class
PointingHand: int = 13
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SizeAll
class
SizeAll: int = 9
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SizeBDiag
class
SizeBDiag: int = 7
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SizeFDiag
class
SizeFDiag: int = 8
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SizeHor
class
SizeHor: int = 6
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SizeVer
class
SizeVer: int = 5
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SplitH
class
SplitH: int = 12
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
SplitV
class
SplitV: int = 11
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
UpArrow
class
UpArrow: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Wait
class
Wait: int = 3
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
WhatsThis
class
WhatsThis: int = 15
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = '@brief The namespace for the cursor constants\nThis class defines the constants for the cursor setting (for example for class \\Plugin, method set_cursor).\nThis class has been introduced in version 0.22.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 418
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Cursor' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> Cursor
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> Cursor
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> Cursor
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> Cursor
@brief Creates a new object of this class
Dispatcher
@brief Root of the configuration space in the plugin context and menu dispatcher
This class provides access to the root configuration space in the context of plugin programming. You can use this class to obtain configuration parameters from the configuration tree during plugin initialization. However, the preferred way of plugin configuration is through \Plugin#configure.
Currently, the application object provides an identical entry point for configuration modification. For example, "Application::instance.set_config" is identical to "Dispatcher::instance.set_config". Hence there is little motivation for the Dispatcher class currently and this interface may be modified or removed in the future. This class has been introduced in version 0.25 as 'PluginRoot'. It is renamed and enhanced as 'Dispatcher' in 0.27.
__doc__
class
__doc__ = '@brief Root of the configuration space in the plugin context and menu dispatcher\n\nThis class provides access to the root configuration space in the context of plugin programming. You can use this class to obtain configuration parameters from the configuration tree during plugin initialization. However, the preferred way of plugin configuration is through \\Plugin#configure.\n\nCurrently, the application object provides an identical entry point for configuration modification. For example, "Application::instance.set_config" is identical to "Dispatcher::instance.set_config". Hence there is little motivation for the Dispatcher class currently and this interface may be modified or removed in the future.\nThis class has been introduced in version 0.25 as \'PluginRoot\'.\nIt is renamed and enhanced as \'Dispatcher\' in 0.27.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 421
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Dispatcher' objects>
list of weak references to the object
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
clear_config
method descriptor
clear_config() -> None
@brief Clears the configuration parameters
commit_config
method descriptor
commit_config() -> None
@brief Commits the configuration settings
Some configuration options are queued for performance reasons and become active only after 'commit_config' has been called. After a sequence of \set_config calls, this method should be called to activate the settings made by these calls.
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
get_config
method descriptor
get_config() -> Any
@brief Gets the value of a local configuration parameter
@param name The name of the configuration parameter whose value shall be obtained (a string)
@return The value of the parameter or nil if there is no such parameter
get_config_names
method descriptor
get_config_names() -> List[str]
@brief Gets the configuration parameter names
@return A list of configuration parameter names
This method returns the names of all known configuration parameters. These names can be used to get and set configuration parameter values.
instance
builtin
instance() -> Dispatcher
@brief Gets the singleton instance of the Dispatcher object
@return The instance
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> Dispatcher
@brief Creates a new object of this class
read_config
method descriptor
read_config() -> bool
@brief Reads the configuration from a file @return A value indicating whether the operation was successful
This method silently does nothing, if the config file does not exist. If it does and an error occurred, the error message is printed on stderr. In both cases, false is returned.
set_config
method descriptor
set_config() -> None
@brief Set a local configuration parameter with the given name to the given value
@param name The name of the configuration parameter to set @param value The value to which to set the configuration parameter
This method sets a 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.
write_config
method descriptor
write_config() -> bool
@brief Writes configuration to a file @return A value indicating whether the operation was successful
If the configuration file cannot be written, false is returned but no exception is thrown.
EditorHooks
@brief An implementation base class for editor hooks
Editor hooks allow implementing technology-specific callbacks into the editor for example to implement visual feedback about DRC rules.
This class provides the basic interface. To implement callbacks, use the \EditorHooks class. You should not need to instantiate this class.
The following is an excample for editor hooks that add DRC space indicators for polygon-alike shapes, It implements the shape creation protocol to capture new shapes and the modification protocol to capture shape manipulations. It displays a halo following hard-coded DRC rules to indicate the forbidden zones around the shapes:
@code class MyEditorHooks < RBA::EditorHooks
def initialize()
register("editor_hooks_demo")
cleanup
# some demo values
@spaces = {
RBA::LayerInfo::new(1, 0) => [ 0.2, RBA::Region::Euclidian ],
RBA::LayerInfo::new(2, 0) => [ 0.5, RBA::Region::Projection ]
}
end
# Utilities
# pick the space value from layer or set to nil def set_space_from_layer(layer_index) lp = @layout.get_info(layer_index) if @spaces[lp] (s, m) = @spaces[lp] @space = s / @layout.dbu @metrics = m else @space = nil end end
def add_marker_from_shape(shape, trans)
if !@space
return # no space value set
end
p = shape.polygon
if !p
return # not a polygon-like object
end
r = RBA::Region::new
# maintain 2-point polygons for the first edge drawn
r.merged_semantics = (p.num_points != 2)
r.insert(p)
# compute DRC hull and prepare markers
r.drc_hull(@metrics, @space).each do |pp|
m = RBA::Marker::new(@view)
m.line_style = 2
m.vertex_size = 0
m.set_polygon(trans * pp)
@markers.append(m)
end
end
# setup session def start(cv) cleanup @view = cv.view @layout = cv.layout end
# end session def cleanup @space = nil @view = nil @layout = nil clear_markers end
def clear_markers @markers && @markers.each do |m| # this is how a marker gets removed in Ruby: m._destroy end @markers = [] end
# Shape creation protocol
def begin_create_shapes(cv, layer) start(cv) set_space_from_layer(layer.layer_index) end
def begin_new_shapes clear_markers end
def create_shape(shape, trans) add_marker_from_shape(shape, trans) end
def end_create_shapes cleanup end
# Modification protocol
def begin_edit(cv) start(cv) end
def begin_edits # create new markers clear_markers end
# transformation of a shape or instance def transformed(path, applied, trans) if path.shape set_space_from_layer(path.layer) add_marker_from_shape(path.shape, trans * applied) end end
# modification of a shape def modified(path, shape, trans) set_space_from_layer(path.layer) add_marker_from_shape(shape, trans) end
def end_edit cleanup end
end
instantiation of the hooks object
MyEditorHooks::new @/code
The EditorHooks class has been introduced in version 0.29.1.
__doc__
class
__doc__ = '@brief An implementation base class for editor hooks\n\nEditor hooks allow implementing technology-specific callbacks into the editor for example to implement visual feedback about DRC rules.\n\nThis class provides the basic interface. To implement callbacks, use the \\EditorHooks class. You should not need to instantiate this class.\n\nThe following is an excample for editor hooks that add DRC space indicators for polygon-alike shapes,\nIt implements the shape creation protocol to capture new shapes and the modification protocol to capture shape manipulations. It displays a halo following hard-coded DRC rules to indicate the forbidden zones around the shapes:\n\n@code\nclass MyEditorHooks < RBA::EditorHooks\n\n def initialize()\n \n register("editor_hooks_demo")\n\n cleanup \n\n # some demo values \n @spaces = {\n RBA::LayerInfo::new(1, 0) => [ 0.2, RBA::Region::Euclidian ],\n RBA::LayerInfo::new(2, 0) => [ 0.5, RBA::Region::Projection ]\n }\n \n end\n\n # Utilities\n \n # pick the space value from layer or set to nil\n def set_space_from_layer(layer_index)\n lp = @layout.get_info(layer_index)\n if @spaces[lp]\n (s, m) = @spaces[lp]\n @space = s / @layout.dbu\n @metrics = m\n else\n @space = nil\n end\n end\n \n def add_marker_from_shape(shape, trans)\n \n if !@space\n return # no space value set\n end\n \n p = shape.polygon\n if !p\n return # not a polygon-like object\n end\n \n r = RBA::Region::new\n # maintain 2-point polygons for the first edge drawn\n r.merged_semantics = (p.num_points != 2)\n r.insert(p)\n \n # compute DRC hull and prepare markers\n r.drc_hull(@metrics, @space).each do |pp|\n m = RBA::Marker::new(@view)\n m.line_style = 2\n m.vertex_size = 0\n m.set_polygon(trans * pp)\n @markers.append(m)\n end\n \n end\n \n # setup session\n def start(cv)\n cleanup\n @view = cv.view\n @layout = cv.layout\n end\n \n # end session\n def cleanup\n @space = nil\n @view = nil\n @layout = nil\n clear_markers\n end\n \n def clear_markers\n @markers && @markers.each do |m|\n # this is how a marker gets removed in Ruby:\n m._destroy\n end\n @markers = []\n end\n \n # Shape creation protocol\n \n def begin_create_shapes(cv, layer)\n start(cv)\n set_space_from_layer(layer.layer_index)\n end\n\n def begin_new_shapes\n clear_markers\n end\n\n def create_shape(shape, trans)\n add_marker_from_shape(shape, trans)\n end\n \n def end_create_shapes\n cleanup\n end\n \n # Modification protocol\n \n def begin_edit(cv)\n start(cv)\n end\n\n def begin_edits\n # create new markers\n clear_markers\n end\n\n # transformation of a shape or instance\n def transformed(path, applied, trans)\n if path.shape\n set_space_from_layer(path.layer)\n add_marker_from_shape(path.shape, trans * applied)\n end\n end\n\n # modification of a shape\n def modified(path, shape, trans)\n set_space_from_layer(path.layer)\n add_marker_from_shape(shape, trans)\n end\n\n def end_edit\n cleanup\n end\n \nend\n\n# instantiation of the hooks object\nMyEditorHooks::new\n@/code\n\nThe EditorHooks class has been introduced in version 0.29.1.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 436
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'EditorHooks' objects>
list of weak references to the object
technology
class
technology: None = <attribute 'technology' of 'EditorHooks' objects>
@brief sets the name of the technology the hooks are associated with This will clear all technology associations and associate the hooks with that technology only.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
add_technology
method descriptor
add_technology() -> None
@brief Additionally associates the hooks with the given technology. See also \clear_technologies.
clear_technologies
method descriptor
clear_technologies() -> None
@brief Clears the list of technologies the hooks are associated with. See also \add_technology.
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
for_technologies
method descriptor
for_technologies() -> bool
@brief Returns a value indicating whether the hooks are associated with any technology.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_for_technology
method descriptor
is_for_technology() -> bool
@brief Returns a value indicating whether the hooks are associated with the given technology. The method is equivalent to checking whether the \technologies list is empty.
name
method descriptor
name() -> str
@brief Gets the name of the hooks object. This is the name, the object was registered under in the system.
new
builtin
new() -> EditorHooks
@brief Creates a new object of this class
register
method descriptor
register() -> None
@brief Registers the hooks in the system. The hooks will not be active before they are registered in the system. Registration will also transfer object ownership to the system.
The name is arbitary, but should be unique. Upon registration, this hooks object will replace others with the same name already registered in the system. This will simplify debugging as you can re-run the same code, without accumulating hooks.
technologies
method descriptor
technologies() -> List[str]
@brief Gets the list of technologies these hooks are associated with.
Image
Bases: klayout.pyacore.BasicImage
@brief An image to be stored as a layout annotation
Images can be put onto the layout canvas as annotations, along with rulers and markers. Images can be monochrome (represent scalar data) as well as color (represent color images). The display of images can be adjusted in various ways, i.e. color mapping (translation of scalar values to colors), geometrical transformations (including rotation by arbitrary angles) and similar. Images are always based on floating point data. The actual data range is not fixed and can be adjusted to the data set (i.e. 0..255 or -1..1). This gives a great flexibility when displaying data which is the result of some measurement or calculation for example. The basic parameters of an image are the width and height of the data set, the width and height of one pixel, the geometrical transformation to be applied, the data range (min_value to max_value) and the data mapping which is described by an own class, \ImageDataMapping.
Starting with version 0.22, the basic transformation is a 3x3 matrix rather than the simple affine transformation. This matrix includes the pixel dimensions as well. One consequence of that is that the magnification part of the matrix and the pixel dimensions are no longer separated. That has certain consequences, i.e. setting an affine transformation with a magnification scales the pixel sizes as before but an affine transformation returned will no longer contain the pixel dimensions as magnification because it only supports isotropic scaling. For backward compatibility, the rotation center for the affine transformations while the default center and the center for matrix transformations is the image center.
As with version 0.25, images become 'live' objects. Changes to image properties will be reflected in the view automatically once the image object has been inserted into a view. Note that changes are not immediately reflected in the view, but are delayed until the view is refreshed. Hence, iterating the view's images will not render the same results than the image objects attached to the view. To ensure synchronization, call \Image#update.
__doc__
class
__doc__ = "@brief An image to be stored as a layout annotation\n\nImages can be put onto the layout canvas as annotations, along with rulers and markers.\nImages can be monochrome (represent scalar data) as well as color (represent color images).\nThe display of images can be adjusted in various ways, i.e. color mapping (translation of scalar values to\ncolors), geometrical transformations (including rotation by arbitrary angles) and similar.\nImages are always based on floating point data. The actual data range is not fixed and can be adjusted to the data set (i.e. 0..255 or -1..1). This gives a great flexibility when displaying data which is the result of some measurement or calculation for example.\nThe basic parameters of an image are the width and height of the data set, the width and height of one pixel, the geometrical transformation to be applied, the data range (min_value to max_value) and the data mapping which is described by an own class, \\ImageDataMapping.\n\nStarting with version 0.22, the basic transformation is a 3x3 matrix rather than the simple affine transformation. This matrix includes the pixel dimensions as well. One consequence of that is that the magnification part of the matrix and the pixel dimensions are no longer separated. That has certain consequences, i.e. setting an affine transformation with a magnification scales the pixel sizes as before but an affine transformation returned will no longer contain the pixel dimensions as magnification because it only supports isotropic scaling. For backward compatibility, the rotation center for the affine transformations while the default center and the center for matrix transformations is the image center.\n\nAs with version 0.25, images become 'live' objects. Changes to image properties will be reflected in the view automatically once the image object has been inserted into a view. Note that changes are not immediately reflected in the view, but are delayed until the view is refreshed. Hence, iterating the view's images will not render the same results than the image objects attached to the view. To ensure synchronization, call \\Image#update."
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 439
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
data_mapping
class
data_mapping: ImageDataMapping = <attribute 'data_mapping' of 'Image' objects>
@brief Gets the data mapping @return The data mapping object
The data mapping describes the transformation of a pixel value (any double value) into pixel data which can be sent to the graphics cards for display. See \ImageDataMapping for a more detailed description.
@brief Sets the data mapping object
The data mapping describes the transformation of a pixel value (any double value) into pixel data which can be sent to the graphics cards for display. See \ImageDataMapping for a more detailed description.
mask_data
class
mask_data: List[bool] = <attribute 'mask_data' of 'Image' objects>
@brief Gets the mask from a array of boolean values See \set_mask_data for a description of the data field.
This method has been introduced in version 0.27.
@brief Sets the mask from a array of boolean values The order of the boolean values is line first, from bottom to top and left to right and is the same as the order in the data array.
This method has been introduced in version 0.27.
matrix
class
matrix: Matrix3d = <attribute 'matrix' of 'Image' objects>
@brief Returns the pixel-to-micron transformation matrix
This transformation matrix converts pixel coordinates (0,0 being the center and each pixel having the dimension of pixel_width and pixel_height) to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel.
The matrix is more general than the transformation used before and supports shear and perspective transformation. This property replaces the \trans property which is still functional, but deprecated.
This method has been introduced in version 0.22.
@brief Sets the transformation matrix
This transformation matrix converts pixel coordinates (0,0 being the center and each pixel having the dimension of pixel_width and pixel_height) to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel.
The matrix is more general than the transformation used before and supports shear and perspective transformation. This property replaces the \trans property which is still functional, but deprecated.
This method has been introduced in version 0.22.
max_value
class
max_value: float = <attribute 'max_value' of 'Image' objects>
@brief Sets the maximum value
See the \max_value method for the description of the maximum value property.
@brief Gets the upper limit of the values in the data set
This value determines the upper end of the data mapping (i.e. white value etc.). It does not necessarily correspond to the maximum value of the data set but it must be larger than that.
min_value
class
min_value: float = <attribute 'min_value' of 'Image' objects>
@brief Gets the upper limit of the values in the data set
This value determines the upper end of the data mapping (i.e. white value etc.). It does not necessarily correspond to the minimum value of the data set but it must be larger than that.
@brief Sets the minimum value
See \min_value for the description of the minimum value property.
pixel_height
class
pixel_height: float = <attribute 'pixel_height' of 'Image' objects>
@brief Gets the pixel height
See \pixel_height= for a description of that property.
Starting with version 0.22, this property is incorporated into the transformation matrix. This property is provided for convenience only.
@brief Sets the pixel height
The pixel height determines the height of on pixel in the original space which is transformed to micron space with the transformation.
Starting with version 0.22, this property is incorporated into the transformation matrix. This property is provided for convenience only.
pixel_width
class
pixel_width: float = <attribute 'pixel_width' of 'Image' objects>
@brief Gets the pixel width
See \pixel_width= for a description of that property.
Starting with version 0.22, this property is incorporated into the transformation matrix. This property is provided for convenience only.
@brief Sets the pixel width
The pixel width determines the width of on pixel in the original space which is transformed to micron space with the transformation.
Starting with version 0.22, this property is incorporated into the transformation matrix. This property is provided for convenience only.
trans
class
trans: DCplxTrans = <attribute 'trans' of 'Image' objects>
@brief Returns the pixel-to-micron transformation
This transformation converts pixel coordinates (0,0 being the lower left corner and each pixel having the dimension of pixel_width and pixel_height) to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel.
The general property is \matrix which also allows perspective and shear transformation. This property will only work, if the transformation does not include perspective or shear components. Therefore this property is deprecated. Please note that for backward compatibility, the rotation center is pixel 0,0 (lowest left one), while it is the image center for the matrix transformation.
@brief Sets the transformation
This transformation converts pixel coordinates (0,0 being the lower left corner and each pixel having the dimension of pixel_width and pixel_height) to micron coordinates. The coordinate of the pixel is the lower left corner of the pixel.
The general property is \matrix which also allows perspective and shear transformation. Please note that for backward compatibility, the rotation center is pixel 0,0 (lowest left one), while it is the image center for the matrix transformation.
visible
class
visible: bool = <attribute 'visible' of 'Image' objects>
@brief Gets a flag indicating whether the image object is visible
An image object can be made invisible by setting the visible property to false.
This method has been introduced in version 0.20.
@brief Sets the visibility
See the \is_visible? method for a description of this property.
This method has been introduced in version 0.20.
z_position
class
z_position: int = <attribute 'z_position' of 'Image' objects>
@brief Gets the z position of the image Images with a higher z position are painted in front of images with lower z position. The z value is an integer that controls the position relative to other images.
This method was introduced in version 0.25.
@brief Sets the z position of the image
See \z_position for details about the z position attribute.
This method was introduced in version 0.25.
__init__
method descriptor
__init__() -> None
__init__(filename: str, trans: Optional[db.DCplxTrans] = ...) -> None
__init__(pixels: PixelBuffer, trans: Optional[db.DCplxTrans] = ...) -> None
__init__(w: int, h: int, data: Sequence[float]) -> None
__init__(w: int, h: int, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> None
__init__(w: int, h: int, trans: db.DCplxTrans, data: Sequence[float]) -> None
__init__(w: int, h: int, trans: db.DCplxTrans, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> None
__init__()
@brief Constructor for a color image with the given pixel values
This constructor creates an image from the given pixel values. The values have to be organized line by line and separated by color channel. Each line must consist of "w" values where the first value is the leftmost pixel. Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to the common convention for image data. Initially the pixel width and height will be 1 micron and the data range will be 0 to 1.0 (black to white level). To adjust the data range use the \min_value and \max_value properties.
@param w The width of the image @param h The height of the image @param trans The transformation from pixel space to micron space @param red The red channel data set which will become owned by the image @param green The green channel data set which will become owned by the image @param blue The blue channel data set which will become owned by the image
__repr__
method descriptor
__repr__() -> str
@brief Converts the image to a string The string returned can be used to create an image object using \from_s. @return The string
__str__
method descriptor
__str__() -> str
@brief Converts the image to a string The string returned can be used to create an image object using \from_s. @return The string
box
method descriptor
box() -> db.DBox
@brief Gets the bounding box of the image @return The bounding box
clear
method descriptor
clear() -> None
@brief Clears the image data (sets to 0 or black). This method has been introduced in version 0.27.
data
method descriptor
data() -> List[float]
@brief Gets the data array for a specific color channel Returns an array of pixel values for the given channel. For a color image, channel 0 is green, channel 1 is red and channel 2 is blue. For a monochrome image, the channel is ignored.
For the format of the data see the constructor description.
This method has been introduced in version 0.27.
delete
method descriptor
delete() -> None
@brief Deletes this image from the view If the image is an "active" one, this method will remove it from the view. This object will become detached and can still be manipulated, but without having an effect on the view. This method has been introduced in version 0.25.
detach
method descriptor
detach() -> None
@brief Detaches the image object from the view If the image object was inserted into the view, property changes will be reflected in the view. To disable this feature, 'detach'' can be called after which the image object becomes inactive and changes will no longer be reflected in the view.
This method has been introduced in version 0.25.
filename
method descriptor
filename() -> str
@brief Gets the name of the file loaded of an empty string if not file is loaded @return The file name (path)
from_s
builtin
from_s() -> Image
@brief Creates an image from the string returned by \to_s. This method has been introduced in version 0.27.
get_pixel
method descriptor
get_pixel(x: int, y: int) -> float
get_pixel(x: int, y: int, component: int) -> float
get_pixel()
@brief Gets one pixel (monochrome and color)
@param x The x coordinate of the pixel (0..width()-1) @param y The y coordinate of the pixel (mathematical order: 0 is the lowest, 0..height()-1) @param component 0 for red, 1 for green, 2 for blue.
If the component index, x or y value exceeds the image bounds, this method returns 0.0. For monochrome images, the component index is ignored.
height
method descriptor
height() -> int
@brief Gets the height of the image in pixels @return The height in pixels
id
method descriptor
id() -> int
@brief Gets the Id
The Id is an arbitrary integer that can be used to track the evolution of an image object. The Id is not changed when the object is edited. On initialization, a unique Id is given to the object. The Id cannot be changed. This behaviour has been modified in version 0.20.
is_color
method descriptor
is_color() -> bool
@brief Returns true, if the image is a color image @return True, if the image is a color image
is_empty
method descriptor
is_empty() -> bool
@brief Returns true, if the image does not contain any data (i.e. is default constructed) @return True, if the image is empty
is_valid
method descriptor
is_valid() -> bool
@brief Returns a value indicating whether the object is a valid reference. If this value is true, the object represents an image on the screen. Otherwise, the object is a 'detached' image which does not have a representation on the screen.
This method was introduced in version 0.25.
is_visible
method descriptor
is_visible() -> bool
@brief Gets a flag indicating whether the image object is visible
An image object can be made invisible by setting the visible property to false.
This method has been introduced in version 0.20.
mask
method descriptor
mask() -> bool
@brief Gets the mask for one pixel
@param x The x coordinate of the pixel (0..width()-1) @param y The y coordinate of the pixel (mathematical order: 0 is the lowest, 0..height()-1) @return false if the pixel is not drawn.
See \set_mask for details about the mask.
This method has been introduced in version 0.23.
new
builtin
new() -> Image
new(filename: str, trans: Optional[db.DCplxTrans] = ...) -> Image
new(pixels: PixelBuffer, trans: Optional[db.DCplxTrans] = ...) -> Image
new(w: int, h: int, data: Sequence[float]) -> Image
new(w: int, h: int, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> Image
new(w: int, h: int, trans: db.DCplxTrans, data: Sequence[float]) -> Image
new(w: int, h: int, trans: db.DCplxTrans, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> Image
new()
@brief Constructor for a color image with the given pixel values
This constructor creates an image from the given pixel values. The values have to be organized line by line and separated by color channel. Each line must consist of "w" values where the first value is the leftmost pixel. Note, that the rows are oriented in the mathematical sense (first one is the lowest) contrary to the common convention for image data. Initially the pixel width and height will be 1 micron and the data range will be 0 to 1.0 (black to white level). To adjust the data range use the \min_value and \max_value properties.
@param w The width of the image @param h The height of the image @param trans The transformation from pixel space to micron space @param red The red channel data set which will become owned by the image @param green The green channel data set which will become owned by the image @param blue The blue channel data set which will become owned by the image
read
builtin
read() -> Image
@brief Loads the image from the given path.
This method expects the image file as a KLayout image format file (.lyimg). This is a XML-based format containing the image data plus placement and transformation information for the image placement. In addition, image manipulation parameters for false color display and color channel enhancement are embedded.
This method has been introduced in version 0.27.
set_data
method descriptor
set_data(w: int, h: int, d: Sequence[float]) -> None
set_data(w: int, h: int, r: Sequence[float], g: Sequence[float], b: Sequence[float]) -> None
set_data()
@brief Writes the image data field (color) @param w The width of the new data @param h The height of the new data @param r The red channel data to load into the image @param g The green channel data to load into the image @param b The blue channel data to load into the image
See the constructor description for the data organisation in that field.
set_mask
method descriptor
set_mask() -> None
@brief Sets the mask for a pixel
@param x The x coordinate of the pixel (0..width()-1) @param y The y coordinate of the pixel (mathematical order: 0 is the lowest, 0..height()-1) @param m The mask
If the mask of a pixel is set to false, the pixel is not drawn. The default is true for all pixels.
This method has been introduced in version 0.23.
set_pixel
method descriptor
set_pixel(x: int, y: int, r: float, g: float, b: float) -> None
set_pixel(x: int, y: int, v: float) -> None
set_pixel()
@brief Sets one pixel (color)
@param x The x coordinate of the pixel (0..width()-1) @param y The y coordinate of the pixel (mathematical order: 0 is the lowest, 0..height()-1) @param red The red component @param green The green component @param blue The blue component
If the component index, x or y value exceeds the image bounds of the image is not a color image, this method does nothing.
to_s
method descriptor
to_s() -> str
@brief Converts the image to a string The string returned can be used to create an image object using \from_s. @return The string
transformed
method descriptor
transformed(t: db.DCplxTrans) -> Image
transformed(t: db.DTrans) -> Image
transformed(t: db.Matrix3d) -> Image
transformed()
@brief Transforms the image with the given complex transformation @param t The magnifying transformation to apply @return The transformed object
transformed_cplx
method descriptor
transformed_cplx() -> Image
@brief Transforms the image with the given complex transformation @param t The magnifying transformation to apply @return The transformed object
transformed_matrix
method descriptor
transformed_matrix() -> Image
@brief Transforms the image with the given matrix transformation @param t The transformation to apply (a matrix) @return The transformed object This method has been introduced in version 0.22.
update
method descriptor
update() -> None
@brief Forces an update of the view Usually it is not required to call this method. The image object is automatically synchronized with the view's image objects. For performance reasons this update is delayed to collect multiple update requests. Calling 'update' will ensure immediate updates.
This method has been introduced in version 0.25.
width
method descriptor
width() -> int
@brief Gets the width of the image in pixels @return The width in pixels
write
method descriptor
write() -> None
@brief Saves the image to KLayout's image format (.lyimg) This method has been introduced in version 0.27.
ImageDataMapping
@brief A structure describing the data mapping of an image object
Data mapping is the process of transforming the data into RGB pixel values. This implementation provides four adjustment steps: first, in the case of monochrome data, the data is converted to a RGB triplet using the color map. The default color map will copy the value to all channels rendering a gray scale. After having normalized the data to 0..1 cooresponding to the min_value and max_value settings of the image, a color channel-independent brightness and contrast adjustment is applied. Then, a per-channel multiplier (red_gain, green_gain, blue_gain) is applied. Finally, the gamma function is applied and the result converted into a 0..255 pixel value range and clipped.
__doc__
class
__doc__ = '@brief A structure describing the data mapping of an image object\n\nData mapping is the process of transforming the data into RGB pixel values.\nThis implementation provides four adjustment steps: first, in the case of monochrome\ndata, the data is converted to a RGB triplet using the color map. The default color map\nwill copy the value to all channels rendering a gray scale. After having normalized the data \nto 0..1 cooresponding to the min_value and max_value settings of the image, a color channel-independent\nbrightness and contrast adjustment is applied. Then, a per-channel multiplier (red_gain, green_gain,\nblue_gain) is applied. Finally, the gamma function is applied and the result converted into a 0..255 \npixel value range and clipped.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 437
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ImageDataMapping' objects>
list of weak references to the object
blue_gain
class
blue_gain: float = <attribute 'blue_gain' of 'ImageDataMapping' objects>
@brief The blue channel gain
This value is the multiplier by which the blue channel is scaled after applying false color transformation and contrast/brightness/gamma.
1.0 is a neutral value. The gain should be >=0.0.
@brief Set the blue_gain See \blue_gain for a description of this property.
brightness
class
brightness: float = <attribute 'brightness' of 'ImageDataMapping' objects>
@brief The brightness value
The brightness is a double value between roughly -1.0 and 1.0. Neutral (original) brightness is 0.0.
@brief Set the brightness See \brightness for a description of this property.
contrast
class
contrast: float = <attribute 'contrast' of 'ImageDataMapping' objects>
@brief The contrast value
The contrast is a double value between roughly -1.0 and 1.0. Neutral (original) contrast is 0.0.
@brief Set the contrast See \contrast for a description of this property.
gamma
class
gamma: float = <attribute 'gamma' of 'ImageDataMapping' objects>
@brief The gamma value
The gamma value allows one to adjust for non-linearities in the display chain and to enhance contrast. A value for linear intensity reproduction on the screen is roughly 0.5. The exact value depends on the monitor calibration. Values below 1.0 give a "softer" appearance while values above 1.0 give a "harder" appearance.
@brief Set the gamma See \gamma for a description of this property.
green_gain
class
green_gain: float = <attribute 'green_gain' of 'ImageDataMapping' objects>
@brief The green channel gain
This value is the multiplier by which the green channel is scaled after applying false color transformation and contrast/brightness/gamma.
1.0 is a neutral value. The gain should be >=0.0.
@brief Set the green_gain See \green_gain for a description of this property.
red_gain
class
red_gain: float = <attribute 'red_gain' of 'ImageDataMapping' objects>
@brief The red channel gain
This value is the multiplier by which the red channel is scaled after applying false color transformation and contrast/brightness/gamma.
1.0 is a neutral value. The gain should be >=0.0.
@brief Set the red_gain See \red_gain for a description of this property.
__copy__
method descriptor
__copy__() -> ImageDataMapping
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> ImageDataMapping
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Create a new data mapping object with default settings
add_colormap_entry
method descriptor
add_colormap_entry(value: float, color: int) -> None
add_colormap_entry(value: float, lcolor: int, rcolor: int) -> None
add_colormap_entry()
@brief Add a colormap entry for this data mapping object. @param value The value at which the given color should be applied. @param lcolor The color to apply left of the value (a 32 bit RGB value). @param rcolor The color to apply right of the value (a 32 bit RGB value).
This settings establishes a color mapping for a given value in the monochrome channel. The colors must be given as a 32 bit integer, where the lowest order byte describes the blue component (0 to 255), the second byte the green component and the third byte the red component, i.e. 0xff0000 is red and 0x0000ff is blue.
In contrast to the version with one color, this version allows specifying a color left and right of the value - i.e. a discontinuous step.
This variant has been introduced in version 0.27.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
clear_colormap
method descriptor
clear_colormap() -> None
@brief The the color map of this data mapping object.
colormap_color
method descriptor
colormap_color() -> int
@brief Returns the color for a given color map entry. @param n The index of the entry (0..\num_colormap_entries-1) @return The color (see \add_colormap_entry for a description).
NOTE: this version is deprecated and provided for backward compatibility. For discontinuous nodes this method delivers the left-sided color.
colormap_lcolor
method descriptor
colormap_lcolor() -> int
@brief Returns the left-side color for a given color map entry. @param n The index of the entry (0..\num_colormap_entries-1) @return The color (see \add_colormap_entry for a description).
This method has been introduced in version 0.27.
colormap_rcolor
method descriptor
colormap_rcolor() -> int
@brief Returns the right-side color for a given color map entry. @param n The index of the entry (0..\num_colormap_entries-1) @return The color (see \add_colormap_entry for a description).
This method has been introduced in version 0.27.
colormap_value
method descriptor
colormap_value() -> float
@brief Returns the value for a given color map entry. @param n The index of the entry (0..\num_colormap_entries-1) @return The value (see \add_colormap_entry for a description).
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> ImageDataMapping
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> ImageDataMapping
@brief Create a new data mapping object with default settings
num_colormap_entries
method descriptor
num_colormap_entries() -> int
@brief Returns the current number of color map entries. @return The number of entries.
KeyCode
@brief The namespace for the some key codes. This namespace defines some key codes understood by built-in \LayoutView components. When compiling with Qt, these codes are compatible with Qt's key codes. The key codes are intended to be used when directly interfacing with \LayoutView in non-Qt-based environments.
This class has been introduced in version 0.28.
Backspace
class
Backspace: int = 16777219
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Backtab
class
Backtab: int = 16777218
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Delete
class
Delete: int = 16777223
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Down
class
Down: int = 16777237
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
End
class
End: int = 16777233
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Enter
class
Enter: int = 16777221
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Escape
class
Escape: int = 16777216
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Home
class
Home: int = 16777232
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Insert
class
Insert: int = 16777222
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Left
class
Left: int = 16777234
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PageDown
class
PageDown: int = 16777239
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
PageUp
class
PageUp: int = 16777238
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Return
class
Return: int = 16777220
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Right
class
Right: int = 16777236
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Tab
class
Tab: int = 16777217
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Up
class
Up: int = 16777235
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__doc__
class
__doc__ = "@brief The namespace for the some key codes.\nThis namespace defines some key codes understood by built-in \\LayoutView components. When compiling with Qt, these codes are compatible with Qt's key codes.\nThe key codes are intended to be used when directly interfacing with \\LayoutView in non-Qt-based environments.\n\nThis class has been introduced in version 0.28.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 420
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'KeyCode' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> KeyCode
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> KeyCode
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> KeyCode
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> KeyCode
@brief Creates a new object of this class
LayerProperties
@brief The layer properties structure
The layer properties encapsulate the settings relevant for the display and source of a layer.
Each attribute is present in two incarnations: local and real. "real" refers to the effective attribute after collecting the attributes from the parents to the leaf property node. In the spirit of this distinction, all read accessors are present in "local" and "real" form. The read accessors take a boolean parameter "real" that must be set to true, if the real value shall be returned.
"brightness" is a index that indicates how much to make the color brighter to darker rendering the effective color (\eff_frame_color, \eff_fill_color). It's value is roughly between -255 and 255.
__doc__
class
__doc__ = '@brief The layer properties structure\n\nThe layer properties encapsulate the settings relevant for\nthe display and source of a layer.\n\nEach attribute is present in two incarnations: local and real.\n"real" refers to the effective attribute after collecting the \nattributes from the parents to the leaf property node.\nIn the spirit of this distinction, all read accessors\nare present in "local" and "real" form. The read accessors take\na boolean parameter "real" that must be set to true, if the real\nvalue shall be returned.\n\n"brightness" is a index that indicates how much to make the\ncolor brighter to darker rendering the effective color \n(\\eff_frame_color, \\eff_fill_color). It\'s value is roughly between\n-255 and 255.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 405
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayerProperties' objects>
list of weak references to the object
animation
class
animation: int = <attribute 'animation' of 'LayerProperties' objects>
@brief Gets the animation state
This method is a convenience method for "animation(true)"
This method has been introduced in version 0.22.
@brief Sets the animation state
See the description of the \animation method for details about the animation state
dither_pattern
class
dither_pattern: int = <attribute 'dither_pattern' of 'LayerProperties' objects>
@brief Gets the dither pattern index
This method is a convenience method for "dither_pattern(true)"
This method has been introduced in version 0.22.
@brief Sets the dither pattern index
The dither pattern index must be one of the valid indices. The first indices are reserved for built-in pattern, the following ones are custom pattern. Index 0 is always solid filled and 1 is always the hollow filled pattern. For custom pattern see \LayoutView#add_stipple.
fill_brightness
class
fill_brightness: int = <attribute 'fill_brightness' of 'LayerProperties' objects>
@brief Gets the fill brightness value
This method is a convenience method for "fill_brightness(true)"
This method has been introduced in version 0.22.
@brief Sets the fill brightness
For neutral brightness set this value to 0. For darker colors set it to a negative value (down to -255), for brighter colors to a positive value (up to 255)
fill_color
class
fill_color: int = <attribute 'fill_color' of 'LayerProperties' objects>
@brief Gets the fill color
This method is a convenience method for "fill_color(true)"
This method has been introduced in version 0.22.
@brief Sets the fill color to the given value
The color is a 32bit value encoding the blue value in the lower 8 bits, the green value in the next 8 bits and the red value in the 8 bits above that.
frame_brightness
class
frame_brightness: int = <attribute 'frame_brightness' of 'LayerProperties' objects>
@brief Gets the frame brightness value
This method is a convenience method for "frame_brightness(true)"
This method has been introduced in version 0.22.
@brief Sets the frame brightness
For neutral brightness set this value to 0. For darker colors set it to a negative value (down to -255), for brighter colors to a positive value (up to 255)
frame_color
class
frame_color: int = <attribute 'frame_color' of 'LayerProperties' objects>
@brief Gets the frame color
This method is a convenience method for "frame_color(true)"
This method has been introduced in version 0.22.
@brief Sets the frame color to the given value
The color is a 32bit value encoding the blue value in the lower 8 bits, the green value in the next 8 bits and the red value in the 8 bits above that.
line_style
class
line_style: int = <attribute 'line_style' of 'LayerProperties' objects>
@brief Gets the line style index
This method is a convenience method for "line_style(true)"
This method has been introduced in version 0.25.
@brief Sets the line style index
The line style index must be one of the valid indices. The first indices are reserved for built-in pattern, the following ones are custom pattern. Index 0 is always solid filled. For custom line styles see \LayoutView#add_line_style.
This method has been introduced in version 0.25.
lower_hier_level
class
lower_hier_level: int = <attribute 'lower_hier_level' of 'LayerProperties' objects>
@brief Gets the lower hierarchy level shown
This method is a convenience method for "lower_hier_level(true)"
This method has been introduced in version 0.22.
@brief Sets the lower hierarchy level
If this method is called, the lower hierarchy level is enabled. See \lower_hier_level for a description of this property.
marked
class
marked: bool = <attribute 'marked' of 'LayerProperties' objects>
@brief Gets the marked state
This method is a convenience method for "marked?(true)"
This method has been introduced in version 0.22.
@brief Sets the marked state
name
class
name: str = <attribute 'name' of 'LayerProperties' objects>
@brief Gets the name
@brief Sets the name to the given string
source
class
source: str = <attribute 'source' of 'LayerProperties' objects>
@brief Gets the source specification
This method is a convenience method for "source(true)"
This method has been introduced in version 0.22.
@brief Loads the source specification from a string
Sets the source specification to the given string. The source specification may contain the cellview index, the source layer (given by layer/datatype or layer name), transformation, property selector etc. This method throws an exception if the specification is not valid.
source_cellview
class
source_cellview: int = <attribute 'source_cellview' of 'LayerProperties' objects>
@brief Gets the cellview index that this layer refers to
This method is a convenience method for "source_cellview(true)"
This method has been introduced in version 0.22.
@brief Sets the cellview index that this layer refers to
See \cellview for a description of the transformations.
source_datatype
class
source_datatype: int = <attribute 'source_datatype' of 'LayerProperties' objects>
@brief Gets the stream datatype that the shapes are taken from
This method is a convenience method for "source_datatype(true)"
This method has been introduced in version 0.22.
@brief Sets the stream datatype that the shapes are taken from
See \datatype for a description of this property
source_layer
class
source_layer: int = <attribute 'source_layer' of 'LayerProperties' objects>
@brief Gets the stream layer that the shapes are taken from
This method is a convenience method for "source_layer(true)"
This method has been introduced in version 0.22.
@brief Sets the stream layer that the shapes are taken from
See \source_layer for a description of this property
source_layer_index
class
source_layer_index: int = <attribute 'source_layer_index' of 'LayerProperties' objects>
@brief Gets the stream layer that the shapes are taken from
This method is a convenience method for "source_layer_index(true)"
This method has been introduced in version 0.22.
@brief Sets the layer index specification that the shapes are taken from
See \source_layer_index for a description of this property.
source_name
class
source_name: str = <attribute 'source_name' of 'LayerProperties' objects>
@brief Gets the stream name that the shapes are taken from
This method is a convenience method for "source_name(true)"
This method has been introduced in version 0.22.
@brief Sets the stream layer name that the shapes are taken from
See \name for a description of this property
trans
class
trans: List[DCplxTrans] = <attribute 'trans' of 'LayerProperties' objects>
@brief Gets the transformations that the layer is transformed with
This method is a convenience method for "trans(true)"
This method has been introduced in version 0.22.
@brief Sets the transformations that the layer is transformed with
See \trans for a description of the transformations.
transparent
class
transparent: bool = <attribute 'transparent' of 'LayerProperties' objects>
@brief Gets the transparency state
This method is a convenience method for "transparent?(true)"
This method has been introduced in version 0.22.
@brief Sets the transparency state
upper_hier_level
class
upper_hier_level: int = <attribute 'upper_hier_level' of 'LayerProperties' objects>
@brief Gets the upper hierarchy level shown
This method is a convenience method for "upper_hier_level(true)"
This method has been introduced in version 0.22.
@brief Sets a upper hierarchy level
If this method is called, the upper hierarchy level is enabled. See \upper_hier_level for a description of this property.
valid
class
valid: bool = <attribute 'valid' of 'LayerProperties' objects>
@brief Gets the validity state
This method is a convenience method for "valid?(true)"
This method has been introduced in version 0.23.
@brief Sets the validity state
visible
class
visible: bool = <attribute 'visible' of 'LayerProperties' objects>
@brief Gets the visibility state
This method is a convenience method for "visible?(true)"
This method has been introduced in version 0.22.
@brief Sets the visibility state
width
class
width: int = <attribute 'width' of 'LayerProperties' objects>
@brief Gets the line width
This method is a convenience method for "width(true)"
This method has been introduced in version 0.22.
@brief Sets the line width to the given width
xfill
class
xfill: bool = <attribute 'xfill' of 'LayerProperties' objects>
@brief Gets a value indicating whether shapes are drawn with a cross
This method is a convenience method for "xfill?(true)"
This attribute has been introduced in version 0.25.
@brief Sets a value indicating whether shapes are drawn with a cross
This attribute has been introduced in version 0.25.
__copy__
method descriptor
__copy__() -> LayerProperties
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> LayerProperties
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality
@param other The other object to compare against
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
__ne__
method descriptor
__ne__() -> bool
@brief Inequality
@param other The other object to compare against
animation_
method descriptor
animation_()
@brief Gets the animation state
The animation state is an integer either being 0 (static), 1 (scrolling), 2 (blinking) or 3 (inversely blinking)
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cellview
method descriptor
cellview() -> int
@brief Gets the the cellview index
This is the index of the actual cellview to use. Basically, this method returns \source_cellview in "real" mode. The result may be different, if the cellview is not valid for example. In this case, a negative value is returned.
clear_dither_pattern
method descriptor
clear_dither_pattern() -> None
@brief Clears the dither pattern
clear_fill_color
method descriptor
clear_fill_color() -> None
@brief Resets the fill color
clear_frame_color
method descriptor
clear_frame_color() -> None
@brief Resets the frame color
clear_line_style
method descriptor
clear_line_style() -> None
@brief Clears the line style
This method has been introduced in version 0.25.
clear_lower_hier_level
method descriptor
clear_lower_hier_level() -> None
@brief Clears the lower hierarchy level specification
See \has_lower_hier_level for a description of this property
clear_source_name
method descriptor
clear_source_name() -> None
@brief Removes any stream layer name specification from this layer
clear_upper_hier_level
method descriptor
clear_upper_hier_level() -> None
@brief Clears the upper hierarchy level specification
See \has_upper_hier_level for a description of this property
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dither_pattern_
method descriptor
dither_pattern_()
@brief Gets the dither pattern index
This method may deliver an invalid dither pattern index if it is not set.
@param real Set to true to return the real instead of local value
dup
method descriptor
dup() -> LayerProperties
@brief Creates a copy of self
eff_dither_pattern
method descriptor
eff_dither_pattern() -> int
eff_dither_pattern(real: bool) -> int
eff_dither_pattern()
@brief Gets the effective dither pattern index
This method is a convenience method for "eff_dither_pattern(true)"
This method has been introduced in version 0.22.
eff_fill_color
method descriptor
eff_fill_color() -> int
eff_fill_color(real: bool) -> int
eff_fill_color()
@brief Gets the effective fill color
This method is a convenience method for "eff_fill_color(true)"
This method has been introduced in version 0.22.
eff_frame_color
method descriptor
eff_frame_color() -> int
eff_frame_color(real: bool) -> int
eff_frame_color()
@brief Gets the effective frame color
This method is a convenience method for "eff_frame_color(true)"
This method has been introduced in version 0.22.
eff_line_style
method descriptor
eff_line_style() -> int
eff_line_style(real: bool) -> int
eff_line_style()
@brief Gets the line style index
This method is a convenience method for "eff_line_style(true)"
This method has been introduced in version 0.25.
fill_brightness_
method descriptor
fill_brightness_()
@brief Gets the fill brightness value
If the brightness is not set, this method may return an invalid value
@param real Set to true to return the real instead of local value
fill_color_
method descriptor
fill_color_()
@brief Gets the fill color
This method may return an invalid color if the color is not set.
@param real Set to true to return the real instead of local value
flat
method descriptor
flat() -> LayerProperties
@brief Returns the "flattened" (effective) layer properties entry for this node
This method returns a \LayerProperties object that is not embedded into a hierarchy. This object represents the effective layer properties for the given node. In particular, all 'local' properties are identical to the 'real' properties. Such an object can be used as a basis for manipulations. This method has been introduced in version 0.22.
frame_brightness_
method descriptor
frame_brightness_()
@brief Gets the frame brightness value
If the brightness is not set, this method may return an invalid value
@param real Set to true to return the real instead of local value
frame_color_
method descriptor
frame_color_()
@brief Gets the frame color
This method may return an invalid color if the color is not set.
@param real Set to true to return the real instead of local value
has_dither_pattern
method descriptor
has_dither_pattern() -> bool
has_dither_pattern(real: bool) -> bool
has_dither_pattern()
@brief True, if the dither pattern is set
This method is a convenience method for "has_dither_pattern?(true)"
This method has been introduced in version 0.22.
has_fill_color
method descriptor
has_fill_color() -> bool
has_fill_color(real: bool) -> bool
has_fill_color()
@brief True, if the fill color is set
This method is a convenience method for "has_fill_color?(true)"
This method has been introduced in version 0.22.
has_frame_color
method descriptor
has_frame_color() -> bool
has_frame_color(real: bool) -> bool
has_frame_color()
@brief True, if the frame color is set
This method is a convenience method for "has_frame_color?(true)"
This method has been introduced in version 0.22.
has_line_style
method descriptor
has_line_style() -> bool
has_line_style(real: bool) -> bool
has_line_style()
@brief True, if the line style is set
This method is a convenience method for "has_line_style?(true)"
This method has been introduced in version 0.25.
has_lower_hier_level
method descriptor
has_lower_hier_level() -> bool
has_lower_hier_level(real: bool) -> bool
has_lower_hier_level()
@brief Gets a value indicating whether a lower hierarchy level is explicitly specified
This method is a convenience method for "has_lower_hier_level?(true)"
This method has been introduced in version 0.22.
has_source_name
method descriptor
has_source_name() -> bool
has_source_name(real: bool) -> bool
has_source_name()
@brief Gets a value indicating whether a stream layer name is specified for this layer
This method is a convenience method for "has_source_name?(true)"
This method has been introduced in version 0.22.
has_upper_hier_level
method descriptor
has_upper_hier_level() -> bool
has_upper_hier_level(real: bool) -> bool
has_upper_hier_level()
@brief Gets a value indicating whether an upper hierarchy level is explicitly specified
This method is a convenience method for "has_upper_hier_level?(true)"
This method has been introduced in version 0.22.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
layer_index
method descriptor
layer_index() -> int
@brief Gets the the layer index
This is the index of the actual layer used. The source specification given by \source_layer, \source_datatype, \source_name is evaluated and the corresponding layer is looked up in the layout object. If a \source_layer_index is specified, this layer index is taken as the layer index to use.
line_style_
method descriptor
line_style_()
@brief Gets the line style index
This method may deliver an invalid line style index if it is not set (see \has_line_style?).
@param real Set to true to return the real instead of local value This method has been introduced in version 0.25.
lower_hier_level_
method descriptor
lower_hier_level_()
@brief Gets the lower hierarchy level shown
This is the hierarchy level at which the drawing starts. This property is only meaningful, if \has_lower_hier_level is true. The hierarchy level can be relative in which case, 0 refers to the context cell's level. A mode can be specified for the hierarchy level which is 0 for absolute, 1 for minimum of specified level and set level and 2 for maximum of specified level and set level.
lower_hier_level_mode
method descriptor
lower_hier_level_mode() -> int
lower_hier_level_mode(real: bool) -> int
lower_hier_level_mode()
@brief Gets the mode for the lower hierarchy level.
This method is a convenience method for "lower_hier_level_mode(true)"
This method has been introduced in version 0.22.
lower_hier_level_relative
method descriptor
lower_hier_level_relative() -> bool
lower_hier_level_relative(real: bool) -> bool
lower_hier_level_relative()
@brief Gets a value indicating whether the upper hierarchy level is relative.
This method is a convenience method for "lower_hier_level_relative(true)"
This method has been introduced in version 0.22.
marked_
method descriptor
marked_()
@brief Gets the marked state
new
builtin
new() -> LayerProperties
@brief Creates a new object of this class
set_lower_hier_level
method descriptor
set_lower_hier_level(level: int, relative: bool) -> None
set_lower_hier_level(level: int, relative: bool, mode: int) -> None
set_lower_hier_level()
@brief Sets the lower hierarchy level, whether it is relative to the context cell and the mode
If this method is called, the lower hierarchy level is enabled. See \lower_hier_level for a description of this property.
This method has been introduced in version 0.20.
set_upper_hier_level
method descriptor
set_upper_hier_level(level: int, relative: bool) -> None
set_upper_hier_level(level: int, relative: bool, mode: int) -> None
set_upper_hier_level()
@brief Sets the upper hierarchy level, if it is relative to the context cell and the mode
If this method is called, the upper hierarchy level is enabled. See \upper_hier_level for a description of this property.
This method has been introduced in version 0.20.
source_
method descriptor
source_()
@brief Gets the source specification
This method delivers the source specification as a string
@param real Set to true to return the computed instead of local value
source_cellview_
method descriptor
source_cellview_()
@brief Gets the cellview index that this layer refers to
If "real" is true, the effective value is returned.
source_datatype_
method descriptor
source_datatype_()
@brief Gets the stream datatype that the shapes are taken from
If the datatype is positive, the actual layer is looked up by this stream datatype. If a name or layer index is specified, the stream datatype is not used.
If "real" is true, the effective value is returned.
source_layer_
method descriptor
source_layer_()
@brief Gets the stream layer that the shapes are taken from
If the layer is positive, the actual layer is looked up by this stream layer. If a name or layer index is specified, the stream layer is not used.
If "real" is true, the effective value is returned.
source_layer_index_
method descriptor
source_layer_index_()
@brief Gets the layer index that the shapes are taken from
If the layer index is positive, the shapes drawn are taken from this layer rather than searched for by layer and datatype. This property is stronger than the layer/datatype or name specification.
A different method is \layer_index which indicates the ID of the layer actually used. While "source_layer_index" is one of several ways to address the layer drawn, "layer_index" is the ID (index) of the layer matching the source specification and is >= 0 if such a layer is found.
If "real" is true, the effective value is returned.
source_name_
method descriptor
source_name_()
@brief Gets the stream name that the shapes are taken from
If the name is non-empty, the actual layer is looked up by this stream layer name. If a layer index (see \layer_index) is specified, the stream datatype is not used. A name is only meaningful for OASIS files.
If "real" is true, the effective value is returned.
trans_
method descriptor
trans_()
@brief Gets the transformations that the layer is transformed with
The transformations returned by this accessor is the one used for displaying this layer. The layout is transformed with each of these transformations before it is drawn.
If "real" is true, the effective value is returned.
transparent_
method descriptor
transparent_()
@brief Gets the transparency state
upper_hier_level_
method descriptor
upper_hier_level_()
@brief Gets the upper hierarchy level shown
This is the hierarchy level at which the drawing starts. This property is only meaningful, if \has_upper_hier_level is true. The hierarchy level can be relative in which case, 0 refers to the context cell's level. A mode can be specified for the hierarchy level which is 0 for absolute, 1 for minimum of specified level and set level and 2 for maximum of specified level and set level.
upper_hier_level_mode
method descriptor
upper_hier_level_mode() -> int
upper_hier_level_mode(real: bool) -> int
upper_hier_level_mode()
@brief Gets the mode for the upper hierarchy level.
This method is a convenience method for "upper_hier_level_mode(true)"
This method has been introduced in version 0.22.
upper_hier_level_relative
method descriptor
upper_hier_level_relative() -> bool
upper_hier_level_relative(real: bool) -> bool
upper_hier_level_relative()
@brief Gets a value indicating whether the upper hierarchy level is relative.
This method is a convenience method for "upper_hier_level_relative(true)"
This method has been introduced in version 0.22.
valid_
method descriptor
valid_()
@brief Gets the validity state
visible_
method descriptor
visible_()
@brief Gets the visibility state
width_
method descriptor
width_()
@brief Gets the line width
xfill_
method descriptor
xfill_()
@brief Gets a value indicating whether shapes are drawn with a cross
This attribute has been introduced in version 0.25.
LayerPropertiesIterator
@brief Layer properties iterator
This iterator provides a flat view for the layers in the layer tree if used with the next method. In this mode it will descend into the hierarchy and deliver node by node as a linear (flat) sequence.
The iterator can also be used to navigate through the node hierarchy using \next_sibling, \down_first_child, \parent etc.
The iterator also plays an important role for manipulating the layer properties tree, i.e. by specifying insertion points in the tree for the \LayoutView class.
__doc__
class
__doc__ = '@brief Layer properties iterator\n\nThis iterator provides a flat view for the layers in the layer tree if used with the next method. In this mode it will descend into the hierarchy and deliver node by node as a linear (flat) sequence.\n\nThe iterator can also be used to navigate through the node hierarchy using \\next_sibling, \\down_first_child, \\parent etc.\n\nThe iterator also plays an important role for manipulating the layer properties tree, i.e. by specifying insertion points in the tree for the \\LayoutView class.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 408
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayerPropertiesIterator' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> LayerPropertiesIterator
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> LayerPropertiesIterator
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality
@param other The other object to compare against Returns true, if self and other point to the same layer properties node. Caution: this does not imply that both layer properties nodes sit in the same tab. Just their position in the tree is compared.
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
__lt__
method descriptor
__lt__() -> bool
@brief Comparison
@param other The other object to compare against
@return true, if self points to an object that comes before other
__ne__
method descriptor
__ne__() -> bool
@brief Inequality
@param other The other object to compare against
assign
method descriptor
assign() -> None
@brief Assigns another object to self
at_end
method descriptor
at_end() -> bool
@brief At-the-end property
This predicate is true if the iterator is at the end of either all elements or at the end of the child list (if \down_last_child or \down_first_child is used to iterate).
at_top
method descriptor
at_top() -> bool
@brief At-the-top property
This predicate is true if there is no parent node above the node addressed by self.
child_index
method descriptor
child_index() -> int
@brief Returns the index of the child within the parent
This method returns the index of that the properties node the iterator points to in the list of children of its parent. If the element does not have a parent, the index of the element in the global list is returned.
create
method descriptor
create() -> None
@brief 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.
current
method descriptor
current() -> LayerPropertiesNodeRef
@brief Returns a reference to the layer properties node that the iterator points to
Starting with version 0.25, the returned object can be manipulated and the changes will be reflected in the view immediately.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
down_first_child
method descriptor
down_first_child() -> LayerPropertiesIterator
@brief Move to the first child
This method moves to the first child of the current element. If there is no child, \at_end? will be true. Even then, the iterator is sitting at the the child level and \up can be used to move back.
down_last_child
method descriptor
down_last_child() -> LayerPropertiesIterator
@brief Move to the last child
This method moves behind the last child of the current element. \at_end? will be true then. Even then, the iterator points to the child level and \up can be used to move back.
Despite the name, the iterator does not address the last child, but the position after that child. To actually get the iterator for the last child, use down_last_child and next_sibling(-1).
dup
method descriptor
dup() -> LayerPropertiesIterator
@brief Creates a copy of self
first_child
method descriptor
first_child() -> LayerPropertiesIterator
@brief Returns the iterator pointing to the first child
If there is no children, the iterator will be a valid insert point but not point to any valid element. It will report \at_end? = true.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_null
method descriptor
is_null() -> bool
@brief "is null" predicate
This predicate is true if the iterator is "null". Such an iterator can be created with the default constructor or by moving a top-level iterator up.
last_child
method descriptor
last_child() -> LayerPropertiesIterator
@brief Returns the iterator pointing behind the last child
The iterator will be a valid insert point but not point to any valid element. It will report \at_end? = true.
Despite the name, the iterator does not address the last child, but the position after that child. To actually get the iterator for the last child, use last_child and call next_sibling(-1) on that iterator.
new
builtin
new() -> LayerPropertiesIterator
@brief Creates a new object of this class
next
method descriptor
next() -> LayerPropertiesIterator
@brief Increment operator
The iterator will be incremented to point to the next layer entry. It will descend into the hierarchy to address child nodes if there are any.
next_sibling
method descriptor
next_sibling() -> LayerPropertiesIterator
@brief Move to the next sibling by a given distance
The iterator is moved to the nth next sibling of the current element. Use negative distances to move backward.
num_siblings
method descriptor
num_siblings() -> int
@brief Return the number of siblings
The count includes the current element. More precisely, this property delivers the number of children of the current node's parent.
parent
method descriptor
parent() -> LayerPropertiesIterator
@brief Returns the iterator pointing to the parent node
This method will return an iterator pointing to the parent element. If there is no parent, the returned iterator will be a null iterator.
to_sibling
method descriptor
to_sibling() -> LayerPropertiesIterator
@brief Move to the sibling with the given index
The iterator is moved to the nth sibling by selecting the nth child in the current node's parent.
up
method descriptor
up() -> LayerPropertiesIterator
@brief Move up
The iterator is moved to point to the current element's parent. If the current element does not have a parent, the iterator will become a null iterator.
LayerPropertiesNode
Bases: klayout.pyacore.LayerProperties
@brief A layer properties node structure
This class is derived from \LayerProperties. Objects of this class are used in the hierarchy of layer views that are arranged in a tree while the \LayerProperties object reflects the properties of a single node.
__doc__
class
__doc__ = '@brief A layer properties node structure\n\nThis class is derived from \\LayerProperties. Objects of this class are used\nin the hierarchy of layer views that are arranged in a tree while the \\LayerProperties\nobject reflects the properties of a single node.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 406
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
expanded
class
expanded: bool = <attribute 'expanded' of 'LayerPropertiesNode' objects>
@brief Gets a value indicating whether the layer tree node is expanded. This predicate has been introduced in version 0.28.6.
@brief Set a value indicating whether the layer tree node is expanded. Setting this value to 'true' will expand (open) the tree node. Setting it to 'false' will collapse the node.
This predicate has been introduced in version 0.28.6.
__eq__
method descriptor
__eq__() -> bool
@brief Equality
@param other The other object to compare against
__ne__
method descriptor
__ne__() -> bool
@brief Inequality
@param other The other object to compare against
add_child
method descriptor
add_child() -> LayerPropertiesNodeRef
add_child(child: LayerProperties) -> LayerPropertiesNodeRef
add_child()
@brief Add a child entry @return A reference to the node created This method allows building a layer properties tree by adding children to node objects. It returns a reference to the node object created.
This method was introduced in version 0.22.
bbox
method descriptor
bbox() -> db.DBox
@brief Compute the bbox of this layer
This takes the layout and path definition (supported by the given default layout or path, if no specific is given). The node must have been attached to a view to make this operation possible.
@return A bbox in micron units
clear_children
method descriptor
clear_children() -> None
@brief Clears all children This method was introduced in version 0.22.
flat
method descriptor
flat() -> LayerPropertiesNode
@brief return the "flattened" (effective) layer properties node for this node
This method returns a \LayerPropertiesNode object that is not embedded into a hierarchy. This object represents the effective layer properties for the given node. In particular, all 'local' properties are identical to the 'real' properties. Such an object can be used as a basis for manipulations.
Unlike the name suggests, this node will still contain a hierarchy of nodes below if the original node did so.
has_children
method descriptor
has_children() -> bool
@brief Test, if there are children
id
method descriptor
id() -> int
@brief Obtain the unique ID
Each layer properties node object has a unique ID that is created when a new LayerPropertiesNode object is instantiated. The ID is copied when the object is copied. The ID can be used to identify the object irregardless of its content.
is_expanded
method descriptor
is_expanded() -> bool
@brief Gets a value indicating whether the layer tree node is expanded. This predicate has been introduced in version 0.28.6.
list_index
method descriptor
list_index() -> int
@brief Gets the index of the layer properties list that the node lives in
view
method descriptor
view() -> LayoutView
@brief Gets the view this node lives in
This reference can be nil if the node is a orphan node that lives outside a view.
LayerPropertiesNodeRef
Bases: klayout.pyacore.LayerPropertiesNode
@brief A class representing a reference to a layer properties node
This object is returned by the layer properties iterator's current method (\LayerPropertiesIterator#current). A reference behaves like a layer properties node, but changes in the node are reflected in the view it is attached to.
A typical use case for references is this:
@code
Hides a layers of a view
view = RBA::LayoutView::current view.each_layer do |lref| # lref is a LayerPropertiesNodeRef object lref.visible = false end @/code
This class has been introduced in version 0.25.
__doc__
class
__doc__ = "@brief A class representing a reference to a layer properties node\n\nThis object is returned by the layer properties iterator's current method (\\LayerPropertiesIterator#current). A reference behaves like a layer properties node, but changes in the node are reflected in the view it is attached to.\n\nA typical use case for references is this:\n\n@code\n# Hides a layers of a view\nview = RBA::LayoutView::current\nview.each_layer do |lref|\n # lref is a LayerPropertiesNodeRef object\n lref.visible = false\nend\n@/code\n\nThis class has been introduced in version 0.25.\n"
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 407
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__copy__
method descriptor
__copy__() -> LayerPropertiesNode
@brief Creates a \LayerPropertiesNode object as a copy of the content of this node. This method is mainly provided for backward compatibility with 0.24 and before.
__deepcopy__
method descriptor
__deepcopy__() -> LayerPropertiesNode
@brief Creates a \LayerPropertiesNode object as a copy of the content of this node. This method is mainly provided for backward compatibility with 0.24 and before.
assign
method descriptor
assign(other: LayerProperties) -> None
assign(other: LayerProperties) -> None
assign()
@brief Assigns the contents of the 'other' object to self.
This version accepts a \LayerProperties object. Assignment will change the properties of the layer in the view.
delete
method descriptor
delete() -> None
@brief Erases the current node and all child nodes
After erasing the node, the reference will become invalid.
dup
method descriptor
dup() -> LayerPropertiesNode
@brief Creates a \LayerPropertiesNode object as a copy of the content of this node. This method is mainly provided for backward compatibility with 0.24 and before.
is_valid
method descriptor
is_valid() -> bool
@brief Returns true, if the reference points to a valid layer properties node
Invalid references behave like ordinary \LayerPropertiesNode objects but without the ability to update the view upon changes of attributes.
LayoutView
Bases: klayout.pyacore.LayoutViewBase
@brief 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.
__doc__
class
__doc__ = '@brief The view object presenting one or more layout objects\n\nThe 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. '
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 434
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
current
class-attribute
current: LayoutView
@brief Returns the current view The current view is the one that is made current by using \current=.
This variation has been introduced for the non-Qt case in version 0.28.
on_drawing_finished_event
class
on_drawing_finished_event: None = <attribute 'on_drawing_finished_event' of 'LayoutView' objects>
@brief An event indicating that the image is fully drawn
This event is triggered when calling \timer. Before this event is issue, a final \on_image_updated_event may be issued.
This event has been introduced in version 0.28.
@brief An event indicating that the image is fully drawn
This event is triggered when calling \timer. Before this event is issue, a final \on_image_updated_event may be issued.
This event has been introduced in version 0.28.
on_image_updated_event
class
on_image_updated_event: None = <attribute 'on_image_updated_event' of 'LayoutView' objects>
@brief An event indicating that the image ("screenshot") was updated
This event is triggered when calling \timer. This event has been introduced in version 0.28.
@brief An event indicating that the image ("screenshot") was updated
This event is triggered when calling \timer. This event has been introduced in version 0.28.
__init__
method descriptor
__init__() -> None
@brief Creates a standalone view
This constructor is for special purposes only. To create a view in the context of a main window, use \MainWindow#create_view and related methods.
@param editable True to make the view editable @param manager The \Manager object to enable undo/redo @param options A combination of the values in the LV_... constants
This constructor has been introduced in version 0.25. It has been enhanced with the arguments in version 0.27.
new
builtin
new() -> LayoutView
@brief Creates a standalone view
This constructor is for special purposes only. To create a view in the context of a main window, use \MainWindow#create_view and related methods.
@param editable True to make the view editable @param manager The \Manager object to enable undo/redo @param options A combination of the values in the LV_... constants
This constructor has been introduced in version 0.25. It has been enhanced with the arguments in version 0.27.
timer
method descriptor
timer() -> None
@brief A callback required to be called regularily in the non-Qt case.
This callback eventually implements the event loop in the non-Qt case. The main task is to indicate new versions of the layout image while it is drawn. When a new image has arrived, this method will issue an \on_image_updated_event. In the implementation of the latter, "screenshot" may be called to retrieve the current image. When drawing has finished, the \on_drawing_finished_event will be triggered.
This method has been introduced in version 0.28.
LayoutViewBase
@hide @alias LayoutView
Add
class
Add: SelectionMode = Add (2)
@brief Specifies how selected objects interact with already selected ones.
This enum was introduced in version 0.27.
Invert
class
Invert: SelectionMode = Invert (3)
@brief Specifies how selected objects interact with already selected ones.
This enum was introduced in version 0.27.
LV_Naked
class
LV_Naked: int = 32
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoBookmarksView
class
LV_NoBookmarksView: int = 16
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoEditorOptionsPanel
class
LV_NoEditorOptionsPanel: int = 8
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoGrid
class
LV_NoGrid: int = 128
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoHierarchyPanel
class
LV_NoHierarchyPanel: int = 2
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoLayers
class
LV_NoLayers: int = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoLibrariesView
class
LV_NoLibrariesView: int = 4
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoMove
class
LV_NoMove: int = 256
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoPlugins
class
LV_NoPlugins: int = 2048
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoPropertiesPopup
class
LV_NoPropertiesPopup: int = 4096
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoSelection
class
LV_NoSelection: int = 1024
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoServices
class
LV_NoServices: int = 3840
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoTracker
class
LV_NoTracker: int = 512
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
LV_NoZoom
class
LV_NoZoom: int = 64
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
Replace
class
Replace: SelectionMode = Replace (0)
@brief Specifies how selected objects interact with already selected ones.
This enum was introduced in version 0.27.
Reset
class
Reset: SelectionMode = Reset (1)
@brief Specifies how selected objects interact with already selected ones.
This enum was introduced in version 0.27.
__doc__
class
__doc__ = '@hide\n@alias LayoutView\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 409
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'LayoutViewBase' objects>
list of weak references to the object
active_cellview_index
class
active_cellview_index: int = <attribute 'active_cellview_index' of 'LayoutViewBase' objects>
@brief Gets the index of the active cellview (shown in hierarchy browser)
@brief Makes the cellview with the given index the active one (shown in hierarchy browser) See \active_cellview_index.
This method has been renamed from set_active_cellview_index to active_cellview_index= in version 0.25. The original name is still available, but is deprecated.
active_setview_index
class
active_setview_index: None = <attribute 'active_setview_index' of 'LayoutViewBase' objects>
@brief Makes the cellview with the given index the active one (shown in hierarchy browser) See \active_cellview_index.
This method has been renamed from set_active_cellview_index to active_cellview_index= in version 0.25. The original name is still available, but is deprecated.
current_layer
class
current_layer: LayerPropertiesIterator = <attribute 'current_layer' of 'LayoutViewBase' objects>
@brief Gets 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.
@brief Sets the current layer view
Specifies an \LayerPropertiesIterator pointing to the new current layer view.
This method has been introduced in version 0.23.
current_layer_list
class
current_layer_list: int = <attribute 'current_layer_list' of 'LayoutViewBase' objects>
@brief Gets the index of the currently selected layer properties tab This method has been introduced in version 0.21.
@brief Sets the index of the currently selected layer properties tab This method has been introduced in version 0.21.
max_hier_levels
class
max_hier_levels: int = <attribute 'max_hier_levels' of 'LayoutViewBase' objects>
@brief Returns the maximum hierarchy level up to which to display geometries
@return The maximum level up to which to display geometries
@brief Sets the maximum hierarchy level up to which to display geometries
@param level The maximum level below which to display something
This methods allows setting the maximum hierarchy below which to display geometries.This method may cause a redraw if required.
min_hier_levels
class
min_hier_levels: int = <attribute 'min_hier_levels' of 'LayoutViewBase' objects>
@brief Returns the minimum hierarchy level at which to display geometries
@return The minimum level at which to display geometries
@brief Sets the minimum hierarchy level at which to display geometries
@param level The minimum level above which to display something
This methods allows setting the minimum hierarchy level above which to display geometries.This method may cause a redraw if required.
object_selection
class
object_selection: List[ObjectInstPath] = <attribute 'object_selection' of 'LayoutViewBase' objects>
@brief Returns a list of selected objects This method will deliver an array of \ObjectInstPath objects listing the selected geometrical objects. Other selected objects such as annotations and images will not be contained in that list.
The list returned is an array of copies of \ObjectInstPath objects. They can be modified, but they will become a new selection only after re-introducing them into the view through \object_selection= or \select_object.
Another way of obtaining the selected objects is \each_object_selected.
This method has been introduced in version 0.24.
@brief Sets the list of selected objects
This method will set the selection of geometrical objects such as shapes and instances. It is the setter which complements the \object_selection method.
Another way of setting the selection is through \clear_object_selection and \select_object.
This method has been introduced in version 0.24.
on_active_cellview_changed
class
on_active_cellview_changed: None = <attribute 'on_active_cellview_changed' of 'LayoutViewBase' objects>
@brief An event indicating that the active cellview has changed
If the active cellview is changed by selecting a new one from the drop-down list, this event is triggered. When this event is triggered, the cellview has already been changed. Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_active_cellview_changed/remove_active_cellview_changed) have been removed in 0.25.
@brief An event indicating that the active cellview has changed
If the active cellview is changed by selecting a new one from the drop-down list, this event is triggered. When this event is triggered, the cellview has already been changed. Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_active_cellview_changed/remove_active_cellview_changed) have been removed in 0.25.
on_annotation_changed
class
on_annotation_changed: None = <attribute 'on_annotation_changed' of 'LayoutViewBase' objects>
@brief A event indicating that an annotation has been modified The argument of the event is the ID of the annotation that was changed. This event has been added in version 0.25.
@brief A event indicating that an annotation has been modified The argument of the event is the ID of the annotation that was changed. This event has been added in version 0.25.
on_annotation_selection_changed
class
on_annotation_selection_changed: None = <attribute 'on_annotation_selection_changed' of 'LayoutViewBase' objects>
@brief A event indicating that the annotation selection has changed This event has been added in version 0.25.
@brief A event indicating that the annotation selection has changed This event has been added in version 0.25.
on_annotations_changed
class
on_annotations_changed: None = <attribute 'on_annotations_changed' of 'LayoutViewBase' objects>
@brief A event indicating that annotations have been added or removed This event has been added in version 0.25.
@brief A event indicating that annotations have been added or removed This event has been added in version 0.25.
on_apply_technology
class
on_apply_technology: None = <attribute 'on_apply_technology' of 'LayoutViewBase' objects>
@brief An event indicating that a cellview has requested a new technology
If the technology of a cellview is changed, this event is triggered. The integer parameter of this event will indicate the cellview that has changed.
This event has been introduced in version 0.28.
@brief An event indicating that a cellview has requested a new technology
If the technology of a cellview is changed, this event is triggered. The integer parameter of this event will indicate the cellview that has changed.
This event has been introduced in version 0.28.
on_cell_visibility_changed
class
on_cell_visibility_changed: None = <attribute 'on_cell_visibility_changed' of 'LayoutViewBase' objects>
@brief An event indicating that the visibility of one or more cells has changed
This event is triggered after the visibility of one or more cells has changed.
Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cell_visibility_observer/remove_cell_visibility_observer) have been removed in 0.25.
@brief An event indicating that the visibility of one or more cells has changed
This event is triggered after the visibility of one or more cells has changed.
Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cell_visibility_observer/remove_cell_visibility_observer) have been removed in 0.25.
on_cellview_changed
class
on_cellview_changed: None = <attribute 'on_cellview_changed' of 'LayoutViewBase' objects>
@brief An event indicating that a cellview has changed
If a cellview is modified, this event is triggered. When this event is triggered, the cellview have already been changed. The integer parameter of this event will indicate the cellview that has changed.
Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cellview_observer/remove_cellview_observer) have been removed in 0.25.
@brief An event indicating that a cellview has changed
If a cellview is modified, this event is triggered. When this event is triggered, the cellview have already been changed. The integer parameter of this event will indicate the cellview that has changed.
Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cellview_observer/remove_cellview_observer) have been removed in 0.25.
on_cellviews_changed
class
on_cellviews_changed: None = <attribute 'on_cellviews_changed' of 'LayoutViewBase' objects>
@brief An event indicating that the cellview collection has changed
If new cellviews are added or cellviews are removed, this event is triggered. When this event is triggered, the cellviews have already been changed. Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cellview_list_observer/remove_cellview_list_observer) have been removed in 0.25.
@brief An event indicating that the cellview collection has changed
If new cellviews are added or cellviews are removed, this event is triggered. When this event is triggered, the cellviews have already been changed. Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_cellview_list_observer/remove_cellview_list_observer) have been removed in 0.25.
on_current_layer_list_changed
class
on_current_layer_list_changed: None = <attribute 'on_current_layer_list_changed' of 'LayoutViewBase' objects>
@brief An event indicating the current layer list (the selected tab) has changed @param index The index of the new current layer list
This event is triggered after the current layer list was changed - i.e. a new tab was selected.
This event was introduced in version 0.25.
@brief An event indicating the current layer list (the selected tab) has changed @param index The index of the new current layer list
This event is triggered after the current layer list was changed - i.e. a new tab was selected.
This event was introduced in version 0.25.
on_file_open
class
on_file_open: None = <attribute 'on_file_open' of 'LayoutViewBase' objects>
@brief An event indicating that a file was opened
If a file is loaded, this event is triggered. When this event is triggered, the file was already loaded and the new file is the new active cellview. Despite its name, this event is also triggered if a layout object is loaded into the view.
Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_file_open_observer/remove_file_open_observer) have been removed in 0.25.
@brief An event indicating that a file was opened
If a file is loaded, this event is triggered. When this event is triggered, the file was already loaded and the new file is the new active cellview. Despite its name, this event is also triggered if a layout object is loaded into the view.
Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_file_open_observer/remove_file_open_observer) have been removed in 0.25.
on_image_changed
class
on_image_changed: None = <attribute 'on_image_changed' of 'LayoutViewBase' objects>
@brief A event indicating that an image has been modified The argument of the event is the ID of the image that was changed. This event has been added in version 0.25.
@brief A event indicating that an image has been modified The argument of the event is the ID of the image that was changed. This event has been added in version 0.25.
on_image_selection_changed
class
on_image_selection_changed: None = <attribute 'on_image_selection_changed' of 'LayoutViewBase' objects>
@brief A event indicating that the image selection has changed This event has been added in version 0.25.
@brief A event indicating that the image selection has changed This event has been added in version 0.25.
on_images_changed
class
on_images_changed: None = <attribute 'on_images_changed' of 'LayoutViewBase' objects>
@brief A event indicating that images have been added or removed This event has been added in version 0.25.
@brief A event indicating that images have been added or removed This event has been added in version 0.25.
on_l2ndb_list_changed
class
on_l2ndb_list_changed: None = <attribute 'on_l2ndb_list_changed' of 'LayoutViewBase' objects>
@brief An event that is triggered the list of netlist databases is changed
If a netlist database is added or removed, this event is triggered.
This method has been added in version 0.26.
@brief An event that is triggered the list of netlist databases is changed
If a netlist database is added or removed, this event is triggered.
This method has been added in version 0.26.
on_layer_list_changed
class
on_layer_list_changed: None = <attribute 'on_layer_list_changed' of 'LayoutViewBase' objects>
@brief An event indicating that the layer list has changed
This event is triggered after the layer list has changed its configuration. The integer argument gives a hint about the nature of the changed: Bit 0 is set, if the properties (visibility, color etc.) of one or more layers have changed. Bit 1 is set if the hierarchy has changed. Bit 2 is set, if layer names have changed. Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_layer_list_observer/remove_layer_list_observer) have been removed in 0.25.
@brief An event indicating that the layer list has changed
This event is triggered after the layer list has changed its configuration. The integer argument gives a hint about the nature of the changed: Bit 0 is set, if the properties (visibility, color etc.) of one or more layers have changed. Bit 1 is set if the hierarchy has changed. Bit 2 is set, if layer names have changed. Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_layer_list_observer/remove_layer_list_observer) have been removed in 0.25.
on_layer_list_deleted
class
on_layer_list_deleted: None = <attribute 'on_layer_list_deleted' of 'LayoutViewBase' objects>
@brief An event indicating that a layer list (a tab) has been removed @param index The index of the layer list that was removed
This event is triggered after the layer list has been removed - i.e. a tab was deleted.
This event was introduced in version 0.25.
@brief An event indicating that a layer list (a tab) has been removed @param index The index of the layer list that was removed
This event is triggered after the layer list has been removed - i.e. a tab was deleted.
This event was introduced in version 0.25.
on_layer_list_inserted
class
on_layer_list_inserted: None = <attribute 'on_layer_list_inserted' of 'LayoutViewBase' objects>
@brief An event indicating that a layer list (a tab) has been inserted @param index The index of the layer list that was inserted
This event is triggered after the layer list has been inserted - i.e. a new tab was created.
This event was introduced in version 0.25.
@brief An event indicating that a layer list (a tab) has been inserted @param index The index of the layer list that was inserted
This event is triggered after the layer list has been inserted - i.e. a new tab was created.
This event was introduced in version 0.25.
on_rdb_list_changed
class
on_rdb_list_changed: None = <attribute 'on_rdb_list_changed' of 'LayoutViewBase' objects>
@brief An event that is triggered the list of report databases is changed
If a report database is added or removed, this event is triggered.
This event was translated from the Observer pattern to an event in version 0.25.
@brief An event that is triggered the list of report databases is changed
If a report database is added or removed, this event is triggered.
This event was translated from the Observer pattern to an event in version 0.25.
on_selection_changed
class
on_selection_changed: None = <attribute 'on_selection_changed' of 'LayoutViewBase' objects>
@brief An event that is triggered if the selection is changed
If the selection changed, this event is triggered.
This event was translated from the Observer pattern to an event in version 0.25.
@brief An event that is triggered if the selection is changed
If the selection changed, this event is triggered.
This event was translated from the Observer pattern to an event in version 0.25.
on_transient_selection_changed
class
on_transient_selection_changed: None = <attribute 'on_transient_selection_changed' of 'LayoutViewBase' objects>
@brief An event that is triggered if the transient selection is changed
If the transient selection is changed, this event is triggered. The transient selection is the highlighted selection when the mouse hovers over some object(s). This event was translated from the Observer pattern to an event in version 0.25.
@brief An event that is triggered if the transient selection is changed
If the transient selection is changed, this event is triggered. The transient selection is the highlighted selection when the mouse hovers over some object(s). This event was translated from the Observer pattern to an event in version 0.25.
on_viewport_changed
class
on_viewport_changed: None = <attribute 'on_viewport_changed' of 'LayoutViewBase' objects>
@brief An event indicating that the viewport (the visible rectangle) has changed
This event is triggered after a new display rectangle was chosen - for example, because the user zoomed into the layout.
Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_viewport_changed_observer/remove_viewport_changed_observer) have been removed in 0.25.
@brief An event indicating that the viewport (the visible rectangle) has changed
This event is triggered after a new display rectangle was chosen - for example, because the user zoomed into the layout.
Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_viewport_changed_observer/remove_viewport_changed_observer) have been removed in 0.25.
title
class
title: str = <attribute 'title' of 'LayoutViewBase' objects>
@brief Returns the view's title string
@return The 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.
@brief Sets the title of the view
@param title The title string to use
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.
SelectionMode
@brief Specifies how selected objects interact with already selected ones.
This enum was introduced in version 0.27.
Add
class
Add: SelectionMode = Add (2)
@brief Specifies how selected objects interact with already selected ones.
This enum was introduced in version 0.27.
Invert
class
Invert: SelectionMode = Invert (3)
@brief Specifies how selected objects interact with already selected ones.
This enum was introduced in version 0.27.
Replace
class
Replace: SelectionMode = Replace (0)
@brief Specifies how selected objects interact with already selected ones.
This enum was introduced in version 0.27.
Reset
class
Reset: SelectionMode = Reset (1)
@brief Specifies how selected objects interact with already selected ones.
This enum was introduced in version 0.27.
__doc__
class
__doc__ = '@brief Specifies how selected objects interact with already selected ones.\n\nThis enum was introduced in version 0.27.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 410
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'SelectionMode' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: LayoutViewBase.SelectionMode) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> LayoutViewBase.SelectionMode
new(s: str) -> LayoutViewBase.SelectionMode
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
active_cellview
method descriptor
active_cellview() -> CellView
@brief Gets the active cellview (shown in hierarchy browser)
This is a convenience method which is equivalent to "cellview(active_cellview_index)".
This method has been introduced in version 0.19. Starting from version 0.25, the returned object can be manipulated which will have an immediate effect on the display.
add_l2ndb
method descriptor
add_l2ndb() -> int
@brief Adds the given netlist database to the view
This method will add an existing database to the view. It will then appear in the netlist database browser. A similar method is \create_l2ndb which will create a new database within the view.
@return The index of the database within the view (see \l2ndb)
This method has been added in version 0.26.
add_line_style
method descriptor
add_line_style(name: str, data: int, bits: int) -> int
add_line_style(name: str, string: str) -> int
add_line_style()
@brief Adds a custom line style from a string
@param name The name under which this pattern will appear in the style editor @param string A string describing the bits of the pattern ('.' for missing pixel, '*' for a set pixel) @return The index of the newly created style, which can be used as the line style index of \LayerProperties. This method has been introduced in version 0.25.
add_lvsdb
method descriptor
add_lvsdb() -> int
@brief Adds the given database to the view
This method will add an existing database to the view. It will then appear in the netlist database browser. A similar method is \create_lvsdb which will create a new database within the view.
@return The index of the database within the view (see \lvsdb)
This method has been added in version 0.26.
add_marker
method descriptor
add_marker() -> None
@brief Adds a persistent marker to the view (transferring ownership)
This method allows creating markers and transferring ownership to the view, hence making them persistent. This means, when the variable with the marker object goes out of scope, the marker will still exist in the view.
To create a persistent marker, use the following code:
@code marker = RBA::Marker::new
... configure marker ...
view.add_marker(marker) @/code
To remove all persistent markers owned by the view, use \clear_markers.
Persistent markers have been introduced in version 0.29.3
add_missing_layers
method descriptor
add_missing_layers() -> None
@brief Adds new layers to layer list This method was introduced in version 0.19.
add_rdb
method descriptor
add_rdb() -> int
@brief Adds the given report database to the view
This method will add an existing database to the view. It will then appear in the marker database browser. A similar method is \create_rdb which will create a new database within the view.
@return The index of the database within the view (see \rdb)
This method has been added in version 0.26.
add_stipple
method descriptor
add_stipple(name: str, data: Sequence[int], bits: int) -> int
add_stipple(name: str, string: str) -> int
add_stipple()
@brief Adds a stipple pattern given by a string
'string' is a string describing the pattern. It consists of one or more lines composed of '.' or '' characters and separated by newline characters. A '.' is for a missing pixel and '' for a set pixel. The length of each line must be the same. Blanks before or after each line are ignored.
@param name The name under which this pattern will appear in the stipple editor @param string See above @return The index of the newly created stipple pattern, which can be used as the dither pattern index of \LayerProperties. This method has been introduced in version 0.25.
annotation
method descriptor
annotation() -> Annotation
@brief Gets the annotation given by an ID Returns a reference to the annotation given by the respective ID or an invalid annotation if the ID is not valid. Use \Annotation#is_valid? to determine whether the returned annotation is valid or not.
The returned annotation is a 'live' object and changing it will update the view.
This method has been introduced in version 0.25.
annotation_templates
method descriptor
annotation_templates() -> List[List[Any]]
@brief Gets a list of \Annotation objects representing the annotation templates.
Annotation templates are the rulers available in the ruler drop-down (preset ruler types). This method will fetch the templates available. This method returns triplets '(annotation, title, mode)'. The first member of the triplet is the annotation object representing the template. The second member is the title string displayed in the menu for this templates. The third member is the mode value (one of the RulerMode... constants - e.g \RulerModeNormal).
The positions of the returned annotation objects are undefined.
This method has been introduced in version 0.28.
ascend
method descriptor
ascend() -> db.InstElement
@brief Ascends upwards in the hierarchy.
Removes one element from the specific path of the cellview with the given index. Returns the element removed.
begin_layers
method descriptor
begin_layers() -> LayerPropertiesIterator
begin_layers(index: int) -> LayerPropertiesIterator
begin_layers()
@brief 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 against a current iterator to check, if there are no further elements. This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21.
box
method descriptor
box() -> db.DBox
@brief Returns the displayed box in micron space
call_menu
method descriptor
call_menu() -> None
@brief Calls the menu item with the provided symbol. To obtain all symbols, use \menu_symbols.
This method has been introduced in version 0.27.
cancel
method descriptor
cancel() -> None
@brief Cancels all edit operations
This method will stop all pending edit operations (i.e. drag and drop) and cancel the current selection. Calling this method is useful to ensure there are no potential interactions with the script's functionality.
cellview
method descriptor
cellview() -> CellView
@brief Gets the cellview object for a given index
@param cv_index The cellview index for which to get the object for
Starting with version 0.25, this method returns a \CellView object that can be manipulated to directly reflect any changes in the display.
cellviews
method descriptor
cellviews() -> int
@brief Gets the number of cellviews
clear_annotations
method descriptor
clear_annotations() -> None
@brief Clears all annotations on this view
clear_config
method descriptor
clear_config() -> None
@brief Clears the local configuration parameters
See \set_config for a description of the local configuration parameters.
clear_images
method descriptor
clear_images() -> None
@brief Clear all images on this view
clear_layers
method descriptor
clear_layers() -> None
clear_layers(index: int) -> None
clear_layers()
@brief Clears all layers for the given layer properties list This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21.
clear_line_styles
method descriptor
clear_line_styles() -> None
@brief Removes all custom line styles All line styles except the fixed ones are removed. If any of the custom styles is still used by the layers displayed, the results will be undefined. This method has been introduced in version 0.25.
clear_markers
method descriptor
clear_markers() -> None
@brief Clears all persistent markers from the view See \add_marker for details about persistent markers.
Persistent markers have been introduced in version 0.29.3
clear_object_selection
method descriptor
clear_object_selection() -> None
@brief Clears the selection of geometrical objects (shapes or cell instances) The selection of other objects (such as annotations and images) will not be affected.
This method has been introduced in version 0.24
clear_selection
method descriptor
clear_selection() -> None
@brief Clears the selection of all objects (shapes, annotations, images ...)
This method has been introduced in version 0.26.2
clear_stipples
method descriptor
clear_stipples() -> None
@brief Removes all custom line styles 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 be undefined.
clear_transactions
method descriptor
clear_transactions() -> None
@brief Clears 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.
clear_transient_selection
method descriptor
clear_transient_selection() -> None
@brief Clears the transient selection (mouse-over hightlights) of all objects (shapes, annotations, images ...)
This method has been introduced in version 0.26.2
commit
method descriptor
commit() -> None
@brief Ends a transaction
See \transaction for a detailed description of transactions. This method was introduced in version 0.16.
commit_config
method descriptor
commit_config() -> None
@brief Commits the configuration settings
Some configuration options are queued for performance reasons and become active only after 'commit_config' has been called. After a sequence of \set_config calls, this method should be called to activate the settings made by these calls.
This method has been introduced in version 0.25.
create
method descriptor
create() -> None
@brief 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.
create_l2ndb
method descriptor
create_l2ndb() -> int
@brief Creates a new netlist database and returns the index of the new database @param name The name of the new netlist database @return The index of the new database This method returns an index of the new netlist database. Use \l2ndb to get the actual object. If a netlist database with the given name already exists, a unique name will be created. The name will be replaced by the file name when a file is loaded into the netlist database.
This method has been added in version 0.26.
create_layout
method descriptor
create_layout(add_cellview: bool) -> int
create_layout(tech: str, add_cellview: bool) -> int
create_layout(tech: str, add_cellview: bool, init_layers: bool) -> int
create_layout()
@brief Create a new, empty layout and associate it with the given technology
The add_cellview parameter controls whether to create a new cellview (true) or clear all cellviews before (false). This variant also allows one to control whether the layer properties are initialized (init_layers = true) or not (init_layers = false).
@return The index of the cellview created.
This variant has been introduced in version 0.22.
create_lvsdb
method descriptor
create_lvsdb() -> int
@brief Creates a new netlist database and returns the index of the new database @param name The name of the new netlist database @return The index of the new database This method returns an index of the new netlist database. Use \lvsdb to get the actual object. If a netlist database with the given name already exists, a unique name will be created. The name will be replaced by the file name when a file is loaded into the netlist database.
This method has been added in version 0.26.
create_measure_ruler
method descriptor
create_measure_ruler() -> Annotation
@brief Createas an auto-measure ruler at the given point.
@param point The seed point where to create the auto-measure ruler @param ac The orientation constraints (determines the search direction too)
The \ac parameters takes one of the Angle... constants from \Annotation.
This method will create a ruler with a measurement, looking to the sides of the seed point for visible layout in the vicinity. The angle constraint determines the main directions where to look. If suitable edges are found, the method will pull a line between the closest edges. The ruler's endpoints will sit on these lines and the ruler's length will be the distance. Only visible layers will participate in the measurement.
The new ruler is inserted into the view already. It is created with the default style of rulers. If the measurement fails because there is no layout in the vicinity, a ruler with identical start and end points will be created.
@return The new ruler object
This method was introduced in version 0.26.
create_rdb
method descriptor
create_rdb() -> int
@brief Creates a new report database and returns the index of the new database @param name The name of the new report database @return The index of the new database This method returns an index of the new report database. Use \rdb to get the actual object. If a report database with the given name already exists, a unique name will be created. The name will be replaced by the file name when a file is loaded into the report database.
delete_layer
method descriptor
delete_layer(index: int, iter: LayerPropertiesIterator) -> None
delete_layer(iter: LayerPropertiesIterator) -> None
delete_layer()
@brief Deletes the layer properties node specified by the iterator
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. This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21.
delete_layer_list
method descriptor
delete_layer_list() -> None
@brief Deletes the given properties list At least one layer properties list must remain. This method may change the current properties list. This method has been introduced in version 0.21.
delete_layers
method descriptor
delete_layers(index: int, iterators: Sequence[LayerPropertiesIterator]) -> None
delete_layers(iterators: Sequence[LayerPropertiesIterator]) -> None
delete_layers()
@brief Deletes the layer properties nodes specified by the iterator
This method deletes the nodes specifies by the iterators. This method is the most convenient way to delete multiple entries. This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.22.
descend
method descriptor
descend() -> None
@brief Descends 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
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
each_annotation
method descriptor
each_annotation() -> Iterator[Annotation]
@brief Iterates over all annotations attached to this view
each_annotation_selected
method descriptor
each_annotation_selected() -> Iterator[Annotation]
@brief Iterate over each selected annotation objects, yielding a \Annotation object for each of them This method was introduced in version 0.19.
each_image
method descriptor
each_image() -> Iterator[Image]
@brief Iterate over all images attached to this view
With version 0.25, the objects returned by the iterator are references and can be manipulated to change their appearance.
each_image_selected
method descriptor
each_image_selected() -> Iterator[Image]
@brief Iterate over each selected image object, yielding a \Image object for each of them This method was introduced in version 0.19.
each_layer
method descriptor
each_layer() -> Iterator[LayerPropertiesNodeRef]
each_layer(layer_list: int) -> Iterator[LayerPropertiesNodeRef]
each_layer()
@brief Hierarchically iterates over the layers in the given layer list
This version of this method allows specification of the layer list to be iterated over. The layer list is specified by its index which is a value between 0 and \num_layer_lists-1.For details see the parameter-less version of this method.
This method was introduced in version 0.25.
each_object_selected
method descriptor
each_object_selected() -> Iterator[ObjectInstPath]
@brief Iterates over each selected geometrical object, yielding a \ObjectInstPath object for each of them
This iterator will deliver const objects - they cannot be modified. In order to modify the selection, create a copy of the \ObjectInstPath objects, modify them and install the new selection using \select_object or \object_selection=.
Another way of obtaining the selection is \object_selection, which returns an array of \ObjectInstPath objects.
each_object_selected_transient
method descriptor
each_object_selected_transient() -> Iterator[ObjectInstPath]
@brief Iterates 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
method descriptor
enable_edits() -> None
@brief Enables or disables edits
@param enable Enable edits if set to true
This method allows putting the view into read-only mode by disabling all edit functions. For doing so, this method has to be called with a 'false' argument. Calling it with a 'true' parameter enables all edits again. This method must not be confused with the edit/viewer mode. The LayoutView's enable_edits method is intended to temporarily disable all menu entries and functions which could allow the user to alter the database. In 0.25, this method has been moved from MainWindow to LayoutView.
end_layers
method descriptor
end_layers() -> LayerPropertiesIterator
end_layers(index: int) -> LayerPropertiesIterator
end_layers()
@brief End iterator for the layers See \begin_layers for a description about this iterator This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21.
erase_annotation
method descriptor
erase_annotation() -> None
@brief Erases the annotation given by the id Deletes an existing annotation given by the id parameter. The id of an annotation can be obtained through \Annotation#id.
This method has been introduced in version 0.24. Starting with version 0.25, the annotation's \Annotation#delete method can also be used to delete an annotation.
erase_cellview
method descriptor
erase_cellview() -> None
@brief Erases the cellview with the given index
This closes the given cellview and unloads the layout associated with it, unless referred to by another cellview.
erase_image
method descriptor
erase_image() -> None
@brief Erase the given image @param id The id of the object to erase
Erases the image with the given Id. The Id can be obtained with if "id" method of the image object.
This method has been introduced in version 0.20.
With version 0.25, \Image#delete can be used to achieve the same results.
expand_layer_properties
method descriptor
expand_layer_properties() -> None
expand_layer_properties(index: int) -> None
expand_layer_properties()
@brief Expands the layer properties for the given tab
This method will expand all wildcard specifications in the layer properties by iterating over the specified objects (i.e. layers, cellviews) and by replacing default colors and stipples by the ones specified with the palettes.
This method was introduced in version 0.21.
get_config
method descriptor
get_config() -> str
@brief Gets the value of a local configuration parameter
@param name The name of the configuration parameter whose value shall be obtained (a string)
@return The value of the parameter
See \set_config for a description of the local configuration parameters.
get_config_names
method descriptor
get_config_names() -> List[str]
@brief Gets the configuration parameter names
@return A list of configuration parameter names
This method returns the names of all known configuration parameters. These names can be used to get and set configuration parameter values.
This method was introduced in version 0.25.
get_current_cell_path
method descriptor
get_current_cell_path() -> List[int]
@brief Gets the 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.
@param cv_index The cellview index for which to get the current path from (usually this will be the active cellview index) This method is was deprecated in version 0.25 since from then, the \CellView object can be used to obtain an manipulate the selected cell.
get_line_style
method descriptor
get_line_style() -> str
@brief Gets the line style string for the style with the given index
This method will return the line style string for the style with the given index. The format of the string is the same than the string accepted by \add_line_style. An empty string corresponds to 'solid line'.
This method has been introduced in version 0.25.
get_pixels
method descriptor
get_pixels() -> PixelBuffer
@brief Gets the layout image as a \PixelBuffer
@param width The width of the image to render in pixel. @param height The height of the image to render in pixel.
The image contains the current scene (layout, annotations etc.). The image is drawn synchronously with the given width and height. Drawing may take some time. This method has been introduced in 0.28.
get_pixels_with_options
method descriptor
get_pixels_with_options() -> PixelBuffer
@brief Gets the layout image as a \PixelBuffer (with options)
@param width The width of the image to render in pixel. @param height The height of the image to render in pixel. @param linewidth The width of a line in pixels (usually 1) or 0 for default. @param oversampling The oversampling factor (1..3) or 0 for default. @param resolution The resolution (pixel size compared to a screen pixel size, i.e 1/oversampling) or 0 for default. @param target_box The box to draw or an empty box for default.
The image contains the current scene (layout, annotations etc.). The image is drawn synchronously with the given width and height. Drawing may take some time. This method has been introduced in 0.28.
get_pixels_with_options_mono
method descriptor
get_pixels_with_options_mono() -> BitmapBuffer
@brief Gets the layout image as a \PixelBuffer (with options)
@param width The width of the image to render in pixel. @param height The height of the image to render in pixel. @param linewidth The width of a line in pixels (usually 1) or 0 for default. @param target_box The box to draw or an empty box for default.
The image contains the current scene (layout, annotations etc.). The image is drawn synchronously with the given width and height. Drawing may take some time. Monochrome images don't have background or annotation objects currently.
This method has been introduced in 0.28.
get_screenshot_pixels
method descriptor
get_screenshot_pixels() -> PixelBuffer
@brief Gets a screenshot as a \PixelBuffer
Getting the image requires the drawing to be complete. Ideally, synchronous mode is switched on for the application to guarantee this condition. The image will have the size of the viewport showing the current layout. This method has been introduced in 0.28.
get_stipple
method descriptor
get_stipple() -> str
@brief Gets the stipple pattern string for the pattern with the given index
This method will return the stipple pattern string for the pattern with the given index. The format of the string is the same than the string accepted by \add_stipple.
This method has been introduced in version 0.25.
has_annotation_selection
method descriptor
has_annotation_selection() -> bool
@brief Returns true, if annotations (rulers) are selected in this view This method was introduced in version 0.19.
has_image_selection
method descriptor
has_image_selection() -> bool
@brief Returns true, if images are selected in this view This method was introduced in version 0.19.
has_object_selection
method descriptor
has_object_selection() -> bool
@brief Returns true, if geometrical objects (shapes or cell instances) are selected in this view
has_selection
method descriptor
has_selection() -> bool
@brief Indicates whether any objects are selected
This method has been introduced in version 0.27
has_transient_object_selection
method descriptor
has_transient_object_selection() -> bool
@brief 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
method descriptor
hide_cell() -> None
@brief Hides the given cell for the given cellview
icon_for_layer
method descriptor
icon_for_layer() -> PixelBuffer
@brief Creates an icon pixmap for the given layer.
The icon will have size w times h pixels multiplied by the device pixel ratio (dpr). The dpr is The number of physical pixels per logical pixels on high-DPI displays.
'di_off' will shift the dither pattern by the given number of (physical) pixels. If 'no_state' is true, the icon will not reflect visibility or validity states but rather the display style.
This method has been introduced in version 0.28.
image
method descriptor
image() -> Image
@brief Gets the image given by an ID Returns a reference to the image given by the respective ID or an invalid image if the ID is not valid. Use \Image#is_valid? to determine whether the returned image is valid or not.
The returned image is a 'live' object and changing it will update the view.
This method has been introduced in version 0.25.
init_layer_properties
method descriptor
init_layer_properties() -> None
@brief Fills the layer properties for a new layer
This method initializes a layer properties object's color and stipples according to the defaults for the given layer source specification. The layer's source must be set already on the layer properties object.
This method was introduced in version 0.19.
@param props The layer properties object to initialize.
insert_annotation
method descriptor
insert_annotation() -> None
@brief Inserts an annotation object into the given view Inserts a new annotation into the view. Existing annotation will remain. Use \clear_annotations to delete them before inserting new ones. Use \replace_annotation to replace an existing one with a new one. Starting with version 0.25 this method modifies self's ID to reflect the ID of the ruler created. After an annotation is inserted into the view, it can be modified and the changes of properties will become reflected immediately in the view.
insert_image
method descriptor
insert_image() -> None
@brief Insert an image object into the given view Insert the image object given by obj into the view.
With version 0.25, this method will attach the image object to the view and the image object will become a 'live' object - i.e. changes to the object will change the appearance of the image on the screen.
insert_layer
method descriptor
insert_layer(index: int, iter: LayerPropertiesIterator, node: Optional[LayerProperties] = ...) -> LayerPropertiesNodeRef
insert_layer(iter: LayerPropertiesIterator, node: Optional[LayerProperties] = ...) -> LayerPropertiesNodeRef
insert_layer()
@brief Inserts the given layer properties node into the list before the given position
This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method inserts the new properties node before the position given by "iter" and returns a const reference to the element created. The iterator that specified the position will remain valid after the node was inserted and will point to the newly created node. It can be used to add further nodes. This method has been introduced in version 0.21. Since version 0.22, this method accepts LayerProperties and LayerPropertiesNode objects. A LayerPropertiesNode object can contain a hierarchy of further nodes. Since version 0.26 the node parameter is optional and the reference returned by this method can be used to set the properties of the new node.
insert_layer_list
method descriptor
insert_layer_list() -> None
@brief Inserts a new layer properties list at the given index This method inserts a new tab at the given position. The current layer properties list will be changed to the new list. This method has been introduced in version 0.21.
is_cell_hidden
method descriptor
is_cell_hidden() -> bool
@brief Returns true, if the cell is hidden
@return True, if the cell with "cell_index" is hidden for the cellview "cv_index"
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_dirty
method descriptor
is_dirty() -> bool
@brief Gets a flag indicating whether one of the layouts displayed needs saving A layout is 'dirty' if it is modified and needs saving. This method returns true if this is the case for at least one of the layouts shown in the view.
This method has been introduced in version 0.29.
is_editable
method descriptor
is_editable() -> bool
@brief Returns true if the view is in editable mode
This read-only attribute has been added in version 0.27.5.
is_transacting
method descriptor
is_transacting() -> bool
@brief Indicates if a transaction is ongoing
See \transaction for a detailed description of transactions. This method was introduced in version 0.16.
l2ndb
method descriptor
l2ndb() -> db.LayoutToNetlist
@brief Gets the netlist database with the given index @return The \LayoutToNetlist object or nil if the index is not valid This method has been added in version 0.26.
load_layer_props
method descriptor
load_layer_props(fn: str) -> None
load_layer_props(fn: str, add_default: bool) -> None
load_layer_props(fn: str, cv_index: int, add_default: bool) -> None
load_layer_props()
@brief Loads the layer properties with options
@param fn The file name of the .lyp file to load @param cv_index See description text @param add_default If true, default layers will be added for each other layer in the layout
Load the layer properties from the file given in "fn". This version allows one to specify whether defaults should be used for all other layers by setting "add_default" to true. It can be used to load the layer properties for a specific cellview by setting "cv_index" to the index for which the layer properties file should be applied. All present definitions for this layout will be removed before the properties file is loaded. "cv_index" can be set to -1. In that case, the layer properties file is applied to each of the layouts individually.
Note that this version will override all cellview index definitions in the layer properties file.
This variant has been added on version 0.21.
load_layout
method descriptor
load_layout(filename: str, add_cellview: Optional[bool] = ...) -> int
load_layout(filename: str, options: db.LoadLayoutOptions, add_cellview: Optional[bool] = ...) -> int
load_layout(filename: str, options: db.LoadLayoutOptions, technology: str, add_cellview: Optional[bool] = ...) -> int
load_layout(filename: str, technology: str, add_cellview: Optional[bool] = ...) -> int
load_layout()
@brief Loads 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).
@return The index of the cellview loaded. The 'add_cellview' argument has been made optional in version 0.28.
lvsdb
method descriptor
lvsdb() -> db.LayoutVsSchematic
@brief Gets the netlist database with the given index @return The \LayoutVsSchematic object or nil if the index is not valid This method has been added in version 0.26.
max_hier
method descriptor
max_hier() -> None
@brief Selects all hierarchy levels available
Show the layout in full depth down to the deepest level of hierarchy. This method may cause a redraw.
menu
method descriptor
menu() -> AbstractMenu
@brief Gets the \AbstractMenu associated with this view.
In normal UI application mode this is the main window's view. For a detached view or in non-UI applications this is the view's private menu.
This method has been introduced in version 0.28.
menu_symbols
builtin
menu_symbols() -> List[str]
@brief Gets all available menu symbols (see \call_menu). NOTE: currently this method delivers a superset of all available symbols. Depending on the context, no all symbols may trigger actual functionality.
This method has been introduced in version 0.27.
mode_name
method descriptor
mode_name() -> str
@brief Gets the name of the current mode.
See \switch_mode about a method to change the mode and \mode_names for a method to retrieve all available mode names.
This method has been introduced in version 0.28.
mode_names
method descriptor
mode_names() -> List[str]
@brief Gets the names of the available modes.
This method allows asking the view for the available mode names for \switch_mode and for the value returned by \mode.
This method has been introduced in version 0.28.
new
builtin
new() -> LayoutViewBase
@brief Creates a new object of this class
num_l2ndbs
method descriptor
num_l2ndbs() -> int
@brief Gets the number of netlist databases loaded into this view @return The number of \LayoutToNetlist objects present in this view
This method has been added in version 0.26.
num_layer_lists
method descriptor
num_layer_lists() -> int
@brief Gets the number of layer properties tabs present This method has been introduced in version 0.23.
num_rdbs
method descriptor
num_rdbs() -> int
@brief Gets the number of report databases loaded into this view @return The number of \ReportDatabase objects present in this view
pan_center
method descriptor
pan_center() -> None
@brief Pans to the given point
The window is positioned such that "p" becomes the new center
pan_down
method descriptor
pan_down() -> None
@brief Pans down
pan_left
method descriptor
pan_left() -> None
@brief Pans to the left
pan_right
method descriptor
pan_right() -> None
@brief Pans to the right
pan_up
method descriptor
pan_up() -> None
@brief Pans upward
rdb
method descriptor
rdb() -> rdb.ReportDatabase
@brief Gets the report database with the given index @return The \ReportDatabase object or nil if the index is not valid
register_annotation_template
method descriptor
register_annotation_template() -> None
@brief Registers the given annotation as a template for this particular view @annotation The annotation to use for the template (positions are ignored) @param title The title to use for the ruler template @param mode The mode the ruler will be created in (see Ruler... constants)
See \Annotation#register_template for a method doing the same on application level. This method is hardly useful normally, but can be used when customizing layout views as individual widgets.
This method has been added in version 0.28.
reload_layout
method descriptor
reload_layout() -> None
@brief Reloads the given cellview
@param cv The index of the cellview to reload
remove_l2ndb
method descriptor
remove_l2ndb() -> None
@brief Removes a netlist database with the given index @param The index of the netlist database to remove from this view This method has been added in version 0.26.
remove_line_style
method descriptor
remove_line_style() -> None
@brief Removes the line style with the given index The line styles with an index less than the first custom style. If a style is removed that is still used, the results are undefined.
This method has been introduced in version 0.25.
remove_rdb
method descriptor
remove_rdb() -> None
@brief Removes a report database with the given index @param The index of the report database to remove from this view
remove_stipple
method descriptor
remove_stipple() -> None
@brief Removes the stipple pattern with the given index The pattern with an index less than the first custom pattern cannot be removed. If a stipple pattern is removed that is still used, the results are undefined.
remove_unused_layers
method descriptor
remove_unused_layers() -> None
@brief Removes unused layers from layer list This method was introduced in version 0.19.
rename_cellview
method descriptor
rename_cellview() -> None
@brief Renames 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), all cellviews are renamed.
rename_layer_list
method descriptor
rename_layer_list() -> None
@brief Sets the title of the given layer properties tab This method has been introduced in version 0.21.
replace_annotation
method descriptor
replace_annotation() -> None
@brief Replaces the annotation given by the id with the new one Replaces an existing annotation given by the id parameter with the new one. The id of an annotation can be obtained through \Annotation#id.
This method has been introduced in version 0.24.
replace_image
method descriptor
replace_image() -> None
@brief Replace an image object with the new image
@param id The id of the object to replace @param new_obj The new object to replace the old one
Replaces the image with the given Id with the new object. The Id can be obtained with if "id" method of the image object.
This method has been introduced in version 0.20.
replace_l2ndb
method descriptor
replace_l2ndb() -> int
@brief Replaces the netlist database with the given index
If the index is not valid, the database will be added to the view (see \add_lvsdb).
@return The index of the database within the view (see \lvsdb)
This method has been added in version 0.26.
replace_layer_node
method descriptor
replace_layer_node(index: int, iter: LayerPropertiesIterator, node: LayerProperties) -> None
replace_layer_node(iter: LayerPropertiesIterator, node: LayerProperties) -> None
replace_layer_node()
@brief Replaces the layer node at the position given by "iter" with a new one This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21. Since version 0.22, this method accepts LayerProperties and LayerPropertiesNode objects. A LayerPropertiesNode object can contain a hierarchy of further nodes.
replace_lvsdb
method descriptor
replace_lvsdb() -> int
@brief Replaces the database with the given index
If the index is not valid, the database will be added to the view (see \add_lvsdb).
@return The index of the database within the view (see \lvsdb)
This method has been added in version 0.26.
replace_rdb
method descriptor
replace_rdb() -> int
@brief Replaces the report database with the given index
If the index is not valid, the database will be added to the view (see \add_rdb).
@return The index of the database within the view (see \rdb)
This method has been added in version 0.26.
reset_title
method descriptor
reset_title() -> None
@brief Resets the title to the standard title
See \set_title and \title for a description about how titles are handled.
resize
method descriptor
resize() -> None
@brief Resizes the layout view to the given dimension
This method has been made available in all builds in 0.28.
save_as
method descriptor
save_as(index: int, filename: str, gzip: bool, options: db.SaveLayoutOptions) -> None
save_as(index: int, filename: str, options: db.SaveLayoutOptions) -> None
save_as()
@brief Saves a layout to the given stream file
@param index The cellview index of the layout to save. @param filename The file to write. @param options Writer options.
The 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.
If the file name ends with a suffix ".gz" or ".gzip", the file is compressed with the zlib algorithm.
save_image
method descriptor
save_image() -> None
@brief Saves the layout as an image to the given file
@param filename The file to which to write the screenshot to. @param width The width of the image to render in pixel. @param height The height of the image to render in pixel.
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 synchronously with the given width and height. Drawing may take some time.
save_image_with_options
method descriptor
save_image_with_options() -> None
@brief Saves the layout as an image to the given file (with options)
@param filename The file to which to write the screenshot to. @param width The width of the image to render in pixel. @param height The height of the image to render in pixel. @param linewidth The line width scale factor (usually 1) or 0 for 1/resolution. @param oversampling The oversampling factor (1..3) or 0 for the oversampling the view was configured with. @param resolution The resolution (pixel size compared to a screen pixel) or 0 for 1/oversampling. @param target_box The box to draw or an empty box for default. @param monochrome If true, monochrome images will be produced.
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 synchronously with the given width and height. Drawing may take some time. Monochrome images don't have background or annotation objects currently.
The 'linewidth' factor scales the layout style line widths.
The 'oversampling' factor will use multiple passes passes to create a single image pixels. An oversampling factor of 2 uses 2x2 virtual pixels to generate an output pixel. This results in a smoother image. This however comes with a corresponding memory and run time penalty. When using oversampling, you can set linewidth and resolution to 0. This way, line widths and stipple pattern are scaled such that the resulting image is equivalent to the standard image.
The 'resolution' is the pixel size used to translate font sizes and stipple pattern. A resolution of 0.5 renders twice as large fonts and stipple pattern. When combining this value with an oversampling factor of 2 and a line width factor of 2, the resulting image is an oversampled version of the standard image.
Examples:
@code
standard image 500x500 pixels (oversampling as configured in the view)
layout_view.save_image_with_options("image.png", 500, 500)
2x oversampled image with 500x500 pixels
layout_view.save_image_with_options("image.png", 500, 500, 0, 2, 0)
2x scaled image with 1000x1000 pixels
layout_view.save_image_with_options("image.png", 1000, 1000, 2, 1, 0.5) @/code
This method has been introduced in 0.23.10.
save_layer_props
method descriptor
save_layer_props() -> None
@brief Saves the layer properties
Save the layer properties to the file given in "fn"
save_screenshot
method descriptor
save_screenshot() -> None
@brief Saves a screenshot to the given file
@param filename The file to which to write the screenshot to.
The screenshot is written as a PNG file to the given file. This requires the drawing to be complete. Ideally, synchronous mode is switched on for the application to guarantee this condition. The image will have the size of the viewport showing the current layout.
select_all
method descriptor
select_all() -> None
@brief Selects all objects from the view
This method has been introduced in version 0.27
select_cell
method descriptor
select_cell() -> None
@brief Selects 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). This method is was deprecated in version 0.25 since from then, the \CellView object can be used to obtain an manipulate the selected cell.
select_cell_path
method descriptor
select_cell_path() -> None
@brief Selects 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). This method is was deprecated in version 0.25 since from then, the \CellView object can be used to obtain an manipulate the selected cell.
select_from
method descriptor
select_from(box: db.DBox, mode: Optional[LayoutViewBase.SelectionMode] = ...) -> None
select_from(point: db.DPoint, mode: Optional[LayoutViewBase.SelectionMode] = ...) -> None
select_from()
@brief Selects the objects from a given box
The mode indicates whether to add to the selection, replace the selection, remove from selection or invert the selected status of the objects found inside the given box.
This method has been introduced in version 0.27
select_object
method descriptor
select_object() -> None
@brief Adds the given selection to the list of selected objects
The selection provided by the \ObjectInstPath descriptor is added to the list of selected objects. To clear the previous selection, use \clear_object_selection.
The selection of other objects (such as annotations and images) will not be affected.
Another way of selecting objects is \object_selection=.
This method has been introduced in version 0.24
selected_cells_paths
method descriptor
selected_cells_paths() -> List[List[int]]
@brief Gets the paths of the selected cells
Gets a list of cell paths to the cells selected in the cellview given by \cv_index. The "selected cells" are the ones selected in the cell list or cell tree. This is not the "current cell" which is the one that is shown in the layout window.
The cell paths are arrays of cell indexes where the last element is the actual cell selected.
This method has be introduced in version 0.25.
selected_layers
method descriptor
selected_layers() -> List[LayerPropertiesIterator]
@brief Gets 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.
selection_bbox
method descriptor
selection_bbox() -> db.DBox
@brief Returns the bounding box of the current selection
This method has been introduced in version 0.26.2
selection_size
method descriptor
selection_size() -> int
@brief Returns the number of selected objects
This method has been introduced in version 0.27
send_enter_event
method descriptor
send_enter_event() -> None
@brief Sends a mouse window leave event
This method is intended to emulate the mouse mouse window leave events sent by Qt normally in environments where Qt is not present. This method was introduced in version 0.28.
send_key_press_event
method descriptor
send_key_press_event() -> None
@brief Sends a key press event
This method is intended to emulate the key press events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#key_event for example.
This method was introduced in version 0.28.
send_leave_event
method descriptor
send_leave_event() -> None
@brief Sends a mouse window leave event
This method is intended to emulate the mouse mouse window leave events sent by Qt normally in environments where Qt is not present. This method was introduced in version 0.28.
send_mouse_double_clicked_event
method descriptor
send_mouse_double_clicked_event() -> None
@brief Sends a mouse button double-click event
This method is intended to emulate the mouse button double-click events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#mouse_moved_event for example.
This method was introduced in version 0.28.
send_mouse_move_event
method descriptor
send_mouse_move_event() -> None
@brief Sends a mouse move event
This method is intended to emulate the mouse move events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#mouse_moved_event for example.
This method was introduced in version 0.28.
send_mouse_press_event
method descriptor
send_mouse_press_event() -> None
@brief Sends a mouse button press event
This method is intended to emulate the mouse button press events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#mouse_moved_event for example.
This method was introduced in version 0.28.
send_mouse_release_event
method descriptor
send_mouse_release_event() -> None
@brief Sends a mouse button release event
This method is intended to emulate the mouse button release events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#mouse_moved_event for example.
This method was introduced in version 0.28.
send_wheel_event
method descriptor
send_wheel_event() -> None
@brief Sends a mouse wheel event
This method is intended to emulate the mouse wheel events sent by Qt normally in environments where Qt is not present. The arguments follow the conventions used within \Plugin#wheel_event for example.
This method was introduced in version 0.28.
set_active_cellview_index
method descriptor
set_active_cellview_index() -> None
@brief Makes the cellview with the given index the active one (shown in hierarchy browser) See \active_cellview_index.
This method has been renamed from set_active_cellview_index to active_cellview_index= in version 0.25. The original name is still available, but is deprecated.
set_config
method descriptor
set_config() -> None
@brief Sets a local configuration parameter with the given name to the given value
@param name The name of the configuration parameter to set @param value The value to which to set the configuration parameter
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.
set_current_cell_path
method descriptor
set_current_cell_path() -> None
@brief Sets 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 highlighted and scrolled into view. To select the cell to be drawn, use the \select_cell or \select_cell_path method.
@param cv_index The cellview index for which to set the current path for (usually this will be the active cellview index) @param path The path to the current cell
This method is was deprecated in version 0.25 since from then, the \CellView object can be used to obtain an manipulate the selected cell.
set_current_layer_list
method descriptor
set_current_layer_list() -> None
@brief Sets the index of the currently selected layer properties tab This method has been introduced in version 0.21.
set_layer_properties
method descriptor
set_layer_properties(index: int, iter: LayerPropertiesIterator, props: LayerProperties) -> None
set_layer_properties(iter: LayerPropertiesIterator, props: LayerProperties) -> None
set_layer_properties()
@brief Sets 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" in the tab given by "index". It will not change the hierarchy but just the properties of the given node.This version addresses a specific list in a multi-tab layer properties arrangement with the "index" parameter. This method has been introduced in version 0.21.
set_title
method descriptor
set_title() -> None
@brief Sets the title of the view
@param title The title string to use
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.
show_all_cells
method descriptor
show_all_cells() -> None
show_all_cells(cv_index: int) -> None
show_all_cells()
@brief Makes all cells shown (cancel effects of \hide_cell) for the specified cell view Unlike \show_all_cells, this method will only clear the hidden flag on the cell view selected by \cv_index.
This variant has been added in version 0.25.
show_cell
method descriptor
show_cell() -> None
@brief Shows the given cell for the given cellview (cancel effect of \hide_cell)
show_image
method descriptor
show_image() -> None
@brief Shows or hides the given image @param id The id of the object to show or hide @param visible True, if the image should be shown
Sets the visibility of the image with the given Id. The Id can be obtained with if "id" method of the image object.
This method has been introduced in version 0.20.
With version 0.25, \Image#visible= can be used to achieve the same results.
show_layout
method descriptor
show_layout(layout: db.Layout, add_cellview: bool) -> int
show_layout(layout: db.Layout, tech: str, add_cellview: bool) -> int
show_layout(layout: db.Layout, tech: str, add_cellview: bool, init_layers: bool) -> int
show_layout()
@brief Shows an existing layout in the view
Shows the given layout in the view. If add_cellview is true, the new layout is added to the list of cellviews in the view. The technology to use for that layout can be specified as well with the 'tech' parameter. Depending on the definition of the technology, layer properties may be loaded for example. The technology string can be empty for the default technology. This variant also allows one to control whether the layer properties are initialized (init_layers = true) or not (init_layers = false).
Note: once a layout is passed to the view with show_layout, it is owned by the view and must not be destroyed with the 'destroy' method.
@return The index of the cellview created.
This method has been introduced in version 0.22.
stop
method descriptor
stop() -> None
@brief Stops redraw thread and close any browsers This method usually does not need to be called explicitly. The redraw thread is stopped automatically.
stop_redraw
method descriptor
stop_redraw() -> None
@brief Stops 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.
switch_mode
method descriptor
switch_mode() -> None
@brief Switches the mode.
See \mode_name about a method to get the name of the current mode and \mode_names for a method to retrieve all available mode names.
This method has been introduced in version 0.28.
transaction
method descriptor
transaction() -> None
@brief Begins a transaction
@param description A text that appears in the 'undo' description
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 occurred. It is advisable therefore to catch errors and issue a commit call in this case.
This method was introduced in version 0.16.
transient_to_selection
method descriptor
transient_to_selection() -> None
@brief Turns the transient selection into the actual selection
The current selection is cleared before. All highlighted objects under the mouse will become selected. This applies to all types of objects (rulers, shapes, images ...).
This method has been introduced in version 0.26.2
unregister_annotation_templates
method descriptor
unregister_annotation_templates() -> None
@brief Unregisters the template or templates with the given category string on this particular view
See \Annotation#unregister_templates for a method doing the same on application level.This method is hardly useful normally, but can be used when customizing layout views as individual widgets.
This method has been added in version 0.28.
unselect_object
method descriptor
unselect_object() -> None
@brief Removes the given selection from the list of selected objects
The selection provided by the \ObjectInstPath descriptor is removed from the list of selected objects. If the given object was not part of the selection, nothing will be changed. The selection of other objects (such as annotations and images) will not be affected.
This method has been introduced in version 0.24
update_content
method descriptor
update_content() -> None
@brief Updates 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 should be called however, after the layer view tree has been changed by the \insert_layer, \replace_layer_node or \delete_layer methods.
viewport_height
method descriptor
viewport_height() -> int
@brief Return the viewport height in pixels This method was introduced in version 0.18.
viewport_trans
method descriptor
viewport_trans() -> db.DCplxTrans
@brief Returns 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.
viewport_width
method descriptor
viewport_width() -> int
@brief Returns the viewport width in pixels This method was introduced in version 0.18.
zoom_box
method descriptor
zoom_box() -> None
@brief Sets the viewport to the given box
@param box The box to which to set the view in micron coordinates
zoom_fit
method descriptor
zoom_fit() -> None
@brief Fits the contents of the current view into the window
zoom_fit_sel
method descriptor
zoom_fit_sel() -> None
@brief Fits the contents of the current selection into the window
This method has been introduced in version 0.25.
zoom_in
method descriptor
zoom_in() -> None
@brief Zooms in somewhat
zoom_out
method descriptor
zoom_out() -> None
@brief Zooms out somewhat
Macro
@brief A macro class
This class is provided mainly to support generation of template macros in the DSL interpreter framework provided by \MacroInterpreter. The implementation may be enhanced in future versions and provide access to macros stored inside KLayout's macro repository. But it can be used to execute macro code in a consistent way:
@code path = "path-to-macro.lym" RBA::Macro::new(path).run() @/code
Using the Macro class with \run for executing code will chose the right interpreter and is able to execute DRC and LVS scripts in the proper environment. This also provides an option to execute Ruby code from Python and vice versa.
In this scenario you can pass values to the script using \Interpreter#define_variable. The interpreter to choose for DRC and LVS scripts is \Interpreter#ruby_interpreter. For passing values back from the script, wrap the variable value into a \Value object which can be modified by the called script and read back by the caller.
DSLInterpreter
class
DSLInterpreter: Interpreter = DSLInterpreter (3)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
MacroFormat
class
MacroFormat: Format = MacroFormat (0)
@brief Specifies the format of a macro This enum has been introduced in version 0.27.5.
None_
class
None_: Interpreter = None (4)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
PlainTextFormat
class
PlainTextFormat: Format = PlainTextFormat (1)
@brief Specifies the format of a macro This enum has been introduced in version 0.27.5.
PlainTextWithHashAnnotationsFormat
class
PlainTextWithHashAnnotationsFormat: Format = PlainTextWithHashAnnotationsFormat (2)
@brief Specifies the format of a macro This enum has been introduced in version 0.27.5.
Python
class
Python: Interpreter = Python (1)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
Ruby
class
Ruby: Interpreter = Ruby (0)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
Text
class
Text: Interpreter = Text (2)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
__doc__
class
__doc__ = '@brief A macro class\n\nThis class is provided mainly to support generation of template macros in the DSL interpreter framework provided by \\MacroInterpreter. The implementation may be enhanced in future versions and provide access to macros stored inside KLayout\'s macro repository.\nBut it can be used to execute macro code in a consistent way:\n\n@code\npath = "path-to-macro.lym"\nRBA::Macro::new(path).run()\n@/code\n\nUsing the Macro class with \\run for executing code will chose the right interpreter and is able to execute DRC and LVS scripts in the proper environment. This also provides an option to execute Ruby code from Python and vice versa.\n\nIn this scenario you can pass values to the script using \\Interpreter#define_variable. The interpreter to choose for DRC and LVS scripts is \\Interpreter#ruby_interpreter. For passing values back from the script, wrap the variable value into a \\Value object which can be modified by the called script and read back by the caller.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 431
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Macro' objects>
list of weak references to the object
category
class
category: str = <attribute 'category' of 'Macro' objects>
@brief Gets the category tags
The category tags string indicates to which categories a macro will belong to. This string is only used for templates currently and is a comma-separated list of category names.
@brief Sets the category tags string See \category for details.
description
class
description: str = <attribute 'description' of 'Macro' objects>
@brief Gets the description text
The description text of a macro will appear in the macro list. If used as a macro template, the description text can have the format "Group;;Description". In that case, the macro will appear in a group with title "Group".
@brief Sets the description text @param description The description text. See \description for details.
doc
class
doc: str = <attribute 'doc' of 'Macro' objects>
@brief Gets the macro's documentation string
This method has been introduced in version 0.27.5.
@brief Sets the macro's documentation string
This method has been introduced in version 0.27.5.
dsl_interpreter
class
dsl_interpreter: str = <attribute 'dsl_interpreter' of 'Macro' objects>
@brief Gets the macro's DSL interpreter name (if interpreter is DSLInterpreter)
This method has been introduced in version 0.27.5.
@brief Sets the macro's DSL interpreter name (if interpreter is DSLInterpreter)
This method has been introduced in version 0.27.5.
epilog
class
epilog: str = <attribute 'epilog' of 'Macro' objects>
@brief Gets the epilog code
The epilog is executed after the actual code is executed. Interpretation depends on the implementation of the DSL interpreter for DSL macros.
@brief Sets the epilog See \epilog for details.
format
class
format: Format = <attribute 'format' of 'Macro' objects>
@brief Gets the macro's storage format
This method has been introduced in version 0.27.5.
@brief Sets the macro's storage format
This method has been introduced in version 0.27.5.
group_name
class
group_name: str = <attribute 'group_name' of 'Macro' objects>
@brief Gets the menu group name
If a group name is specified and \show_in_menu? is true, the macro will appear in a separate group (separated by a separator) together with other macros sharing the same group.
@brief Sets the menu group name See \group_name for details.
interpreter
class
interpreter: Interpreter = <attribute 'interpreter' of 'Macro' objects>
@brief Gets the macro's interpreter
This method has been introduced in version 0.27.5.
@brief Sets the macro's interpreter
This method has been introduced in version 0.27.5.
is_autorun
class
is_autorun: bool = <attribute 'is_autorun' of 'Macro' objects>
@brief Gets a flag indicating whether the macro is automatically executed on startup
This method has been introduced in version 0.27.5.
@brief Sets a flag indicating whether the macro is automatically executed on startup
This method has been introduced in version 0.27.5.
is_autorun_early
class
is_autorun_early: bool = <attribute 'is_autorun_early' of 'Macro' objects>
@brief Gets a flag indicating whether the macro is automatically executed early on startup
This method has been introduced in version 0.27.5.
@brief Sets a flag indicating whether the macro is automatically executed early on startup
This method has been introduced in version 0.27.5.
menu_path
class
menu_path: str = <attribute 'menu_path' of 'Macro' objects>
@brief Gets the menu path
If a menu path is specified and \show_in_menu? is true, the macro will appear in the menu at the specified position.
@brief Sets the menu path See \menu_path for details.
prolog
class
prolog: str = <attribute 'prolog' of 'Macro' objects>
@brief Gets the prolog code
The prolog is executed before the actual code is executed. Interpretation depends on the implementation of the DSL interpreter for DSL macros.
@brief Sets the prolog See \prolog for details.
shortcut
class
shortcut: str = <attribute 'shortcut' of 'Macro' objects>
@brief Gets the macro's keyboard shortcut
This method has been introduced in version 0.27.5.
@brief Sets the macro's keyboard shortcut
This method has been introduced in version 0.27.5.
show_in_menu
class
show_in_menu: bool = <attribute 'show_in_menu' of 'Macro' objects>
@brief Gets a value indicating whether the macro shall be shown in the menu
@brief Sets a value indicating whether the macro shall be shown in the menu
text
class
text: str = <attribute 'text' of 'Macro' objects>
@brief Gets the macro text
The text is the code executed by the macro interpreter. Depending on the DSL interpreter, the text can be any kind of code.
@brief Sets the macro text See \text for details.
version
class
version: str = <attribute 'version' of 'Macro' objects>
@brief Gets the macro's version
This method has been introduced in version 0.27.5.
@brief Sets the macro's version
This method has been introduced in version 0.27.5.
Format
@brief Specifies the format of a macro This enum has been introduced in version 0.27.5.
MacroFormat
class
MacroFormat: Format = MacroFormat (0)
@brief Specifies the format of a macro This enum has been introduced in version 0.27.5.
PlainTextFormat
class
PlainTextFormat: Format = PlainTextFormat (1)
@brief Specifies the format of a macro This enum has been introduced in version 0.27.5.
PlainTextWithHashAnnotationsFormat
class
PlainTextWithHashAnnotationsFormat: Format = PlainTextWithHashAnnotationsFormat (2)
@brief Specifies the format of a macro This enum has been introduced in version 0.27.5.
__doc__
class
__doc__ = '@brief Specifies the format of a macro\nThis enum has been introduced in version 0.27.5.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 432
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Format' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: Macro.Format) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> Macro.Format
new(s: str) -> Macro.Format
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
Interpreter
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
DSLInterpreter
class
DSLInterpreter: Interpreter = DSLInterpreter (3)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
None_
class
None_: Interpreter = None (4)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
Python
class
Python: Interpreter = Python (1)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
Ruby
class
Ruby: Interpreter = Ruby (0)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
Text
class
Text: Interpreter = Text (2)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
__doc__
class
__doc__ = '@brief Specifies the interpreter used for executing a macro\nThis enum has been introduced in version 0.27.5.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 433
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Interpreter' objects>
list of weak references to the object
__eq__
method descriptor
__eq__(other: int) -> bool
__eq__(other: object) -> bool
__eq__()
@brief Compares an enum with an integer value
__hash__
method descriptor
__hash__() -> int
@brief Gets the hash value from the enum
__init__
method descriptor
__init__(i: int) -> None
__init__(s: str) -> None
__init__()
@brief Creates an enum from a string value
__int__
method descriptor
__int__() -> int
@brief Gets the integer value from the enum
__lt__
method descriptor
__lt__(other: Macro.Interpreter) -> bool
__lt__(other: int) -> bool
__lt__()
@brief Returns true if the enum is less (in the enum symbol order) than the integer value
__ne__
method descriptor
__ne__(other: int) -> bool
__ne__(other: object) -> bool
__ne__()
@brief Compares an enum with an integer for inequality
__repr__
method descriptor
__repr__() -> str
@brief Converts an enum to a visual string
__str__
method descriptor
__str__() -> str
@brief Gets the symbolic string from an enum
hash
method descriptor
hash() -> int
@brief Gets the hash value from the enum
inspect
method descriptor
inspect() -> str
@brief Converts an enum to a visual string
new
builtin
new(i: int) -> Macro.Interpreter
new(s: str) -> Macro.Interpreter
new()
@brief Creates an enum from a string value
to_i
method descriptor
to_i() -> int
@brief Gets the integer value from the enum
to_s
method descriptor
to_s() -> str
@brief Gets the symbolic string from an enum
__init__
method descriptor
__init__() -> None
@brief Loads the macro from the given file path
This constructor has been introduced in version 0.27.5.
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
interpreter_name
method descriptor
interpreter_name() -> str
@brief Gets the macro interpreter name This is the string version of \interpreter.
This method has been introduced in version 0.27.5.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
macro_by_path
builtin
macro_by_path() -> Macro
@brief Finds the macro by installation path
Returns nil if no macro with this path can be found.
This method has been added in version 0.26.
name
method descriptor
name() -> str
@brief Gets the name of the macro
This attribute has been added in version 0.25.
new
builtin
new() -> Macro
@brief Loads the macro from the given file path
This constructor has been introduced in version 0.27.5.
path
method descriptor
path() -> str
@brief Gets the path of the macro
The path is the path where the macro is stored, starting with an abstract group identifier. The path is used to identify the macro in the debugger for example.
real_line
builtin
real_line() -> int
@brief Gets the real line number for an include-encoded path and line number
When using KLayout's include scheme based on '# %include ...', FILE and LINE (Ruby) will not have the proper values but encoded file names. This method allows retrieving the real line number by using
@code
Ruby
real_line = RBA::Macro::real_line(FILE, LINE)
Python
real_line = pya::Macro::real_line(file, line) @/code
This substitution is not required for top-level macros as KLayout's interpreter will automatically use this function instead of FILE. Call this function when you need FILE from files included through the languages mechanisms such as 'require' or 'load' where this substitution does not happen.
For Python there is no equivalent for LINE, so you always have to use:
@code
Pythonimport inspect
real_line = pya.Macro.real_line(file, inspect.currentframe().f_back.f_lineno) @/code
This feature has been introduced in version 0.27.
real_path
builtin
real_path() -> str
@brief Gets the real path for an include-encoded path and line number
When using KLayout's include scheme based on '# %include ...', FILE and LINE (Ruby) will not have the proper values but encoded file names. This method allows retrieving the real file by using
@code
Ruby
real_file = RBA::Macro::real_path(FILE, LINE) @/code
This substitution is not required for top-level macros as KLayout's interpreter will automatically use this function instead of FILE. Call this function when you need FILE from files included through the languages mechanisms such as 'require' or 'load' where this substitution does not happen.
For Python there is no equivalent for LINE, so you always have to use:
@code
Pythonimport inspect
real_file = pya.Macro.real_path(file, inspect.currentframe().f_back.f_lineno) @/code
This feature has been introduced in version 0.27.
run
method descriptor
run() -> int
@brief Executes the macro
This method has been introduced in version 0.27.5.
save_to
method descriptor
save_to() -> None
@brief Saves the macro to the given file
This method has been introduced in version 0.27.5.
sync_properties_with_text
method descriptor
sync_properties_with_text() -> None
@brief Synchronizes the macro properties with the text
This method performs the reverse process of \sync_text_with_properties.
This method has been introduced in version 0.27.5.
sync_text_with_properties
method descriptor
sync_text_with_properties() -> None
@brief Synchronizes the macro text with the properties
This method applies to PlainTextWithHashAnnotationsFormat format. The macro text will be enhanced with pseudo-comments reflecting the macro properties. This way, the macro properties can be stored in plain files.
This method has been introduced in version 0.27.5.
MacroExecutionContext
@brief Support for various debugger features
This class implements some features that allow customization of the debugger behavior, specifically the generation of back traces and the handling of exception. These functions are particular useful for implementing DSL interpreters and providing proper error locations in the back traces or to suppress exceptions when re-raising them.
__doc__
class
__doc__ = '@brief Support for various debugger features\n\nThis class implements some features that allow customization of the debugger behavior, specifically the generation of back traces and the handling of exception. These functions are particular useful for implementing DSL interpreters and providing proper error locations in the back traces or to suppress exceptions when re-raising them.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 429
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'MacroExecutionContext' objects>
list of weak references to the object
__copy__
method descriptor
__copy__() -> MacroExecutionContext
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> MacroExecutionContext
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> MacroExecutionContext
@brief Creates a copy of self
ignore_next_exception
builtin
ignore_next_exception() -> None
@brief Ignores the next exception in the debugger The next exception thrown will be ignored in the debugger. That feature is useful when re-raising exceptions if those new exception shall not appear in the debugger.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> MacroExecutionContext
@brief Creates a new object of this class
remove_debugger_scope
builtin
remove_debugger_scope() -> None
@brief Removes a debugger scope previously set with \set_debugger_scope
set_debugger_scope
builtin
set_debugger_scope() -> None
@brief Sets a debugger scope (file level which shall appear in the debugger) If a debugger scope is set, back traces will be produced starting from that scope. Setting a scope is useful for implementing DSL interpreters and giving a proper hint about the original location of an error.
MacroInterpreter
@brief A custom interpreter for a DSL (domain specific language)
DSL interpreters are a way to provide macros written in a language specific for the application. One example are DRC scripts which are written in some special language optimized for DRC ruledecks. Interpreters for such languages can be built using scripts itself by providing the interpreter implementation through this object.
An interpreter implementation involves at least these steps:
@ul @li Derive a new object from RBA::MacroInterpreter @/li @li Reimplement the \execute method for the actual execution of the code @/li @li In the initialize method configure the object using the attribute setters like \suffix= and register the object as DSL interpreter (in that order) @/li @li Create at least one template macro in the initialize method @/li @/ul
Template macros provide a way for the macro editor to present macros for the new interpreter in the list of templates. Template macros can provide menu bindings, shortcuts and some initial text for example
The simple implementation can be enhanced by providing more information, i.e. syntax highlighter information, the debugger to use etc. This involves reimplementing further methods, i.e. "syntax_scheme".
This is a simple example for an interpreter in Ruby. Is is registered under the name 'simple-dsl' and just evaluates the script text:
@code class SimpleExecutable < RBA::Excutable
# Constructor def initialize(macro) \@macro = macro end
# Implements the execute method def execute eval(\@macro.text, nil, \@macro.path) nil end
end
class SimpleInterpreter < RBA::MacroInterpreter
# Constructor def initialize self.description = "A test interpreter" # Registers the new interpreter register("simple-dsl") # create a template for the macro editor: # Name is "new_simple", the description will be "Simple interpreter macro" # in the "Special" group. mt = create_template("new_simple") mt.description = "Special;;Simple interpreter macro" end
# Creates the executable delegate def executable(macro) SimpleExecutable::new(macro) end
end
Register the new interpreter
SimpleInterpreter::new
@/code
Please note that such an implementation is dangerous because the evaluation of the script happens in the context of the interpreter object. In this implementation the script could redefine the execute method for example. This implementation is provided as an example only. A real implementation should add execution of prolog and epilog code inside the execute method and proper error handling.
In order to make the above code effective, store the code in an macro, set "early auto-run" and restart KLayout.
This class has been introduced in version 0.23 and modified in 0.27.
MacroFormat
class
MacroFormat: Format = MacroFormat (0)
@brief Specifies the format of a macro This enum has been introduced in version 0.27.5.
NoDebugger
class
NoDebugger: Interpreter = None (4)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
PlainTextFormat
class
PlainTextFormat: Format = PlainTextFormat (1)
@brief Specifies the format of a macro This enum has been introduced in version 0.27.5.
PlainTextWithHashAnnotationsFormat
class
PlainTextWithHashAnnotationsFormat: Format = PlainTextWithHashAnnotationsFormat (2)
@brief Specifies the format of a macro This enum has been introduced in version 0.27.5.
RubyDebugger
class
RubyDebugger: Interpreter = Ruby (0)
@brief Specifies the interpreter used for executing a macro This enum has been introduced in version 0.27.5.
__doc__
class
__doc__ = '@brief A custom interpreter for a DSL (domain specific language)\n\nDSL interpreters are a way to provide macros written in a language specific for the application. One example are DRC scripts which are written in some special language optimized for DRC ruledecks. Interpreters for such languages can be built using scripts itself by providing the interpreter implementation through this object.\n\nAn interpreter implementation involves at least these steps:\n\n@ul\n@li Derive a new object from RBA::MacroInterpreter @/li\n@li Reimplement the \\execute method for the actual execution of the code @/li\n@li In the initialize method configure the object using the attribute setters like \\suffix= and register the object as DSL interpreter (in that order) @/li\n@li Create at least one template macro in the initialize method @/li\n@/ul\n\nTemplate macros provide a way for the macro editor to present macros for the new interpreter in the list of templates. Template macros can provide menu bindings, shortcuts and some initial text for example\n\nThe simple implementation can be enhanced by providing more information, i.e. syntax highlighter information, the debugger to use etc. This involves reimplementing further methods, i.e. "syntax_scheme".\n\nThis is a simple example for an interpreter in Ruby. Is is registered under the name \'simple-dsl\' and just evaluates the script text:\n\n@code\nclass SimpleExecutable < RBA::Excutable\n\n # Constructor\n def initialize(macro)\n \\@macro = macro\n end\n \n # Implements the execute method\n def execute\n eval(\\@macro.text, nil, \\@macro.path)\n nil\n end\n\nend\n\nclass SimpleInterpreter < RBA::MacroInterpreter\n\n # Constructor\n def initialize\n self.description = "A test interpreter"\n # Registers the new interpreter\n register("simple-dsl")\n # create a template for the macro editor:\n # Name is "new_simple", the description will be "Simple interpreter macro"\n # in the "Special" group.\n mt = create_template("new_simple")\n mt.description = "Special;;Simple interpreter macro"\n end\n \n # Creates the executable delegate\n def executable(macro)\n SimpleExecutable::new(macro)\n end\n\nend\n\n# Register the new interpreter\nSimpleInterpreter::new\n\n@/code\n\nPlease note that such an implementation is dangerous because the evaluation of the script happens in the context of the interpreter object. In this implementation the script could redefine the execute method for example. This implementation is provided as an example only.\nA real implementation should add execution of prolog and epilog code inside the execute method and proper error handling.\n\nIn order to make the above code effective, store the code in an macro, set "early auto-run" and restart KLayout.\n\nThis class has been introduced in version 0.23 and modified in 0.27.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 430
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'MacroInterpreter' objects>
list of weak references to the object
debugger_scheme
class
debugger_scheme: None = <attribute 'debugger_scheme' of 'MacroInterpreter' objects>
@brief Sets the debugger scheme (which debugger to use for the DSL macro)
The value can be one of the constants \RubyDebugger or \NoDebugger.
Use this attribute setter in the initializer before registering the interpreter.
Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for performance reasons in version 0.25.
description
class
description: None = <attribute 'description' of 'MacroInterpreter' objects>
@brief Sets a description string
This string is used for showing the type of DSL macro in the file selection box together with the suffix for example. Use this attribute setter in the initializer before registering the interpreter.
Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for performance reasons in version 0.25.
storage_scheme
class
storage_scheme: None = <attribute 'storage_scheme' of 'MacroInterpreter' objects>
@brief Sets the storage scheme (the format as which the macro is stored)
This value indicates how files for this DSL macro type shall be stored. The value can be one of the constants \PlainTextFormat, \PlainTextWithHashAnnotationsFormat and \MacroFormat.
Use this attribute setter in the initializer before registering the interpreter.
Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for performance reasons in version 0.25.
suffix
class
suffix: None = <attribute 'suffix' of 'MacroInterpreter' objects>
@brief Sets the file suffix
This string defines which file suffix to associate with the DSL macro. If an empty string is given (the default) no particular suffix is assciated with that macro type and "lym" is assumed. Use this attribute setter in the initializer before registering the interpreter.
Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for performance reasons in version 0.25.
supports_include_expansion
class
supports_include_expansion: None = <attribute 'supports_include_expansion' of 'MacroInterpreter' objects>
@brief Sets a value indicating whether this interpreter supports the default include file expansion scheme. If this value is set to true (the default), lines like '# %include ...' will be substituted by the content of the file following the '%include' keyword. Set this value to false if you don't want to support this feature.
This attribute has been introduced in version 0.27.
syntax_scheme
class
syntax_scheme: None = <attribute 'syntax_scheme' of 'MacroInterpreter' objects>
@brief Sets a string indicating the syntax highlighter scheme
The scheme string can be empty (indicating no syntax highlighting), "ruby" for the Ruby syntax highlighter or another string. In that case, the highlighter will look for a syntax definition under the resource path ":/syntax/
Use this attribute setter in the initializer before registering the interpreter.
Before version 0.25 this attribute was a re-implementable method. It has been turned into an attribute for performance reasons in version 0.25.
__copy__
method descriptor
__copy__() -> MacroInterpreter
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> MacroInterpreter
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
create_template
method descriptor
create_template() -> Macro
@brief Creates a new macro template @param url The template will be initialized from that URL.
This method will create a register a new macro template. It returns a \Macro object which can be modified in order to adjust the template (for example to set description, add a content, menu binding, autorun flags etc.)
This method must be called after \register has called.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> MacroInterpreter
@brief Creates a copy of self
include_expansion
method descriptor
include_expansion() -> List[str]
@brief Provides include expansion as defined by the interpreter The return value will be a two-element array with the encoded file path and the include-expanded text.
This method has been introduced in version 0.28.12.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> MacroInterpreter
@brief Creates a new object of this class
register
method descriptor
register() -> None
@brief Registers the macro interpreter @param name The interpreter name. This is an arbitrary string which should be unique.
Registration of the interpreter makes the object known to the system. After registration, macros whose interpreter is set to 'dsl' can use this object to run the script. For executing a script, the system will call the interpreter's \execute method.
Marker
@brief The floating-point coordinate marker object
The marker is a visual object that "marks" (highlights) a certain area of the layout, given by a database object. This object accepts database objects with floating-point coordinates in micron values.
Since version 0.29.3, markers can be attached to views in two ways: self-managed or persistent.
Self-managed markers are created with a view argument. When the variable goes out of scope, the and the Marker object is released, the marker vanishes. This was the only concept before 0.29.3:
@code view = ... # some LayoutView marker = RBA::Marker::new(view) @/code
Persistent markers on the other hand are attached to the view and stay within the view. To create a persistent marker, do not use a view argument to the constructor. Instead add them to the view using \LayoutView#add_marker. To remove persistent markers, use \LayoutView#clear_markers (removes all) or call _destroy on a specific marker:
@code view = ... # some LayoutView marker = RBA::Marker::new view.add_marker(marker) ... view.clear_markers @/code
Persistent markers do not need to be held in separate variables to keep them visible. In some applications this may be useful.
__doc__
class
__doc__ = '@brief The floating-point coordinate marker object\n\nThe marker is a visual object that "marks" (highlights) a \ncertain area of the layout, given by a database object. This object accepts database objects with floating-point coordinates in micron values.\n\nSince version 0.29.3, markers can be attached to views in two ways: self-managed or persistent.\n\nSelf-managed markers are created with a view argument. When the variable goes out of scope, the and the Marker object is released, the marker vanishes. This was the only concept before 0.29.3:\n\n@code\nview = ... # some LayoutView\nmarker = RBA::Marker::new(view)\n@/code\n\nPersistent markers on the other hand are attached to the view and stay within the view. To create a persistent marker, do not use a view argument to the constructor. Instead add them to the view using \\LayoutView#add_marker. To remove persistent markers, use \\LayoutView#clear_markers (removes all) or call \\_destroy on a specific marker:\n\n@code\nview = ... # some LayoutView\nmarker = RBA::Marker::new\nview.add_marker(marker)\n...\nview.clear_markers\n@/code\n\nPersistent markers do not need to be held in separate variables to keep them visible. In some applications this may be useful.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 412
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Marker' objects>
list of weak references to the object
color
class
color: int = <attribute 'color' of 'Marker' objects>
@brief Gets the color of the marker This value is valid only if \has_color? is true.
@brief Sets the color of the marker The color is a 32bit unsigned integer encoding the RGB values in the lower 3 bytes (blue in the lowest significant byte). The color can be reset with \reset_color, in which case, the default foreground color is used.
dismissable
class
dismissable: bool = <attribute 'dismissable' of 'Marker' objects>
@brief Gets a value indicating whether the marker can be hidden See \dismissable= for a description of this predicate.
@brief Sets a value indicating whether the marker can be hidden Dismissable markers can be hidden setting "View/Show Markers" to "off". The default setting is "false" meaning the marker can't be hidden.
This attribute has been introduced in version 0.25.4.
dither_pattern
class
dither_pattern: int = <attribute 'dither_pattern' of 'Marker' objects>
@brief Gets the stipple pattern index See \dither_pattern= for a description of the stipple pattern index.
@brief Sets the stipple pattern index A value of -1 or less than zero indicates that the marker is not filled. Otherwise, the value indicates which pattern to use for filling the marker.
frame_color
class
frame_color: int = <attribute 'frame_color' of 'Marker' objects>
@brief Gets the frame color of the marker This value is valid only if \has_frame_color? is true.The set method has been added in version 0.20.
@brief Sets the frame color of the marker The color is a 32bit unsigned integer encoding the RGB values in the lower 3 bytes (blue in the lowest significant byte). The color can be reset with \reset_frame_color, in which case the fill color is used. The set method has been added in version 0.20.
halo
class
halo: int = <attribute 'halo' of 'Marker' objects>
@brief Gets the halo flag See \halo= for a description of the halo flag.
@brief Sets the halo flag The halo flag is either -1 (for taking the default), 0 to disable the halo or 1 to enable it. If the halo is enabled, a pixel border with the background color is drawn around the marker, the vertices and texts.
line_style
class
line_style: int = <attribute 'line_style' of 'Marker' objects>
@brief Get the line style See \line_style= for a description of the line style index. This method has been introduced in version 0.25.
@brief Sets the line style The line style is given by an index. 0 is solid, 1 is dashed and so forth.
This method has been introduced in version 0.25.
line_width
class
line_width: int = <attribute 'line_width' of 'Marker' objects>
@brief Gets the line width of the marker See \line_width= for a description of the line width.
@brief Sets the line width of the marker This is the width of the line drawn for the outline of the marker.
vertex_size
class
vertex_size: int = <attribute 'vertex_size' of 'Marker' objects>
@brief Gets the vertex size of the marker See \vertex_size= for a description.
@brief Sets the vertex size of the marker This is the size of the rectangles drawn for the vertices object.
__init__
method descriptor
__init__() -> None
@brief Creates a marker
A marker is always associated with a view, in which it is shown. The view this marker is associated with must be passed to the constructor.
See the class description about the options for attaching markers to a view.
The 'view' argument is optional since version 0.29.3.
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
has_color
method descriptor
has_color() -> bool
@brief Returns a value indicating whether the marker has a specific color
has_frame_color
method descriptor
has_frame_color() -> bool
@brief Returns a value indicating whether the marker has a specific frame color The set method has been added in version 0.20.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> Marker
@brief Creates a marker
A marker is always associated with a view, in which it is shown. The view this marker is associated with must be passed to the constructor.
See the class description about the options for attaching markers to a view.
The 'view' argument is optional since version 0.29.3.
reset_color
method descriptor
reset_color() -> None
@brief Resets the color of the marker See \set_color for a description of the color property of the marker.
reset_frame_color
method descriptor
reset_frame_color() -> None
@brief Resets the frame color of the marker See \set_frame_color for a description of the frame color property of the marker.The set method has been added in version 0.20.
set
method descriptor
set(box: db.DBox) -> None
set(edge: db.DEdge) -> None
set(path: db.DPath) -> None
set(polygon: db.DPolygon) -> None
set(text: db.DText) -> None
set()
@brief Sets the polygon the marker is to display
Makes the marker show a polygon. The polygon must be given in micron units. The set method has been added in version 0.20.
set_box
method descriptor
set_box() -> None
@brief Sets the box the marker is to display
Makes the marker show a box. The box must be given in micron units. If the box is empty, no marker is drawn. The set method has been added in version 0.20.
set_edge
method descriptor
set_edge() -> None
@brief Sets the edge the marker is to display
Makes the marker show a edge. The edge must be given in micron units. The set method has been added in version 0.20.
set_path
method descriptor
set_path() -> None
@brief Sets the path the marker is to display
Makes the marker show a path. The path must be given in micron units. The set method has been added in version 0.20.
set_polygon
method descriptor
set_polygon() -> None
@brief Sets the polygon the marker is to display
Makes the marker show a polygon. The polygon must be given in micron units. The set method has been added in version 0.20.
set_text
method descriptor
set_text() -> None
@brief Sets the text the marker is to display
Makes the marker show a text. The text must be given in micron units. The set method has been added in version 0.20.
ObjectInstPath
@brief A class describing a selected shape or instance
A shape or instance is addressed by a path which describes all instances leading to the specified object. These instances are described through \InstElement objects, which specify the instance and, in case of array instances, the specific array member. For shapes, additionally the layer and the shape itself is specified. The ObjectInstPath objects encapsulates both forms, which can be distinguished with the \is_cell_inst? predicate.
An instantiation path leads from a top cell down to the container cell which either holds the shape or the instance. The top cell can be obtained through the \top attribute, the container cell through the \source attribute. Both are cell indexes which can be converted to \Cell objects through the \Layout#cell. In case of objects located in the top cell, \top and \source refer to the same cell. The first element of the instantiation path is the instance located within the top cell leading to the first child cell. The second element leads to the next child cell and so forth. \path_nth can be used to obtain a specific element of the path.
The \cv_index attribute specifies the cellview the selection applies to. Use \LayoutView#cellview to obtain the \CellView object from the index.
The shape or instance the selection refers to can be obtained with \shape and \inst respectively. Use \is_cell_inst? to decide whether the selection refers to an instance or not.
The ObjectInstPath class plays a role when retrieving and modifying the selection of shapes and instances through \LayoutView#object_selection, \LayoutView#object_selection=, \LayoutView#select_object and \LayoutView#unselect_object. \ObjectInstPath objects can be modified to reflect a new selection, but the new selection becomes active only after it is installed in the view. The following sample demonstrates that. It implements a function to convert all shapes to polygons:
@code mw = RBA::Application::instance::main_window view = mw.current_view
begin
view.transaction("Convert selected shapes to polygons")
sel = view.object_selection
sel.each do |s| if !s.is_cell_inst? && !s.shape.is_text? ly = view.cellview(s.cv_index).layout # convert to polygon s.shape.polygon = s.shape.polygon end end
view.object_selection = sel
ensure view.commit end @/code
Note, that without resetting the selection in the above example, the application might raise errors because after modifying the selected objects, the current selection will no longer be valid. Establishing a new valid selection in the way shown above will help avoiding this issue.
__doc__
class
__doc__ = '@brief A class describing a selected shape or instance\n\nA shape or instance is addressed by a path which describes all instances leading to the specified\nobject. These instances are described through \\InstElement objects, which specify the instance and, in case of array instances, the specific array member.\nFor shapes, additionally the layer and the shape itself is specified. The ObjectInstPath objects\nencapsulates both forms, which can be distinguished with the \\is_cell_inst? predicate.\n\nAn instantiation path leads from a top cell down to the container cell which either holds the shape or the instance.\nThe top cell can be obtained through the \\top attribute, the container cell through the \\source attribute. Both are cell indexes which can be converted to \\Cell objects through the \\Layout#cell. In case of objects located in the top cell, \\top and \\source refer to the same cell.\nThe first element of the instantiation path is the instance located within the top cell leading to the first child cell. The second element leads to the next child cell and so forth. \\path_nth can be used to obtain a specific element of the path.\n\nThe \\cv_index attribute specifies the cellview the selection applies to. Use \\LayoutView#cellview to obtain the \\CellView object from the index.\n\nThe shape or instance the selection refers to can be obtained with \\shape and \\inst respectively. Use \\is_cell_inst? to decide whether the selection refers to an instance or not.\n\nThe ObjectInstPath class plays a role when retrieving and modifying the selection of shapes and instances through \\LayoutView#object_selection, \\LayoutView#object_selection=, \\LayoutView#select_object and \\LayoutView#unselect_object. \\ObjectInstPath objects can be modified to reflect a new selection, but the new selection becomes active only after it is installed in the view. The following sample demonstrates that. It implements a function to convert all shapes to polygons:\n\n@code\nmw = RBA::Application::instance::main_window\nview = mw.current_view\n\nbegin\n\n view.transaction("Convert selected shapes to polygons")\n\n sel = view.object_selection\n\n sel.each do |s|\n if !s.is_cell_inst? && !s.shape.is_text?\n ly = view.cellview(s.cv_index).layout\n # convert to polygon\n s.shape.polygon = s.shape.polygon\n end\n end\n \n view.object_selection = sel\n\nensure\n view.commit\nend\n@/code\n\nNote, that without resetting the selection in the above example, the application might raise errors because after modifying the selected objects, the current selection will no longer be valid. Establishing a new valid selection in the way shown above will help avoiding this issue.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 435
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'ObjectInstPath' objects>
list of weak references to the object
cv_index
class
cv_index: int = <attribute 'cv_index' of 'ObjectInstPath' objects>
@brief Gets the cellview index that describes which cell view the shape or instance is located in
@brief Sets the cellview index that describes which cell view the shape or instance is located in
This method has been introduced in version 0.24.
layer
class
layer: Any = <attribute 'layer' of 'ObjectInstPath' objects>
@brief Gets the layer index that describes which layer the selected shape is on
Starting with version 0.27, this method returns nil for this property if \is_cell_inst? is false - i.e. the selection does not represent a shape.
@brief Sets to the layer index that describes which layer the selected shape is on
Setting the layer property to a valid layer index makes the path a shape selection path. Setting the layer property to a negative layer index makes the selection an instance selection.
This method has been introduced in version 0.24.
path
class
path: List[InstElement] = <attribute 'path' of 'ObjectInstPath' objects>
@brief Gets the instantiation path The path is a sequence of \InstElement objects leading to the target object.
This method was introduced in version 0.26.
@brief Sets the instantiation path
This method was introduced in version 0.26.
seq
class
seq: int = <attribute 'seq' of 'ObjectInstPath' objects>
@brief Gets the sequence number
The sequence number describes when the item was selected. A sequence number of 0 indicates that the item was selected in the first selection action (without 'Shift' pressed).
@brief Sets the sequence number
See \seq for a description of this property.
This method was introduced in version 0.24.
shape
class
shape: Any = <attribute 'shape' of 'ObjectInstPath' objects>
@brief Gets the selected shape
The shape object may be modified. This does not have an immediate effect on the selection. Instead, the selection must be set in the view using \LayoutView#object_selection= or \LayoutView#select_object.
This method delivers valid results only for object selections that represent shapes. Starting with version 0.27, this method returns nil for this property if \is_cell_inst? is false.
@brief Sets the shape object that describes the selected shape geometrically
When using this setter, the layer index must be set to a valid layout layer (see \layer=). Setting both properties makes the selection a shape selection.
This method has been introduced in version 0.24.
top
class
top: int = <attribute 'top' of 'ObjectInstPath' objects>
@brief Gets the cell index of the top cell the selection applies to
The top cell is identical to the current cell provided by the cell view. It is the cell from which is instantiation path originates and the container cell if no instantiation path is set.
This method has been introduced in version 0.24.
@brief Sets the cell index of the top cell the selection applies to
See \top_cell for a description of this property.
This method has been introduced in version 0.24.
__copy__
method descriptor
__copy__() -> ObjectInstPath
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> ObjectInstPath
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Equality of two ObjectInstPath objects Note: this operator returns true if both instance paths refer to the same object, not just identical ones.
This method has been introduced with version 0.24.
__init__
method descriptor
__init__() -> None
@brief Creates a new path object from a \RecursiveShapeIterator Use this constructor to quickly turn a recursive shape iterator delivery into a shape selection.
__lt__
method descriptor
__lt__() -> bool
@brief Provides an order criterion for two ObjectInstPath objects Note: this operator is just provided to establish any order, not a particular one.
This method has been introduced with version 0.24.
__ne__
method descriptor
__ne__() -> bool
@brief Inequality of two ObjectInstPath objects See the comments on the == operator.
This method has been introduced with version 0.24.
append_path
method descriptor
append_path() -> None
@brief Appends an element to the instantiation path
This method allows building of an instantiation path pointing to the selected object. For an instance selection, the last component added is the instance which is selected. For a shape selection, the path points to the cell containing the selected shape.
This method was introduced in version 0.24.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
cell_index
method descriptor
cell_index() -> int
@brief Gets the cell index of the cell that the selection applies to. This method returns the cell index that describes which cell the selected shape is located in or the cell whose instance is selected if \is_cell_inst? is true. This property is set implicitly by setting the top cell and adding elements to the instantiation path. To obtain the index of the container cell, use \source.
clear_path
method descriptor
clear_path() -> None
@brief Clears the instantiation path
This method was introduced in version 0.24.
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dtrans
method descriptor
dtrans() -> db.DCplxTrans
@brief Gets the transformation applicable for the shape in micron space.
This method returns the same transformation than \trans, but applicable to objects in micrometer units:
@code
renders the micrometer-unit polygon in top cell coordinates:
dpolygon_in_top = sel.dtrans * sel.shape.dpolygon @/code
This method is not applicable to instance selections. A more generic attribute is \source_dtrans.
The method has been introduced in version 0.25.
dup
method descriptor
dup() -> ObjectInstPath
@brief Creates a copy of self
each_inst
method descriptor
each_inst() -> Iterator[db.InstElement]
@brief Yields the instantiation path
The instantiation path describes by an sequence of \InstElement objects the path by which the cell containing the selected shape is found from the cell view's current cell. If this object represents an instance, the path will contain the selected instance as the last element. The elements are delivered top down.
inst
method descriptor
inst() -> db.Instance
@brief Deliver the instance represented by this selection
This method delivers valid results only if \is_cell_inst? is true. It returns the instance reference (an \Instance object) that this selection represents.
This property is set implicitly by adding instance elements to the instantiation path.
This method has been added in version 0.16.
is_cell_inst
method descriptor
is_cell_inst() -> bool
@brief True, if this selection represents a cell instance
If this attribute is true, the shape reference and layer are not valid.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
is_valid
method descriptor
is_valid() -> bool
@brief Gets a value indicating whether the instance path refers to a valid object in the context of the given view
This predicate has been introduced in version 0.27.12.
layout
method descriptor
layout() -> db.Layout
@brief Gets the Layout object the selected object lives in.
This method returns the \Layout object that the selected object lives in. This method may return nil, if the selection does not point to a valid object.
This method has been introduced in version 0.25.
new
builtin
new() -> ObjectInstPath
@brief Creates a new path object from a \RecursiveShapeIterator Use this constructor to quickly turn a recursive shape iterator delivery into a shape selection.
path_length
method descriptor
path_length() -> int
@brief Returns the length of the path (number of elements delivered by \each_inst)
This method has been added in version 0.16.
path_nth
method descriptor
path_nth() -> db.InstElement
@brief Returns the nth element of the path (similar to \each_inst but with direct access through the index)
@param n The index of the element to retrieve (0..\path_length-1) This method has been added in version 0.16.
source
method descriptor
source() -> int
@brief Returns to the cell index of the cell that the selected element resides inside.
If this reference represents a cell instance, this method delivers the index of the cell in which the cell instance resides. Otherwise, this method returns the same value than \cell_index.
This property is set implicitly by setting the top cell and adding elements to the instantiation path.
This method has been added in version 0.16.
source_dtrans
method descriptor
source_dtrans() -> db.DCplxTrans
@brief Gets the transformation applicable for an instance and shape in micron space.
This method returns the same transformation than \source_trans, but applicable to objects in micrometer units:
@code
renders the cell instance as seen from top level:
dcell_inst_in_top = sel.source_dtrans * sel.inst.dcell_inst @/code
The method has been introduced in version 0.25.
source_trans
method descriptor
source_trans() -> db.ICplxTrans
@brief Gets the transformation applicable for an instance and shape.
If this object represents a shape, this transformation describes how the selected shape is transformed into the current cell of the cell view. If this object represents an instance, this transformation describes how the selected instance is transformed into the current cell of the cell view. This method is similar to \trans, except that the resulting transformation does not include the instance transformation if the object represents an instance.
This property is set implicitly by setting the top cell and adding elements to the instantiation path.
This method has been added in version 0.16.
trans
method descriptor
trans() -> db.ICplxTrans
@brief Gets the transformation applicable for the shape.
If this object represents a shape, this transformation describes how the selected shape is transformed into the current cell of the cell view. Basically, this transformation is the accumulated transformation over the instantiation path. If the ObjectInstPath represents a cell instance, this includes the transformation of the selected instance as well.
This property is set implicitly by setting the top cell and adding elements to the instantiation path. This method is not applicable for instance selections. A more generic attribute is \source_trans.
PixelBuffer
@brief A simplistic pixel buffer representing an image of ARGB32 or RGB32 values
This object is mainly provided for offline rendering of layouts in Qt-less environments. It supports a rectangular pixel space with color values encoded in 32bit integers. It supports transparency through an optional alpha channel. The color format for a pixel is "0xAARRGGBB" where 'AA' is the alpha value which is ignored in non-transparent mode.
This class supports basic operations such as initialization, single-pixel access and I/O to PNG.
This class has been introduced in version 0.28.
__doc__
class
__doc__ = '@brief A simplistic pixel buffer representing an image of ARGB32 or RGB32 values\n\nThis object is mainly provided for offline rendering of layouts in Qt-less environments.\nIt supports a rectangular pixel space with color values encoded in 32bit integers. It supports transparency through an optional alpha channel. The color format for a pixel is "0xAARRGGBB" where \'AA\' is the alpha value which is ignored in non-transparent mode.\n\nThis class supports basic operations such as initialization, single-pixel access and I/O to PNG.\n\nThis class has been introduced in version 0.28.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 227
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PixelBuffer' objects>
list of weak references to the object
transparent
class
transparent: bool = <attribute 'transparent' of 'PixelBuffer' objects>
@brief Gets a flag indicating whether the pixel buffer supports an alpha channel
@brief Sets a flag indicating whether the pixel buffer supports an alpha channel
By default, the pixel buffer does not support an alpha channel.
__copy__
method descriptor
__copy__() -> PixelBuffer
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> PixelBuffer
@brief Creates a copy of self
__eq__
method descriptor
__eq__() -> bool
@brief Returns a value indicating whether self is identical to the other image
__init__
method descriptor
__init__() -> None
@brief Creates a pixel buffer object
@param width The width in pixels @param height The height in pixels
The pixels are basically uninitialized. You will need to use \fill to initialize them to a certain value.
__ne__
method descriptor
__ne__() -> bool
@brief Returns a value indicating whether self is not identical to the other image
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
diff
method descriptor
diff() -> PixelBuffer
@brief Creates a difference image
This method is provided to support transfer of image differences - i.e. small updates instead of full images. It works for non-transparent images only and generates an image with transpareny enabled and with the new pixel values for pixels that have changed. The alpha value will be 0 for identical images and 255 for pixels with different values. This way, the difference image can be painted over the original image to generate the new image.
dup
method descriptor
dup() -> PixelBuffer
@brief Creates a copy of self
fill
method descriptor
fill() -> None
@brief Fills the pixel buffer with the given pixel value
from_png_data
builtin
from_png_data() -> PixelBuffer
@brief Reads the pixel buffer from a PNG byte stream This method may not be available if PNG support is not compiled into KLayout.
height
method descriptor
height() -> int
@brief Gets the height of the pixel buffer in pixels
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> PixelBuffer
@brief Creates a pixel buffer object
@param width The width in pixels @param height The height in pixels
The pixels are basically uninitialized. You will need to use \fill to initialize them to a certain value.
patch
method descriptor
patch() -> None
@brief Patches another pixel buffer into this one
This method is the inverse of \diff - it will patch the difference image created by diff into this pixel buffer. Note that this method will not do true alpha blending and requires the other pixel buffer to have the same format than self. Self will be modified by this operation.
pixel
method descriptor
pixel() -> int
@brief Gets the value of the pixel at position x, y
read_png
builtin
read_png() -> PixelBuffer
@brief Reads the pixel buffer from a PNG file This method may not be available if PNG support is not compiled into KLayout.
set_pixel
method descriptor
set_pixel() -> None
@brief Sets the value of the pixel at position x, y
swap
method descriptor
swap() -> None
@brief Swaps data with another PixelBuffer object
to_png_data
method descriptor
to_png_data() -> bytes
@brief Converts the pixel buffer to a PNG byte stream This method may not be available if PNG support is not compiled into KLayout.
width
method descriptor
width() -> int
@brief Gets the width of the pixel buffer in pixels
write_png
method descriptor
write_png() -> None
@brief Writes the pixel buffer to a PNG file This method may not be available if PNG support is not compiled into KLayout.
Plugin
@brief The plugin object
This class provides the actual plugin implementation. Each view gets its own instance of the plugin class. The plugin factory \PluginFactory class must be specialized to provide a factory for new objects of the Plugin class. See the documentation there for details about the plugin mechanism and the basic concepts.
This class has been introduced in version 0.22.
__doc__
class
__doc__ = '@brief The plugin object\n\nThis class provides the actual plugin implementation. Each view gets its own instance of the plugin class. The plugin factory \\PluginFactory class must be specialized to provide a factory for new objects of the Plugin class. See the documentation there for details about the plugin mechanism and the basic concepts.\n\nThis class has been introduced in version 0.22.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 417
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'Plugin' objects>
list of weak references to the object
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
grab_mouse
method descriptor
grab_mouse() -> None
@brief Redirects mouse events to this plugin, even if the plugin is not active.
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> Plugin
@brief Creates a new object of this class
set_cursor
method descriptor
set_cursor() -> None
@brief Sets the cursor in the view area to the given type Setting the cursor has an effect only inside event handlers, i.e. mouse_press_event. The cursor is not set permanently. Is is reset in the mouse move handler unless a button is pressed or the cursor is explicitly set again in the mouse_move_event.
The cursor type is one of the cursor constants in the \Cursor class, i.e. 'CursorArrow' for the normal cursor.
ungrab_mouse
method descriptor
ungrab_mouse() -> None
@brief Removes a mouse grab registered with \grab_mouse.
PluginFactory
@brief The plugin framework's plugin factory object
Plugins are components that extend KLayout's functionality in various aspects. Scripting support exists currently for providing mouse mode handlers and general on-demand functionality connected with a menu entry.
Plugins are objects that implement the \Plugin interface. Each layout view is associated with one instance of such an object. The PluginFactory is a singleton which is responsible for creating \Plugin objects and providing certain configuration information such as where to put the menu items connected to this plugin and what configuration keys are used.
An implementation of PluginFactory must at least provide an implementation of \create_plugin. This method must instantiate a new object of the specific plugin.
After the factory has been created, it must be registered in the system using one of the \register methods. It is therefore recommended to put the call to \register at the end of the "initialize" method. For the registration to work properly, the menu items must be defined before \register is called.
The following features can also be implemented:
@
-
@
- Reserve keys in the configuration file using \add_option in the constructor@ @
- Create menu items by using \add_menu_entry in the constructor@ @
- Set the title for the mode entry that appears in the tool bar using the \register argument@ @
- Provide global functionality (independent from the layout view) using \configure or \menu_activated@ @
This is a simple example for a plugin in Ruby. It switches the mouse cursor to a 'cross' cursor when it is active:
@code class PluginTestFactory < RBA::PluginFactory
# Constructor def initialize # registers the new plugin class at position 100000 (at the end), with name # "my_plugin_test" and title "My plugin test" register(100000, "my_plugin_test", "My plugin test") end
# Create a new plugin instance of the custom type def create_plugin(manager, dispatcher, view) return PluginTest.new end
end
The plugin class
class PluginTest < RBA::Plugin def mouse_moved_event(p, buttons, prio) if prio # Set the cursor to cross if our plugin is active. set_cursor(RBA::Cursor::Cross) end # Returning false indicates that we don't want to consume the event. # This way for example the cursor position tracker still works. false end def mouse_click_event(p, buttons, prio) if prio puts "mouse button clicked." # This indicates we want to consume the event and others don't receive the mouse click # with prio = false. return true end # don't consume the event if we are not active. false end end
Instantiate the new plugin factory.
PluginTestFactory.new @/code
This class has been introduced in version 0.22.
__doc__
class
__doc__ = '@brief The plugin framework\'s plugin factory object\n\nPlugins are components that extend KLayout\'s functionality in various aspects. Scripting support exists currently for providing mouse mode handlers and general on-demand functionality connected with a menu entry.\n\nPlugins are objects that implement the \\Plugin interface. Each layout view is associated with one instance of such an object. The PluginFactory is a singleton which is responsible for creating \\Plugin objects and providing certain configuration information such as where to put the menu items connected to this plugin and what configuration keys are used.\n\nAn implementation of PluginFactory must at least provide an implementation of \\create_plugin. This method must instantiate a new object of the specific plugin.\n\nAfter the factory has been created, it must be registered in the system using one of the \\register methods. It is therefore recommended to put the call to \\register at the end of the "initialize" method. For the registration to work properly, the menu items must be defined before \\register is called.\n\nThe following features can also be implemented:\n\n@<ul>\n @<li>Reserve keys in the configuration file using \\add_option in the constructor@</li>\n @<li>Create menu items by using \\add_menu_entry in the constructor@</li>\n @<li>Set the title for the mode entry that appears in the tool bar using the \\register argument@</li>\n @<li>Provide global functionality (independent from the layout view) using \\configure or \\menu_activated@</li>\n@</ul>\n\nThis is a simple example for a plugin in Ruby. It switches the mouse cursor to a \'cross\' cursor when it is active:\n\n@code\nclass PluginTestFactory < RBA::PluginFactory\n\n # Constructor\n def initialize\n # registers the new plugin class at position 100000 (at the end), with name\n # "my_plugin_test" and title "My plugin test"\n register(100000, "my_plugin_test", "My plugin test")\n end\n \n # Create a new plugin instance of the custom type\n def create_plugin(manager, dispatcher, view)\n return PluginTest.new\n end\n\nend\n\n# The plugin class\nclass PluginTest < RBA::Plugin\n def mouse_moved_event(p, buttons, prio)\n if prio\n # Set the cursor to cross if our plugin is active.\n set_cursor(RBA::Cursor::Cross)\n end\n # Returning false indicates that we don\'t want to consume the event.\n # This way for example the cursor position tracker still works.\n false\n end\n def mouse_click_event(p, buttons, prio)\n if prio\n puts "mouse button clicked."\n # This indicates we want to consume the event and others don\'t receive the mouse click\n # with prio = false.\n return true\n end\n # don\'t consume the event if we are not active.\n false\n end\nend\n\n# Instantiate the new plugin factory.\nPluginTestFactory.new\n@/code\n\nThis class has been introduced in version 0.22.\n'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__gsi_id__
class
__gsi_id__ = 416
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
__module__
class
__module__ = 'klayout.pyacore'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__weakref__
class
__weakref__ = <attribute '__weakref__' of 'PluginFactory' objects>
list of weak references to the object
has_tool_entry
class
has_tool_entry: None = <attribute 'has_tool_entry' of 'PluginFactory' objects>
@brief Enables or disables the tool bar entry Initially this property is set to true. This means that the plugin will have a visible entry in the toolbar. This property can be set to false to disable this feature. In that case, the title and icon given on registration will be ignored.
__copy__
method descriptor
__copy__() -> PluginFactory
@brief Creates a copy of self
__deepcopy__
method descriptor
__deepcopy__() -> PluginFactory
@brief Creates a copy of self
__init__
method descriptor
__init__() -> None
@brief Creates a new object of this class
add_config_menu_item
method descriptor
add_config_menu_item() -> None
@brief Adds a configuration menu item
Menu items created this way will send a configuration request with 'cname' as the configuration parameter name and 'cvalue' as the configuration parameter value.
This method has been introduced in version 0.27.
add_menu_entry
method descriptor
add_menu_entry(menu_name: str, insert_pos: str) -> None
add_menu_entry(symbol: str, menu_name: str, insert_pos: str, title: str) -> None
add_menu_entry(symbol: str, menu_name: str, insert_pos: str, title: str, sub_menu: bool) -> None
add_menu_entry()
@brief Specifies a menu item or sub-menu Similar to the previous form of "add_menu_entry", but this version allows also to create sub-menus by setting the last parameter to "true".
With version 0.27 it's more convenient to use \add_submenu.
add_menu_item_clone
method descriptor
add_menu_item_clone() -> None
@brief Specifies a menu item as a clone of another one Using this method, a menu item can be made a clone of another entry (given as path by 'copy_from'). The new item will share the \Action object with the original one, so manipulating the action will change both the original entry and the new entry.
This method has been introduced in version 0.27.
add_option
method descriptor
add_option() -> None
@brief Specifies configuration variables. Call this method in the factory constructor to add configuration key/value pairs to the configuration repository. Without specifying configuration variables, the status of a plugin cannot be persisted.
Once the configuration variables are known, they can be retrieved on demand using "get_config" from \MainWindow or listening to \configure callbacks (either in the factory or the plugin instance). Configuration variables can be set using "set_config" from \MainWindow. This scheme also works without registering the configuration options, but doing so has the advantage that it is guaranteed that a variable with this keys exists and has the given default value initially.
add_submenu
method descriptor
add_submenu() -> None
@brief Specifies a menu item or sub-menu
This method has been introduced in version 0.27.
assign
method descriptor
assign() -> None
@brief Assigns another object to self
create
method descriptor
create() -> None
@brief 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.
destroy
method descriptor
destroy() -> None
@brief 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.
destroyed
method descriptor
destroyed() -> bool
@brief 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.
dup
method descriptor
dup() -> PluginFactory
@brief Creates a copy of self
is_const_object
method descriptor
is_const_object() -> bool
@brief 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.
new
builtin
new() -> PluginFactory
@brief Creates a new object of this class
register
method descriptor
register(position: int, name: str, title: str) -> None
register(position: int, name: str, title: str, icon: str) -> None
register()
@brief Registers the plugin factory @param position An integer that determines the order in which the plugins are created. The internal plugins use the values from 1000 to 50000. @param name The plugin name. This is an arbitrary string which should be unique. Hence it is recommended to use a unique prefix, i.e. "myplugin::ThePluginClass". @param title The title string which is supposed to appear in the tool bar and menu related to this plugin. @param icon The path to the icon that appears in the tool bar and menu related to this plugin.
This version also allows registering an icon for the tool bar.
Registration of the plugin factory makes the object known to the system. Registration requires that the menu items have been set already. Hence it is recommended to put the registration at the end of the initialization method of the factory class.