From 5a1e845a641f2971f0cfd8eaf10181464ac434b4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 11 Mar 2023 19:55:06 +0100 Subject: [PATCH] [consider merging] regenerating pyi stubs, sorting methods by name for better stability of files, small patch (missing box ctor arg names) --- scripts/stubgen.py | 19 +- src/db/db/gsiDeclDbBox.cc | 4 +- src/pymod/distutils_src/klayout/dbcore.pyi | 67440 +++++++++--------- src/pymod/distutils_src/klayout/laycore.pyi | 15054 ++-- src/pymod/distutils_src/klayout/rdbcore.pyi | 776 +- src/pymod/distutils_src/klayout/tlcore.pyi | 3072 +- src/pymod/pymod.pri | 17 +- 7 files changed, 43574 insertions(+), 42808 deletions(-) diff --git a/scripts/stubgen.py b/scripts/stubgen.py index 98943562d..18439602e 100644 --- a/scripts/stubgen.py +++ b/scripts/stubgen.py @@ -209,9 +209,14 @@ class PropertyStub(Stub): class ClassStub(Stub): indent_docstring: bool = True +def get_child_classes(c: ktl.Class): + child_classes = [] + for c_child in c.each_child_class(): + child_classes.append(c_child) + return sorted(child_classes, key=lambda cls: cls.name()) def get_py_child_classes(c: ktl.Class): - for c_child in c.each_child_class(): + for c_child in get_child_classes(c): yield c_child @@ -390,9 +395,9 @@ def get_py_methods( ) ) - boundmethods = sorted(boundmethods) - properties = sorted(properties) - classmethods = sorted(classmethods) + boundmethods = sorted(boundmethods, key=lambda m: m.signature) + properties = sorted(properties, key=lambda m: m.signature) + classmethods = sorted(classmethods, key=lambda m: m.signature) return_list: List[Stub] = properties + classmethods + boundmethods @@ -415,7 +420,7 @@ def get_class_stub( signature="class " + full_name + base, docstring=c.doc(), name=full_name ) child_attributes = get_py_methods(c) - for child_c in c.each_child_class(): + for child_c in get_child_classes(c): _cstub.child_stubs.append( get_class_stub( child_c, @@ -434,7 +439,7 @@ def get_classes(module: str) -> List[ktl.Class]: if c.module() != module: continue _classes.append(c) - return _classes + return sorted(_classes, key=lambda cls: cls.name()) def get_module_stubs(module: str) -> List[ClassStub]: @@ -457,7 +462,7 @@ def print_mod(module, dependencies): if __name__ == "__main__": if len(argv) < 2: - print("Specity module in argument") + print("Specify module in argument") exit(1) if len(argv) == 2: print_mod(argv[1], []) diff --git a/src/db/db/gsiDeclDbBox.cc b/src/db/db/gsiDeclDbBox.cc index b55d8a915..ab6b02db2 100644 --- a/src/db/db/gsiDeclDbBox.cc +++ b/src/db/db/gsiDeclDbBox.cc @@ -141,14 +141,14 @@ struct box_defs "box is also an empty box. The width, height, p1 and p2 attributes of an empty box are undefined. " "Use \\empty? to get a value indicating whether the box is empty.\n" ) + - constructor ("new", &new_sq, + constructor ("new", &new_sq, gsi::arg ("w"), "@brief Creates a square with the given dimensions centered around the origin\n" "\n" "Note that for integer-unit boxes, the dimension has to be an even number to avoid rounding.\n" "\n" "This convenience constructor has been introduced in version 0.28." ) + - constructor ("new", &new_wh, + constructor ("new", &new_wh, gsi::arg ("w"), gsi::arg ("h"), "@brief Creates a rectangle with given width and height, centered around the origin\n" "\n" "Note that for integer-unit boxes, the dimensions have to be an even number to avoid rounding.\n" diff --git a/src/pymod/distutils_src/klayout/dbcore.pyi b/src/pymod/distutils_src/klayout/dbcore.pyi index fcf7dd1bf..36e46e0f4 100644 --- a/src/pymod/distutils_src/klayout/dbcore.pyi +++ b/src/pymod/distutils_src/klayout/dbcore.pyi @@ -94,16 +94,6 @@ class Box: """ @overload @classmethod - def new(cls, arg0: int) -> Box: - r""" - @brief Creates a square with the given dimensions centered around the origin - - Note that for integer-unit boxes, the dimension has to be an even number to avoid rounding. - - This convenience constructor has been introduced in version 0.28. - """ - @overload - @classmethod def new(cls, dbox: DBox) -> Box: r""" @brief Creates an integer coordinate box from a floating-point coordinate box @@ -112,13 +102,12 @@ class Box: """ @overload @classmethod - def new(cls, arg0: int, arg1: int) -> Box: + def new(cls, left: int, bottom: int, right: int, top: int) -> Box: r""" - @brief Creates a rectangle with given width and height, centered around the origin + @brief Creates a box with four coordinates - Note that for integer-unit boxes, the dimensions have to be an even number to avoid rounding. - This convenience constructor has been introduced in version 0.28. + Four coordinates are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. """ @overload @classmethod @@ -131,12 +120,23 @@ class Box: """ @overload @classmethod - def new(cls, left: int, bottom: int, right: int, top: int) -> Box: + def new(cls, w: int) -> Box: r""" - @brief Creates a box with four coordinates + @brief Creates a square with the given dimensions centered around the origin + Note that for integer-unit boxes, the dimension has to be an even number to avoid rounding. - Four coordinates are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. + This convenience constructor has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, w: int, h: int) -> Box: + r""" + @brief Creates a rectangle with given width and height, centered around the origin + + Note that for integer-unit boxes, the dimensions have to be an even number to avoid rounding. + + This convenience constructor has been introduced in version 0.28. """ @classmethod def world(cls) -> Box: @@ -226,15 +226,6 @@ class Box: Empty boxes don't modify a box when joined with it. The intersection between an empty and any other box is also an empty box. The width, height, p1 and p2 attributes of an empty box are undefined. Use \empty? to get a value indicating whether the box is empty. """ @overload - def __init__(self, arg0: int) -> None: - r""" - @brief Creates a square with the given dimensions centered around the origin - - Note that for integer-unit boxes, the dimension has to be an even number to avoid rounding. - - This convenience constructor has been introduced in version 0.28. - """ - @overload def __init__(self, dbox: DBox) -> None: r""" @brief Creates an integer coordinate box from a floating-point coordinate box @@ -242,13 +233,12 @@ class Box: This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dbox'. """ @overload - def __init__(self, arg0: int, arg1: int) -> None: + def __init__(self, left: int, bottom: int, right: int, top: int) -> None: r""" - @brief Creates a rectangle with given width and height, centered around the origin + @brief Creates a box with four coordinates - Note that for integer-unit boxes, the dimensions have to be an even number to avoid rounding. - This convenience constructor has been introduced in version 0.28. + Four coordinates are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. """ @overload def __init__(self, lower_left: Point, upper_right: Point) -> None: @@ -259,12 +249,22 @@ class Box: Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. """ @overload - def __init__(self, left: int, bottom: int, right: int, top: int) -> None: + def __init__(self, w: int) -> None: r""" - @brief Creates a box with four coordinates + @brief Creates a square with the given dimensions centered around the origin + Note that for integer-unit boxes, the dimension has to be an even number to avoid rounding. - Four coordinates are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. + This convenience constructor has been introduced in version 0.28. + """ + @overload + def __init__(self, w: int, h: int) -> None: + r""" + @brief Creates a rectangle with given width and height, centered around the origin + + Note that for integer-unit boxes, the dimensions have to be an even number to avoid rounding. + + This convenience constructor has been introduced in version 0.28. """ def __lt__(self, box: Box) -> bool: r""" @@ -465,6 +465,17 @@ class Box: @return A reference to this box. """ @overload + def enlarge(self, dx: int, dy: int) -> Box: + r""" + @brief Enlarges the box by a certain amount. + + + This is a convenience method which takes two values instead of a Vector object. + This method has been introduced in version 0.23. + + @return A reference to this box. + """ + @overload def enlarge(self, enlargement: Vector) -> Box: r""" @brief Enlarges the box by a certain amount. @@ -484,17 +495,6 @@ class Box: @return A reference to this box. """ @overload - def enlarge(self, dx: int, dy: int) -> Box: - r""" - @brief Enlarges the box by a certain amount. - - - This is a convenience method which takes two values instead of a Vector object. - This method has been introduced in version 0.23. - - @return A reference to this box. - """ - @overload def enlarged(self, d: int) -> Box: r""" @brief Enlarges the box by a certain amount on all sides. @@ -505,6 +505,17 @@ class Box: @return The enlarged box. """ @overload + def enlarged(self, dx: int, dy: int) -> Box: + r""" + @brief Enlarges the box by a certain amount. + + + This is a convenience method which takes two values instead of a Vector object. + This method has been introduced in version 0.23. + + @return The enlarged box. + """ + @overload def enlarged(self, enlargement: Vector) -> Box: r""" @brief Returns the enlarged box. @@ -521,17 +532,6 @@ class Box: @param enlargement The grow or shrink amount in x and y direction - @return The enlarged box. - """ - @overload - def enlarged(self, dx: int, dy: int) -> Box: - r""" - @brief Enlarges the box by a certain amount. - - - This is a convenience method which takes two values instead of a Vector object. - This method has been introduced in version 0.23. - @return The enlarged box. """ def hash(self) -> int: @@ -684,689 +684,6 @@ class Box: @brief Gets the width of the box """ -class DBox: - r""" - @brief A box class with floating-point coordinates - - This object represents a box (a rectangular shape). - - The definition of the attributes is: p1 is the lower left point, p2 the - upper right one. If a box is constructed from two points (or four coordinates), the - coordinates are sorted accordingly. - - A box can be empty. An empty box represents no area - (not even a point). Empty boxes behave neutral with respect to most operations. - Empty boxes return true on \empty?. - - A box can be a point or a single - line. In this case, the area is zero but the box still - can overlap other boxes for example and it is not empty. - - See @The Database API@ for more details about the database objects. - """ - bottom: float - r""" - Getter: - @brief Gets the bottom coordinate of the box - - Setter: - @brief Sets the bottom coordinate of the box - """ - left: float - r""" - Getter: - @brief Gets the left coordinate of the box - - Setter: - @brief Sets the left coordinate of the box - """ - p1: DPoint - r""" - Getter: - @brief Gets the lower left point of the box - - Setter: - @brief Sets the lower left point of the box - """ - p2: DPoint - r""" - Getter: - @brief Gets the upper right point of the box - - Setter: - @brief Sets the upper right point of the box - """ - right: float - r""" - Getter: - @brief Gets the right coordinate of the box - - Setter: - @brief Sets the right coordinate of the box - """ - top: float - r""" - Getter: - @brief Gets the top coordinate of the box - - Setter: - @brief Sets the top coordinate of the box - """ - @classmethod - def from_ibox(cls, box: Box) -> DBox: - r""" - @brief Creates a floating-point coordinate box from an integer coordinate box - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ibox'. - """ - @classmethod - def from_s(cls, s: str) -> DBox: - r""" - @brief Creates a box object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - @overload - @classmethod - def new(cls) -> DBox: - r""" - @brief Creates an empty (invalid) box - - Empty boxes don't modify a box when joined with it. The intersection between an empty and any other box is also an empty box. The width, height, p1 and p2 attributes of an empty box are undefined. Use \empty? to get a value indicating whether the box is empty. - """ - @overload - @classmethod - def new(cls, arg0: float) -> DBox: - r""" - @brief Creates a square with the given dimensions centered around the origin - - Note that for integer-unit boxes, the dimension has to be an even number to avoid rounding. - - This convenience constructor has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, box: Box) -> DBox: - r""" - @brief Creates a floating-point coordinate box from an integer coordinate box - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ibox'. - """ - @overload - @classmethod - def new(cls, arg0: float, arg1: float) -> DBox: - r""" - @brief Creates a rectangle with given width and height, centered around the origin - - Note that for integer-unit boxes, the dimensions have to be an even number to avoid rounding. - - This convenience constructor has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, lower_left: DPoint, upper_right: DPoint) -> DBox: - r""" - @brief Creates a box from two points - - - Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. - """ - @overload - @classmethod - def new(cls, left: float, bottom: float, right: float, top: float) -> DBox: - r""" - @brief Creates a box with four coordinates - - - Four coordinates are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. - """ - @classmethod - def world(cls) -> DBox: - r""" - @brief Gets the 'world' box - The world box is the biggest box that can be represented. So it is basically 'all'. The world box behaves neutral on intersections for example. In other operations such as displacement or transformations, the world box may render unexpected results because of coordinate overflow. - - The world box can be used - @ul - @li for comparison ('==', '!=', '<') @/li - @li in union and intersection ('+' and '&') @/li - @li in relations (\contains?, \overlaps?, \touches?) @/li - @li as 'all' argument in region queries @/li - @/ul - - This method has been introduced in version 0.28. - """ - @overload - def __add__(self, box: DBox) -> DBox: - r""" - @brief Joins two boxes - - - The + operator joins the first box with the one given as - the second argument. Joining constructs a box that encloses - both boxes given. Empty boxes are neutral: they do not - change another box when joining. Overwrites this box - with the result. - - @param box The box to join with this box. - - @return The joined box - """ - @overload - def __add__(self, point: DPoint) -> DBox: - r""" - @brief Joins box with a point - - - The + operator joins a point with the box. The resulting box will enclose both the original box and the point. - - @param point The point to join with this box. - - @return The box joined with the point - """ - def __and__(self, box: DBox) -> DBox: - r""" - @brief Returns the intersection of this box with another box - - - The intersection of two boxes is the largest - box common to both boxes. The intersection may be - empty if both boxes to not touch. If the boxes do - not overlap but touch the result may be a single - line or point with an area of zero. Overwrites this box - with the result. - - @param box The box to take the intersection with - - @return The intersection box - """ - def __copy__(self) -> DBox: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DBox: - r""" - @brief Creates a copy of self - """ - def __eq__(self, box: object) -> bool: - r""" - @brief Returns true if this box is equal to the other box - Returns true, if this box and the given box are equal - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given box. This method enables boxes as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates an empty (invalid) box - - Empty boxes don't modify a box when joined with it. The intersection between an empty and any other box is also an empty box. The width, height, p1 and p2 attributes of an empty box are undefined. Use \empty? to get a value indicating whether the box is empty. - """ - @overload - def __init__(self, arg0: float) -> None: - r""" - @brief Creates a square with the given dimensions centered around the origin - - Note that for integer-unit boxes, the dimension has to be an even number to avoid rounding. - - This convenience constructor has been introduced in version 0.28. - """ - @overload - def __init__(self, box: Box) -> None: - r""" - @brief Creates a floating-point coordinate box from an integer coordinate box - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ibox'. - """ - @overload - def __init__(self, arg0: float, arg1: float) -> None: - r""" - @brief Creates a rectangle with given width and height, centered around the origin - - Note that for integer-unit boxes, the dimensions have to be an even number to avoid rounding. - - This convenience constructor has been introduced in version 0.28. - """ - @overload - def __init__(self, lower_left: DPoint, upper_right: DPoint) -> None: - r""" - @brief Creates a box from two points - - - Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. - """ - @overload - def __init__(self, left: float, bottom: float, right: float, top: float) -> None: - r""" - @brief Creates a box with four coordinates - - - Four coordinates are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. - """ - def __lt__(self, box: DBox) -> bool: - r""" - @brief Returns true if this box is 'less' than another box - Returns true, if this box is 'less' with respect to first and second point (in this order) - """ - @overload - def __mul__(self, box: DBox) -> DBox: - r""" - @brief Returns the convolution product from this box with another box - - - The * operator convolves the firstbox with the one given as - the second argument. The box resulting from "convolution" is the - outer boundary of the union set formed by placing - the second box at every point of the first. In other words, - the returned box of (p1,p2)*(q1,q2) is (p1+q1,p2+q2). - - @param box The box to convolve with this box. - - @return The convolved box - """ - @overload - def __mul__(self, scale_factor: float) -> DBox: - r""" - @brief Returns the scaled box - - - The * operator scales the box with the given factor and returns the result. - - This method has been introduced in version 0.22. - - @param scale_factor The scaling factor - - @return The scaled box - """ - def __ne__(self, box: object) -> bool: - r""" - @brief Returns true if this box is not equal to the other box - Returns true, if this box and the given box are not equal - """ - @overload - def __rmul__(self, box: DBox) -> DBox: - r""" - @brief Returns the convolution product from this box with another box - - - The * operator convolves the firstbox with the one given as - the second argument. The box resulting from "convolution" is the - outer boundary of the union set formed by placing - the second box at every point of the first. In other words, - the returned box of (p1,p2)*(q1,q2) is (p1+q1,p2+q2). - - @param box The box to convolve with this box. - - @return The convolved box - """ - @overload - def __rmul__(self, scale_factor: float) -> DBox: - r""" - @brief Returns the scaled box - - - The * operator scales the box with the given factor and returns the result. - - This method has been introduced in version 0.22. - - @param scale_factor The scaling factor - - @return The scaled box - """ - def __str__(self, dbu: Optional[float] = ...) -> str: - r""" - @brief Returns a string representing this box - - This string can be turned into a box again by using \from_s - . If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def area(self) -> float: - r""" - @brief Computes the box area - - Returns the box area or 0 if the box is empty - """ - def assign(self, other: DBox) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> DBox: - r""" - @brief Returns the bounding box - This method is provided for consistency of the shape API is returns the box itself. - - This method has been introduced in version 0.27. - """ - def center(self) -> DPoint: - r""" - @brief Gets the center of the box - """ - @overload - def contains(self, point: DPoint) -> bool: - r""" - @brief Returns true if the box contains the given point - - - Tests whether a point is inside the box. - It also returns true if the point is exactly on the box contour. - - @param p The point to test against. - - @return true if the point is inside the box. - """ - @overload - def contains(self, x: float, y: float) -> bool: - r""" - @brief Returns true if the box contains the given point - - - Tests whether a point (x, y) is inside the box. - It also returns true if the point is exactly on the box contour. - - @return true if the point is inside the box. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DBox: - r""" - @brief Creates a copy of self - """ - def empty(self) -> bool: - r""" - @brief Returns a value indicating whether the box is empty - - An empty box may be created with the default constructor for example. Such a box is neutral when combining it with other boxes and renders empty boxes if used in box intersections and false in geometrical relationship tests. - """ - @overload - def enlarge(self, d: float) -> DBox: - r""" - @brief Enlarges the box by a certain amount on all sides. - - This is a convenience method which takes one values instead of two values. It will apply the given enlargement in both directions. - This method has been introduced in version 0.28. - - @return A reference to this box. - """ - @overload - def enlarge(self, enlargement: DVector) -> DBox: - r""" - @brief Enlarges the box by a certain amount. - - - Enlarges the box by x and y value specified in the vector - passed. Positive values with grow the box, negative ones - will shrink the box. The result may be an empty box if the - box disappears. The amount specifies the grow or shrink - per edge. The width and height will change by twice the - amount. - Does not check for coordinate - overflows. - - @param enlargement The grow or shrink amount in x and y direction - - @return A reference to this box. - """ - @overload - def enlarge(self, dx: float, dy: float) -> DBox: - r""" - @brief Enlarges the box by a certain amount. - - - This is a convenience method which takes two values instead of a Vector object. - This method has been introduced in version 0.23. - - @return A reference to this box. - """ - @overload - def enlarged(self, d: float) -> DBox: - r""" - @brief Enlarges the box by a certain amount on all sides. - - This is a convenience method which takes one values instead of two values. It will apply the given enlargement in both directions. - This method has been introduced in version 0.28. - - @return The enlarged box. - """ - @overload - def enlarged(self, enlargement: DVector) -> DBox: - r""" - @brief Returns the enlarged box. - - - Enlarges the box by x and y value specified in the vector - passed. Positive values with grow the box, negative ones - will shrink the box. The result may be an empty box if the - box disappears. The amount specifies the grow or shrink - per edge. The width and height will change by twice the - amount. - Does not modify this box. Does not check for coordinate - overflows. - - @param enlargement The grow or shrink amount in x and y direction - - @return The enlarged box. - """ - @overload - def enlarged(self, dx: float, dy: float) -> DBox: - r""" - @brief Enlarges the box by a certain amount. - - - This is a convenience method which takes two values instead of a Vector object. - This method has been introduced in version 0.23. - - @return The enlarged box. - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given box. This method enables boxes as hash keys. - - This method has been introduced in version 0.25. - """ - def height(self) -> float: - r""" - @brief Gets the height of the box - """ - def inside(self, box: DBox) -> bool: - r""" - @brief Tests if this box is inside the argument box - - - Returns true, if this box is inside the given box, i.e. the box intersection renders this box - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_point(self) -> bool: - r""" - @brief Returns true, if the box is a single point - """ - @overload - def move(self, distance: DVector) -> DBox: - r""" - @brief Moves the box by a certain distance - - - Moves the box by a given offset and returns the moved - box. Does not check for coordinate overflows. - - @param distance The offset to move the box. - - @return A reference to this box. - """ - @overload - def move(self, dx: float, dy: float) -> DBox: - r""" - @brief Moves the box by a certain distance - - - This is a convenience method which takes two values instead of a Point object. - This method has been introduced in version 0.23. - - @return A reference to this box. - """ - @overload - def moved(self, distance: DVector) -> DBox: - r""" - @brief Returns the box moved by a certain distance - - - Moves the box by a given offset and returns the moved - box. Does not modify this box. Does not check for coordinate - overflows. - - @param distance The offset to move the box. - - @return The moved box. - """ - @overload - def moved(self, dx: float, dy: float) -> DBox: - r""" - @brief Moves the box by a certain distance - - - This is a convenience method which takes two values instead of a Point object. - This method has been introduced in version 0.23. - - @return The moved box. - """ - def overlaps(self, box: DBox) -> bool: - r""" - @brief Tests if this box overlaps the argument box - - - Returns true, if the intersection box of this box with the argument box exists and has a non-vanishing area - """ - def perimeter(self) -> float: - r""" - @brief Returns the perimeter of the box - - This method is equivalent to 2*(width+height). For empty boxes, this method returns 0. - - This method has been introduced in version 0.23. - """ - def to_itype(self, dbu: Optional[float] = ...) -> Box: - r""" - @brief Converts the box to an integer coordinate box - - The database unit can be specified to translate the floating-point coordinate box in micron units to an integer-coordinate box in database units. The boxes coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self, dbu: Optional[float] = ...) -> str: - r""" - @brief Returns a string representing this box - - This string can be turned into a box again by using \from_s - . If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - def touches(self, box: DBox) -> bool: - r""" - @brief Tests if this box touches the argument box - - - Two boxes touch if they overlap or their boundaries share at least one common point. Touching is equivalent to a non-empty intersection ('!(b1 & b2).empty?'). - """ - @overload - def transformed(self, t: DCplxTrans) -> DBox: - r""" - @brief Returns the box transformed with the given complex transformation - - - @param t The magnifying transformation to apply - @return The transformed box (a DBox now) - """ - @overload - def transformed(self, t: DTrans) -> DBox: - r""" - @brief Returns the box transformed with the given simple transformation - - - @param t The transformation to apply - @return The transformed box - """ - @overload - def transformed(self, t: VCplxTrans) -> Box: - r""" - @brief Transforms the box with the given complex transformation - - - @param t The magnifying transformation to apply - @return The transformed box (in this case an integer coordinate box) - - This method has been introduced in version 0.25. - """ - def width(self) -> float: - r""" - @brief Gets the width of the box - """ - class Cell: r""" @brief A cell @@ -1692,6 +1009,16 @@ class Cell: This method has been introduced in version 0.23. """ @overload + def change_pcell_parameters(self, instance: Instance, dict: Dict[str, Any]) -> Instance: + r""" + @brief Changes the given parameter for an individual PCell instance + @return The new instance (the old may be invalid) + This version receives a dictionary of names and values. It will change the parameters given by the names to the values given by the values of the dictionary. The functionality is similar to the same function with an array, but more convenient to use. + Values with unknown names are ignored. + + This method has been introduced in version 0.24. + """ + @overload def change_pcell_parameters(self, instance: Instance, parameters: Sequence[Any]) -> Instance: r""" @brief Changes the parameters for an individual PCell instance @@ -1706,16 +1033,6 @@ class Cell: This method has been introduced in version 0.22. """ - @overload - def change_pcell_parameters(self, instance: Instance, dict: Dict[str, Any]) -> Instance: - r""" - @brief Changes the given parameter for an individual PCell instance - @return The new instance (the old may be invalid) - This version receives a dictionary of names and values. It will change the parameters given by the names to the values given by the values of the dictionary. The functionality is similar to the same function with an array, but more convenient to use. - Values with unknown names are ignored. - - This method has been introduced in version 0.24. - """ def child_cells(self) -> int: r""" @brief Gets the number of child cells @@ -2000,6 +1317,15 @@ class Cell: This convenience method has been introduced in version 0.16. """ @overload + def each_overlapping_shape(self, layer_index: int, box: Box, flags: int) -> Iterator[Shape]: + r""" + @brief Iterates over all shapes of a given layer that overlap the given box + + @param flags An "or"-ed combination of the S.. constants of the \Shapes class + @param box The box by which to query the shapes + @param layer_index The layer on which to run the query + """ + @overload def each_overlapping_shape(self, layer_index: int, box: DBox) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that overlap the given box, with the box given in micrometer units @@ -2011,15 +1337,6 @@ class Cell: This convenience method has been introduced in version 0.16. """ @overload - def each_overlapping_shape(self, layer_index: int, box: Box, flags: int) -> Iterator[Shape]: - r""" - @brief Iterates over all shapes of a given layer that overlap the given box - - @param flags An "or"-ed combination of the S.. constants of the \Shapes class - @param box The box by which to query the shapes - @param layer_index The layer on which to run the query - """ - @overload def each_overlapping_shape(self, layer_index: int, box: DBox, flags: int) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that overlap the given box, with the box given in micrometer units @@ -2097,6 +1414,15 @@ class Cell: This convenience method has been introduced in version 0.16. """ @overload + def each_touching_shape(self, layer_index: int, box: Box, flags: int) -> Iterator[Shape]: + r""" + @brief Iterates over all shapes of a given layer that touch the given box + + @param flags An "or"-ed combination of the S.. constants of the \Shapes class + @param box The box by which to query the shapes + @param layer_index The layer on which to run the query + """ + @overload def each_touching_shape(self, layer_index: int, box: DBox) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that touch the given box, with the box given in micrometer units @@ -2108,15 +1434,6 @@ class Cell: This convenience method has been introduced in version 0.16. """ @overload - def each_touching_shape(self, layer_index: int, box: Box, flags: int) -> Iterator[Shape]: - r""" - @brief Iterates over all shapes of a given layer that touch the given box - - @param flags An "or"-ed combination of the S.. constants of the \Shapes class - @param box The box by which to query the shapes - @param layer_index The layer on which to run the query - """ - @overload def each_touching_shape(self, layer_index: int, box: DBox, flags: int) -> Iterator[Shape]: r""" @brief Iterates over all shapes of a given layer that touch the given box, with the box given in micrometer units @@ -2132,6 +1449,27 @@ class Cell: This method has been introduced in version 0.16. It can only be used in editable mode. """ @overload + def fill_region(self, region: Region, fill_cell_index: int, fc_bbox: Box, row_step: Vector, column_step: Vector, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None: + r""" + @brief Fills the given region with cells of the given type (skew step version) + @param region The region to fill + @param fill_cell_index The fill cell to place + @param fc_bbox The fill cell's box to place + @param row_step The 'rows' step vector + @param column_step The 'columns' step vector + @param origin The global origin of the fill pattern or nil to allow local (per-polygon) optimization + @param remaining_parts See explanation in other version + @param fill_margin See explanation in other version + @param remaining_polygons See explanation in other version + + This version is similar to the version providing an orthogonal fill, but it offers more generic stepping of the fill cell. + The step pattern is defined by an origin and two vectors (row_step and column_step) which span the axes of the fill cell pattern. + + The fill box and the step vectors are decoupled which means the fill box can be larger or smaller than the step pitch - it can be overlapping and there can be space between the fill box instances. Fill boxes are placed where they fit entirely into a polygon of the region. The fill boxes lower left corner is the reference for the fill pattern and aligns with the origin if given. + + This variant has been introduced in version 0.27. + """ + @overload def fill_region(self, region: Region, fill_cell_index: int, fc_box: Box, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None: r""" @brief Fills the given region with cells of the given type (extended version) @@ -2179,27 +1517,6 @@ class Cell: This method has been introduced in version 0.23 and enhanced in version 0.27. """ - @overload - def fill_region(self, region: Region, fill_cell_index: int, fc_bbox: Box, row_step: Vector, column_step: Vector, origin: Optional[Point] = ..., remaining_parts: Optional[Region] = ..., fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None: - r""" - @brief Fills the given region with cells of the given type (skew step version) - @param region The region to fill - @param fill_cell_index The fill cell to place - @param fc_bbox The fill cell's box to place - @param row_step The 'rows' step vector - @param column_step The 'columns' step vector - @param origin The global origin of the fill pattern or nil to allow local (per-polygon) optimization - @param remaining_parts See explanation in other version - @param fill_margin See explanation in other version - @param remaining_polygons See explanation in other version - - This version is similar to the version providing an orthogonal fill, but it offers more generic stepping of the fill cell. - The step pattern is defined by an origin and two vectors (row_step and column_step) which span the axes of the fill cell pattern. - - The fill box and the step vectors are decoupled which means the fill box can be larger or smaller than the step pitch - it can be overlapping and there can be space between the fill box instances. Fill boxes are placed where they fit entirely into a polygon of the region. The fill boxes lower left corner is the reference for the fill pattern and aligns with the origin if given. - - This variant has been introduced in version 0.27. - """ def fill_region_multi(self, region: Region, fill_cell_index: int, fc_bbox: Box, row_step: Vector, column_step: Vector, fill_margin: Optional[Vector] = ..., remaining_polygons: Optional[Region] = ..., glue_box: Optional[Box] = ...) -> None: r""" @brief Fills the given region with cells of the given type in enhanced mode with iterations @@ -2210,6 +1527,20 @@ class Cell: This method has been introduced in version 0.27. """ @overload + def flatten(self, levels: int, prune: bool) -> None: + r""" + @brief Flattens the given cell + + This method propagates all shapes from the specified number of hierarchy levels below into the given cell. + It also removes the instances of the cells from which the shapes came from, but does not remove the cells themselves if prune is set to false. + If prune is set to true, these cells are removed if not used otherwise. + + @param levels The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.) + @param prune Set to true to remove orphan cells. + + This method has been introduced in version 0.23. + """ + @overload def flatten(self, prune: bool) -> None: r""" @brief Flattens the given cell @@ -2222,20 +1553,6 @@ class Cell: @param prune Set to true to remove orphan cells. - This method has been introduced in version 0.23. - """ - @overload - def flatten(self, levels: int, prune: bool) -> None: - r""" - @brief Flattens the given cell - - This method propagates all shapes from the specified number of hierarchy levels below into the given cell. - It also removes the instances of the cells from which the shapes came from, but does not remove the cells themselves if prune is set to false. - If prune is set to true, these cells are removed if not used otherwise. - - @param levels The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.) - @param prune Set to true to remove orphan cells. - This method has been introduced in version 0.23. """ def has_prop_id(self) -> bool: @@ -2261,6 +1578,15 @@ class Cell: It's use is discouraged in readonly mode, since it invalidates other Instance references. """ @overload + def insert(self, cell_inst_array: CellInstArray, property_id: int) -> Instance: + r""" + @brief Inserts a cell instance (array) with properties + @return An \Instance object representing the new instance + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + With version 0.16, this method returns an Instance object that represents the new instance. + It's use is discouraged in readonly mode, since it invalidates other Instance references. + """ + @overload def insert(self, cell_inst_array: DCellInstArray) -> Instance: r""" @brief Inserts a cell instance (array) given in micron units @@ -2270,6 +1596,15 @@ class Cell: This variant has been introduced in version 0.25. """ @overload + def insert(self, cell_inst_array: DCellInstArray, property_id: int) -> Instance: + r""" + @brief Inserts a cell instance (array) given in micron units with properties + @return An Instance object representing the new instance + This method inserts an instance array, similar to \insert with a \CellInstArray parameter and a property set ID. But in this version, the argument is a cell instance array given in micrometer units. It is translated to database units internally. + + This variant has been introduced in version 0.25. + """ + @overload def insert(self, inst: Instance) -> Instance: r""" @brief Inserts a cell instance given by another reference @@ -2279,24 +1614,6 @@ class Cell: It has been added in version 0.16. """ - @overload - def insert(self, cell_inst_array: CellInstArray, property_id: int) -> Instance: - r""" - @brief Inserts a cell instance (array) with properties - @return An \Instance object representing the new instance - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - With version 0.16, this method returns an Instance object that represents the new instance. - It's use is discouraged in readonly mode, since it invalidates other Instance references. - """ - @overload - def insert(self, cell_inst_array: DCellInstArray, property_id: int) -> Instance: - r""" - @brief Inserts a cell instance (array) given in micron units with properties - @return An Instance object representing the new instance - This method inserts an instance array, similar to \insert with a \CellInstArray parameter and a property set ID. But in this version, the argument is a cell instance array given in micrometer units. It is translated to database units internally. - - This variant has been introduced in version 0.25. - """ def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -2582,15 +1899,6 @@ class Cell: This method has been introduced in version 0.22. """ @overload - def pcell_parameter(self, name: str) -> Any: - r""" - @brief Gets a PCell parameter by name if the cell is a PCell variant - If the cell is a PCell variant, this method returns the parameter with the given name. - If the cell is not a PCell variant or the name is not a valid PCell parameter name, the return value is nil. - - This method has been introduced in version 0.25. - """ - @overload def pcell_parameter(self, instance: Instance, name: str) -> Any: r""" @brief Returns a PCell parameter by name for a pcell instance @@ -2602,6 +1910,15 @@ class Cell: This method has been introduced in version 0.25. """ @overload + def pcell_parameter(self, name: str) -> Any: + r""" + @brief Gets a PCell parameter by name if the cell is a PCell variant + If the cell is a PCell variant, this method returns the parameter with the given name. + If the cell is not a PCell variant or the name is not a valid PCell parameter name, the return value is nil. + + This method has been introduced in version 0.25. + """ + @overload def pcell_parameters(self) -> List[Any]: r""" @brief Returns the PCell parameters for a pcell variant @@ -2765,15 +2082,6 @@ class Cell: The instance given by the instance object (first argument) is replaced by the given instance (second argument). The new object will not have any properties. """ @overload - def replace(self, instance: Instance, cell_inst_array: DCellInstArray) -> Instance: - r""" - @brief Replaces a cell instance (array) with a different one, given in micrometer units - @return An \Instance object representing the new instance - This method is identical to the corresponding \replace variant with a \CellInstArray argument. It however accepts a micrometer-unit \DCellInstArray object which is translated to database units internally. - - This variant has been introduced in version 0.25. - """ - @overload def replace(self, instance: Instance, cell_inst_array: CellInstArray, property_id: int) -> Instance: r""" @brief Replaces a cell instance (array) with a different one with properties @@ -2784,6 +2092,15 @@ class Cell: The new object will not have any properties. """ @overload + def replace(self, instance: Instance, cell_inst_array: DCellInstArray) -> Instance: + r""" + @brief Replaces a cell instance (array) with a different one, given in micrometer units + @return An \Instance object representing the new instance + This method is identical to the corresponding \replace variant with a \CellInstArray argument. It however accepts a micrometer-unit \DCellInstArray object which is translated to database units internally. + + This variant has been introduced in version 0.25. + """ + @overload def replace(self, instance: Instance, cell_inst_array: DCellInstArray, property_id: int) -> Instance: r""" @brief Replaces a cell instance (array) with a different one and new properties, where the cell instance is given in micrometer units @@ -2839,42 +2156,6 @@ class Cell: This method swaps two layers inside this cell. """ @overload - def transform(self, trans: DCplxTrans) -> None: - r""" - @brief Transforms the cell by the given, micrometer-unit transformation - - This method transforms all instances and all shapes by the given transformation. There is a variant called \transform_into which applies the transformation to instances in a way such that it can be applied recursively to the child cells. The difference is important in the presence of magnifications: "transform" will leave magnified instances while "transform_into" will not do so but expect the magnification to be applied inside the called cells too. - - This method has been introduced in version 0.26.7. - """ - @overload - def transform(self, trans: DTrans) -> None: - r""" - @brief Transforms the cell by the given, micrometer-unit transformation - - This method transforms all instances and all shapes by the given transformation. There is a variant called \transform_into which applies the transformation to instances in a way such that it can be applied recursively to the child cells. - - This method has been introduced in version 0.26.7. - """ - @overload - def transform(self, trans: ICplxTrans) -> None: - r""" - @brief Transforms the cell by the given complex integer transformation - - This method transforms all instances and all shapes by the given transformation. There is a variant called \transform_into which applies the transformation to instances in a way such that it can be applied recursively to the child cells. The difference is important in the presence of magnifications: "transform" will leave magnified instances while "transform_into" will not do so but expect the magnification to be applied inside the called cells too. - - This method has been introduced in version 0.26.7. - """ - @overload - def transform(self, trans: Trans) -> None: - r""" - @brief Transforms the cell by the given integer transformation - - This method transforms all instances and all shapes by the given transformation. There is a variant called \transform_into which applies the transformation to instances in a way such that it can be applied recursively to the child cells. - - This method has been introduced in version 0.26.7. - """ - @overload def transform(self, instance: Instance, trans: DCplxTrans) -> Instance: r""" @brief Transforms the instance with the given complex floating-point transformation given in micrometer units @@ -2911,37 +2192,40 @@ class Cell: It is permitted in editable mode only. """ @overload - def transform_into(self, trans: DCplxTrans) -> None: + def transform(self, trans: DCplxTrans) -> None: r""" - @brief Transforms the cell into a new coordinate system with the given complex integer transformation where the transformation is in micrometer units - This method is identical to the corresponding \transform_into method with a \ICplxTrans argument. For this variant however, the transformation is given in micrometer units and is translated to database units internally. + @brief Transforms the cell by the given, micrometer-unit transformation - This variant has been introduced in version 0.25. + This method transforms all instances and all shapes by the given transformation. There is a variant called \transform_into which applies the transformation to instances in a way such that it can be applied recursively to the child cells. The difference is important in the presence of magnifications: "transform" will leave magnified instances while "transform_into" will not do so but expect the magnification to be applied inside the called cells too. + + This method has been introduced in version 0.26.7. """ @overload - def transform_into(self, trans: DTrans) -> None: + def transform(self, trans: DTrans) -> None: r""" - @brief Transforms the cell into a new coordinate system with the given transformation where the transformation is in micrometer units - This method is identical to the corresponding \transform_into method with a \Trans argument. For this variant however, the transformation is given in micrometer units and is translated to database units internally. + @brief Transforms the cell by the given, micrometer-unit transformation - This variant has been introduced in version 0.25. + This method transforms all instances and all shapes by the given transformation. There is a variant called \transform_into which applies the transformation to instances in a way such that it can be applied recursively to the child cells. + + This method has been introduced in version 0.26.7. """ @overload - def transform_into(self, trans: ICplxTrans) -> None: + def transform(self, trans: ICplxTrans) -> None: r""" - @brief Transforms the cell into a new coordinate system with the given complex integer transformation + @brief Transforms the cell by the given complex integer transformation - See the comments for the simple-transformation version for a description of this method. - This method has been introduced in version 0.23. + This method transforms all instances and all shapes by the given transformation. There is a variant called \transform_into which applies the transformation to instances in a way such that it can be applied recursively to the child cells. The difference is important in the presence of magnifications: "transform" will leave magnified instances while "transform_into" will not do so but expect the magnification to be applied inside the called cells too. + + This method has been introduced in version 0.26.7. """ @overload - def transform_into(self, trans: Trans) -> None: + def transform(self, trans: Trans) -> None: r""" - @brief Transforms the cell into a new coordinate system with the given transformation + @brief Transforms the cell by the given integer transformation - This method transforms all instances and all shapes. The instances are transformed in a way that allows propagation of the transformation into child cells. For this, it applies just a part of the given transformation to the instance such that when transforming the shapes of the cell instantiated, the result will reflect the desired transformation. Mathematically spoken, the transformation of the instance (A) is transformed with the given transformation T using "A' = T * A * Tinv" where Tinv is the inverse of T. In effect, the transformation T commutes with the new instance transformation A' and can be applied to child cells as well. This method is therefore useful to transform a hierarchy of cells. + This method transforms all instances and all shapes by the given transformation. There is a variant called \transform_into which applies the transformation to instances in a way such that it can be applied recursively to the child cells. - It has been introduced in version 0.23. + This method has been introduced in version 0.26.7. """ @overload def transform_into(self, instance: Instance, trans: DCplxTrans) -> Instance: @@ -2985,6 +2269,39 @@ class Cell: It is permitted in editable mode only. """ @overload + def transform_into(self, trans: DCplxTrans) -> None: + r""" + @brief Transforms the cell into a new coordinate system with the given complex integer transformation where the transformation is in micrometer units + This method is identical to the corresponding \transform_into method with a \ICplxTrans argument. For this variant however, the transformation is given in micrometer units and is translated to database units internally. + + This variant has been introduced in version 0.25. + """ + @overload + def transform_into(self, trans: DTrans) -> None: + r""" + @brief Transforms the cell into a new coordinate system with the given transformation where the transformation is in micrometer units + This method is identical to the corresponding \transform_into method with a \Trans argument. For this variant however, the transformation is given in micrometer units and is translated to database units internally. + + This variant has been introduced in version 0.25. + """ + @overload + def transform_into(self, trans: ICplxTrans) -> None: + r""" + @brief Transforms the cell into a new coordinate system with the given complex integer transformation + + See the comments for the simple-transformation version for a description of this method. + This method has been introduced in version 0.23. + """ + @overload + def transform_into(self, trans: Trans) -> None: + r""" + @brief Transforms the cell into a new coordinate system with the given transformation + + This method transforms all instances and all shapes. The instances are transformed in a way that allows propagation of the transformation into child cells. For this, it applies just a part of the given transformation to the instance such that when transforming the shapes of the cell instantiated, the result will reflect the desired transformation. Mathematically spoken, the transformation of the instance (A) is transformed with the given transformation T using "A' = T * A * Tinv" where Tinv is the inverse of T. In effect, the transformation T commutes with the new instance transformation A' and can be applied to child cells as well. This method is therefore useful to transform a hierarchy of cells. + + It has been introduced in version 0.23. + """ + @overload def write(self, file_name: str) -> None: r""" @brief Writes the cell to a layout file @@ -3002,774 +2319,6 @@ class Cell: This method has been introduced in version 0.23. """ -class Instance: - r""" - @brief An instance proxy - - An instance proxy is basically a pointer to an instance of different kinds, - similar to \Shape, the shape proxy. \Instance objects can be duplicated without - creating copies of the instances itself: the copy will still point to the same instance - than the original. - - When the \Instance object is modified, the actual instance behind it is modified. The \Instance object acts as a simplified interface for single and array instances with or without properties. - - See @The Database API@ for more details about the database objects. - """ - a: Vector - r""" - Getter: - @brief Returns the displacement vector for the 'a' axis - - Starting with version 0.25 the displacement is of vector type. - Setter: - @brief Sets the displacement vector for the 'a' axis - - If the instance was not an array instance before it is made one. - - This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type. - """ - b: Vector - r""" - Getter: - @brief Returns the displacement vector for the 'b' axis - - Starting with version 0.25 the displacement is of vector type. - Setter: - @brief Sets the displacement vector for the 'b' axis in micrometer units - - Like \b= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. - - This method has been introduced in version 0.25. - """ - cell: Cell - r""" - Getter: - @brief Gets the \Cell object of the cell this instance refers to - - Please note that before version 0.23 this method returned the cell the instance is contained in. For consistency, this method has been renamed \parent_cell. - - This method has been introduced in version 0.23. - Setter: - @brief Sets the \Cell object this instance refers to - - Setting the cell object to nil is equivalent to deleting the instance. - - This method has been introduced in version 0.23. - """ - cell_index: int - r""" - Getter: - @brief Get the index of the cell this instance refers to - - Setter: - @brief Sets the index of the cell this instance refers to - - This method has been introduced in version 0.23. - """ - cell_inst: CellInstArray - r""" - Getter: - @brief Gets the basic \CellInstArray object associated with this instance reference. - Setter: - @brief Returns the basic cell instance array object by giving a micrometer unit object. - This method replaces the instance by the given CellInstArray object and it internally transformed into database units. - - This method has been introduced in version 0.25 - """ - cplx_trans: ICplxTrans - r""" - Getter: - @brief Gets the complex transformation of the instance or the first instance in the array - This method is always valid compared to \trans, since simple transformations can be expressed as complex transformations as well. - Setter: - @brief Sets the complex transformation of the instance or the first instance in the array - - This method has been introduced in version 0.23. - """ - da: DVector - r""" - Getter: - @brief Returns the displacement vector for the 'a' axis in micrometer units - - Like \a, this method returns the displacement, but it will be translated to database units internally. - - This method has been introduced in version 0.25. - Setter: - @brief Sets the displacement vector for the 'a' axis in micrometer units - - Like \a= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. - - This method has been introduced in version 0.25. - """ - db: DVector - r""" - Getter: - @brief Returns the displacement vector for the 'b' axis in micrometer units - - Like \b, this method returns the displacement, but it will be translated to database units internally. - - This method has been introduced in version 0.25. - Setter: - @brief Sets the displacement vector for the 'b' axis in micrometer units - - Like \b= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. - - This method has been introduced in version 0.25. - """ - dcell_inst: DCellInstArray - r""" - Getter: - @brief Returns the micrometer unit version of the basic cell instance array object. - - This method has been introduced in version 0.25 - Setter: - @brief Returns the basic cell instance array object by giving a micrometer unit object. - This method replaces the instance by the given CellInstArray object and it internally transformed into database units. - - This method has been introduced in version 0.25 - """ - dcplx_trans: DCplxTrans - r""" - Getter: - @brief Gets the complex transformation of the instance or the first instance in the array (in micrometer units) - This method returns the same transformation as \cplx_trans, but the displacement of this transformation is given in micrometer units. It is internally translated from database units into micrometers. - - This method has been introduced in version 0.25. - - Setter: - @brief Sets the complex transformation of the instance or the first instance in the array (in micrometer units) - This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. - - This method has been introduced in version 0.25. - """ - dtrans: DTrans - r""" - Getter: - @brief Gets the transformation of the instance or the first instance in the array (in micrometer units) - This method returns the same transformation as \cplx_trans, but the displacement of this transformation is given in micrometer units. It is internally translated from database units into micrometers. - - This method has been introduced in version 0.25. - - Setter: - @brief Sets the transformation of the instance or the first instance in the array (in micrometer units) - This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. - - This method has been introduced in version 0.25. - """ - na: int - r""" - Getter: - @brief Returns the number of instances in the 'a' axis - - Setter: - @brief Sets the number of instances in the 'a' axis - - If the instance was not an array instance before it is made one. - - This method has been introduced in version 0.23. - """ - nb: int - r""" - Getter: - @brief Returns the number of instances in the 'b' axis - - Setter: - @brief Sets the number of instances in the 'b' axis - - If the instance was not an array instance before it is made one. - - This method has been introduced in version 0.23. - """ - parent_cell: Cell - r""" - Getter: - @brief Gets the cell this instance is contained in - - Returns nil if the instance does not live inside a cell. - This method was named "cell" previously which lead to confusion with \cell_index. - It was renamed to "parent_cell" in version 0.23. - - Setter: - @brief Moves the instance to a different cell - - Both the current and the target cell must live in the same layout. - - This method has been introduced in version 0.23. - """ - prop_id: int - r""" - Getter: - @brief Gets the properties ID associated with the instance - - Setter: - @brief Sets the properties ID associated with the instance - This method is provided, if a properties ID has been derived already. Usually it's more convenient to use \delete_property, \set_property or \property. - - This method has been introduced in version 0.22. - """ - trans: Trans - r""" - Getter: - @brief Gets the transformation of the instance or the first instance in the array - The transformation returned is only valid if the array does not represent a complex transformation array - Setter: - @brief Sets the transformation of the instance or the first instance in the array (in micrometer units) - This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. - - This method has been introduced in version 0.25. - """ - @classmethod - def new(cls) -> Instance: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> Instance: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Instance: - r""" - @brief Creates a copy of self - """ - def __eq__(self, b: object) -> bool: - r""" - @brief Tests for equality of two Instance objects - See the hint on the < operator. - """ - def __getitem__(self, key: Any) -> Any: - r""" - @brief Gets the user property with the given key or, if available, the PCell parameter with the name given by the key - Getting the PCell parameter has priority over the user property. - This method has been introduced in version 0.25. - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def __len__(self) -> int: - r""" - @brief Gets the number of single instances in the instance array - If the instance represents a single instance, the count is 1. Otherwise it is na*nb. - """ - def __lt__(self, b: Instance) -> bool: - r""" - @brief Provides an order criterion for two Instance objects - Warning: this operator is just provided to establish any order, not a particular one. - """ - def __ne__(self, b: object) -> bool: - r""" - @brief Tests for inequality of two Instance objects - Warning: this operator returns true if both objects refer to the same instance, not just identical ones. - """ - def __setitem__(self, key: Any, value: Any) -> None: - r""" - @brief Sets the user property with the given key or, if available, the PCell parameter with the name given by the key - Setting the PCell parameter has priority over the user property. - This method has been introduced in version 0.25. - """ - def __str__(self) -> str: - r""" - @brief Creates a string showing the contents of the reference - - This method has been introduced with version 0.16. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Instance) -> None: - r""" - @brief Assigns another object to self - """ - @overload - def bbox(self) -> Box: - r""" - @brief Gets the bounding box of the instance - The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array). - This method has been introduced in version 0.23. - """ - @overload - def bbox(self, layer_index: int) -> Box: - r""" - @brief Gets the bounding box of the instance for a given layer - @param layer_index The index of the layer the bounding box will be computed for. - The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all it's children', an empty bounding box will be returned. - This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28. - """ - def bbox_per_layer(self, layer_index: int) -> Box: - r""" - @brief Gets the bounding box of the instance for a given layer - @param layer_index The index of the layer the bounding box will be computed for. - The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all it's children', an empty bounding box will be returned. - This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28. - """ - def change_pcell_parameter(self, name: str, value: Any) -> None: - r""" - @brief Changes a single parameter of a PCell instance to the given value - - This method changes a parameter of a PCell instance to the given value. The name identifies the PCell parameter and must correspond to one parameter listed in the PCell declaration. - - This method has been introduced in version 0.24. - """ - @overload - def change_pcell_parameters(self, params: Sequence[Any]) -> None: - r""" - @brief Changes the parameters of a PCell instance to the list of parameters - - This method changes the parameters of a PCell instance to the given list of parameters. The list must correspond to the parameters listed in the pcell declaration. - A more convenient method is provided with the same name which accepts a dictionary of names and values - . - This method has been introduced in version 0.24. - """ - @overload - def change_pcell_parameters(self, dict: Dict[str, Any]) -> None: - r""" - @brief Changes the parameters of a PCell instance to the dictionary of parameters - - This method changes the parameters of a PCell instance to the given values. The values are specifies as a dictionary of names (keys) vs. values. - Unknown names are ignored and only the parameters listed in the dictionary are changed. - - This method has been introduced in version 0.24. - """ - def convert_to_static(self) -> None: - r""" - @brief Converts a PCell instance to a static cell - - If the instance is a PCell instance, this method will convert the cell into a static cell and remove the PCell variant if required. A new cell will be created containing the PCell content but being a static cell. If the instance is not a PCell instance, this method won't do anything. - - This method has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - @overload - def dbbox(self) -> DBox: - r""" - @brief Gets the bounding box of the instance in micron units - Gets the bounding box (see \bbox) of the instance, but will compute the micrometer unit box by multiplying \bbox with the database unit. - - This method has been introduced in version 0.25. - """ - @overload - def dbbox(self, layer_index: int) -> DBox: - r""" - @brief Gets the bounding box of the instance in micron units - @param layer_index The index of the layer the bounding box will be computed for. - Gets the bounding box (see \bbox) of the instance, but will compute the micrometer unit box by multiplying \bbox with the database unit. - - This method has been introduced in version 0.25. 'dbbox' is the preferred synonym for it since version 0.28. - """ - def dbbox_per_layer(self, layer_index: int) -> DBox: - r""" - @brief Gets the bounding box of the instance in micron units - @param layer_index The index of the layer the bounding box will be computed for. - Gets the bounding box (see \bbox) of the instance, but will compute the micrometer unit box by multiplying \bbox with the database unit. - - This method has been introduced in version 0.25. 'dbbox' is the preferred synonym for it since version 0.28. - """ - def delete(self) -> None: - r""" - @brief Deletes this instance - - After this method was called, the instance object is pointing to nothing. - - This method has been introduced in version 0.23. - """ - def delete_property(self, key: Any) -> None: - r""" - @brief Deletes the user property with the given key - This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. - This method may change the properties ID. Calling this method may invalidate any iterators. It should not be called inside a loop iterating over instances. - - This method has been introduced in version 0.22. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> Instance: - r""" - @brief Creates a copy of self - """ - def explode(self) -> None: - r""" - @brief Explodes the instance array - - This method does nothing if the instance was not an array before. - The instance object will point to the first instance of the array afterwards. - - This method has been introduced in version 0.23. - """ - @overload - def flatten(self) -> None: - r""" - @brief Flattens the instance - - This method will convert the instance to a number of shapes which are equivalent to the content of the cell. The instance itself will be removed. - There is another variant of this method which allows specification of the number of hierarchy levels to flatten. - - This method has been introduced in version 0.24. - """ - @overload - def flatten(self, levels: int) -> None: - r""" - @brief Flattens the instance - - This method will convert the instance to a number of shapes which are equivalent to the content of the cell. The instance itself will be removed. - This version of the method allows specification of the number of hierarchy levels to remove. Specifying 1 for 'levels' will remove the instance and replace it by the contents of the cell. Specifying a negative value or zero for the number of levels will flatten the instance completely. - - This method has been introduced in version 0.24. - """ - def has_prop_id(self) -> bool: - r""" - @brief Returns true, if the instance has properties - """ - def is_complex(self) -> bool: - r""" - @brief Tests, if the array is a complex array - - Returns true if the array represents complex instances (that is, with magnification and - arbitrary rotation angles). - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_null(self) -> bool: - r""" - @brief Checks, if the instance is a valid one - """ - def is_pcell(self) -> bool: - r""" - @brief Returns a value indicating whether the instance is a PCell instance - - This method has been introduced in version 0.24. - """ - def is_regular_array(self) -> bool: - r""" - @brief Tests, if this instance is a regular array - """ - def is_valid(self) -> bool: - r""" - @brief Tests if the \Instance object is still pointing to a valid instance - If the instance represented by the given reference has been deleted, this method returns false. If however, another instance has been inserted already that occupies the original instances position, this method will return true again. - - This method has been introduced in version 0.23 and is a shortcut for "inst.cell.is_valid?(inst)". - """ - @overload - def layout(self) -> Layout: - r""" - @brief Gets the layout this instance is contained in - - This method has been introduced in version 0.22. - """ - @overload - def layout(self) -> Layout: - r""" - @brief Gets the layout this instance is contained in - - This const version of the method has been introduced in version 0.25. - """ - def pcell_declaration(self) -> PCellDeclaration_Native: - r""" - @brief Returns the PCell declaration object - - If the instance is a PCell instance, this method returns the PCell declaration object for that PCell. If not, this method will return nil. - This method has been introduced in version 0.24. - """ - def pcell_parameter(self, name: str) -> Any: - r""" - @brief Gets a PCell parameter by the name of the parameter - @return The parameter value or nil if the instance is not a PCell or does not have a parameter with given name - - This method has been introduced in version 0.25. - """ - def pcell_parameters(self) -> List[Any]: - r""" - @brief Gets the parameters of a PCell instance as a list of values - @return A list of values - - If the instance is a PCell instance, this method will return an array of values where each value corresponds to one parameter. The order of the values is the order the parameters are declared in the PCell declaration. - If the instance is not a PCell instance, this list returned will be empty. - - This method has been introduced in version 0.24. - """ - def pcell_parameters_by_name(self) -> Dict[str, Any]: - r""" - @brief Gets the parameters of a PCell instance as a dictionary of values vs. names - @return A dictionary of values by parameter name - - If the instance is a PCell instance, this method will return a map of values vs. parameter names. The names are the ones defined in the PCell declaration.If the instance is not a PCell instance, the dictionary returned will be empty. - - This method has been introduced in version 0.24. - """ - def property(self, key: Any) -> Any: - r""" - @brief Gets the user property with the given key - This method is a convenience method that gets the property with the given key. If no property with that key exists, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value. - This method has been introduced in version 0.22. - """ - def set_property(self, key: Any, value: Any) -> None: - r""" - @brief Sets the user property with the given key to the given value - This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. - This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. Calling this method may invalidate any iterators. It should not be called inside a loop iterating over instances. - - This method has been introduced in version 0.22. - """ - def size(self) -> int: - r""" - @brief Gets the number of single instances in the instance array - If the instance represents a single instance, the count is 1. Otherwise it is na*nb. - """ - @overload - def to_s(self) -> str: - r""" - @brief Creates a string showing the contents of the reference - - This method has been introduced with version 0.16. - """ - @overload - def to_s(self, with_cellname: bool) -> str: - r""" - @brief Creates a string showing the contents of the reference - - Passing true to with_cellname makes the string contain the cellname instead of the cell index - - This method has been introduced with version 0.23. - """ - @overload - def transform(self, t: DCplxTrans) -> None: - r""" - @brief Transforms the instance array with the given complex transformation (given in micrometer units) - Transforms the instance like \transform does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units. - - This method has been introduced in version 0.25. - """ - @overload - def transform(self, t: DTrans) -> None: - r""" - @brief Transforms the instance array with the given transformation (given in micrometer units) - Transforms the instance like \transform does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units. - - This method has been introduced in version 0.25. - """ - @overload - def transform(self, t: ICplxTrans) -> None: - r""" - @brief Transforms the instance array with the given complex transformation - See \Cell#transform for a description of this method. - - This method has been introduced in version 0.23. - """ - @overload - def transform(self, t: Trans) -> None: - r""" - @brief Transforms the instance array with the given transformation - See \Cell#transform for a description of this method. - - This method has been introduced in version 0.23. - """ - @overload - def transform_into(self, t: DCplxTrans) -> None: - r""" - @brief Transforms the instance array with the given complex transformation (given in micrometer units) - Transforms the instance like \transform_into does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units. - - This method has been introduced in version 0.25. - """ - @overload - def transform_into(self, t: DTrans) -> None: - r""" - @brief Transforms the instance array with the given transformation (given in micrometer units) - Transforms the instance like \transform_into does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units. - - This method has been introduced in version 0.25. - """ - @overload - def transform_into(self, t: ICplxTrans) -> None: - r""" - @brief Transforms the instance array with the given transformation - See \Cell#transform_into for a description of this method. - - This method has been introduced in version 0.23. - """ - @overload - def transform_into(self, t: Trans) -> None: - r""" - @brief Transforms the instance array with the given transformation - See \Cell#transform_into for a description of this method. - - This method has been introduced in version 0.23. - """ - -class ParentInstArray: - r""" - @brief A parent instance - - A parent instance is basically an inverse instance: instead of pointing - to the child cell, it is pointing to the parent cell and the transformation - is representing the shift of the parent cell relative to the child cell. - For memory performance, a parent instance is not stored as a instance but - rather as a reference to a child instance and a reference to the cell which - is the parent. - The parent instance itself is computed on the fly. It is representative for - a set of instances belonging to the same cell index. The special parent instance - iterator takes care of producing the right sequence (\Cell#each_parent_inst). - - See @The Database API@ for more details about the database objects. - """ - @classmethod - def new(cls) -> ParentInstArray: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> ParentInstArray: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> ParentInstArray: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ParentInstArray) -> None: - r""" - @brief Assigns another object to self - """ - def child_inst(self) -> Instance: - r""" - @brief Retrieve the child instance associated with this parent instance - - Starting with version 0.15, this method returns an \Instance object rather than a \CellInstArray reference. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dinst(self) -> DCellInstArray: - r""" - @brief Compute the inverse instance by which the parent is seen from the child in micrometer units - - This convenience method has been introduced in version 0.28. - """ - def dup(self) -> ParentInstArray: - r""" - @brief Creates a copy of self - """ - def inst(self) -> CellInstArray: - r""" - @brief Compute the inverse instance by which the parent is seen from the child - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def parent_cell_index(self) -> int: - r""" - @brief Gets the index of the parent cell - """ - class CellInstArray: r""" @brief A single or array cell instance @@ -3809,15 +2358,6 @@ class CellInstArray: This method was introduced in version 0.22. Starting with version 0.25 the displacement is of vector type. """ - @property - def cell(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the cell this instance refers to - This is a convenience method and equivalent to 'cell_index = cell.cell_index()'. There is no getter for the cell pointer because the \CellInstArray object only knows about cell indexes. - - This convenience method has been introduced in version 0.28. - """ cell_index: int r""" Getter: @@ -3836,6 +2376,15 @@ class CellInstArray: This method was introduced in version 0.22. """ + @property + def cell(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the cell this instance refers to + This is a convenience method and equivalent to 'cell_index = cell.cell_index()'. There is no getter for the cell pointer because the \CellInstArray object only knows about cell indexes. + + This convenience method has been introduced in version 0.28. + """ na: int r""" Getter: @@ -3890,51 +2439,6 @@ class CellInstArray: """ @overload @classmethod - def new(cls, cell: Cell, trans: ICplxTrans) -> CellInstArray: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell: Cell, trans: Trans) -> CellInstArray: - r""" - @brief Creates a single cell instance - @param cell The cell to instantiate - @param trans The transformation by which to instantiate the cell - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell_index: int, disp: Vector) -> CellInstArray: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param disp The displacement - This convenience initializer has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell_index: int, trans: ICplxTrans) -> CellInstArray: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell_index The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - """ - @overload - @classmethod - def new(cls, cell_index: int, trans: Trans) -> CellInstArray: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param trans The transformation by which to instantiate the cell - """ - @overload - @classmethod def new(cls, cell: Cell, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: r""" @brief Creates a single cell instance @@ -3949,6 +2453,16 @@ class CellInstArray: """ @overload @classmethod + def new(cls, cell: Cell, trans: ICplxTrans) -> CellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod def new(cls, cell: Cell, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: r""" @brief Creates a single cell instance with a complex transformation @@ -3963,6 +2477,16 @@ class CellInstArray: """ @overload @classmethod + def new(cls, cell: Cell, trans: Trans) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod def new(cls, cell: Cell, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: r""" @brief Creates a single cell instance @@ -3977,6 +2501,15 @@ class CellInstArray: """ @overload @classmethod + def new(cls, cell_index: int, disp: Vector) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The displacement + This convenience initializer has been introduced in version 0.28. + """ + @overload + @classmethod def new(cls, cell_index: int, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: r""" @brief Creates a single cell instance @@ -3991,6 +2524,14 @@ class CellInstArray: """ @overload @classmethod + def new(cls, cell_index: int, trans: ICplxTrans) -> CellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell_index The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + """ + @overload + @classmethod def new(cls, cell_index: int, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: r""" @brief Creates a single cell instance with a complex transformation @@ -4005,6 +2546,14 @@ class CellInstArray: """ @overload @classmethod + def new(cls, cell_index: int, trans: Trans) -> CellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param trans The transformation by which to instantiate the cell + """ + @overload + @classmethod def new(cls, cell_index: int, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> CellInstArray: r""" @brief Creates a single cell instance @@ -4051,46 +2600,6 @@ class CellInstArray: This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. """ @overload - def __init__(self, cell: Cell, trans: ICplxTrans) -> None: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - def __init__(self, cell: Cell, trans: Trans) -> None: - r""" - @brief Creates a single cell instance - @param cell The cell to instantiate - @param trans The transformation by which to instantiate the cell - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - def __init__(self, cell_index: int, disp: Vector) -> None: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param disp The displacement - This convenience initializer has been introduced in version 0.28. - """ - @overload - def __init__(self, cell_index: int, trans: ICplxTrans) -> None: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell_index The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - """ - @overload - def __init__(self, cell_index: int, trans: Trans) -> None: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param trans The transformation by which to instantiate the cell - """ - @overload def __init__(self, cell: Cell, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> None: r""" @brief Creates a single cell instance @@ -4104,6 +2613,15 @@ class CellInstArray: This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. """ @overload + def __init__(self, cell: Cell, trans: ICplxTrans) -> None: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload def __init__(self, cell: Cell, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> None: r""" @brief Creates a single cell instance with a complex transformation @@ -4117,6 +2635,15 @@ class CellInstArray: This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. """ @overload + def __init__(self, cell: Cell, trans: Trans) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload def __init__(self, cell: Cell, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> None: r""" @brief Creates a single cell instance @@ -4130,6 +2657,14 @@ class CellInstArray: This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. """ @overload + def __init__(self, cell_index: int, disp: Vector) -> None: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The displacement + This convenience initializer has been introduced in version 0.28. + """ + @overload def __init__(self, cell_index: int, disp: Vector, a: Vector, b: Vector, na: int, nb: int) -> None: r""" @brief Creates a single cell instance @@ -4143,6 +2678,13 @@ class CellInstArray: This convenience initializer has been introduced in version 0.28. """ @overload + def __init__(self, cell_index: int, trans: ICplxTrans) -> None: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell_index The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + """ + @overload def __init__(self, cell_index: int, trans: ICplxTrans, a: Vector, b: Vector, na: int, nb: int) -> None: r""" @brief Creates a single cell instance with a complex transformation @@ -4156,6 +2698,13 @@ class CellInstArray: Starting with version 0.25 the displacements are of vector type. """ @overload + def __init__(self, cell_index: int, trans: Trans) -> None: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param trans The transformation by which to instantiate the cell + """ + @overload def __init__(self, cell_index: int, trans: Trans, a: Vector, b: Vector, na: int, nb: int) -> None: r""" @brief Creates a single cell instance @@ -4359,551 +2908,6 @@ class CellInstArray: This method has been introduced in version 0.20. """ -class DCellInstArray: - r""" - @brief A single or array cell instance in micrometer units - This object is identical to \CellInstArray, except that it holds coordinates in micron units instead of database units. - - This class has been introduced in version 0.25. - """ - a: DVector - r""" - Getter: - @brief Gets the displacement vector for the 'a' axis - - Setter: - @brief Sets the displacement vector for the 'a' axis - - If the instance was not regular before this property is set, it will be initialized to a regular instance. - """ - b: DVector - r""" - Getter: - @brief Gets the displacement vector for the 'b' axis - - Setter: - @brief Sets the displacement vector for the 'b' axis - - If the instance was not regular before this property is set, it will be initialized to a regular instance. - """ - @property - def cell(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the cell this instance refers to - This is a convenience method and equivalent to 'cell_index = cell.cell_index()'. There is no getter for the cell pointer because the \CellInstArray object only knows about cell indexes. - - This convenience method has been introduced in version 0.28. - """ - cell_index: int - r""" - Getter: - @brief Gets the cell index of the cell instantiated - Use \Layout#cell to get the \Cell object from the cell index. - Setter: - @brief Sets the index of the cell this instance refers to - """ - cplx_trans: DCplxTrans - r""" - Getter: - @brief Gets the complex transformation of the first instance in the array - This method is always applicable, compared to \trans, since simple transformations can be expressed as complex transformations as well. - Setter: - @brief Sets the complex transformation of the instance or the first instance in the array - """ - na: int - r""" - Getter: - @brief Gets the number of instances in the 'a' axis - - Setter: - @brief Sets the number of instances in the 'a' axis - - If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. - To make an instance a single instance, set na or nb to 0. - """ - nb: int - r""" - Getter: - @brief Gets the number of instances in the 'b' axis - - Setter: - @brief Sets the number of instances in the 'b' axis - - If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. - To make an instance a single instance, set na or nb to 0. - """ - trans: DTrans - r""" - Getter: - @brief Gets the transformation of the first instance in the array - The transformation returned is only valid if the array does not represent a complex transformation array - Setter: - @brief Sets the transformation of the instance or the first instance in the array - """ - @overload - @classmethod - def new(cls) -> DCellInstArray: - r""" - @brief Creates en empty cell instance with size 0 - """ - @overload - @classmethod - def new(cls, cell: Cell, disp: DVector) -> DCellInstArray: - r""" - @brief Creates a single cell instance - @param cell The cell to instantiate - @param disp The displacement - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell: Cell, trans: DCplxTrans) -> DCellInstArray: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell: Cell, trans: DTrans) -> DCellInstArray: - r""" - @brief Creates a single cell instance - @param cell The cell to instantiate - @param trans The transformation by which to instantiate the cell - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell_index: int, disp: DVector) -> DCellInstArray: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param disp The displacement - This convenience initializer has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell_index: int, trans: DCplxTrans) -> DCellInstArray: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell_index The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - """ - @overload - @classmethod - def new(cls, cell_index: int, trans: DTrans) -> DCellInstArray: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param trans The transformation by which to instantiate the cell - """ - @overload - @classmethod - def new(cls, cell: Cell, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: - r""" - @brief Creates a single cell instance - @param cell The cell to instantiate - @param disp The basic displacement of the first instance - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell: Cell, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell: Cell, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: - r""" - @brief Creates a single cell instance - @param cell The cell to instantiate - @param trans The transformation by which to instantiate the cell - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell_index: int, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param disp The basic displacement of the first instance - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - - This convenience initializer has been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls, cell_index: int, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell_index The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - """ - @overload - @classmethod - def new(cls, cell_index: int, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param trans The transformation by which to instantiate the cell - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - """ - def __copy__(self) -> DCellInstArray: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DCellInstArray: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two arrays for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given cell instance. This method enables cell instances as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates en empty cell instance with size 0 - """ - @overload - def __init__(self, cell: Cell, disp: DVector) -> None: - r""" - @brief Creates a single cell instance - @param cell The cell to instantiate - @param disp The displacement - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - def __init__(self, cell: Cell, trans: DCplxTrans) -> None: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - def __init__(self, cell: Cell, trans: DTrans) -> None: - r""" - @brief Creates a single cell instance - @param cell The cell to instantiate - @param trans The transformation by which to instantiate the cell - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - def __init__(self, cell_index: int, disp: DVector) -> None: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param disp The displacement - This convenience initializer has been introduced in version 0.28. - """ - @overload - def __init__(self, cell_index: int, trans: DCplxTrans) -> None: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell_index The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - """ - @overload - def __init__(self, cell_index: int, trans: DTrans) -> None: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param trans The transformation by which to instantiate the cell - """ - @overload - def __init__(self, cell: Cell, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> None: - r""" - @brief Creates a single cell instance - @param cell The cell to instantiate - @param disp The basic displacement of the first instance - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - def __init__(self, cell: Cell, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> None: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - def __init__(self, cell: Cell, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> None: - r""" - @brief Creates a single cell instance - @param cell The cell to instantiate - @param trans The transformation by which to instantiate the cell - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - - This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. - """ - @overload - def __init__(self, cell_index: int, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> None: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param disp The basic displacement of the first instance - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - - This convenience initializer has been introduced in version 0.28. - """ - @overload - def __init__(self, cell_index: int, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> None: - r""" - @brief Creates a single cell instance with a complex transformation - @param cell_index The cell to instantiate - @param trans The complex transformation by which to instantiate the cell - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - """ - @overload - def __init__(self, cell_index: int, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> None: - r""" - @brief Creates a single cell instance - @param cell_index The cell to instantiate - @param trans The transformation by which to instantiate the cell - @param a The displacement vector of the array in the 'a' axis - @param b The displacement vector of the array in the 'b' axis - @param na The number of placements in the 'a' axis - @param nb The number of placements in the 'b' axis - """ - def __len__(self) -> int: - r""" - @brief Gets the number of single instances in the array - If the instance represents a single instance, the count is 1. Otherwise it is na*nb. Starting with version 0.27, there may be iterated instances for which the size is larger than 1, but \is_regular_array? will return false. In this case, use \each_trans or \each_cplx_trans to retrieve the individual placements of the iterated instance. - """ - def __lt__(self, other: DCellInstArray) -> bool: - r""" - @brief Compares two arrays for 'less' - The comparison provides an arbitrary sorting criterion and not specific sorting order. It is guaranteed that if an array a is less than b, b is not less than a. In addition, it a is not less than b and b is not less than a, then a is equal to b. - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two arrays for inequality - """ - def __str__(self) -> str: - r""" - @brief Converts the array to a string - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DCellInstArray) -> None: - r""" - @brief Assigns another object to self - """ - @overload - def bbox(self, layout: Layout) -> DBox: - r""" - @brief Gets the bounding box of the array - The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. - """ - @overload - def bbox(self, layout: Layout, layer_index: int) -> DBox: - r""" - @brief Gets the bounding box of the array with respect to one layer - The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. - - 'bbox' is the preferred synonym since version 0.28. - """ - def bbox_per_layer(self, layout: Layout, layer_index: int) -> DBox: - r""" - @brief Gets the bounding box of the array with respect to one layer - The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. - - 'bbox' is the preferred synonym since version 0.28. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DCellInstArray: - r""" - @brief Creates a copy of self - """ - def each_cplx_trans(self) -> Iterator[DCplxTrans]: - r""" - @brief Gets the complex transformations represented by this instance - For a single instance, this iterator will deliver the single, complex transformation. For array instances, the iterator will deliver each complex transformation of the expanded array. - This iterator is a generalization of \each_trans for general complex transformations. - """ - def each_trans(self) -> Iterator[DTrans]: - r""" - @brief Gets the simple transformations represented by this instance - For a single instance, this iterator will deliver the single, simple transformation. For array instances, the iterator will deliver each simple transformation of the expanded array. - - This iterator will only deliver valid transformations if the instance array is not of complex type (see \is_complex?). A more general iterator that delivers the complex transformations is \each_cplx_trans. - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given cell instance. This method enables cell instances as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> None: - r""" - @brief Inverts the array reference - - The inverted array reference describes in which transformations the parent cell is - seen from the current cell. - """ - def is_complex(self) -> bool: - r""" - @brief Gets a value indicating whether the array is a complex array - - Returns true if the array represents complex instances (that is, with magnification and - arbitrary rotation angles). - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_regular_array(self) -> bool: - r""" - @brief Gets a value indicating whether this instance is a regular array - """ - def size(self) -> int: - r""" - @brief Gets the number of single instances in the array - If the instance represents a single instance, the count is 1. Otherwise it is na*nb. Starting with version 0.27, there may be iterated instances for which the size is larger than 1, but \is_regular_array? will return false. In this case, use \each_trans or \each_cplx_trans to retrieve the individual placements of the iterated instance. - """ - def to_s(self) -> str: - r""" - @brief Converts the array to a string - """ - @overload - def transform(self, trans: DCplxTrans) -> None: - r""" - @brief Transforms the cell instance with the given complex transformation - """ - @overload - def transform(self, trans: DTrans) -> None: - r""" - @brief Transforms the cell instance with the given transformation - """ - @overload - def transformed(self, trans: DCplxTrans) -> DCellInstArray: - r""" - @brief Gets the transformed cell instance (complex transformation) - """ - @overload - def transformed(self, trans: DTrans) -> DCellInstArray: - r""" - @brief Gets the transformed cell instance - """ - class CellMapping: r""" @brief A cell mapping (source to target layout) @@ -5337,6 +3341,478 @@ class CellMapping: This method has been introduced in version 0.25. """ +class Circuit(NetlistObject): + r""" + @brief Circuits are the basic building blocks of the netlist + A circuit has pins by which it can connect to the outside. Pins are created using \create_pin and are represented by the \Pin class. + + Furthermore, a circuit manages the components of the netlist. Components are devices (class \Device) and subcircuits (class \SubCircuit). Devices are basic devices such as resistors or transistors. Subcircuits are other circuits to which nets from this circuit connect. Devices are created using the \create_device method. Subcircuits are created using the \create_subcircuit method. + + Devices are connected through 'terminals', subcircuits are connected through their pins. Terminals and pins are described by integer ID's in the context of most methods. + + Finally, the circuit consists of the nets. Nets connect terminals of devices and pins of subcircuits or the circuit itself. Nets are created using \create_net and are represented by objects of the \Net class. + See there for more about nets. + + The Circuit object is only valid if the netlist object is alive. Circuits must be added to a netlist using \Netlist#add to become part of the netlist. + + The Circuit class has been introduced in version 0.26. + """ + boundary: DPolygon + r""" + Getter: + @brief Gets the boundary of the circuit + Setter: + @brief Sets the boundary of the circuit + """ + cell_index: int + r""" + Getter: + @brief Gets the cell index of the circuit + See \cell_index= for details. + + Setter: + @brief Sets the cell index + The cell index relates a circuit with a cell from a layout. It's intended to hold a cell index number if the netlist was extracted from a layout. + """ + dont_purge: bool + r""" + Getter: + @brief Gets a value indicating whether the circuit can be purged on \Netlist#purge. + + Setter: + @brief Sets a value indicating whether the circuit can be purged on \Netlist#purge. + If this attribute is set to true, \Netlist#purge will never delete this circuit. + This flag therefore marks this circuit as 'precious'. + """ + name: str + r""" + Getter: + @brief Gets the name of the circuit + Setter: + @brief Sets the name of the circuit + """ + def _assign(self, other: NetlistObject) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> Circuit: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def blank(self) -> None: + r""" + @brief Blanks out the circuit + This method will remove all the innards of the circuit and just leave the pins. The pins won't be connected to inside nets anymore, but the circuit can still be called by subcircuit references. This method will eventually create a 'circuit abstract' (or black box). It will set the \dont_purge flag to mark this circuit as 'intentionally empty'. + """ + def clear(self) -> None: + r""" + @brief Clears the circuit + This method removes all objects and clears the other attributes. + """ + def combine_devices(self) -> None: + r""" + @brief Combines devices where possible + This method will combine devices that can be combined according to their device classes 'combine_devices' method. + For example, serial or parallel resistors can be combined into a single resistor. + """ + @overload + def connect_pin(self, pin: Pin, net: Net) -> None: + r""" + @brief Connects the given pin with the given net. + The net and the pin must be objects from inside the circuit. Any previous connected is resolved before this connection is made. A pin can only be connected to one net at a time. + """ + @overload + def connect_pin(self, pin_id: int, net: Net) -> None: + r""" + @brief Connects the given pin with the given net. + The net must be one inside the circuit. Any previous connected is resolved before this connection is made. A pin can only be connected to one net at a time. + """ + def create_device(self, device_class: DeviceClass, name: Optional[str] = ...) -> Device: + r""" + @brief Creates a new bound \Device object inside the circuit + This object describes a device of the circuit. The device is already attached to the device class. The name is optional and is used to identify the device in a netlist file. + + For more details see the \Device class. + """ + def create_net(self, name: Optional[str] = ...) -> Net: + r""" + @brief Creates a new \Net object inside the circuit + This object will describe a net of the circuit. The nets are basically connections between the different components of the circuit (subcircuits, devices and pins). + + A net needs to be filled with references to connect to specific objects. See the \Net class for more details. + """ + def create_pin(self, name: str) -> Pin: + r""" + @brief Creates a new \Pin object inside the circuit + This object will describe a pin of the circuit. A circuit connects to the outside through such a pin. The pin is added after all existing pins. For more details see the \Pin class. + + Starting with version 0.26.8, this method returns a reference to a \Pin object rather than a copy. + """ + def create_subcircuit(self, circuit: Circuit, name: Optional[str] = ...) -> SubCircuit: + r""" + @brief Creates a new bound \SubCircuit object inside the circuit + This object describes an instance of another circuit inside the circuit. The subcircuit is already attached to the other circuit. The name is optional and is used to identify the subcircuit in a netlist file. + + For more details see the \SubCircuit class. + """ + @overload + def device_by_id(self, id: int) -> Device: + r""" + @brief Gets the device object for a given ID. + If the ID is not a valid device ID, nil is returned. + """ + @overload + def device_by_id(self, id: int) -> Device: + r""" + @brief Gets the device object for a given ID (const version). + If the ID is not a valid device ID, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def device_by_name(self, name: str) -> Device: + r""" + @brief Gets the device object for a given name. + If the ID is not a valid device name, nil is returned. + """ + @overload + def device_by_name(self, name: str) -> Device: + r""" + @brief Gets the device object for a given name (const version). + If the ID is not a valid device name, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def disconnect_pin(self, pin: Pin) -> None: + r""" + @brief Disconnects the given pin from any net. + """ + @overload + def disconnect_pin(self, pin_id: int) -> None: + r""" + @brief Disconnects the given pin from any net. + """ + @overload + def each_child(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the child circuits of this circuit + Child circuits are the ones that are referenced from this circuit via subcircuits. + """ + @overload + def each_child(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the child circuits of this circuit (const version) + Child circuits are the ones that are referenced from this circuit via subcircuits. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def each_device(self) -> Iterator[Device]: + r""" + @brief Iterates over the devices of the circuit + """ + @overload + def each_device(self) -> Iterator[Device]: + r""" + @brief Iterates over the devices of the circuit (const version) + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def each_net(self) -> Iterator[Net]: + r""" + @brief Iterates over the nets of the circuit + """ + @overload + def each_net(self) -> Iterator[Net]: + r""" + @brief Iterates over the nets of the circuit (const version) + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def each_parent(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the parent circuits of this circuit + Child circuits are the ones that are referencing this circuit via subcircuits. + """ + @overload + def each_parent(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the parent circuits of this circuit (const version) + Child circuits are the ones that are referencing this circuit via subcircuits. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def each_pin(self) -> Iterator[Pin]: + r""" + @brief Iterates over the pins of the circuit + """ + @overload + def each_pin(self) -> Iterator[Pin]: + r""" + @brief Iterates over the pins of the circuit (const version) + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def each_ref(self) -> Iterator[SubCircuit]: + r""" + @brief Iterates over the subcircuit objects referencing this circuit + """ + @overload + def each_ref(self) -> Iterator[SubCircuit]: + r""" + @brief Iterates over the subcircuit objects referencing this circuit (const version) + + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def each_subcircuit(self) -> Iterator[SubCircuit]: + r""" + @brief Iterates over the subcircuits of the circuit + """ + @overload + def each_subcircuit(self) -> Iterator[SubCircuit]: + r""" + @brief Iterates over the subcircuits of the circuit (const version) + + This constness variant has been introduced in version 0.26.8 + """ + def flatten_subcircuit(self, subcircuit: SubCircuit) -> None: + r""" + @brief Flattens a subcircuit + This method will substitute the given subcircuit by it's contents. The subcircuit is removed after this. + """ + def has_refs(self) -> bool: + r""" + @brief Returns a value indicating whether the circuit has references + A circuit has references if there is at least one subcircuit referring to it. + """ + def join_nets(self, net: Net, with_: Net) -> None: + r""" + @brief Joins (connects) two nets into one + This method will connect the 'with' net with 'net' and remove 'with'. + + This method has been introduced in version 0.26.4. + """ + def net_by_cluster_id(self, cluster_id: int) -> Net: + r""" + @brief Gets the net object corresponding to a specific cluster ID + If the ID is not a valid pin cluster ID, nil is returned. + """ + @overload + def net_by_name(self, name: str) -> Net: + r""" + @brief Gets the net object for a given name. + If the ID is not a valid net name, nil is returned. + """ + @overload + def net_by_name(self, name: str) -> Net: + r""" + @brief Gets the net object for a given name (const version). + If the ID is not a valid net name, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def net_for_pin(self, pin: Pin) -> Net: + r""" + @brief Gets the net object attached to a specific pin. + This is the net object inside the circuit which attaches to the given outward-bound pin. + This method returns nil if the pin is not connected or the pin object is nil. + """ + @overload + def net_for_pin(self, pin: Pin) -> Net: + r""" + @brief Gets the net object attached to a specific pin (const version). + This is the net object inside the circuit which attaches to the given outward-bound pin. + This method returns nil if the pin is not connected or the pin object is nil. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def net_for_pin(self, pin_id: int) -> Net: + r""" + @brief Gets the net object attached to a specific pin. + This is the net object inside the circuit which attaches to the given outward-bound pin. + This method returns nil if the pin is not connected or the pin ID is invalid. + """ + @overload + def net_for_pin(self, pin_id: int) -> Net: + r""" + @brief Gets the net object attached to a specific pin (const version). + This is the net object inside the circuit which attaches to the given outward-bound pin. + This method returns nil if the pin is not connected or the pin ID is invalid. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def netlist(self) -> Netlist: + r""" + @brief Gets the netlist object the circuit lives in + """ + @overload + def netlist(self) -> Netlist: + r""" + @brief Gets the netlist object the circuit lives in (const version) + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def nets_by_name(self, name_pattern: str) -> List[Net]: + r""" + @brief Gets the net objects for a given name filter. + The name filter is a glob pattern. This method will return all \Net objects matching the glob pattern. + + This method has been introduced in version 0.27.3. + """ + @overload + def nets_by_name(self, name_pattern: str) -> List[Net]: + r""" + @brief Gets the net objects for a given name filter (const version). + The name filter is a glob pattern. This method will return all \Net objects matching the glob pattern. + + + This constness variant has been introduced in version 0.27.3 + """ + @overload + def pin_by_id(self, id: int) -> Pin: + r""" + @brief Gets the \Pin object corresponding to a specific ID + If the ID is not a valid pin ID, nil is returned. + """ + @overload + def pin_by_id(self, id: int) -> Pin: + r""" + @brief Gets the \Pin object corresponding to a specific ID (const version) + If the ID is not a valid pin ID, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def pin_by_name(self, name: str) -> Pin: + r""" + @brief Gets the \Pin object corresponding to a specific name + If the ID is not a valid pin name, nil is returned. + """ + @overload + def pin_by_name(self, name: str) -> Pin: + r""" + @brief Gets the \Pin object corresponding to a specific name (const version) + If the ID is not a valid pin name, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + def pin_count(self) -> int: + r""" + @brief Gets the number of pins in the circuit + """ + def purge_nets(self) -> None: + r""" + @brief Purges floating nets. + Floating nets are nets with no device or subcircuit attached to. Such floating nets are removed in this step. If these nets are connected outward to a circuit pin, this circuit pin is also removed. + """ + def purge_nets_keep_pins(self) -> None: + r""" + @brief Purges floating nets but keep pins. + This method will remove floating nets like \purge_nets, but if these nets are attached to a pin, the pin will be left disconnected from any net. + + This method has been introduced in version 0.26.2. + """ + def remove_device(self, device: Device) -> None: + r""" + @brief Removes the given device from the circuit + """ + def remove_net(self, net: Net) -> None: + r""" + @brief Removes the given net from the circuit + """ + def remove_pin(self, id: int) -> None: + r""" + @brief Removes the pin with the given ID from the circuit + + This method has been introduced in version 0.26.2. + """ + def remove_subcircuit(self, subcircuit: SubCircuit) -> None: + r""" + @brief Removes the given subcircuit from the circuit + """ + def rename_pin(self, id: int, new_name: str) -> None: + r""" + @brief Renames the pin with the given ID to 'new_name' + + This method has been introduced in version 0.26.8. + """ + @overload + def subcircuit_by_id(self, id: int) -> SubCircuit: + r""" + @brief Gets the subcircuit object for a given ID. + If the ID is not a valid subcircuit ID, nil is returned. + """ + @overload + def subcircuit_by_id(self, id: int) -> SubCircuit: + r""" + @brief Gets the subcircuit object for a given ID (const version). + If the ID is not a valid subcircuit ID, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def subcircuit_by_name(self, name: str) -> SubCircuit: + r""" + @brief Gets the subcircuit object for a given name. + If the ID is not a valid subcircuit name, nil is returned. + """ + @overload + def subcircuit_by_name(self, name: str) -> SubCircuit: + r""" + @brief Gets the subcircuit object for a given name (const version). + If the ID is not a valid subcircuit name, nil is returned. + + This constness variant has been introduced in version 0.26.8 + """ + class CompoundRegionOperationNode: r""" @brief A base class for compound DRC operations @@ -5351,6 +3827,100 @@ class CompoundRegionOperationNode: This class has been introduced in version 0.27. """ + class GeometricalOp: + r""" + @brief This class represents the CompoundRegionOperationNode::GeometricalOp enum + + This enum has been introduced in version 0.27. + """ + And: ClassVar[CompoundRegionOperationNode.GeometricalOp] + r""" + @brief Indicates a geometrical '&' (and). + """ + Not: ClassVar[CompoundRegionOperationNode.GeometricalOp] + r""" + @brief Indicates a geometrical '-' (not). + """ + Or: ClassVar[CompoundRegionOperationNode.GeometricalOp] + r""" + @brief Indicates a geometrical '|' (or). + """ + Xor: ClassVar[CompoundRegionOperationNode.GeometricalOp] + r""" + @brief Indicates a geometrical '^' (xor). + """ + @overload + @classmethod + def new(cls, i: int) -> CompoundRegionOperationNode.GeometricalOp: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> CompoundRegionOperationNode.GeometricalOp: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: CompoundRegionOperationNode.GeometricalOp) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ class LogicalOp: r""" @brief This class represents the CompoundRegionOperationNode::LogicalOp enum @@ -5398,200 +3968,16 @@ class CompoundRegionOperationNode: @brief Creates an enum from a string value """ @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload def __lt__(self, other: CompoundRegionOperationNode.LogicalOp) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - class GeometricalOp: - r""" - @brief This class represents the CompoundRegionOperationNode::GeometricalOp enum - - This enum has been introduced in version 0.27. - """ - And: ClassVar[CompoundRegionOperationNode.GeometricalOp] - r""" - @brief Indicates a geometrical '&' (and). - """ - Not: ClassVar[CompoundRegionOperationNode.GeometricalOp] - r""" - @brief Indicates a geometrical '-' (not). - """ - Or: ClassVar[CompoundRegionOperationNode.GeometricalOp] - r""" - @brief Indicates a geometrical '|' (or). - """ - Xor: ClassVar[CompoundRegionOperationNode.GeometricalOp] - r""" - @brief Indicates a geometrical '^' (xor). - """ - @overload - @classmethod - def new(cls, i: int) -> CompoundRegionOperationNode.GeometricalOp: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> CompoundRegionOperationNode.GeometricalOp: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload def __lt__(self, other: int) -> bool: r""" @brief Returns true if the enum is less (in the enum symbol order) than the integer value """ @overload - def __lt__(self, other: CompoundRegionOperationNode.GeometricalOp) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - class ResultType: - r""" - @brief This class represents the CompoundRegionOperationNode::ResultType enum - - This enum has been introduced in version 0.27. - """ - EdgePairs: ClassVar[CompoundRegionOperationNode.ResultType] - r""" - @brief Indicates edge pair result type. - """ - Edges: ClassVar[CompoundRegionOperationNode.ResultType] - r""" - @brief Indicates edge result type. - """ - Region: ClassVar[CompoundRegionOperationNode.ResultType] - r""" - @brief Indicates polygon result type. - """ - @overload - @classmethod - def new(cls, i: int) -> CompoundRegionOperationNode.ResultType: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> CompoundRegionOperationNode.ResultType: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: CompoundRegionOperationNode.ResultType) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload def __ne__(self, other: object) -> bool: r""" @brief Compares an enum with an integer for inequality @@ -5662,12 +4048,12 @@ class CompoundRegionOperationNode: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __init__(self, i: int) -> None: @@ -5680,25 +4066,25 @@ class CompoundRegionOperationNode: @brief Creates an enum from a string value """ @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload def __lt__(self, other: CompoundRegionOperationNode.ParameterType) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ @overload - def __ne__(self, other: object) -> bool: + def __lt__(self, other: int) -> bool: r""" - @brief Compares two enums for inequality + @brief Returns true if the enum is less (in the enum symbol order) than the integer value """ @overload def __ne__(self, other: object) -> bool: r""" @brief Compares an enum with an integer for inequality """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ def __repr__(self) -> str: r""" @brief Converts an enum to a visual string @@ -5770,16 +4156,106 @@ class CompoundRegionOperationNode: @brief Creates an enum from a string value """ @overload + def __lt__(self, other: CompoundRegionOperationNode.RatioParameterType) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload def __lt__(self, other: int) -> bool: r""" @brief Returns true if the enum is less (in the enum symbol order) than the integer value """ @overload - def __lt__(self, other: CompoundRegionOperationNode.RatioParameterType) -> bool: + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + class ResultType: + r""" + @brief This class represents the CompoundRegionOperationNode::ResultType enum + + This enum has been introduced in version 0.27. + """ + EdgePairs: ClassVar[CompoundRegionOperationNode.ResultType] + r""" + @brief Indicates edge pair result type. + """ + Edges: ClassVar[CompoundRegionOperationNode.ResultType] + r""" + @brief Indicates edge result type. + """ + Region: ClassVar[CompoundRegionOperationNode.ResultType] + r""" + @brief Indicates polygon result type. + """ + @overload + @classmethod + def new(cls, i: int) -> CompoundRegionOperationNode.ResultType: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> CompoundRegionOperationNode.ResultType: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: CompoundRegionOperationNode.ResultType) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload def __ne__(self, other: object) -> bool: r""" @brief Compares an enum with an integer for inequality @@ -5922,7 +4398,7 @@ class CompoundRegionOperationNode: @brief Creates a node delivering an empty result of the given type """ @classmethod - def new_enclosed_check(cls, other: CompoundRegionOperationNode, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: + def new_enclosed_check(cls, other: CompoundRegionOperationNode, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node providing an enclosed (secondary enclosing primary) check. @@ -5934,7 +4410,7 @@ class CompoundRegionOperationNode: @brief Creates a node representing an inside selection operation between the inputs. """ @classmethod - def new_enclosing_check(cls, other: CompoundRegionOperationNode, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: + def new_enclosing_check(cls, other: CompoundRegionOperationNode, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node providing an inside (enclosure) check. """ @@ -6001,7 +4477,7 @@ class CompoundRegionOperationNode: @brief Creates a node representing an interacting selection operation between the inputs. """ @classmethod - def new_isolated_check(cls, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: + def new_isolated_check(cls, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node providing a isolated polygons (space between different polygons) check. """ @@ -6071,7 +4547,7 @@ class CompoundRegionOperationNode: @brief Creates a node providing a Minkowski sum with a point sequence forming a contour. """ @classmethod - def new_notch_check(cls, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: + def new_notch_check(cls, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node providing a intra-polygon space check. """ @@ -6081,7 +4557,7 @@ class CompoundRegionOperationNode: @brief Creates a node representing an outside selection operation between the inputs. """ @classmethod - def new_overlap_check(cls, other: CompoundRegionOperationNode, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: + def new_overlap_check(cls, other: CompoundRegionOperationNode, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node providing an overlap check. """ @@ -6157,7 +4633,7 @@ class CompoundRegionOperationNode: @brief Creates a node object representing the secondary input from the given region """ @classmethod - def new_separation_check(cls, other: CompoundRegionOperationNode, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: + def new_separation_check(cls, other: CompoundRegionOperationNode, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node providing a separation check. """ @@ -6174,7 +4650,7 @@ class CompoundRegionOperationNode: @param keep_hv If true, horizontal and vertical edges are maintained. """ @classmethod - def new_space_check(cls, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: + def new_space_check(cls, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node providing a space check. """ @@ -6195,7 +4671,7 @@ class CompoundRegionOperationNode: @brief Creates a node providing a composition into trapezoids. """ @classmethod - def new_width_check(cls, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: + def new_width_check(cls, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> CompoundRegionOperationNode: r""" @brief Creates a node providing a width check. """ @@ -6268,91 +4744,36 @@ class CompoundRegionOperationNode: @brief Gets the result type of this node """ -class TrapezoidDecompositionMode: +class Connectivity: r""" - @brief This class represents the TrapezoidDecompositionMode enum used within trapezoid decomposition + @brief This class specifies connections between different layers. + Connections are build using \connect. There are basically two flavours of connections: intra-layer and inter-layer. - This enum has been introduced in version 0.27. + Intra-layer connections make nets begin propagated along different shapes on the same net. Without the intra-layer connections, nets are not propagated over shape boundaries. As this is usually intended, intra-layer connections should always be specified for each layer. + + Inter-layer connections connect shapes on different layers. Shapes which touch across layers will be connected if their layers are specified as being connected through inter-layer \connect. + + All layers are specified in terms of layer indexes. Layer indexes are layout layer indexes (see \Layout class). + + The connectivity object also manages the global nets. Global nets are substrate for example and they are propagated automatically from subcircuits to circuits. Global nets are defined by name and are managed through IDs. To get the name for a given ID, use \global_net_name. + This class has been introduced in version 0.26. """ - TD_htrapezoids: ClassVar[TrapezoidDecompositionMode] - r""" - @brief Indicates horizontal trapezoid decomposition. - """ - TD_simple: ClassVar[TrapezoidDecompositionMode] - r""" - @brief Indicates unspecific decomposition. - """ - TD_vtrapezoids: ClassVar[TrapezoidDecompositionMode] - r""" - @brief Indicates vertical trapezoid decomposition. - """ - @overload @classmethod - def new(cls, i: int) -> TrapezoidDecompositionMode: + def new(cls) -> Connectivity: r""" - @brief Creates an enum from an integer value + @brief Creates a new object of this class """ - @overload - @classmethod - def new(cls, s: str) -> TrapezoidDecompositionMode: - r""" - @brief Creates an enum from a string value - """ - def __copy__(self) -> TrapezoidDecompositionMode: + def __copy__(self) -> Connectivity: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> TrapezoidDecompositionMode: + def __deepcopy__(self) -> Connectivity: r""" @brief Creates a copy of self """ - @overload - def __eq__(self, other: object) -> bool: + def __init__(self) -> None: r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: TrapezoidDecompositionMode) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum + @brief Creates a new object of this class """ def _create(self) -> None: r""" @@ -6391,10 +4812,25 @@ class TrapezoidDecompositionMode: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: TrapezoidDecompositionMode) -> None: + def assign(self, other: Connectivity) -> None: r""" @brief Assigns another object to self """ + @overload + def connect(self, layer: int) -> None: + r""" + @brief Specifies intra-layer connectivity. + """ + @overload + def connect(self, layer_a: int, layer_b: int) -> None: + r""" + @brief Specifies inter-layer connectivity. + """ + def connect_global(self, layer: int, global_net_name: str) -> int: + r""" + @brief Connects the given layer to the global net given by name. + Returns the ID of the global net. + """ def create(self) -> None: r""" @brief Ensures the C++ object is created @@ -6412,13 +4848,17 @@ class TrapezoidDecompositionMode: 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. """ - def dup(self) -> TrapezoidDecompositionMode: + def dup(self) -> Connectivity: r""" @brief Creates a copy of self """ - def inspect(self) -> str: + def global_net_id(self, global_net_name: str) -> int: r""" - @brief Converts an enum to a visual string + @brief Gets the ID for a given global net name. + """ + def global_net_name(self, global_net_id: int) -> str: + r""" + @brief Gets the name for a given global net ID. """ def is_const_object(self) -> bool: r""" @@ -6426,262 +4866,126 @@ class TrapezoidDecompositionMode: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ -class PreferredOrientation: +class CplxTrans: r""" - @brief This class represents the PreferredOrientation enum used within polygon decomposition + @brief A complex transformation - This enum has been introduced in version 0.27. - """ - PO_any: ClassVar[PreferredOrientation] - r""" - @brief Indicates any orientation. - """ - PO_horizontal: ClassVar[PreferredOrientation] - r""" - @brief Indicates horizontal orientation. - """ - PO_htrapezoids: ClassVar[PreferredOrientation] - r""" - @brief Indicates horizontal trapezoid decomposition. - """ - PO_vertical: ClassVar[PreferredOrientation] - r""" - @brief Indicates vertical orientation. - """ - PO_vtrapezoids: ClassVar[PreferredOrientation] - r""" - @brief Indicates vertical trapezoid decomposition. - """ - @overload - @classmethod - def new(cls, i: int) -> PreferredOrientation: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> PreferredOrientation: - r""" - @brief Creates an enum from a string value - """ - def __copy__(self) -> PreferredOrientation: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> PreferredOrientation: - r""" - @brief Creates a copy of self - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: PreferredOrientation) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary + angle and a displacement. This is also the order, the operations are applied. + This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications. - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar. - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: PreferredOrientation) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> PreferredOrientation: - r""" - @brief Creates a copy of self - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ + Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: -class Edge: - r""" - @brief An edge class + @code + # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree + # and displacement of 10 in x and 20 units in y direction: + t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) + t.to_s # r90 *1.5 10,20 + # compute the inverse: + t.inverted.to_s # r270 *0.666666667 -13,7 + # Combine with another displacement (applied after that): + (RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 + # Transform a point: + t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 + @/code - An edge is a connection between points, usually participating in a larger context such as a polygon. An edge has a defined direction (from p1 to p2). Edges play a role in the database as parts of polygons and to describe a line through both points. - Although supported, edges are rarely used as individual database objects. - - See @The Database API@ for more details about the database objects like the Edge class. + The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. + See @The Database API@ for more details about the database objects. """ - p1: Point + M0: ClassVar[CplxTrans] + r""" + @brief A constant giving "mirrored at the x-axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M135: ClassVar[CplxTrans] + r""" + @brief A constant giving "mirrored at the 135 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M45: ClassVar[CplxTrans] + r""" + @brief A constant giving "mirrored at the 45 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M90: ClassVar[CplxTrans] + r""" + @brief A constant giving "mirrored at the y (90 degree) axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R0: ClassVar[CplxTrans] + r""" + @brief A constant giving "unrotated" (unit) transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R180: ClassVar[CplxTrans] + r""" + @brief A constant giving "rotated by 180 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R270: ClassVar[CplxTrans] + r""" + @brief A constant giving "rotated by 270 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R90: ClassVar[CplxTrans] + r""" + @brief A constant giving "rotated by 90 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + angle: float r""" Getter: - @brief The first point. + @brief Gets the angle + + Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. + + @return The rotation angle this transformation provides in degree units (0..360 deg). Setter: - @brief Sets the first point. - This method has been added in version 0.23. + @brief Sets the angle + @param a The new angle + See \angle for a description of that attribute. """ - p2: Point + disp: DVector r""" Getter: - @brief The second point. + @brief Gets the displacement Setter: - @brief Sets the second point. - This method has been added in version 0.23. + @brief Sets the displacement + @param u The new displacement """ - x1: int + mag: float r""" Getter: - @brief Shortcut for p1.x + @brief Gets the magnification Setter: - @brief Sets p1.x - This method has been added in version 0.23. + @brief Sets the magnification + @param m The new magnification """ - x2: int + mirror: bool r""" Getter: - @brief Shortcut for p2.x + @brief Gets the mirror flag + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. Setter: - @brief Sets p2.x - This method has been added in version 0.23. - """ - y1: int - r""" - Getter: - @brief Shortcut for p1.y - - Setter: - @brief Sets p1.y - This method has been added in version 0.23. - """ - y2: int - r""" - Getter: - @brief Shortcut for p2.y - - Setter: - @brief Sets p2.y - This method has been added in version 0.23. + @brief Sets the mirror flag + "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag """ @classmethod - def from_dedge(cls, dedge: DEdge) -> Edge: + def from_dtrans(cls, trans: DCplxTrans) -> CplxTrans: r""" - @brief Creates an integer coordinate edge from a floating-point coordinate edge + @brief Creates a floating-point coordinate transformation from another coordinate flavour - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge'. + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. """ @classmethod - def from_s(cls, s: str) -> Edge: + def from_s(cls, s: str) -> CplxTrans: r""" @brief Creates an object from a string Creates the object from a string representation (as returned by \to_s) @@ -6690,133 +4994,1136 @@ class Edge: """ @overload @classmethod - def new(cls) -> Edge: + def new(cls) -> CplxTrans: r""" - @brief Default constructor: creates a degenerated edge 0,0 to 0,0 + @brief Creates a unit transformation """ @overload @classmethod - def new(cls, dedge: DEdge) -> Edge: + def new(cls, c: CplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> CplxTrans: r""" - @brief Creates an integer coordinate edge from a floating-point coordinate edge + @brief Creates a transformation from another transformation plus a magnification and displacement - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge'. + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement """ @overload @classmethod - def new(cls, p1: Point, p2: Point) -> Edge: + def new(cls, c: CplxTrans, m: float, x: int, y: int) -> CplxTrans: r""" - @brief Constructor with two points + @brief Creates a transformation from another transformation plus a magnification and displacement - Two points are given to create a new edge. + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) """ @overload @classmethod - def new(cls, x1: int, y1: int, x2: int, y2: int) -> Edge: + def new(cls, m: float) -> CplxTrans: r""" - @brief Constructor with two coordinates given as single values + @brief Creates a transformation from a magnification - Two points are given to create a new edge. + Creates a magnifying transformation without displacement and rotation given the magnification m. """ + @overload @classmethod - def new_pp(cls, p1: Point, p2: Point) -> Edge: + def new(cls, mag: float, rot: float, mirrx: bool, u: DVector) -> CplxTrans: r""" - @brief Constructor with two points + @brief Creates a transformation using magnification, angle, mirror flag and displacement - Two points are given to create a new edge. + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement """ + @overload @classmethod - def new_xyxy(cls, x1: int, y1: int, x2: int, y2: int) -> Edge: + def new(cls, mag: float, rot: float, mirrx: bool, x: float, y: float) -> CplxTrans: r""" - @brief Constructor with two coordinates given as single values + @brief Creates a transformation using magnification, angle, mirror flag and displacement - Two points are given to create a new edge. + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement """ - def __copy__(self) -> Edge: + @overload + @classmethod + def new(cls, t: Trans) -> CplxTrans: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + @classmethod + def new(cls, t: Trans, m: float) -> CplxTrans: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + @classmethod + def new(cls, trans: DCplxTrans) -> CplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + @classmethod + def new(cls, trans: ICplxTrans) -> CplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, trans: VCplxTrans) -> CplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, u: DVector) -> CplxTrans: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + @classmethod + def new(cls, x: float, y: float) -> CplxTrans: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + def __copy__(self) -> CplxTrans: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> Edge: + def __deepcopy__(self) -> CplxTrans: r""" @brief Creates a copy of self """ - def __eq__(self, e: object) -> bool: + def __eq__(self, other: object) -> bool: r""" - @brief Equality test - @param e The object to compare against + @brief Tests for equality """ def __hash__(self) -> int: r""" @brief Computes a hash value - Returns a hash value for the given edge. This method enables edges as hash keys. + Returns a hash value for the given transformation. This method enables transformations as hash keys. This method has been introduced in version 0.25. """ @overload def __init__(self) -> None: r""" - @brief Default constructor: creates a degenerated edge 0,0 to 0,0 + @brief Creates a unit transformation """ @overload - def __init__(self, dedge: DEdge) -> None: + def __init__(self, c: CplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> None: r""" - @brief Creates an integer coordinate edge from a floating-point coordinate edge + @brief Creates a transformation from another transformation plus a magnification and displacement - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge'. + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement """ @overload - def __init__(self, p1: Point, p2: Point) -> None: + def __init__(self, c: CplxTrans, m: float, x: int, y: int) -> None: r""" - @brief Constructor with two points + @brief Creates a transformation from another transformation plus a magnification and displacement - Two points are given to create a new edge. + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) """ @overload - def __init__(self, x1: int, y1: int, x2: int, y2: int) -> None: + def __init__(self, m: float) -> None: r""" - @brief Constructor with two coordinates given as single values + @brief Creates a transformation from a magnification - Two points are given to create a new edge. + Creates a magnifying transformation without displacement and rotation given the magnification m. """ - def __lt__(self, e: Edge) -> bool: + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, u: DVector) -> None: r""" - @brief Less operator - @param e The object to compare against - @return True, if the edge is 'less' as the other edge with respect to first and second point - """ - def __mul__(self, scale_factor: float) -> Edge: - r""" - @brief Scale edge + @brief Creates a transformation using magnification, angle, mirror flag and displacement - The * operator scales self with the given factor. + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, x: float, y: float) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + @overload + def __init__(self, t: Trans) -> None: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + def __init__(self, t: Trans, m: float) -> None: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + def __init__(self, trans: DCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + def __init__(self, trans: ICplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, trans: VCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, u: DVector) -> None: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + def __init__(self, x: float, y: float) -> None: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + def __lt__(self, other: CplxTrans) -> bool: + r""" + @brief Provides a 'less' criterion for sorting + This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. + """ + @overload + def __mul__(self, box: Box) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, d: int) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __mul__(self, edge: Edge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: Point) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: Vector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: Path) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: Polygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, t: CplxTrans) -> CplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, t: ICplxTrans) -> CplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, t: VCplxTrans) -> DCplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, text: Text) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Tests for inequality + """ + @overload + def __rmul__(self, box: Box) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, d: int) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __rmul__(self, edge: Edge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: Point) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: Vector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: Path) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: Polygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, text: Text) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __str__(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: CplxTrans) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def ctrans(self, d: int) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> CplxTrans: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> CplxTrans: + r""" + @brief Inverts the transformation (in place) + + Inverts the transformation and replaces this transformation by it's + inverted one. + + @return The inverted transformation + """ + def inverted(self) -> VCplxTrans: + r""" + @brief Returns the inverted transformation + + Returns the inverted transformation. This method does not modify the transformation. + + @return The inverted transformation + """ + def is_complex(self) -> bool: + r""" + @brief Returns true if the transformation is a complex one + + If this predicate is false, the transformation can safely be converted to a simple transformation. + Otherwise, this conversion will be lossy. + The predicate value is equivalent to 'is_mag || !is_ortho'. + + This method has been introduced in version 0.27.5. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_mag(self) -> bool: + r""" + @brief Tests, if the transformation is a magnifying one + + This is the recommended test for checking if the transformation represents + a magnification. + """ + def is_mirror(self) -> bool: + r""" + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + """ + def is_ortho(self) -> bool: + r""" + @brief Tests, if the transformation is an orthogonal transformation + + If the rotation is by a multiple of 90 degree, this method will return true. + """ + def is_unity(self) -> bool: + r""" + @brief Tests, whether this is a unit transformation + """ + def rot(self) -> int: + r""" + @brief Returns the respective simple transformation equivalent rotation code if possible + + If this transformation is orthogonal (is_ortho () == true), then this method + will return the corresponding fixpoint transformation, not taking into account + magnification and displacement. If the transformation is not orthogonal, the result + reflects the quadrant the rotation goes into. + """ + def s_trans(self) -> Trans: + r""" + @brief Extracts the simple transformation part + + The simple transformation part does not reflect magnification or arbitrary angles. + Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. + """ + def to_itrans(self, dbu: Optional[float] = ...) -> ICplxTrans: + r""" + @brief Converts the transformation to another transformation with integer input and output coordinates + + The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def to_trans(self) -> DCplxTrans: + r""" + @brief Converts the transformation to another transformation with floating-point input coordinates + + This method has been introduced in version 0.25. + """ + def to_vtrans(self, dbu: Optional[float] = ...) -> VCplxTrans: + r""" + @brief Converts the transformation to another transformation with integer output and floating-point input coordinates + + The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + @overload + def trans(self, box: Box) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, edge: Edge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, p: Point) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def trans(self, p: Vector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def trans(self, path: Path) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, polygon: Polygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, text: Text) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + +class DBox: + r""" + @brief A box class with floating-point coordinates + + This object represents a box (a rectangular shape). + + The definition of the attributes is: p1 is the lower left point, p2 the + upper right one. If a box is constructed from two points (or four coordinates), the + coordinates are sorted accordingly. + + A box can be empty. An empty box represents no area + (not even a point). Empty boxes behave neutral with respect to most operations. + Empty boxes return true on \empty?. + + A box can be a point or a single + line. In this case, the area is zero but the box still + can overlap other boxes for example and it is not empty. + + See @The Database API@ for more details about the database objects. + """ + bottom: float + r""" + Getter: + @brief Gets the bottom coordinate of the box + + Setter: + @brief Sets the bottom coordinate of the box + """ + left: float + r""" + Getter: + @brief Gets the left coordinate of the box + + Setter: + @brief Sets the left coordinate of the box + """ + p1: DPoint + r""" + Getter: + @brief Gets the lower left point of the box + + Setter: + @brief Sets the lower left point of the box + """ + p2: DPoint + r""" + Getter: + @brief Gets the upper right point of the box + + Setter: + @brief Sets the upper right point of the box + """ + right: float + r""" + Getter: + @brief Gets the right coordinate of the box + + Setter: + @brief Sets the right coordinate of the box + """ + top: float + r""" + Getter: + @brief Gets the top coordinate of the box + + Setter: + @brief Sets the top coordinate of the box + """ + @classmethod + def from_ibox(cls, box: Box) -> DBox: + r""" + @brief Creates a floating-point coordinate box from an integer coordinate box + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ibox'. + """ + @classmethod + def from_s(cls, s: str) -> DBox: + r""" + @brief Creates a box object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DBox: + r""" + @brief Creates an empty (invalid) box + + Empty boxes don't modify a box when joined with it. The intersection between an empty and any other box is also an empty box. The width, height, p1 and p2 attributes of an empty box are undefined. Use \empty? to get a value indicating whether the box is empty. + """ + @overload + @classmethod + def new(cls, box: Box) -> DBox: + r""" + @brief Creates a floating-point coordinate box from an integer coordinate box + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ibox'. + """ + @overload + @classmethod + def new(cls, left: float, bottom: float, right: float, top: float) -> DBox: + r""" + @brief Creates a box with four coordinates + + + Four coordinates are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. + """ + @overload + @classmethod + def new(cls, lower_left: DPoint, upper_right: DPoint) -> DBox: + r""" + @brief Creates a box from two points + + + Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. + """ + @overload + @classmethod + def new(cls, w: float) -> DBox: + r""" + @brief Creates a square with the given dimensions centered around the origin + + Note that for integer-unit boxes, the dimension has to be an even number to avoid rounding. + + This convenience constructor has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, w: float, h: float) -> DBox: + r""" + @brief Creates a rectangle with given width and height, centered around the origin + + Note that for integer-unit boxes, the dimensions have to be an even number to avoid rounding. + + This convenience constructor has been introduced in version 0.28. + """ + @classmethod + def world(cls) -> DBox: + r""" + @brief Gets the 'world' box + The world box is the biggest box that can be represented. So it is basically 'all'. The world box behaves neutral on intersections for example. In other operations such as displacement or transformations, the world box may render unexpected results because of coordinate overflow. + + The world box can be used + @ul + @li for comparison ('==', '!=', '<') @/li + @li in union and intersection ('+' and '&') @/li + @li in relations (\contains?, \overlaps?, \touches?) @/li + @li as 'all' argument in region queries @/li + @/ul + + This method has been introduced in version 0.28. + """ + @overload + def __add__(self, box: DBox) -> DBox: + r""" + @brief Joins two boxes + + + The + operator joins the first box with the one given as + the second argument. Joining constructs a box that encloses + both boxes given. Empty boxes are neutral: they do not + change another box when joining. Overwrites this box + with the result. + + @param box The box to join with this box. + + @return The joined box + """ + @overload + def __add__(self, point: DPoint) -> DBox: + r""" + @brief Joins box with a point + + + The + operator joins a point with the box. The resulting box will enclose both the original box and the point. + + @param point The point to join with this box. + + @return The box joined with the point + """ + def __and__(self, box: DBox) -> DBox: + r""" + @brief Returns the intersection of this box with another box + + + The intersection of two boxes is the largest + box common to both boxes. The intersection may be + empty if both boxes to not touch. If the boxes do + not overlap but touch the result may be a single + line or point with an area of zero. Overwrites this box + with the result. + + @param box The box to take the intersection with + + @return The intersection box + """ + def __copy__(self) -> DBox: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DBox: + r""" + @brief Creates a copy of self + """ + def __eq__(self, box: object) -> bool: + r""" + @brief Returns true if this box is equal to the other box + Returns true, if this box and the given box are equal + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given box. This method enables boxes as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates an empty (invalid) box + + Empty boxes don't modify a box when joined with it. The intersection between an empty and any other box is also an empty box. The width, height, p1 and p2 attributes of an empty box are undefined. Use \empty? to get a value indicating whether the box is empty. + """ + @overload + def __init__(self, box: Box) -> None: + r""" + @brief Creates a floating-point coordinate box from an integer coordinate box + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ibox'. + """ + @overload + def __init__(self, left: float, bottom: float, right: float, top: float) -> None: + r""" + @brief Creates a box with four coordinates + + + Four coordinates are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. + """ + @overload + def __init__(self, lower_left: DPoint, upper_right: DPoint) -> None: + r""" + @brief Creates a box from two points + + + Two points are given to create a new box. If the coordinates are not provided in the correct order (i.e. right < left), these are swapped. + """ + @overload + def __init__(self, w: float) -> None: + r""" + @brief Creates a square with the given dimensions centered around the origin + + Note that for integer-unit boxes, the dimension has to be an even number to avoid rounding. + + This convenience constructor has been introduced in version 0.28. + """ + @overload + def __init__(self, w: float, h: float) -> None: + r""" + @brief Creates a rectangle with given width and height, centered around the origin + + Note that for integer-unit boxes, the dimensions have to be an even number to avoid rounding. + + This convenience constructor has been introduced in version 0.28. + """ + def __lt__(self, box: DBox) -> bool: + r""" + @brief Returns true if this box is 'less' than another box + Returns true, if this box is 'less' with respect to first and second point (in this order) + """ + @overload + def __mul__(self, box: DBox) -> DBox: + r""" + @brief Returns the convolution product from this box with another box + + + The * operator convolves the firstbox with the one given as + the second argument. The box resulting from "convolution" is the + outer boundary of the union set formed by placing + the second box at every point of the first. In other words, + the returned box of (p1,p2)*(q1,q2) is (p1+q1,p2+q2). + + @param box The box to convolve with this box. + + @return The convolved box + """ + @overload + def __mul__(self, scale_factor: float) -> DBox: + r""" + @brief Returns the scaled box + + + The * operator scales the box with the given factor and returns the result. This method has been introduced in version 0.22. @param scale_factor The scaling factor - @return The scaled edge + @return The scaled box """ - def __ne__(self, e: object) -> bool: + def __ne__(self, box: object) -> bool: r""" - @brief Inequality test - @param e The object to compare against + @brief Returns true if this box is not equal to the other box + Returns true, if this box and the given box are not equal """ - def __rmul__(self, scale_factor: float) -> Edge: + @overload + def __rmul__(self, box: DBox) -> DBox: r""" - @brief Scale edge + @brief Returns the convolution product from this box with another box - The * operator scales self with the given factor. + + The * operator convolves the firstbox with the one given as + the second argument. The box resulting from "convolution" is the + outer boundary of the union set formed by placing + the second box at every point of the first. In other words, + the returned box of (p1,p2)*(q1,q2) is (p1+q1,p2+q2). + + @param box The box to convolve with this box. + + @return The convolved box + """ + @overload + def __rmul__(self, scale_factor: float) -> DBox: + r""" + @brief Returns the scaled box + + + The * operator scales the box with the given factor and returns the result. This method has been introduced in version 0.22. @param scale_factor The scaling factor - @return The scaled edge + @return The scaled box """ def __str__(self, dbu: Optional[float] = ...) -> str: r""" - @brief Returns a string representing the edge - If a DBU is given, the output units will be micrometers. + @brief Returns a string representing this box + + This string can be turned into a box again by using \from_s + . If a DBU is given, the output units will be micrometers. The DBU argument has been added in version 0.27.6. """ @@ -6857,112 +6164,56 @@ class Edge: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: Edge) -> None: + def area(self) -> float: + r""" + @brief Computes the box area + + Returns the box area or 0 if the box is empty + """ + def assign(self, other: DBox) -> None: r""" @brief Assigns another object to self """ - def bbox(self) -> Box: + def bbox(self) -> DBox: r""" - @brief Return the bounding box of the edge. + @brief Returns the bounding box + This method is provided for consistency of the shape API is returns the box itself. + + This method has been introduced in version 0.27. """ - def clipped(self, box: Box) -> Any: + def center(self) -> DPoint: r""" - @brief Returns the edge clipped at the given box - - @param box The clip box. - @return The clipped edge or nil if the edge does not intersect with the box. - - This method has been introduced in version 0.26.2. + @brief Gets the center of the box """ - def clipped_line(self, box: Box) -> Any: + @overload + def contains(self, point: DPoint) -> bool: r""" - @brief Returns the line through the edge clipped at the given box + @brief Returns true if the box contains the given point - @param box The clip box. - @return The part of the line through the box or nil if the line does not intersect with the box. - In contrast to \clipped, this method will consider the edge extended infinitely (a "line"). The returned edge will be the part of this line going through the box. + Tests whether a point is inside the box. + It also returns true if the point is exactly on the box contour. - This method has been introduced in version 0.26.2. + @param p The point to test against. + + @return true if the point is inside the box. """ - def coincident(self, e: Edge) -> bool: + @overload + def contains(self, x: float, y: float) -> bool: r""" - @brief Coincidence check. + @brief Returns true if the box contains the given point - Checks whether a edge is coincident with another edge. - Coincidence is defined by being parallel and that - at least one point of one edge is on the other edge. - @param e the edge to test with + Tests whether a point (x, y) is inside the box. + It also returns true if the point is exactly on the box contour. - @return True if the edges are coincident. - """ - def contains(self, p: Point) -> bool: - r""" - @brief Test whether a point is on an edge. - - A point is on a edge if it is on (or at least closer - than a grid point to) the edge. - - @param p The point to test with the edge. - - @return True if the point is on the edge. - """ - def contains_excl(self, p: Point) -> bool: - r""" - @brief Test whether a point is on an edge excluding the endpoints. - - A point is on a edge if it is on (or at least closer - than a grid point to) the edge. - - @param p The point to test with the edge. - - @return True if the point is on the edge but not equal p1 or p2. + @return true if the point is inside the box. """ def create(self) -> None: r""" @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. """ - def crossed_by(self, e: Edge) -> bool: - r""" - @brief Check, if an edge is cut by a line (given by an edge) - - This method returns true if p1 is in one semispace - while p2 is in the other or one of them is on the line - through the edge "e" - - @param e The edge representing the line that the edge must be crossing. - """ - def crossing_point(self, e: Edge) -> Point: - r""" - @brief Returns the crossing point on two edges. - - This method delivers the point where the given edge (self) crosses the line given by the edge in argument "e". If self does not cross this line, the result is undefined. See \crossed_by? for a description of the crossing predicate. - - @param e The edge representing the line that self must be crossing. - @return The point where self crosses the line given by "e". - - This method has been introduced in version 0.19. - """ - def cut_point(self, e: Edge) -> Any: - r""" - @brief Returns the intersection point of the lines through the two edges. - - This method delivers the intersection point between the lines through the two edges. If the lines are parallel and do not intersect, the result will be nil. - In contrast to \intersection_point, this method will regard the edges as infinitely extended and intersection is not confined to the edge span. - - @param e The edge to test. - @return The point where the lines intersect. - - This method has been introduced in version 0.27.1. - """ - def d(self) -> Vector: - r""" - @brief Gets the edge extension as a vector. - This method is equivalent to p2 - p1. - This method has been introduced in version 0.26.2. - """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -6975,139 +6226,113 @@ class Edge: 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. """ - def distance(self, p: Point) -> int: - r""" - @brief Distance between the edge and a point. - - Returns the distance between the edge and the point. The - distance is signed which is negative if the point is to the - "right" of the edge and positive if the point is to the "left". - The distance is measured by projecting the point onto the - line through the edge. If the edge is degenerated, the distance - is not defined. - - @param p The point to test. - - @return The distance - """ - def distance_abs(self, p: Point) -> int: - r""" - @brief Absolute distance between the edge and a point. - - Returns the distance between the edge and the point. - - @param p The point to test. - - @return The distance - """ - def dup(self) -> Edge: + def dup(self) -> DBox: r""" @brief Creates a copy of self """ - def dx(self) -> int: + def empty(self) -> bool: r""" - @brief The horizontal extend of the edge. + @brief Returns a value indicating whether the box is empty + + An empty box may be created with the default constructor for example. Such a box is neutral when combining it with other boxes and renders empty boxes if used in box intersections and false in geometrical relationship tests. """ - def dx_abs(self) -> int: + @overload + def enlarge(self, d: float) -> DBox: r""" - @brief The absolute value of the horizontal extend of the edge. + @brief Enlarges the box by a certain amount on all sides. + + This is a convenience method which takes one values instead of two values. It will apply the given enlargement in both directions. + This method has been introduced in version 0.28. + + @return A reference to this box. """ - def dy(self) -> int: + @overload + def enlarge(self, dx: float, dy: float) -> DBox: r""" - @brief The vertical extend of the edge. - """ - def dy_abs(self) -> int: - r""" - @brief The absolute value of the vertical extend of the edge. - """ - def enlarge(self, p: Vector) -> Edge: - r""" - @brief Enlarges the edge. + @brief Enlarges the box by a certain amount. - Enlarges the edge by the given distance and returns the - enlarged edge. The edge is overwritten. - Enlargement means - that the first point is shifted by -p, the second by p. - - @param p The distance to move the edge points. - - @return The enlarged edge. - """ - def enlarged(self, p: Vector) -> Edge: - r""" - @brief Returns the enlarged edge (does not modify self) - - Enlarges the edge by the given offset and returns the - enlarged edge. The edge is not modified. Enlargement means - that the first point is shifted by -p, the second by p. - - @param p The distance to move the edge points. - - @return The enlarged edge. - """ - def extend(self, d: int) -> Edge: - r""" - @brief Extends the edge (modifies self) - - Extends the edge by the given distance and returns the - extended edge. The edge is not modified. Extending means - that the first point is shifted by -d along the edge, the second by d. - The length of the edge will increase by 2*d. - - \extended is a version that does not modify self but returns the extended edges. + This is a convenience method which takes two values instead of a Vector object. This method has been introduced in version 0.23. - @param d The distance by which to shift the end points. - - @return The extended edge (self). + @return A reference to this box. """ - def extended(self, d: int) -> Edge: + @overload + def enlarge(self, enlargement: DVector) -> DBox: r""" - @brief Returns the extended edge (does not modify self) + @brief Enlarges the box by a certain amount. - Extends the edge by the given distance and returns the - extended edge. The edge is not modified. Extending means - that the first point is shifted by -d along the edge, the second by d. - The length of the edge will increase by 2*d. - \extend is a version that modifies self (in-place). + Enlarges the box by x and y value specified in the vector + passed. Positive values with grow the box, negative ones + will shrink the box. The result may be an empty box if the + box disappears. The amount specifies the grow or shrink + per edge. The width and height will change by twice the + amount. + Does not check for coordinate + overflows. + @param enlargement The grow or shrink amount in x and y direction + + @return A reference to this box. + """ + @overload + def enlarged(self, d: float) -> DBox: + r""" + @brief Enlarges the box by a certain amount on all sides. + + This is a convenience method which takes one values instead of two values. It will apply the given enlargement in both directions. + This method has been introduced in version 0.28. + + @return The enlarged box. + """ + @overload + def enlarged(self, dx: float, dy: float) -> DBox: + r""" + @brief Enlarges the box by a certain amount. + + + This is a convenience method which takes two values instead of a Vector object. This method has been introduced in version 0.23. - @param d The distance by which to shift the end points. + @return The enlarged box. + """ + @overload + def enlarged(self, enlargement: DVector) -> DBox: + r""" + @brief Returns the enlarged box. - @return The extended edge. + + Enlarges the box by x and y value specified in the vector + passed. Positive values with grow the box, negative ones + will shrink the box. The result may be an empty box if the + box disappears. The amount specifies the grow or shrink + per edge. The width and height will change by twice the + amount. + Does not modify this box. Does not check for coordinate + overflows. + + @param enlargement The grow or shrink amount in x and y direction + + @return The enlarged box. """ def hash(self) -> int: r""" @brief Computes a hash value - Returns a hash value for the given edge. This method enables edges as hash keys. + Returns a hash value for the given box. This method enables boxes as hash keys. This method has been introduced in version 0.25. """ - def intersect(self, e: Edge) -> bool: + def height(self) -> float: r""" - @brief Intersection test. - - Returns true if the edges intersect. Two edges intersect if they share at least one point. - If the edges coincide, they also intersect. - For degenerated edges, the intersection is mapped to - point containment tests. - - @param e The edge to test. + @brief Gets the height of the box """ - def intersection_point(self, e: Edge) -> Any: + def inside(self, box: DBox) -> bool: r""" - @brief Returns the intersection point of two edges. + @brief Tests if this box is inside the argument box - This method delivers the intersection point. If the edges do not intersect, the result will be nil. - @param e The edge to test. - @return The point where the edges intersect. - - This method has been introduced in version 0.19. - From version 0.26.2, this method will return nil in case of non-intersection. + Returns true, if this box is inside the given box, i.e. the box intersection renders this box """ def is_const_object(self) -> bool: r""" @@ -7115,208 +6340,1583 @@ class Edge: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def is_degenerate(self) -> bool: + def is_point(self) -> bool: r""" - @brief Test for degenerated edge - - An edge is degenerate, if both end and start point are identical. - """ - def is_parallel(self, e: Edge) -> bool: - r""" - @brief Test for being parallel - - @param e The edge to test against - - @return True if both edges are parallel - """ - def length(self) -> int: - r""" - @brief The length of the edge + @brief Returns true, if the box is a single point """ @overload - def move(self, p: Vector) -> Edge: + def move(self, distance: DVector) -> DBox: r""" - @brief Moves the edge. + @brief Moves the box by a certain distance - Moves the edge by the given offset and returns the - moved edge. The edge is overwritten. - @param p The distance to move the edge. + Moves the box by a given offset and returns the moved + box. Does not check for coordinate overflows. - @return The moved edge. + @param distance The offset to move the box. + + @return A reference to this box. """ @overload - def move(self, dx: int, dy: int) -> Edge: + def move(self, dx: float, dy: float) -> DBox: r""" - @brief Moves the edge. + @brief Moves the box by a certain distance - Moves the edge by the given offset and returns the - moved edge. The edge is overwritten. - - @param dx The x distance to move the edge. - @param dy The y distance to move the edge. - - @return The moved edge. - - This version has been added in version 0.23. - """ - @overload - def moved(self, p: Vector) -> Edge: - r""" - @brief Returns the moved edge (does not modify self) - - Moves the edge by the given offset and returns the - moved edge. The edge is not modified. - - @param p The distance to move the edge. - - @return The moved edge. - """ - @overload - def moved(self, dx: int, dy: int) -> Edge: - r""" - @brief Returns the moved edge (does not modify self) - - Moves the edge by the given offset and returns the - moved edge. The edge is not modified. - - @param dx The x distance to move the edge. - @param dy The y distance to move the edge. - - @return The moved edge. - - This version has been added in version 0.23. - """ - def ortho_length(self) -> int: - r""" - @brief The orthogonal length of the edge ("manhattan-length") - - @return The orthogonal length (abs(dx)+abs(dy)) - """ - def shift(self, d: int) -> Edge: - r""" - @brief Shifts the edge (modifies self) - - Shifts the edge by the given distance and returns the - shifted edge. The edge is not modified. Shifting by a positive value will produce an edge which is shifted by d to the left. Shifting by a negative value will produce an edge which is shifted by d to the right. - - \shifted is a version that does not modify self but returns the extended edges. + This is a convenience method which takes two values instead of a Point object. This method has been introduced in version 0.23. - @param d The distance by which to shift the edge. - - @return The shifted edge (self). + @return A reference to this box. """ - def shifted(self, d: int) -> Edge: + @overload + def moved(self, distance: DVector) -> DBox: r""" - @brief Returns the shifted edge (does not modify self) + @brief Returns the box moved by a certain distance - Shifts the edge by the given distance and returns the - shifted edge. The edge is not modified. Shifting by a positive value will produce an edge which is shifted by d to the left. Shifting by a negative value will produce an edge which is shifted by d to the right. - \shift is a version that modifies self (in-place). + Moves the box by a given offset and returns the moved + box. Does not modify this box. Does not check for coordinate + overflows. + @param distance The offset to move the box. + + @return The moved box. + """ + @overload + def moved(self, dx: float, dy: float) -> DBox: + r""" + @brief Moves the box by a certain distance + + + This is a convenience method which takes two values instead of a Point object. This method has been introduced in version 0.23. - @param d The distance by which to shift the edge. - - @return The shifted edge. + @return The moved box. """ - def side_of(self, p: Point) -> int: + def overlaps(self, box: DBox) -> bool: r""" - @brief Indicates at which side the point is located relative to the edge. + @brief Tests if this box overlaps the argument box - Returns 1 if the point is "left" of the edge, 0 if on - and -1 if the point is "right" of the edge. - @param p The point to test. - - @return The side value + Returns true, if the intersection box of this box with the argument box exists and has a non-vanishing area """ - def sq_length(self) -> int: + def perimeter(self) -> float: r""" - @brief The square of the length of the edge - """ - def swap_points(self) -> Edge: - r""" - @brief Swap the points of the edge + @brief Returns the perimeter of the box - This version modifies self. A version that does not modify self is \swapped_points. Swapping the points basically reverses the direction of the edge. + This method is equivalent to 2*(width+height). For empty boxes, this method returns 0. This method has been introduced in version 0.23. """ - def swapped_points(self) -> Edge: + def to_itype(self, dbu: Optional[float] = ...) -> Box: r""" - @brief Returns an edge in which both points are swapped + @brief Converts the box to an integer coordinate box - Swapping the points basically reverses the direction of the edge. - - This method has been introduced in version 0.23. - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DEdge: - r""" - @brief Converts the edge to a floating-point coordinate edge - - The database unit can be specified to translate the integer-coordinate edge into a floating-point coordinate edge in micron units. The database unit is basically a scaling factor. + The database unit can be specified to translate the floating-point coordinate box in micron units to an integer-coordinate box in database units. The boxes coordinates will be divided by the database unit. This method has been introduced in version 0.25. """ def to_s(self, dbu: Optional[float] = ...) -> str: r""" - @brief Returns a string representing the edge - If a DBU is given, the output units will be micrometers. + @brief Returns a string representing this box + + This string can be turned into a box again by using \from_s + . If a DBU is given, the output units will be micrometers. The DBU argument has been added in version 0.27.6. """ - @overload - def transformed(self, t: CplxTrans) -> DEdge: + def touches(self, box: DBox) -> bool: r""" - @brief Transform the edge. + @brief Tests if this box touches the argument box - Transforms the edge with the given complex transformation. - Does not modify the edge but returns the transformed edge. - @param t The transformation to apply. - - @return The transformed edge. + Two boxes touch if they overlap or their boundaries share at least one common point. Touching is equivalent to a non-empty intersection ('!(b1 & b2).empty?'). """ @overload - def transformed(self, t: ICplxTrans) -> Edge: + def transformed(self, t: DCplxTrans) -> DBox: r""" - @brief Transform the edge. + @brief Returns the box transformed with the given complex transformation - Transforms the edge with the given complex transformation. - Does not modify the edge but returns the transformed edge. - @param t The transformation to apply. - - @return The transformed edge (in this case an integer coordinate edge). - - This method has been introduced in version 0.18. + @param t The magnifying transformation to apply + @return The transformed box (a DBox now) """ @overload - def transformed(self, t: Trans) -> Edge: + def transformed(self, t: DTrans) -> DBox: r""" - @brief Transform the edge. + @brief Returns the box transformed with the given simple transformation - Transforms the edge with the given transformation. - Does not modify the edge but returns the transformed edge. - @param t The transformation to apply. - - @return The transformed edge. + @param t The transformation to apply + @return The transformed box """ - def transformed_cplx(self, t: CplxTrans) -> DEdge: + @overload + def transformed(self, t: VCplxTrans) -> Box: r""" - @brief Transform the edge. + @brief Transforms the box with the given complex transformation - Transforms the edge with the given complex transformation. - Does not modify the edge but returns the transformed edge. - @param t The transformation to apply. + @param t The magnifying transformation to apply + @return The transformed box (in this case an integer coordinate box) - @return The transformed edge. + This method has been introduced in version 0.25. + """ + def width(self) -> float: + r""" + @brief Gets the width of the box + """ + +class DCellInstArray: + r""" + @brief A single or array cell instance in micrometer units + This object is identical to \CellInstArray, except that it holds coordinates in micron units instead of database units. + + This class has been introduced in version 0.25. + """ + a: DVector + r""" + Getter: + @brief Gets the displacement vector for the 'a' axis + + Setter: + @brief Sets the displacement vector for the 'a' axis + + If the instance was not regular before this property is set, it will be initialized to a regular instance. + """ + b: DVector + r""" + Getter: + @brief Gets the displacement vector for the 'b' axis + + Setter: + @brief Sets the displacement vector for the 'b' axis + + If the instance was not regular before this property is set, it will be initialized to a regular instance. + """ + cell_index: int + r""" + Getter: + @brief Gets the cell index of the cell instantiated + Use \Layout#cell to get the \Cell object from the cell index. + Setter: + @brief Sets the index of the cell this instance refers to + """ + cplx_trans: DCplxTrans + r""" + Getter: + @brief Gets the complex transformation of the first instance in the array + This method is always applicable, compared to \trans, since simple transformations can be expressed as complex transformations as well. + Setter: + @brief Sets the complex transformation of the instance or the first instance in the array + """ + @property + def cell(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the cell this instance refers to + This is a convenience method and equivalent to 'cell_index = cell.cell_index()'. There is no getter for the cell pointer because the \CellInstArray object only knows about cell indexes. + + This convenience method has been introduced in version 0.28. + """ + na: int + r""" + Getter: + @brief Gets the number of instances in the 'a' axis + + Setter: + @brief Sets the number of instances in the 'a' axis + + If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. + To make an instance a single instance, set na or nb to 0. + """ + nb: int + r""" + Getter: + @brief Gets the number of instances in the 'b' axis + + Setter: + @brief Sets the number of instances in the 'b' axis + + If the instance was not regular before this property is set to a value larger than zero, it will be initialized to a regular instance. + To make an instance a single instance, set na or nb to 0. + """ + trans: DTrans + r""" + Getter: + @brief Gets the transformation of the first instance in the array + The transformation returned is only valid if the array does not represent a complex transformation array + Setter: + @brief Sets the transformation of the instance or the first instance in the array + """ + @overload + @classmethod + def new(cls) -> DCellInstArray: + r""" + @brief Creates en empty cell instance with size 0 + """ + @overload + @classmethod + def new(cls, cell: Cell, disp: DVector) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The displacement + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: DCplxTrans) -> DCellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: DTrans) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell: Cell, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, disp: DVector) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The displacement + This convenience initializer has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience initializer has been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: DCplxTrans) -> DCellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell_index The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell_index The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: DTrans) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param trans The transformation by which to instantiate the cell + """ + @overload + @classmethod + def new(cls, cell_index: int, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> DCellInstArray: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param trans The transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + """ + def __copy__(self) -> DCellInstArray: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DCellInstArray: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two arrays for equality + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given cell instance. This method enables cell instances as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates en empty cell instance with size 0 + """ + @overload + def __init__(self, cell: Cell, disp: DVector) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The displacement + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: DCplxTrans) -> None: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: DTrans) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell: Cell, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance + @param cell The cell to instantiate + @param trans The transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience variant takes a \Cell pointer and is equivalent to using 'cell.cell_index()'. It has been introduced in version 0.28. + """ + @overload + def __init__(self, cell_index: int, disp: DVector) -> None: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The displacement + This convenience initializer has been introduced in version 0.28. + """ + @overload + def __init__(self, cell_index: int, disp: DVector, a: DVector, b: DVector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param disp The basic displacement of the first instance + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + + This convenience initializer has been introduced in version 0.28. + """ + @overload + def __init__(self, cell_index: int, trans: DCplxTrans) -> None: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell_index The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + """ + @overload + def __init__(self, cell_index: int, trans: DCplxTrans, a: DVector, b: DVector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance with a complex transformation + @param cell_index The cell to instantiate + @param trans The complex transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + """ + @overload + def __init__(self, cell_index: int, trans: DTrans) -> None: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param trans The transformation by which to instantiate the cell + """ + @overload + def __init__(self, cell_index: int, trans: DTrans, a: DVector, b: DVector, na: int, nb: int) -> None: + r""" + @brief Creates a single cell instance + @param cell_index The cell to instantiate + @param trans The transformation by which to instantiate the cell + @param a The displacement vector of the array in the 'a' axis + @param b The displacement vector of the array in the 'b' axis + @param na The number of placements in the 'a' axis + @param nb The number of placements in the 'b' axis + """ + def __len__(self) -> int: + r""" + @brief Gets the number of single instances in the array + If the instance represents a single instance, the count is 1. Otherwise it is na*nb. Starting with version 0.27, there may be iterated instances for which the size is larger than 1, but \is_regular_array? will return false. In this case, use \each_trans or \each_cplx_trans to retrieve the individual placements of the iterated instance. + """ + def __lt__(self, other: DCellInstArray) -> bool: + r""" + @brief Compares two arrays for 'less' + The comparison provides an arbitrary sorting criterion and not specific sorting order. It is guaranteed that if an array a is less than b, b is not less than a. In addition, it a is not less than b and b is not less than a, then a is equal to b. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two arrays for inequality + """ + def __str__(self) -> str: + r""" + @brief Converts the array to a string + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DCellInstArray) -> None: + r""" + @brief Assigns another object to self + """ + @overload + def bbox(self, layout: Layout) -> DBox: + r""" + @brief Gets the bounding box of the array + The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. + """ + @overload + def bbox(self, layout: Layout, layer_index: int) -> DBox: + r""" + @brief Gets the bounding box of the array with respect to one layer + The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. + + 'bbox' is the preferred synonym since version 0.28. + """ + def bbox_per_layer(self, layout: Layout, layer_index: int) -> DBox: + r""" + @brief Gets the bounding box of the array with respect to one layer + The bounding box incorporates all instances that the array represents. It needs the layout object to access the actual cell from the cell index. + + 'bbox' is the preferred synonym since version 0.28. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DCellInstArray: + r""" + @brief Creates a copy of self + """ + def each_cplx_trans(self) -> Iterator[DCplxTrans]: + r""" + @brief Gets the complex transformations represented by this instance + For a single instance, this iterator will deliver the single, complex transformation. For array instances, the iterator will deliver each complex transformation of the expanded array. + This iterator is a generalization of \each_trans for general complex transformations. + """ + def each_trans(self) -> Iterator[DTrans]: + r""" + @brief Gets the simple transformations represented by this instance + For a single instance, this iterator will deliver the single, simple transformation. For array instances, the iterator will deliver each simple transformation of the expanded array. + + This iterator will only deliver valid transformations if the instance array is not of complex type (see \is_complex?). A more general iterator that delivers the complex transformations is \each_cplx_trans. + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given cell instance. This method enables cell instances as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> None: + r""" + @brief Inverts the array reference + + The inverted array reference describes in which transformations the parent cell is + seen from the current cell. + """ + def is_complex(self) -> bool: + r""" + @brief Gets a value indicating whether the array is a complex array + + Returns true if the array represents complex instances (that is, with magnification and + arbitrary rotation angles). + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_regular_array(self) -> bool: + r""" + @brief Gets a value indicating whether this instance is a regular array + """ + def size(self) -> int: + r""" + @brief Gets the number of single instances in the array + If the instance represents a single instance, the count is 1. Otherwise it is na*nb. Starting with version 0.27, there may be iterated instances for which the size is larger than 1, but \is_regular_array? will return false. In this case, use \each_trans or \each_cplx_trans to retrieve the individual placements of the iterated instance. + """ + def to_s(self) -> str: + r""" + @brief Converts the array to a string + """ + @overload + def transform(self, trans: DCplxTrans) -> None: + r""" + @brief Transforms the cell instance with the given complex transformation + """ + @overload + def transform(self, trans: DTrans) -> None: + r""" + @brief Transforms the cell instance with the given transformation + """ + @overload + def transformed(self, trans: DCplxTrans) -> DCellInstArray: + r""" + @brief Gets the transformed cell instance (complex transformation) + """ + @overload + def transformed(self, trans: DTrans) -> DCellInstArray: + r""" + @brief Gets the transformed cell instance + """ + +class DCplxTrans: + r""" + @brief A complex transformation + + A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary + angle and a displacement. This is also the order, the operations are applied. + + A complex transformation provides a superset of the simple transformation. + In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. + This version can transform floating-point coordinate objects. + + Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar. + + Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: + + @code + # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree + # and displacement of 10 in x and 20 units in y direction: + t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) + t.to_s # r90 *1.5 10,20 + # compute the inverse: + t.inverted.to_s # r270 *0.666666667 -13,7 + # Combine with another displacement (applied after that): + (RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 + # Transform a point: + t.trans(RBA::Point::new(100, 200)).to_s # -290,170 + @/code + + See @The Database API@ for more details about the database objects. + """ + M0: ClassVar[DCplxTrans] + r""" + @brief A constant giving "mirrored at the x-axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M135: ClassVar[DCplxTrans] + r""" + @brief A constant giving "mirrored at the 135 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M45: ClassVar[DCplxTrans] + r""" + @brief A constant giving "mirrored at the 45 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M90: ClassVar[DCplxTrans] + r""" + @brief A constant giving "mirrored at the y (90 degree) axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R0: ClassVar[DCplxTrans] + r""" + @brief A constant giving "unrotated" (unit) transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R180: ClassVar[DCplxTrans] + r""" + @brief A constant giving "rotated by 180 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R270: ClassVar[DCplxTrans] + r""" + @brief A constant giving "rotated by 270 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R90: ClassVar[DCplxTrans] + r""" + @brief A constant giving "rotated by 90 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + angle: float + r""" + Getter: + @brief Gets the angle + + Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. + + @return The rotation angle this transformation provides in degree units (0..360 deg). + + Setter: + @brief Sets the angle + @param a The new angle + See \angle for a description of that attribute. + """ + disp: DVector + r""" + Getter: + @brief Gets the displacement + + Setter: + @brief Sets the displacement + @param u The new displacement + """ + mag: float + r""" + Getter: + @brief Gets the magnification + + Setter: + @brief Sets the magnification + @param m The new magnification + """ + mirror: bool + r""" + Getter: + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + Setter: + @brief Sets the mirror flag + "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + """ + @classmethod + def from_itrans(cls, trans: CplxTrans) -> DCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @classmethod + def from_s(cls, s: str) -> DCplxTrans: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DCplxTrans: + r""" + @brief Creates a unit transformation + """ + @overload + @classmethod + def new(cls, c: DCplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> DCplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + @classmethod + def new(cls, c: DCplxTrans, m: float, x: float, y: float) -> DCplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + @classmethod + def new(cls, m: float) -> DCplxTrans: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, u: DVector) -> DCplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, x: float, y: float) -> DCplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + @overload + @classmethod + def new(cls, t: DTrans) -> DCplxTrans: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + @classmethod + def new(cls, t: DTrans, m: float) -> DCplxTrans: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + @classmethod + def new(cls, trans: CplxTrans) -> DCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @overload + @classmethod + def new(cls, trans: ICplxTrans) -> DCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, trans: VCplxTrans) -> DCplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, u: DVector) -> DCplxTrans: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + @classmethod + def new(cls, x: float, y: float) -> DCplxTrans: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + def __copy__(self) -> DCplxTrans: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DCplxTrans: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Tests for equality + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a unit transformation + """ + @overload + def __init__(self, c: DCplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + def __init__(self, c: DCplxTrans, m: float, x: float, y: float) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + def __init__(self, m: float) -> None: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, u: DVector) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, x: float, y: float) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + @overload + def __init__(self, t: DTrans) -> None: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + def __init__(self, t: DTrans, m: float) -> None: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + def __init__(self, trans: CplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @overload + def __init__(self, trans: ICplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, trans: VCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, u: DVector) -> None: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + def __init__(self, x: float, y: float) -> None: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + def __lt__(self, other: DCplxTrans) -> bool: + r""" + @brief Provides a 'less' criterion for sorting + This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. + """ + @overload + def __mul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __mul__(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, t: CplxTrans) -> CplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, t: DCplxTrans) -> DCplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Tests for inequality + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __rmul__(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __str__(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DCplxTrans) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def ctrans(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DCplxTrans: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> DCplxTrans: + r""" + @brief Inverts the transformation (in place) + + Inverts the transformation and replaces this transformation by it's + inverted one. + + @return The inverted transformation + """ + def inverted(self) -> DCplxTrans: + r""" + @brief Returns the inverted transformation + + Returns the inverted transformation. This method does not modify the transformation. + + @return The inverted transformation + """ + def is_complex(self) -> bool: + r""" + @brief Returns true if the transformation is a complex one + + If this predicate is false, the transformation can safely be converted to a simple transformation. + Otherwise, this conversion will be lossy. + The predicate value is equivalent to 'is_mag || !is_ortho'. + + This method has been introduced in version 0.27.5. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_mag(self) -> bool: + r""" + @brief Tests, if the transformation is a magnifying one + + This is the recommended test for checking if the transformation represents + a magnification. + """ + def is_mirror(self) -> bool: + r""" + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + """ + def is_ortho(self) -> bool: + r""" + @brief Tests, if the transformation is an orthogonal transformation + + If the rotation is by a multiple of 90 degree, this method will return true. + """ + def is_unity(self) -> bool: + r""" + @brief Tests, whether this is a unit transformation + """ + def rot(self) -> int: + r""" + @brief Returns the respective simple transformation equivalent rotation code if possible + + If this transformation is orthogonal (is_ortho () == true), then this method + will return the corresponding fixpoint transformation, not taking into account + magnification and displacement. If the transformation is not orthogonal, the result + reflects the quadrant the rotation goes into. + """ + def s_trans(self) -> DTrans: + r""" + @brief Extracts the simple transformation part + + The simple transformation part does not reflect magnification or arbitrary angles. + Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. + """ + def to_itrans(self, dbu: Optional[float] = ...) -> ICplxTrans: + r""" + @brief Converts the transformation to another transformation with integer input and output coordinates + + The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def to_trans(self) -> CplxTrans: + r""" + @brief Converts the transformation to another transformation with integer input coordinates + + This method has been introduced in version 0.25. + """ + def to_vtrans(self, dbu: Optional[float] = ...) -> VCplxTrans: + r""" + @brief Converts the transformation to another transformation with integer output coordinates + + The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + @overload + def trans(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def trans(self, p: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def trans(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. """ class DEdge: @@ -7844,18 +8444,6 @@ class DEdge: @brief The length of the edge """ @overload - def move(self, p: DVector) -> DEdge: - r""" - @brief Moves the edge. - - Moves the edge by the given offset and returns the - moved edge. The edge is overwritten. - - @param p The distance to move the edge. - - @return The moved edge. - """ - @overload def move(self, dx: float, dy: float) -> DEdge: r""" @brief Moves the edge. @@ -7871,12 +8459,12 @@ class DEdge: This version has been added in version 0.23. """ @overload - def moved(self, p: DVector) -> DEdge: + def move(self, p: DVector) -> DEdge: r""" - @brief Returns the moved edge (does not modify self) + @brief Moves the edge. Moves the edge by the given offset and returns the - moved edge. The edge is not modified. + moved edge. The edge is overwritten. @param p The distance to move the edge. @@ -7897,6 +8485,18 @@ class DEdge: This version has been added in version 0.23. """ + @overload + def moved(self, p: DVector) -> DEdge: + r""" + @brief Returns the moved edge (does not modify self) + + Moves the edge by the given offset and returns the + moved edge. The edge is not modified. + + @param p The distance to move the edge. + + @return The moved edge. + """ def ortho_length(self) -> float: r""" @brief The orthogonal length of the edge ("manhattan-length") @@ -8025,328 +8625,6 @@ class DEdge: @return The transformed edge. """ -class EdgePair: - r""" - @brief An edge pair (a pair of two edges) - Edge pairs are objects representing two edges or parts of edges. They play a role mainly in the context of DRC functions, where they specify a DRC violation by connecting two edges which violate the condition checked. Within the framework of polygon and edge collections which provide DRC functionality, edges pairs are used in the form of edge pair collections (\EdgePairs). - - Edge pairs basically consist of two edges, called first and second. If created by a two-layer DRC function, the first edge will correspond to edges from the first layer and the second to edges from the second layer. - - This class has been introduced in version 0.23. - """ - first: Edge - r""" - Getter: - @brief Gets the first edge - - Setter: - @brief Sets the first edge - """ - second: Edge - r""" - Getter: - @brief Gets the second edge - - Setter: - @brief Sets the second edge - """ - symmetric: bool - r""" - Getter: - @brief Returns a value indicating whether the edge pair is symmetric - For symmetric edge pairs, the edges are commutable. Specifically, a symmetric edge pair with (e1,e2) is identical to (e2,e1). Symmetric edge pairs are generated by some checks for which there is no directed error marker (width, space, notch, isolated). - - Symmetric edge pairs have been introduced in version 0.27. - - Setter: - @brief Sets a value indicating whether the edge pair is symmetric - See \symmetric? for a description of this attribute. - - Symmetric edge pairs have been introduced in version 0.27. - """ - @classmethod - def from_s(cls, s: str) -> EdgePair: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - @overload - @classmethod - def new(cls) -> EdgePair: - r""" - @brief Default constructor - - This constructor creates an default edge pair. - """ - @overload - @classmethod - def new(cls, dedge_pair: DEdgePair) -> EdgePair: - r""" - @brief Creates an integer coordinate edge pair from a floating-point coordinate edge pair - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge_pair'. - """ - @overload - @classmethod - def new(cls, first: Edge, second: Edge, symmetric: Optional[bool] = ...) -> EdgePair: - r""" - @brief Constructor from two edges - - This constructor creates an edge pair from the two edges given. - See \symmetric? for a description of this attribute. - """ - def __copy__(self) -> EdgePair: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> EdgePair: - r""" - @brief Creates a copy of self - """ - def __eq__(self, box: object) -> bool: - r""" - @brief Equality - Returns true, if this edge pair and the given one are equal - - This method has been introduced in version 0.25. - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given edge pair. This method enables edge pairs as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor - - This constructor creates an default edge pair. - """ - @overload - def __init__(self, dedge_pair: DEdgePair) -> None: - r""" - @brief Creates an integer coordinate edge pair from a floating-point coordinate edge pair - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge_pair'. - """ - @overload - def __init__(self, first: Edge, second: Edge, symmetric: Optional[bool] = ...) -> None: - r""" - @brief Constructor from two edges - - This constructor creates an edge pair from the two edges given. - See \symmetric? for a description of this attribute. - """ - def __lt__(self, box: EdgePair) -> bool: - r""" - @brief Less operator - Returns true, if this edge pair is 'less' with respect to first and second edge - - This method has been introduced in version 0.25. - """ - def __ne__(self, box: object) -> bool: - r""" - @brief Inequality - Returns true, if this edge pair and the given one are not equal - - This method has been introduced in version 0.25. - """ - def __str__(self, dbu: Optional[float] = ...) -> str: - r""" - @brief Returns a string representing the edge pair - If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def area(self) -> int: - r""" - @brief Gets the area between the edges of the edge pair - - This attribute has been introduced in version 0.28. - """ - def assign(self, other: EdgePair) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> Box: - r""" - @brief Gets the bounding box of the edge pair - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> EdgePair: - r""" - @brief Creates a copy of self - """ - def greater(self) -> Edge: - r""" - @brief Gets the 'greater' edge for symmetric edge pairs - As first and second edges are commutable for symmetric edge pairs (see \symmetric?), this accessor allows retrieving a 'second' edge in a way independent on the actual assignment. - - This read-only attribute has been introduced in version 0.27. - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given edge pair. This method enables edge pairs as hash keys. - - This method has been introduced in version 0.25. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def lesser(self) -> Edge: - r""" - @brief Gets the 'lesser' edge for symmetric edge pairs - As first and second edges are commutable for symmetric edge pairs (see \symmetric?), this accessor allows retrieving a 'first' edge in a way independent on the actual assignment. - - This read-only attribute has been introduced in version 0.27. - """ - def normalized(self) -> EdgePair: - r""" - @brief Normalizes the edge pair - This method normalized the edge pair such that when connecting the edges at their - start and end points a closed loop is formed which is oriented clockwise. To achieve this, the points of the first and/or first and second edge are swapped. Normalization is a first step recommended before converting an edge pair to a polygon, because that way the polygons won't be self-overlapping and the enlargement parameter is applied properly. - """ - def perimeter(self) -> int: - r""" - @brief Gets the perimeter of the edge pair - - The perimeter is defined as the sum of the lengths of both edges ('active perimeter'). - - This attribute has been introduced in version 0.28. - """ - def polygon(self, e: int) -> Polygon: - r""" - @brief Convert an edge pair to a polygon - The polygon is formed by connecting the end and start points of the edges. It is recommended to use \normalized before converting the edge pair to a polygon. - - The enlargement parameter applies the specified enlargement parallel and perpendicular to the edges. Basically this introduces a bias which blows up edge pairs by the specified amount. That parameter is useful to convert degenerated edge pairs to valid polygons, i.e. edge pairs with coincident edges and edge pairs consisting of two point-like edges. - - Another version for converting edge pairs to simple polygons is \simple_polygon which renders a \SimplePolygon object. - @param e The enlargement (set to zero for exact representation) - """ - def simple_polygon(self, e: int) -> SimplePolygon: - r""" - @brief Convert an edge pair to a simple polygon - The polygon is formed by connecting the end and start points of the edges. It is recommended to use \normalized before converting the edge pair to a polygon. - - The enlargement parameter applies the specified enlargement parallel and perpendicular to the edges. Basically this introduces a bias which blows up edge pairs by the specified amount. That parameter is useful to convert degenerated edge pairs to valid polygons, i.e. edge pairs with coincident edges and edge pairs consisting of two point-like edges. - - Another version for converting edge pairs to polygons is \polygon which renders a \Polygon object. - @param e The enlargement (set to zero for exact representation) - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DEdgePair: - r""" - @brief Converts the edge pair to a floating-point coordinate edge pair - - The database unit can be specified to translate the integer-coordinate edge pair into a floating-point coordinate edge pair in micron units. The database unit is basically a scaling factor. - - This method has been introduced in version 0.25. - """ - def to_s(self, dbu: Optional[float] = ...) -> str: - r""" - @brief Returns a string representing the edge pair - If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - @overload - def transformed(self, t: CplxTrans) -> DEdgePair: - r""" - @brief Returns the transformed edge pair - - Transforms the edge pair with the given complex transformation. - Does not modify the edge pair but returns the transformed edge. - - @param t The transformation to apply. - - @return The transformed edge pair - """ - @overload - def transformed(self, t: ICplxTrans) -> EdgePair: - r""" - @brief Returns the transformed edge pair - - Transforms the edge pair with the given complex transformation. - Does not modify the edge pair but returns the transformed edge. - - @param t The transformation to apply. - - @return The transformed edge pair (in this case an integer coordinate edge pair). - """ - @overload - def transformed(self, t: Trans) -> EdgePair: - r""" - @brief Returns the transformed pair - - Transforms the edge pair with the given transformation. - Does not modify the edge pair but returns the transformed edge. - - @param t The transformation to apply. - - @return The transformed edge pair - """ - class DEdgePair: r""" @brief An edge pair (a pair of two edges) @@ -8668,10353 +8946,6 @@ class DEdgePair: This method has been introduced in version 0.25. """ -class EdgePairs(ShapeCollection): - r""" - @brief EdgePairs (a collection of edge pairs) - - Edge pairs are used mainly in the context of the DRC functions (width_check, space_check etc.) of \Region and \Edges. A single edge pair represents two edges participating in a DRC violation. In the two-layer checks (inside, overlap) The first edge represents an edge from the first layer and the second edge an edge from the second layer. For single-layer checks (width, space) the order of the edges is arbitrary. - - This class has been introduced in version 0.23. - """ - @overload - @classmethod - def new(cls) -> EdgePairs: - r""" - @brief Default constructor - - This constructor creates an empty edge pair collection. - """ - @overload - @classmethod - def new(cls, array: Sequence[EdgePair]) -> EdgePairs: - r""" - @brief Constructor from an edge pair array - - This constructor creates an edge pair collection from an array of \EdgePair objects. - - This constructor has been introduced in version 0.26. - """ - @overload - @classmethod - def new(cls, edge_pair: EdgePair) -> EdgePairs: - r""" - @brief Constructor from a single edge pair object - - This constructor creates an edge pair collection with a single edge pair. - - This constructor has been introduced in version 0.26. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator) -> EdgePairs: - r""" - @brief Constructor from a hierarchical shape set - - This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. - Only edge pairs are taken from the shape set and other shapes are ignored. - This method allows feeding the edge pair collection from a hierarchy of cells. - Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer)) - @/code - - This constructor has been introduced in version 0.26. - """ - @overload - @classmethod - def new(cls, shapes: Shapes) -> EdgePairs: - r""" - @brief Shapes constructor - - This constructor creates an edge pair collection from a \Shapes collection. - - This constructor has been introduced in version 0.26. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> EdgePairs: - r""" - @brief Creates a hierarchical edge pair collection from an original layer - - This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. - This version will create a hierarchical edge pair collection which supports hierarchical operations. - Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer)) - @/code - - This constructor has been introduced in version 0.26. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> EdgePairs: - r""" - @brief Constructor from a hierarchical shape set with a transformation - - This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. - Only edge pairs are taken from the shape set and other shapes are ignored. - The given transformation is applied to each edge pair taken. - This method allows feeding the edge pair collection from a hierarchy of cells. - The transformation is useful to scale to a specific database unit for example. - Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - - This constructor has been introduced in version 0.26. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> EdgePairs: - r""" - @brief Creates a hierarchical edge pair collection from an original layer with a transformation - - This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. - This version will create a hierarchical edge pair collection which supports hierarchical operations. - The transformation is useful to scale to a specific database unit for example. - Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - - This constructor has been introduced in version 0.26. - """ - def __add__(self, other: EdgePairs) -> EdgePairs: - r""" - @brief Returns the combined edge pair collection of self and the other one - - @return The resulting edge pair collection - - This operator adds the edge pairs of the other collection to self and returns a new combined set. - - This method has been introduced in version 0.24. - """ - def __copy__(self) -> EdgePairs: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> EdgePairs: - r""" - @brief Creates a copy of self - """ - def __getitem__(self, n: int) -> EdgePair: - r""" - @brief Returns the nth edge pair - - This method returns nil if the index is out of range. It is available for flat edge pairs only - i.e. those for which \has_valid_edge_pairs? is true. Use \flatten to explicitly flatten an edge pair collection. - - The \each iterator is the more general approach to access the edge pairs. - """ - def __iadd__(self, other: EdgePairs) -> EdgePairs: - r""" - @brief Adds the edge pairs of the other edge pair collection to self - - @return The edge pair collection after modification (self) - - This operator adds the edge pairs of the other collection to self. - - This method has been introduced in version 0.24. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor - - This constructor creates an empty edge pair collection. - """ - @overload - def __init__(self, array: Sequence[EdgePair]) -> None: - r""" - @brief Constructor from an edge pair array - - This constructor creates an edge pair collection from an array of \EdgePair objects. - - This constructor has been introduced in version 0.26. - """ - @overload - def __init__(self, edge_pair: EdgePair) -> None: - r""" - @brief Constructor from a single edge pair object - - This constructor creates an edge pair collection with a single edge pair. - - This constructor has been introduced in version 0.26. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator) -> None: - r""" - @brief Constructor from a hierarchical shape set - - This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. - Only edge pairs are taken from the shape set and other shapes are ignored. - This method allows feeding the edge pair collection from a hierarchy of cells. - Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer)) - @/code - - This constructor has been introduced in version 0.26. - """ - @overload - def __init__(self, shapes: Shapes) -> None: - r""" - @brief Shapes constructor - - This constructor creates an edge pair collection from a \Shapes collection. - - This constructor has been introduced in version 0.26. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> None: - r""" - @brief Creates a hierarchical edge pair collection from an original layer - - This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. - This version will create a hierarchical edge pair collection which supports hierarchical operations. - Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer)) - @/code - - This constructor has been introduced in version 0.26. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: - r""" - @brief Constructor from a hierarchical shape set with a transformation - - This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. - Only edge pairs are taken from the shape set and other shapes are ignored. - The given transformation is applied to each edge pair taken. - This method allows feeding the edge pair collection from a hierarchy of cells. - The transformation is useful to scale to a specific database unit for example. - Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - - This constructor has been introduced in version 0.26. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> None: - r""" - @brief Creates a hierarchical edge pair collection from an original layer with a transformation - - This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. - This version will create a hierarchical edge pair collection which supports hierarchical operations. - The transformation is useful to scale to a specific database unit for example. - Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - - This constructor has been introduced in version 0.26. - """ - def __iter__(self) -> Iterator[EdgePair]: - r""" - @brief Returns each edge pair of the edge pair collection - """ - def __len__(self) -> int: - r""" - @brief Returns the (flat) number of edge pairs in the edge pair collection - - The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated. - - Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. - """ - def __str__(self) -> str: - r""" - @brief Converts the edge pair collection to a string - The length of the output is limited to 20 edge pairs to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ShapeCollection) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> Box: - r""" - @brief Return the bounding box of the edge pair collection - The bounding box is the box enclosing all points of all edge pairs. - """ - def clear(self) -> None: - r""" - @brief Clears the edge pair collection - """ - def count(self) -> int: - r""" - @brief Returns the (flat) number of edge pairs in the edge pair collection - - The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated. - - Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. - """ - def create(self) -> None: - r""" - @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. - """ - def data_id(self) -> int: - r""" - @brief Returns the data ID (a unique identifier for the underlying data storage) - - This method has been added in version 0.26. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def disable_progress(self) -> None: - r""" - @brief Disable progress reporting - Calling this method will disable progress reporting. See \enable_progress. - """ - def dup(self) -> EdgePairs: - r""" - @brief Creates a copy of self - """ - def each(self) -> Iterator[EdgePair]: - r""" - @brief Returns each edge pair of the edge pair collection - """ - def edges(self) -> Edges: - r""" - @brief Decomposes the edge pairs into single edges - @return An edge collection containing the individual edges - """ - def enable_progress(self, label: str) -> None: - r""" - @brief Enable progress reporting - After calling this method, the edge pair collection will report the progress through a progress bar while expensive operations are running. - The label is a text which is put in front of the progress bar. - Using a progress bar will imply a performance penalty of a few percent typically. - """ - @overload - def extents(self) -> Region: - r""" - @brief Returns a region with the bounding boxes of the edge pairs - This method will return a region consisting of the bounding boxes of the edge pairs. - The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. - """ - @overload - def extents(self, d: int) -> Region: - r""" - @brief Returns a region with the enlarged bounding boxes of the edge pairs - This method will return a region consisting of the bounding boxes of the edge pairs enlarged by the given distance d. - The enlargement is specified per edge, i.e the width and height will be increased by 2*d. - The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. - """ - @overload - def extents(self, dx: int, dy: int) -> Region: - r""" - @brief Returns a region with the enlarged bounding boxes of the edge pairs - This method will return a region consisting of the bounding boxes of the edge pairs enlarged by the given distance dx in x direction and dy in y direction. - The enlargement is specified per edge, i.e the width will be increased by 2*dx. - The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. - """ - def first_edges(self) -> Edges: - r""" - @brief Returns the first one of all edges - @return An edge collection containing the first edges - """ - def flatten(self) -> None: - r""" - @brief Explicitly flattens an edge pair collection - - If the collection is already flat (i.e. \has_valid_edge_pairs? returns true), this method will not change the collection. - - This method has been introduced in version 0.26. - """ - def has_valid_edge_pairs(self) -> bool: - r""" - @brief Returns true if the edge pair collection is flat and individual edge pairs can be accessed randomly - - This method has been introduced in version 0.26. - """ - def hier_count(self) -> int: - r""" - @brief Returns the (hierarchical) number of edge pairs in the edge pair collection - - The count is computed 'hierarchical', i.e. edge pairs inside a cell are counted once even if the cell is instantiated multiple times. - - This method has been introduced in version 0.27. - """ - @overload - def insert(self, edge_pair: EdgePair) -> None: - r""" - @brief Inserts an edge pair into the collection - """ - @overload - def insert(self, edge_pairs: EdgePairs) -> None: - r""" - @brief Inserts all edge pairs from the other edge pair collection into this edge pair collection - This method has been introduced in version 0.25. - """ - @overload - def insert(self, first: Edge, second: Edge) -> None: - r""" - @brief Inserts an edge pair into the collection - """ - def insert_into(self, layout: Layout, cell_index: int, layer: int) -> None: - r""" - @brief Inserts this edge pairs into the given layout, below the given cell and into the given layer. - If the edge pair collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. - - This method has been introduced in version 0.26. - """ - def insert_into_as_polygons(self, layout: Layout, cell_index: int, layer: int, e: int) -> None: - r""" - @brief Inserts this edge pairs into the given layout, below the given cell and into the given layer. - If the edge pair collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. - - The edge pairs will be converted to polygons with the enlargement value given be 'e'. - - This method has been introduced in version 0.26. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_deep(self) -> bool: - r""" - @brief Returns true if the edge pair collection is a deep (hierarchical) one - - This method has been added in version 0.26. - """ - def is_empty(self) -> bool: - r""" - @brief Returns true if the collection is empty - """ - @overload - def move(self, p: Vector) -> EdgePairs: - r""" - @brief Moves the edge pair collection - - Moves the edge pairs by the given offset and returns the - moved edge pair collection. The edge pair collection is overwritten. - - @param p The distance to move the edge pairs. - - @return The moved edge pairs (self). - - Starting with version 0.25 the displacement is of vector type. - """ - @overload - def move(self, x: int, y: int) -> EdgePairs: - r""" - @brief Moves the edge pair collection - - Moves the edge pairs by the given offset and returns the - moved edge pairs. The edge pair collection is overwritten. - - @param x The x distance to move the edge pairs. - @param y The y distance to move the edge pairs. - - @return The moved edge pairs (self). - """ - @overload - def moved(self, p: Vector) -> EdgePairs: - r""" - @brief Returns the moved edge pair collection (does not modify self) - - Moves the edge pairs by the given offset and returns the - moved edge pairs. The edge pair collection is not modified. - - @param p The distance to move the edge pairs. - - @return The moved edge pairs. - - Starting with version 0.25 the displacement is of vector type. - """ - @overload - def moved(self, x: int, y: int) -> EdgePairs: - r""" - @brief Returns the moved edge pair collection (does not modify self) - - Moves the edge pairs by the given offset and returns the - moved edge pairs. The edge pair collection is not modified. - - @param x The x distance to move the edge pairs. - @param y The y distance to move the edge pairs. - - @return The moved edge pairs. - """ - @overload - def polygons(self) -> Region: - r""" - @brief Converts the edge pairs to polygons - This method creates polygons from the edge pairs. Each polygon will be a triangle or quadrangle which connects the start and end points of the edges forming the edge pair. - """ - @overload - def polygons(self, e: int) -> Region: - r""" - @brief Converts the edge pairs to polygons - This method creates polygons from the edge pairs. Each polygon will be a triangle or quadrangle which connects the start and end points of the edges forming the edge pair. This version allows one to specify an enlargement which is applied to the edges. The length of the edges is modified by applying the enlargement and the edges are shifted by the enlargement. By specifying an enlargement it is possible to give edge pairs an area which otherwise would not have one (coincident edges, two point-like edges). - """ - def second_edges(self) -> Edges: - r""" - @brief Returns the second one of all edges - @return An edge collection containing the second edges - """ - def size(self) -> int: - r""" - @brief Returns the (flat) number of edge pairs in the edge pair collection - - The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated. - - Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. - """ - def swap(self, other: EdgePairs) -> None: - r""" - @brief Swap the contents of this collection with the contents of another collection - This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare. - """ - @overload - def to_s(self) -> str: - r""" - @brief Converts the edge pair collection to a string - The length of the output is limited to 20 edge pairs to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. - """ - @overload - def to_s(self, max_count: int) -> str: - r""" - @brief Converts the edge pair collection to a string - This version allows specification of the maximum number of edge pairs contained in the string. - """ - @overload - def transform(self, t: ICplxTrans) -> EdgePairs: - r""" - @brief Transform the edge pair collection with a complex transformation (modifies self) - - Transforms the edge pair collection with the given transformation. - This version modifies the edge pair collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed edge pair collection. - """ - @overload - def transform(self, t: IMatrix2d) -> EdgePairs: - r""" - @brief Transform the edge pair collection (modifies self) - - Transforms the edge pair collection with the given 2d matrix transformation. - This version modifies the edge pair collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed edge pair collection. - - This variant has been introduced in version 0.27. - """ - @overload - def transform(self, t: IMatrix3d) -> EdgePairs: - r""" - @brief Transform the edge pair collection (modifies self) - - Transforms the edge pair collection with the given 3d matrix transformation. - This version modifies the edge pair collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed edge pair collection. - - This variant has been introduced in version 0.27. - """ - @overload - def transform(self, t: Trans) -> EdgePairs: - r""" - @brief Transform the edge pair collection (modifies self) - - Transforms the edge pair collection with the given transformation. - This version modifies the edge pair collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed edge pair collection. - """ - def transform_icplx(self, t: ICplxTrans) -> EdgePairs: - r""" - @brief Transform the edge pair collection with a complex transformation (modifies self) - - Transforms the edge pair collection with the given transformation. - This version modifies the edge pair collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed edge pair collection. - """ - @overload - def transformed(self, t: ICplxTrans) -> EdgePairs: - r""" - @brief Transform the edge pair collection with a complex transformation - - Transforms the edge pairs with the given complex transformation. - Does not modify the edge pair collection but returns the transformed edge pairs. - - @param t The transformation to apply. - - @return The transformed edge pairs. - """ - @overload - def transformed(self, t: IMatrix2d) -> EdgePairs: - r""" - @brief Transform the edge pair collection - - Transforms the edge pairs with the given 2d matrix transformation. - Does not modify the edge pair collection but returns the transformed edge pairs. - - @param t The transformation to apply. - - @return The transformed edge pairs. - - This variant has been introduced in version 0.27. - """ - @overload - def transformed(self, t: IMatrix3d) -> EdgePairs: - r""" - @brief Transform the edge pair collection - - Transforms the edge pairs with the given 3d matrix transformation. - Does not modify the edge pair collection but returns the transformed edge pairs. - - @param t The transformation to apply. - - @return The transformed edge pairs. - - This variant has been introduced in version 0.27. - """ - @overload - def transformed(self, t: Trans) -> EdgePairs: - r""" - @brief Transform the edge pair collection - - Transforms the edge pairs with the given transformation. - Does not modify the edge pair collection but returns the transformed edge pairs. - - @param t The transformation to apply. - - @return The transformed edge pairs. - """ - def transformed_icplx(self, t: ICplxTrans) -> EdgePairs: - r""" - @brief Transform the edge pair collection with a complex transformation - - Transforms the edge pairs with the given complex transformation. - Does not modify the edge pair collection but returns the transformed edge pairs. - - @param t The transformation to apply. - - @return The transformed edge pairs. - """ - @overload - def with_angle(self, angle: float, inverse: bool) -> EdgePairs: - r""" - @brief Filter the edge pairs by orientation of their edges - Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with at least one edge having the given angle to the x-axis are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - This will filter edge pairs with at least one horizontal edge: - - @code - horizontal = edge_pairs.with_angle(0, false) - @/code - - Note that the inverse @b result @/b of \with_angle is delivered by \with_angle_both with the inverse flag set as edge pairs are unselected when both edges fail to meet the criterion. - I.e - - @code - result = edge_pairs.with_angle(0, false) - others = edge_pairs.with_angle_both(0, true) - @/code - - This method has been added in version 0.27.1. - """ - @overload - def with_angle(self, type: Edges.EdgeType, inverse: bool) -> EdgePairs: - r""" - @brief Filter the edge pairs by orientation of their edges - Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with at least one edge having an angle of the given type are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations and are specified using one of the \Edges#OrthoEdges, \Edges#DiagonalEdges or \Edges#OrthoDiagonalEdges types. - - Note that the inverse @b result @/b of \with_angle is delivered by \with_angle_both with the inverse flag set as edge pairs are unselected when both edges fail to meet the criterion. - I.e - - @code - result = edge_pairs.with_angle(RBA::Edges::Ortho, false) - others = edge_pairs.with_angle_both(RBA::Edges::Ortho, true) - @/code - - This method has been added in version 0.28. - """ - @overload - def with_angle(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Filter the edge pairs by orientation of their edges - Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with at least one edge having an angle between min_angle and max_angle are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - With "include_min_angle" set to true (the default), the minimum angle is included in the criterion while with false, the minimum angle itself is not included. Same for "include_max_angle" where the default is false, meaning the maximum angle is not included in the range. - - Note that the inverse @b result @/b of \with_angle is delivered by \with_angle_both with the inverse flag set as edge pairs are unselected when both edges fail to meet the criterion. - I.e - - @code - result = edge_pairs.with_angle(0, 45, false) - others = edge_pairs.with_angle_both(0, 45, true) - @/code - - This method has been added in version 0.27.1. - """ - @overload - def with_angle_both(self, angle: float, inverse: bool) -> EdgePairs: - r""" - @brief Filter the edge pairs by orientation of both of their edges - Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with both edges having the given angle to the x-axis are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - This will filter edge pairs with at least one horizontal edge: - - @code - horizontal = edge_pairs.with_angle_both(0, false) - @/code - - Note that the inverse @b result @/b of \with_angle_both is delivered by \with_angle with the inverse flag set as edge pairs are unselected when one edge fails to meet the criterion. - I.e - - @code - result = edge_pairs.with_angle_both(0, false) - others = edge_pairs.with_angle(0, true) - @/code - - This method has been added in version 0.27.1. - """ - @overload - def with_angle_both(self, type: Edges.EdgeType, inverse: bool) -> EdgePairs: - r""" - @brief Filter the edge pairs by orientation of their edges - Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with both edges having an angle of the given type are returned. If "inverse" is true, edge pairs not fulfilling this criterion for both edges are returned. - - This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations and are specified using one of the \Edges#OrthoEdges, \Edges#DiagonalEdges or \Edges#OrthoDiagonalEdges types. - - Note that the inverse @b result @/b of \with_angle_both is delivered by \with_angle with the inverse flag set as edge pairs are unselected when one edge fails to meet the criterion. - I.e - - @code - result = edge_pairs.with_angle_both(RBA::Edges::Ortho, false) - others = edge_pairs.with_angle(RBA::Edges::Ortho, true) - @/code - - This method has been added in version 0.28. - """ - @overload - def with_angle_both(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Filter the edge pairs by orientation of both of their edges - Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with both edges having an angle between min_angle and max_angle are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - With "include_min_angle" set to true (the default), the minimum angle is included in the criterion while with false, the minimum angle itself is not included. Same for "include_max_angle" where the default is false, meaning the maximum angle is not included in the range. - - Note that the inverse @b result @/b of \with_angle_both is delivered by \with_angle with the inverse flag set as edge pairs are unselected when one edge fails to meet the criterion. - I.e - - @code - result = edge_pairs.with_angle_both(0, 45, false) - others = edge_pairs.with_angle(0, 45, true) - @/code - - This method has been added in version 0.27.1. - """ - @overload - def with_area(self, area: int, inverse: bool) -> EdgePairs: - r""" - @brief Filters the edge pairs by the enclosed area - Filters the edge pairs in the edge pair collection by enclosed area. If "inverse" is false, only edge pairs with the given area are returned. If "inverse" is true, edge pairs not with the given area are returned. - - This method has been added in version 0.27.2. - """ - @overload - def with_area(self, min_area: int, max_area: int, inverse: bool) -> EdgePairs: - r""" - @brief Filters the edge pairs by the enclosed area - Filters the edge pairs in the edge pair collection by enclosed area. If "inverse" is false, only edge pairs with an area between min_area and max_area (max_area itself is excluded) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - This method has been added in version 0.27.2. - """ - @overload - def with_distance(self, distance: int, inverse: bool) -> EdgePairs: - r""" - @brief Filters the edge pairs by the distance of the edges - Filters the edge pairs in the edge pair collection by distance of the edges. If "inverse" is false, only edge pairs where both edges have the given distance are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - Distance is measured as the shortest distance between any of the points on the edges. - - This method has been added in version 0.27.1. - """ - @overload - def with_distance(self, min_distance: Any, max_distance: Any, inverse: bool) -> EdgePairs: - r""" - @brief Filters the edge pairs by the distance of the edges - Filters the edge pairs in the edge pair collection by distance of the edges. If "inverse" is false, only edge pairs where both edges have a distance between min_distance and max_distance (max_distance itself is excluded) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - Distance is measured as the shortest distance between any of the points on the edges. - - This method has been added in version 0.27.1. - """ - @overload - def with_internal_angle(self, angle: float, inverse: bool) -> EdgePairs: - r""" - @brief Filters the edge pairs by the angle between their edges - Filters the edge pairs in the edge pair collection by the angle between their edges. If "inverse" is false, only edge pairs with the given angle are returned. If "inverse" is true, edge pairs not with the given angle are returned. - - The angle is measured between the two edges. It is between 0 (parallel or anti-parallel edges) and 90 degree (perpendicular edges). - - This method has been added in version 0.27.2. - """ - @overload - def with_internal_angle(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: - r""" - @brief Filters the edge pairs by the angle between their edges - Filters the edge pairs in the edge pair collection by the angle between their edges. If "inverse" is false, only edge pairs with an angle between min_angle and max_angle (max_angle itself is excluded) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - The angle is measured between the two edges. It is between 0 (parallel or anti-parallel edges) and 90 degree (perpendicular edges). - - With "include_min_angle" set to true (the default), the minimum angle is included in the criterion while with false, the minimum angle itself is not included. Same for "include_max_angle" where the default is false, meaning the maximum angle is not included in the range. - - This method has been added in version 0.27.2. - """ - @overload - def with_length(self, length: int, inverse: bool) -> EdgePairs: - r""" - @brief Filters the edge pairs by length of one of their edges - Filters the edge pairs in the edge pair collection by length of at least one of their edges. If "inverse" is false, only edge pairs with at least one edge having the given length are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - This method has been added in version 0.27.1. - """ - @overload - def with_length(self, min_length: Any, max_length: Any, inverse: bool) -> EdgePairs: - r""" - @brief Filters the edge pairs by length of one of their edges - Filters the edge pairs in the edge pair collection by length of at least one of their edges. If "inverse" is false, only edge pairs with at least one edge having a length between min_length and max_length (excluding max_length itself) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - This method has been added in version 0.27.1. - """ - @overload - def with_length_both(self, length: int, inverse: bool) -> EdgePairs: - r""" - @brief Filters the edge pairs by length of both of their edges - Filters the edge pairs in the edge pair collection by length of both of their edges. If "inverse" is false, only edge pairs where both edges have the given length are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - This method has been added in version 0.27.1. - """ - @overload - def with_length_both(self, min_length: Any, max_length: Any, inverse: bool) -> EdgePairs: - r""" - @brief Filters the edge pairs by length of both of their edges - Filters the edge pairs in the edge pair collection by length of both of their edges. If "inverse" is false, only edge pairs with both edges having a length between min_length and max_length (excluding max_length itself) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. - - If you don't want to specify a lower or upper limit, pass nil to that parameter. - - This method has been added in version 0.27.1. - """ - -class EdgeProcessor: - r""" - @brief The edge processor (boolean, sizing, merge) - - The edge processor implements the boolean and edge set operations (size, merge). Because the edge processor might allocate resources which can be reused in later operations, it is implemented as an object that can be used several times. - - Here is a simple example of how to use the edge processor: - - @code - ep = RBA::EdgeProcessor::new - # Prepare two boxes - a = [ RBA::Polygon::new(RBA::Box::new(0, 0, 300, 300)) ] - b = [ RBA::Polygon::new(RBA::Box::new(100, 100, 200, 200)) ] - # Run an XOR -> creates a polygon with a hole, since the 'resolve_holes' parameter - # is false: - out = ep.boolean_p2p(a, b, RBA::EdgeProcessor::ModeXor, false, false) - out.to_s # -> [(0,0;0,300;300,300;300,0/100,100;200,100;200,200;100,200)] - @/code - """ - ModeANotB: ClassVar[int] - r""" - @brief boolean method's mode value for A NOT B operation - """ - ModeAnd: ClassVar[int] - r""" - @brief boolean method's mode value for AND operation - """ - ModeBNotA: ClassVar[int] - r""" - @brief boolean method's mode value for B NOT A operation - """ - ModeOr: ClassVar[int] - r""" - @brief boolean method's mode value for OR operation - """ - ModeXor: ClassVar[int] - r""" - @brief boolean method's mode value for XOR operation - """ - @classmethod - def mode_and(cls) -> int: - r""" - @brief boolean method's mode value for AND operation - """ - @classmethod - def mode_anotb(cls) -> int: - r""" - @brief boolean method's mode value for A NOT B operation - """ - @classmethod - def mode_bnota(cls) -> int: - r""" - @brief boolean method's mode value for B NOT A operation - """ - @classmethod - def mode_or(cls) -> int: - r""" - @brief boolean method's mode value for OR operation - """ - @classmethod - def mode_xor(cls) -> int: - r""" - @brief boolean method's mode value for XOR operation - """ - @classmethod - def new(cls) -> EdgeProcessor: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> EdgeProcessor: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> EdgeProcessor: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: EdgeProcessor) -> None: - r""" - @brief Assigns another object to self - """ - @overload - def boolean(self, a: Sequence[Edge], b: Sequence[Edge], mode: int) -> List[Edge]: - r""" - @brief Boolean operation for a set of given edges, creating edges - - This method computes the result for the given boolean operation on two sets of edges. - The input edges must form closed contours where holes and hulls must be oriented differently. - The input edges are processed with a simple non-zero wrap count rule as a whole. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param a The input edges (first operand) - @param b The input edges (second operand) - @param mode The boolean mode (one of the Mode.. values) - @return The output edges - """ - @overload - def boolean(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int) -> List[Edge]: - r""" - @brief Boolean operation for a set of given polygons, creating edges - - This method computes the result for the given boolean operation on two sets of polygons. - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - This is a convenience method that bundles filling of the edges, processing with - a Boolean operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param a The input polygons (first operand) - @param b The input polygons (second operand) - @param mode The boolean mode - @return The output edges - """ - def boolean_e2e(self, a: Sequence[Edge], b: Sequence[Edge], mode: int) -> List[Edge]: - r""" - @brief Boolean operation for a set of given edges, creating edges - - This method computes the result for the given boolean operation on two sets of edges. - The input edges must form closed contours where holes and hulls must be oriented differently. - The input edges are processed with a simple non-zero wrap count rule as a whole. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param a The input edges (first operand) - @param b The input edges (second operand) - @param mode The boolean mode (one of the Mode.. values) - @return The output edges - """ - def boolean_e2p(self, a: Sequence[Edge], b: Sequence[Edge], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Boolean operation for a set of given edges, creating polygons - - This method computes the result for the given boolean operation on two sets of edges. - The input edges must form closed contours where holes and hulls must be oriented differently. - The input edges are processed with a simple non-zero wrap count rule as a whole. - - This method produces polygons on output and allows fine-tuning of the parameters for that purpose. - - Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param a The input polygons (first operand) - @param b The input polygons (second operand) - @param mode The boolean mode (one of the Mode.. values) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - def boolean_p2e(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int) -> List[Edge]: - r""" - @brief Boolean operation for a set of given polygons, creating edges - - This method computes the result for the given boolean operation on two sets of polygons. - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - This is a convenience method that bundles filling of the edges, processing with - a Boolean operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param a The input polygons (first operand) - @param b The input polygons (second operand) - @param mode The boolean mode - @return The output edges - """ - def boolean_p2p(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Boolean operation for a set of given polygons, creating polygons - - This method computes the result for the given boolean operation on two sets of polygons. - This method produces polygons on output and allows fine-tuning of the parameters for that purpose. - - This is a convenience method that bundles filling of the edges, processing with - a Boolean operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param a The input polygons (first operand) - @param b The input polygons (second operand) - @param mode The boolean mode (one of the Mode.. values) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def boolean_to_polygon(self, a: Sequence[Edge], b: Sequence[Edge], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Boolean operation for a set of given edges, creating polygons - - This method computes the result for the given boolean operation on two sets of edges. - The input edges must form closed contours where holes and hulls must be oriented differently. - The input edges are processed with a simple non-zero wrap count rule as a whole. - - This method produces polygons on output and allows fine-tuning of the parameters for that purpose. - - Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param a The input polygons (first operand) - @param b The input polygons (second operand) - @param mode The boolean mode (one of the Mode.. values) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def boolean_to_polygon(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Boolean operation for a set of given polygons, creating polygons - - This method computes the result for the given boolean operation on two sets of polygons. - This method produces polygons on output and allows fine-tuning of the parameters for that purpose. - - This is a convenience method that bundles filling of the edges, processing with - a Boolean operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param a The input polygons (first operand) - @param b The input polygons (second operand) - @param mode The boolean mode (one of the Mode.. values) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def disable_progress(self) -> None: - r""" - @brief Disable progress reporting - Calling this method will stop the edge processor from showing a progress bar. See \enable_progress. - - This method has been introduced in version 0.23. - """ - def dup(self) -> EdgeProcessor: - r""" - @brief Creates a copy of self - """ - def enable_progress(self, label: str) -> None: - r""" - @brief Enable progress reporting - After calling this method, the edge processor will report the progress through a progress bar. - The label is a text which is put in front of the progress bar. - Using a progress bar will imply a performance penalty of a few percent typically. - - This method has been introduced in version 0.23. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def merge(self, in_: Sequence[Polygon], min_wc: int) -> List[Edge]: - r""" - @brief Merge the given polygons - - In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. - Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the - hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps - of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping - polygons do not contribute to higher wrap count areas. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - Prior to version 0.21 this method was called 'merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) - @return The output edges - """ - def merge_p2e(self, in_: Sequence[Polygon], min_wc: int) -> List[Edge]: - r""" - @brief Merge the given polygons - - In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. - Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the - hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps - of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping - polygons do not contribute to higher wrap count areas. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - Prior to version 0.21 this method was called 'merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) - @return The output edges - """ - def merge_p2p(self, in_: Sequence[Polygon], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Merge the given polygons - - In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. - Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the - hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps - of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping - polygons do not contribute to higher wrap count areas. - - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - Prior to version 0.21 this method was called 'merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - def merge_to_polygon(self, in_: Sequence[Polygon], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Merge the given polygons - - In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. - Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the - hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps - of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping - polygons do not contribute to higher wrap count areas. - - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - Prior to version 0.21 this method was called 'merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def simple_merge(self, in_: Sequence[Edge]) -> List[Edge]: - r""" - @brief Merge the given edges in a simple "non-zero wrapcount" fashion - - The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. - Overlapping contours are merged when the orientation is the same. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input edges - @return The output edges - """ - @overload - def simple_merge(self, in_: Sequence[Polygon]) -> List[Edge]: - r""" - @brief Merge the given polygons in a simple "non-zero wrapcount" fashion - - The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they - have different orientation (since a polygon is oriented by construction that is not easy to achieve). - The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before - merging them. "simple_merge" is somewhat faster and consumes less memory. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @return The output edges - """ - @overload - def simple_merge(self, in_: Sequence[Edge], mode: int) -> List[Edge]: - r""" - @brief Merge the given polygons and specify the merge mode - - The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. - Overlapping contours are merged when the orientation is the same. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - This method has been added in version 0.22. - - The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). - - @param mode See description - @param in The input edges - @return The output edges - """ - @overload - def simple_merge(self, in_: Sequence[Polygon], mode: int) -> List[Edge]: - r""" - @brief Merge the given polygons and specify the merge mode - - The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they - have different orientation (since a polygon is oriented by construction that is not easy to achieve). - The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before - merging them. "simple_merge" is somewhat faster and consumes less memory. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - This method has been added in version 0.22. - - The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). - - @param mode See description - @param in The input polygons - @return The output edges - """ - @overload - def simple_merge_e2e(self, in_: Sequence[Edge]) -> List[Edge]: - r""" - @brief Merge the given edges in a simple "non-zero wrapcount" fashion - - The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. - Overlapping contours are merged when the orientation is the same. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input edges - @return The output edges - """ - @overload - def simple_merge_e2e(self, in_: Sequence[Edge], mode: int) -> List[Edge]: - r""" - @brief Merge the given polygons and specify the merge mode - - The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. - Overlapping contours are merged when the orientation is the same. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - This method has been added in version 0.22. - - The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). - - @param mode See description - @param in The input edges - @return The output edges - """ - @overload - def simple_merge_e2p(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Merge the given edges in a simple "non-zero wrapcount" fashion into polygons - - The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. - Overlapping contours are merged when the orientation is the same. - - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input edges - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def simple_merge_e2p(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: - r""" - @brief Merge the given polygons and specify the merge mode - - The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. - Overlapping contours are merged when the orientation is the same. - - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - This method has been added in version 0.22. - - The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). - - @param mode See description - @param in The input edges - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def simple_merge_p2e(self, in_: Sequence[Polygon]) -> List[Edge]: - r""" - @brief Merge the given polygons in a simple "non-zero wrapcount" fashion - - The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they - have different orientation (since a polygon is oriented by construction that is not easy to achieve). - The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before - merging them. "simple_merge" is somewhat faster and consumes less memory. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @return The output edges - """ - @overload - def simple_merge_p2e(self, in_: Sequence[Polygon], mode: int) -> List[Edge]: - r""" - @brief Merge the given polygons and specify the merge mode - - The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they - have different orientation (since a polygon is oriented by construction that is not easy to achieve). - The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before - merging them. "simple_merge" is somewhat faster and consumes less memory. - - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - This method has been added in version 0.22. - - The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). - - @param mode See description - @param in The input polygons - @return The output edges - """ - @overload - def simple_merge_p2p(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Merge the given polygons in a simple "non-zero wrapcount" fashion into polygons - - The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they - have different orientation (since a polygon is oriented by construction that is not easy to achieve). - The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before - merging them. "simple_merge" is somewhat faster and consumes less memory. - - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def simple_merge_p2p(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: - r""" - @brief Merge the given polygons and specify the merge mode - - The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they - have different orientation (since a polygon is oriented by construction that is not easy to achieve). - The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before - merging them. "simple_merge" is somewhat faster and consumes less memory. - - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - This method has been added in version 0.22. - - The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). - - @param mode See description - @param in The input polygons - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def simple_merge_to_polygon(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Merge the given edges in a simple "non-zero wrapcount" fashion into polygons - - The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. - Overlapping contours are merged when the orientation is the same. - - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input edges - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def simple_merge_to_polygon(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Merge the given polygons in a simple "non-zero wrapcount" fashion into polygons - - The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they - have different orientation (since a polygon is oriented by construction that is not easy to achieve). - The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before - merging them. "simple_merge" is somewhat faster and consumes less memory. - - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def simple_merge_to_polygon(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: - r""" - @brief Merge the given polygons and specify the merge mode - - The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. - Overlapping contours are merged when the orientation is the same. - - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - This method has been added in version 0.22. - - The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). - - @param mode See description - @param in The input edges - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def simple_merge_to_polygon(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: - r""" - @brief Merge the given polygons and specify the merge mode - - The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they - have different orientation (since a polygon is oriented by construction that is not easy to achieve). - The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before - merging them. "simple_merge" is somewhat faster and consumes less memory. - - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - This is a convenience method that bundles filling of the edges, processing with - a SimpleMerge operator and puts the result into an output vector. - - This method has been added in version 0.22. - - The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). - - @param mode See description - @param in The input polygons - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def size(self, in_: Sequence[Polygon], d: int, mode: int) -> List[Edge]: - r""" - @brief Size the given polygons (isotropic) - - This method is equivalent to calling the anisotropic version with identical dx and dy. - - Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param d The sizing value in x direction - @param mode The sizing mode - @return The output edges - """ - @overload - def size(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int) -> List[Edge]: - r""" - @brief Size the given polygons - - This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied - on the individual result polygons of the merge step. The result may contain overlapping contours, but no self-overlaps. - - dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). - The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both - dx and dy. - - The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param dx The sizing value in x direction - @param dy The sizing value in y direction - @param mode The sizing mode (standard is 2) - @return The output edges - """ - @overload - def size_p2e(self, in_: Sequence[Polygon], d: int, mode: int) -> List[Edge]: - r""" - @brief Size the given polygons (isotropic) - - This method is equivalent to calling the anisotropic version with identical dx and dy. - - Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param d The sizing value in x direction - @param mode The sizing mode - @return The output edges - """ - @overload - def size_p2e(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int) -> List[Edge]: - r""" - @brief Size the given polygons - - This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied - on the individual result polygons of the merge step. The result may contain overlapping contours, but no self-overlaps. - - dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). - The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both - dx and dy. - - The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. - The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while - holes are oriented counter-clockwise. - - Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param dx The sizing value in x direction - @param dy The sizing value in y direction - @param mode The sizing mode (standard is 2) - @return The output edges - """ - @overload - def size_p2p(self, in_: Sequence[Polygon], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Size the given polygons into polygons (isotropic) - - This method is equivalent to calling the anisotropic version with identical dx and dy. - - Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param d The sizing value in x direction - @param mode The sizing mode - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def size_p2p(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Size the given polygons into polygons - - This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied - on the individual result polygons of the merge step. The result may contain overlapping polygons, but no self-overlapping ones. - Polygon overlap occurs if the polygons are close enough, so a positive sizing makes polygons overlap. - - dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). - The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both - dx and dy. - - The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param dx The sizing value in x direction - @param dy The sizing value in y direction - @param mode The sizing mode (standard is 2) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def size_to_polygon(self, in_: Sequence[Polygon], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Size the given polygons into polygons (isotropic) - - This method is equivalent to calling the anisotropic version with identical dx and dy. - - Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param d The sizing value in x direction - @param mode The sizing mode - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - @overload - def size_to_polygon(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: - r""" - @brief Size the given polygons into polygons - - This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied - on the individual result polygons of the merge step. The result may contain overlapping polygons, but no self-overlapping ones. - Polygon overlap occurs if the polygons are close enough, so a positive sizing makes polygons overlap. - - dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). - The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both - dx and dy. - - The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. - This method produces polygons and allows fine-tuning of the parameters for that purpose. - - Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. - - @param in The input polygons - @param dx The sizing value in x direction - @param dy The sizing value in y direction - @param mode The sizing mode (standard is 2) - @param resolve_holes true, if holes should be resolved into the hull - @param min_coherence true, if touching corners should be resolved into less connected contours - @return The output polygons - """ - -class Edges(ShapeCollection): - r""" - @brief A collection of edges (Not necessarily describing closed contours) - - - This class was introduced to simplify operations on edges sets. See \Edge for a description of the individual edge object. The edge collection contains an arbitrary number of edges and supports operations to select edges by various criteria, produce polygons from the edges by applying an extension, filtering edges against other edges collections and checking geometrical relations to other edges (DRC functionality). - - The edge collection is supposed to work closely with the \Region polygon set. Both are related, although the edge collection has a lower rank since it potentially represents a disconnected collection of edges. Edge collections may form closed contours, for example immediately after they have been derived from a polygon set using \Region#edges. But this state is volatile and can easily be destroyed by filtering edges. Hence the connected state does not play an important role in the edge collection's API. - - Edge collections may also contain points (degenerated edges with identical start and end points). Such point-like objects participate in some although not all methods of the edge collection class. - Edge collections can be used in two different flavors: in raw mode or merged semantics. With merged semantics (the default), connected edges are considered to belong together and are effectively merged. - Overlapping parts are counted once in that mode. Dot-like edges are not considered in merged semantics. - In raw mode (without merged semantics), each edge is considered as it is. Overlaps between edges - may exists and merging has to be done explicitly using the \merge method. The semantics can be - selected using \merged_semantics=. - - - This class has been introduced in version 0.23. - """ - class EdgeType: - r""" - @brief This enum specifies the the edge type for edge angle filters. - - This enum was introduced in version 0.28. - """ - DiagonalEdges: ClassVar[Edges.EdgeType] - r""" - @brief Diagonal edges are selected (-45 and 45 degree) - """ - OrthoDiagonalEdges: ClassVar[Edges.EdgeType] - r""" - @brief Diagonal or orthogonal edges are selected (0, 90, -45 and 45 degree) - """ - OrthoEdges: ClassVar[Edges.EdgeType] - r""" - @brief Horizontal and vertical edges are selected - """ - @overload - @classmethod - def new(cls, i: int) -> Edges.EdgeType: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> Edges.EdgeType: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: Edges.EdgeType) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - DiagonalEdges: ClassVar[Edges.EdgeType] - r""" - @brief Diagonal edges are selected (-45 and 45 degree) - """ - Euclidian: ClassVar[Region.Metrics] - r""" - @brief Specifies Euclidian metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by: - - @code - d = sqrt(dx^2 + dy^2) - @/code - - All points within a circle with radius d around one point are considered to have a smaller distance than d. - """ - OrthoDiagonalEdges: ClassVar[Edges.EdgeType] - r""" - @brief Diagonal or orthogonal edges are selected (0, 90, -45 and 45 degree) - """ - OrthoEdges: ClassVar[Edges.EdgeType] - r""" - @brief Horizontal and vertical edges are selected - """ - Projection: ClassVar[Region.Metrics] - r""" - @brief Specifies projected distance metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other. - """ - Square: ClassVar[Region.Metrics] - r""" - @brief Specifies square metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies square metrics, i.e. the distance between two points is measured by: - - @code - d = max(abs(dx), abs(dy)) - @/code - - All points within a square with length 2*d around one point are considered to have a smaller distance than d in this metrics. - """ - merged_semantics: bool - r""" - Getter: - @brief Gets a flag indicating whether merged semantics is enabled - See \merged_semantics= for a description of this attribute. - - Setter: - @brief Enable or disable merged semantics - If merged semantics is enabled (the default), colinear, connected or overlapping edges will be considered - as single edges. - """ - @overload - @classmethod - def new(cls) -> Edges: - r""" - @brief Default constructor - - This constructor creates an empty edge collection. - """ - @overload - @classmethod - def new(cls, array: Sequence[Edge]) -> Edges: - r""" - @brief Constructor from an edge array - - This constructor creates an edge collection from an array of edges. - """ - @overload - @classmethod - def new(cls, array: Sequence[Polygon]) -> Edges: - r""" - @brief Constructor from a polygon array - - This constructor creates an edge collection from an array of polygons. - The edges form the contours of the polygons. - """ - @overload - @classmethod - def new(cls, box: Box) -> Edges: - r""" - @brief Box constructor - - This constructor creates an edge collection from a box. - The edges form the contour of the box. - """ - @overload - @classmethod - def new(cls, edge: Edge) -> Edges: - r""" - @brief Constructor from a single edge - - This constructor creates an edge collection with a single edge. - """ - @overload - @classmethod - def new(cls, path: Path) -> Edges: - r""" - @brief Path constructor - - This constructor creates an edge collection from a path. - The edges form the contour of the path. - """ - @overload - @classmethod - def new(cls, polygon: Polygon) -> Edges: - r""" - @brief Polygon constructor - - This constructor creates an edge collection from a polygon. - The edges form the contour of the polygon. - """ - @overload - @classmethod - def new(cls, polygon: SimplePolygon) -> Edges: - r""" - @brief Simple polygon constructor - - This constructor creates an edge collection from a simple polygon. - The edges form the contour of the polygon. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, as_edges: Optional[bool] = ...) -> Edges: - r""" - @brief Constructor of a flat edge collection from a hierarchical shape set - - This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. - It feeds the shapes from a hierarchy of cells into a flat edge set. - - Text objects are not inserted, because they cannot be converted to edges. - Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::Edges::new(layout.begin_shapes(cell, layer), false) - @/code - """ - @overload - @classmethod - def new(cls, shapes: Shapes, as_edges: Optional[bool] = ...) -> Edges: - r""" - @brief Constructor of a flat edge collection from a \Shapes container - - If 'as_edges' is true, the shapes from the container will be converted to edges (i.e. polygon contours to edges). Otherwise, only edges will be taken from the container. - - This method has been introduced in version 0.26. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, as_edges: Optional[bool] = ...) -> Edges: - r""" - @brief Constructor of a hierarchical edge collection - - This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. - It feeds the shapes from a hierarchy of cells into the hierarchical edge set. - The edges remain within their original hierarchy unless other operations require the edges to be moved in the hierarchy. - - Text objects are not inserted, because they cannot be converted to edges. - Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::Edges::new(layout.begin_shapes(cell, layer), dss, false) - @/code - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ...) -> Edges: - r""" - @brief Constructor from a text set - - @param shape_iterator The iterator from which to derive the texts - @param expr The selection string - @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. - - This special constructor will create dot-like edges from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. - Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: - - @code - dots = RBA::Edges::new(iter, "*") # all texts - dots = RBA::Edges::new(iter, "A*") # all texts starting with an 'A' - dots = RBA::Edges::new(iter, "A*", false) # all texts exactly matching 'A*' - @/code - - This method has been introduced in version 0.26. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> Edges: - r""" - @brief Constructor of a flat edge collection from a hierarchical shape set with a transformation - - This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. - It feeds the shapes from a hierarchy of cells into a flat edge set. - The transformation is useful to scale to a specific database unit for example. - - Text objects are not inserted, because they cannot be converted to edges. - Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Edges::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ...) -> Edges: - r""" - @brief Constructor from a text set - - @param shape_iterator The iterator from which to derive the texts - @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. - @param expr The selection string - @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. - - This special constructor will create a deep edge set from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. - Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: - - @code - region = RBA::Region::new(iter, dss, "*") # all texts - region = RBA::Region::new(iter, dss, "A*") # all texts starting with an 'A' - region = RBA::Region::new(iter, dss, "A*", false) # all texts exactly matching 'A*' - @/code - - This method has been introduced in version 0.26. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> Edges: - r""" - @brief Constructor of a hierarchical edge collection with a transformation - - This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. - It feeds the shapes from a hierarchy of cells into the hierarchical edge set. - The edges remain within their original hierarchy unless other operations require the edges to be moved in the hierarchy. - The transformation is useful to scale to a specific database unit for example. - - Text objects are not inserted, because they cannot be converted to edges. - Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Edges::new(layout.begin_shapes(cell, layer), dss, RBA::ICplxTrans::new(layout.dbu / dbu), false) - @/code - """ - def __add__(self, other: Edges) -> Edges: - r""" - @brief Returns the combined edge set of self and the other one - - @return The resulting edge set - - This operator adds the edges of the other edge set to self and returns a new combined edge set. This usually creates unmerged edge sets and edges may overlap. Use \merge if you want to ensure the result edge set is merged. - """ - @overload - def __and__(self, other: Edges) -> Edges: - r""" - @brief Returns the boolean AND between self and the other edge collection - - @return The result of the boolean AND operation - - The boolean AND operation will return all parts of the edges in this collection which are coincident with parts of the edges in the other collection.The result will be a merged edge collection. - """ - @overload - def __and__(self, other: Region) -> Edges: - r""" - @brief Returns the parts of the edges inside the given region - - @return The edges inside the given region - - This operation returns the parts of the edges which are inside the given region. - Edges on the borders of the polygons are included in the edge set. - As a side effect, the edges are made non-intersecting by introducing cut points where - edges intersect. - - This method has been introduced in version 0.24. - """ - def __copy__(self) -> Edges: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Edges: - r""" - @brief Creates a copy of self - """ - def __getitem__(self, n: int) -> Edge: - r""" - @brief Returns the nth edge of the collection - - This method returns nil if the index is out of range. It is available for flat edge collections only - i.e. those for which \has_valid_edges? is true. Use \flatten to explicitly flatten an edge collection. - This method returns the raw edge (not merged edges, even if merged semantics is enabled). - - The \each iterator is the more general approach to access the edges. - """ - def __iadd__(self, other: Edges) -> Edges: - r""" - @brief Adds the edges of the other edge collection to self - - @return The edge set after modification (self) - - This operator adds the edges of the other edge set to self. This usually creates unmerged edge sets and edges may overlap. Use \merge if you want to ensure the result edge set is merged. - """ - @overload - def __iand__(self, other: Edges) -> Edges: - r""" - @brief Performs the boolean AND between self and the other edge collection - - @return The edge collection after modification (self) - - The boolean AND operation will return all parts of the edges in this collection which are coincident with parts of the edges in the other collection.The result will be a merged edge collection. - """ - @overload - def __iand__(self, other: Region) -> Edges: - r""" - @brief Selects the parts of the edges inside the given region - - @return The edge collection after modification (self) - - This operation selects the parts of the edges which are inside the given region. - Edges on the borders of the polygons are included in the edge set. - As a side effect, the edges are made non-intersecting by introducing cut points where - edges intersect. - - This method has been introduced in version 0.24. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor - - This constructor creates an empty edge collection. - """ - @overload - def __init__(self, array: Sequence[Edge]) -> None: - r""" - @brief Constructor from an edge array - - This constructor creates an edge collection from an array of edges. - """ - @overload - def __init__(self, array: Sequence[Polygon]) -> None: - r""" - @brief Constructor from a polygon array - - This constructor creates an edge collection from an array of polygons. - The edges form the contours of the polygons. - """ - @overload - def __init__(self, box: Box) -> None: - r""" - @brief Box constructor - - This constructor creates an edge collection from a box. - The edges form the contour of the box. - """ - @overload - def __init__(self, edge: Edge) -> None: - r""" - @brief Constructor from a single edge - - This constructor creates an edge collection with a single edge. - """ - @overload - def __init__(self, path: Path) -> None: - r""" - @brief Path constructor - - This constructor creates an edge collection from a path. - The edges form the contour of the path. - """ - @overload - def __init__(self, polygon: Polygon) -> None: - r""" - @brief Polygon constructor - - This constructor creates an edge collection from a polygon. - The edges form the contour of the polygon. - """ - @overload - def __init__(self, polygon: SimplePolygon) -> None: - r""" - @brief Simple polygon constructor - - This constructor creates an edge collection from a simple polygon. - The edges form the contour of the polygon. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, as_edges: Optional[bool] = ...) -> None: - r""" - @brief Constructor of a flat edge collection from a hierarchical shape set - - This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. - It feeds the shapes from a hierarchy of cells into a flat edge set. - - Text objects are not inserted, because they cannot be converted to edges. - Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::Edges::new(layout.begin_shapes(cell, layer), false) - @/code - """ - @overload - def __init__(self, shapes: Shapes, as_edges: Optional[bool] = ...) -> None: - r""" - @brief Constructor of a flat edge collection from a \Shapes container - - If 'as_edges' is true, the shapes from the container will be converted to edges (i.e. polygon contours to edges). Otherwise, only edges will be taken from the container. - - This method has been introduced in version 0.26. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, as_edges: Optional[bool] = ...) -> None: - r""" - @brief Constructor of a hierarchical edge collection - - This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. - It feeds the shapes from a hierarchy of cells into the hierarchical edge set. - The edges remain within their original hierarchy unless other operations require the edges to be moved in the hierarchy. - - Text objects are not inserted, because they cannot be converted to edges. - Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::Edges::new(layout.begin_shapes(cell, layer), dss, false) - @/code - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ...) -> None: - r""" - @brief Constructor from a text set - - @param shape_iterator The iterator from which to derive the texts - @param expr The selection string - @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. - - This special constructor will create dot-like edges from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. - Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: - - @code - dots = RBA::Edges::new(iter, "*") # all texts - dots = RBA::Edges::new(iter, "A*") # all texts starting with an 'A' - dots = RBA::Edges::new(iter, "A*", false) # all texts exactly matching 'A*' - @/code - - This method has been introduced in version 0.26. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> None: - r""" - @brief Constructor of a flat edge collection from a hierarchical shape set with a transformation - - This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. - It feeds the shapes from a hierarchy of cells into a flat edge set. - The transformation is useful to scale to a specific database unit for example. - - Text objects are not inserted, because they cannot be converted to edges. - Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Edges::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ...) -> None: - r""" - @brief Constructor from a text set - - @param shape_iterator The iterator from which to derive the texts - @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. - @param expr The selection string - @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. - - This special constructor will create a deep edge set from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. - Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: - - @code - region = RBA::Region::new(iter, dss, "*") # all texts - region = RBA::Region::new(iter, dss, "A*") # all texts starting with an 'A' - region = RBA::Region::new(iter, dss, "A*", false) # all texts exactly matching 'A*' - @/code - - This method has been introduced in version 0.26. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> None: - r""" - @brief Constructor of a hierarchical edge collection with a transformation - - This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. - It feeds the shapes from a hierarchy of cells into the hierarchical edge set. - The edges remain within their original hierarchy unless other operations require the edges to be moved in the hierarchy. - The transformation is useful to scale to a specific database unit for example. - - Text objects are not inserted, because they cannot be converted to edges. - Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Edges::new(layout.begin_shapes(cell, layer), dss, RBA::ICplxTrans::new(layout.dbu / dbu), false) - @/code - """ - def __ior__(self, other: Edges) -> Edges: - r""" - @brief Performs the boolean OR between self and the other edge set - - @return The edge collection after modification (self) - - The boolean OR is implemented by merging the edges of both edge sets. To simply join the edge collections without merging, the + operator is more efficient. - """ - @overload - def __isub__(self, other: Edges) -> Edges: - r""" - @brief Performs the boolean NOT between self and the other edge collection - - @return The edge collection after modification (self) - - The boolean NOT operation will return all parts of the edges in this collection which are not coincident with parts of the edges in the other collection.The result will be a merged edge collection. - """ - @overload - def __isub__(self, other: Region) -> Edges: - r""" - @brief Selects the parts of the edges outside the given region - - @return The edge collection after modification (self) - - This operation selects the parts of the edges which are outside the given region. - Edges on the borders of the polygons are not included in the edge set. - As a side effect, the edges are made non-intersecting by introducing cut points where - edges intersect. - - This method has been introduced in version 0.24. - """ - def __iter__(self) -> Iterator[Edge]: - r""" - @brief Returns each edge of the region - """ - def __ixor__(self, other: Edges) -> Edges: - r""" - @brief Performs the boolean XOR between self and the other edge collection - - @return The edge collection after modification (self) - - The boolean XOR operation will return all parts of the edges in this and the other collection except the parts where both are coincident. - The result will be a merged edge collection. - """ - def __len__(self) -> int: - r""" - @brief Returns the (flat) number of edges in the edge collection - - This returns the number of raw edges (not merged edges if merged semantics is enabled). - The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated. - - Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. - """ - def __or__(self, other: Edges) -> Edges: - r""" - @brief Returns the boolean OR between self and the other edge set - - @return The resulting edge collection - - The boolean OR is implemented by merging the edges of both edge sets. To simply join the edge collections without merging, the + operator is more efficient. - """ - def __str__(self) -> str: - r""" - @brief Converts the edge collection to a string - The length of the output is limited to 20 edges to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. - """ - @overload - def __sub__(self, other: Edges) -> Edges: - r""" - @brief Returns the boolean NOT between self and the other edge collection - - @return The result of the boolean NOT operation - - The boolean NOT operation will return all parts of the edges in this collection which are not coincident with parts of the edges in the other collection.The result will be a merged edge collection. - """ - @overload - def __sub__(self, other: Region) -> Edges: - r""" - @brief Returns the parts of the edges outside the given region - - @return The edges outside the given region - - This operation returns the parts of the edges which are outside the given region. - Edges on the borders of the polygons are not included in the edge set. - As a side effect, the edges are made non-intersecting by introducing cut points where - edges intersect. - - This method has been introduced in version 0.24. - """ - def __xor__(self, other: Edges) -> Edges: - r""" - @brief Returns the boolean XOR between self and the other edge collection - - @return The result of the boolean XOR operation - - The boolean XOR operation will return all parts of the edges in this and the other collection except the parts where both are coincident. - The result will be a merged edge collection. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - @overload - def andnot(self, other: Edges) -> List[Edges]: - r""" - @brief Returns the boolean AND and NOT between self and the other edge set - - @return A two-element array of edge collections with the first one being the AND result and the second one being the NOT result - - This method will compute the boolean AND and NOT between two edge sets simultaneously. Because this requires a single sweep only, using this method is faster than doing AND and NOT separately. - - This method has been added in version 0.28. - """ - @overload - def andnot(self, other: Region) -> List[Edges]: - r""" - @brief Returns the boolean AND and NOT between self and the region - - @return A two-element array of edge collections with the first one being the AND result and the second one being the NOT result - - This method will compute the boolean AND and NOT simultaneously. Because this requires a single sweep only, using this method is faster than doing AND and NOT separately. - - This method has been added in version 0.28. - """ - def assign(self, other: ShapeCollection) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> Box: - r""" - @brief Returns the bounding box of the edge collection - The bounding box is the box enclosing all points of all edges. - """ - def centers(self, length: int, fraction: float) -> Edges: - r""" - @brief Returns edges representing the center part of the edges - @return A new collection of edges representing the part around the center - This method allows one to specify the length of these segments in a twofold way: either as a fixed length or by specifying a fraction of the original length: - - @code - edges = ... # An edge collection - edges.centers(100, 0.0) # All segments have a length of 100 DBU - edges.centers(0, 50.0) # All segments have a length of half the original length - edges.centers(100, 50.0) # All segments have a length of half the original length - # or 100 DBU, whichever is larger - @/code - - It is possible to specify 0 for both values. In this case, degenerated edges (points) are delivered which specify the centers of the edges but can't participate in some functions. - """ - def clear(self) -> None: - r""" - @brief Clears the edge collection - """ - def count(self) -> int: - r""" - @brief Returns the (flat) number of edges in the edge collection - - This returns the number of raw edges (not merged edges if merged semantics is enabled). - The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated. - - Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. - """ - def create(self) -> None: - r""" - @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. - """ - def data_id(self) -> int: - r""" - @brief Returns the data ID (a unique identifier for the underlying data storage) - - This method has been added in version 0.26. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def disable_progress(self) -> None: - r""" - @brief Disable progress reporting - Calling this method will disable progress reporting. See \enable_progress. - """ - def dup(self) -> Edges: - r""" - @brief Creates a copy of self - """ - def each(self) -> Iterator[Edge]: - r""" - @brief Returns each edge of the region - """ - def each_merged(self) -> Iterator[Edge]: - r""" - @brief Returns each edge of the region - - In contrast to \each, this method delivers merged edges if merge semantics applies while \each delivers the original edges only. - - This method has been introduced in version 0.25. - """ - def enable_progress(self, label: str) -> None: - r""" - @brief Enable progress reporting - After calling this method, the edge collection will report the progress through a progress bar while expensive operations are running. - The label is a text which is put in front of the progress bar. - Using a progress bar will imply a performance penalty of a few percent typically. - """ - def enclosed_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: - r""" - @brief Performs an inside check with options - @param d The minimum distance for which the edges are checked - @param other The other edge collection against which to check - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The threshold angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper threshold of the projected length of one edge onto another - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. - - The 'enclosed_check' alias was introduced in version 0.27.5. - """ - def enclosing_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: - r""" - @brief Performs an enclosing check with options - @param d The minimum distance for which the edges are checked - @param other The other edge collection against which to check - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The threshold angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper threshold of the projected length of one edge onto another - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. - """ - def end_segments(self, length: int, fraction: float) -> Edges: - r""" - @brief Returns edges representing a part of the edge before the end point - @return A new collection of edges representing the end part - This method allows one to specify the length of these segments in a twofold way: either as a fixed length or by specifying a fraction of the original length: - - @code - edges = ... # An edge collection - edges.end_segments(100, 0.0) # All segments have a length of 100 DBU - edges.end_segments(0, 50.0) # All segments have a length of half the original length - edges.end_segments(100, 50.0) # All segments have a length of half the original length - # or 100 DBU, whichever is larger - @/code - - It is possible to specify 0 for both values. In this case, degenerated edges (points) are delivered which specify the end positions of the edges but can't participate in some functions. - """ - def extended(self, b: int, e: int, o: int, i: int, join: bool) -> Region: - r""" - @brief Returns a region with shapes representing the edges with the specified extensions - @param b the parallel extension at the start point of the edge - @param e the parallel extension at the end point of the edge - @param o the perpendicular extension to the "outside" (left side as seen in the direction of the edge) - @param i the perpendicular extension to the "inside" (right side as seen in the direction of the edge) - @param join If true, connected edges are joined before the extension is applied - @return A region containing the polygons representing these extended edges - This is a generic version of \extended_in and \extended_out. It allows one to specify extensions for all four directions of an edge and to join the edges before the extension is applied. - - For degenerated edges forming a point, a rectangle with the b, e, o and i used as left, right, top and bottom distance to the center point of this edge is created. - - If join is true and edges form a closed loop, the b and e parameters are ignored and a rim polygon is created that forms the loop with the outside and inside extension given by o and i. - """ - def extended_in(self, e: int) -> Region: - r""" - @brief Returns a region with shapes representing the edges with the given width - @param e The extension width - @return A region containing the polygons representing these extended edges - The edges are extended to the "inside" by the given distance "e". The distance will be applied to the right side as seen in the direction of the edge. By definition, this is the side pointing to the inside of the polygon if the edge was derived from a polygon. - - Other versions of this feature are \extended_out and \extended. - """ - def extended_out(self, e: int) -> Region: - r""" - @brief Returns a region with shapes representing the edges with the given width - @param e The extension width - @return A region containing the polygons representing these extended edges - The edges are extended to the "outside" by the given distance "e". The distance will be applied to the left side as seen in the direction of the edge. By definition, this is the side pointing to the outside of the polygon if the edge was derived from a polygon. - - Other versions of this feature are \extended_in and \extended. - """ - @overload - def extents(self) -> Region: - r""" - @brief Returns a region with the bounding boxes of the edges - This method will return a region consisting of the bounding boxes of the edges. - The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. - """ - @overload - def extents(self, d: int) -> Region: - r""" - @brief Returns a region with the enlarged bounding boxes of the edges - This method will return a region consisting of the bounding boxes of the edges enlarged by the given distance d. - The enlargement is specified per edge, i.e the width and height will be increased by 2*d. - The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. - """ - @overload - def extents(self, dx: int, dy: int) -> Region: - r""" - @brief Returns a region with the enlarged bounding boxes of the edges - This method will return a region consisting of the bounding boxes of the edges enlarged by the given distance dx in x direction and dy in y direction. - The enlargement is specified per edge, i.e the width will be increased by 2*dx. - The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. - """ - def flatten(self) -> None: - r""" - @brief Explicitly flattens an edge collection - - If the collection is already flat (i.e. \has_valid_edges? returns true), this method will not change it. - - This method has been introduced in version 0.26. - """ - def has_valid_edges(self) -> bool: - r""" - @brief Returns true if the edge collection is flat and individual edges can be accessed randomly - - This method has been introduced in version 0.26. - """ - def hier_count(self) -> int: - r""" - @brief Returns the (hierarchical) number of edges in the edge collection - - This returns the number of raw edges (not merged edges if merged semantics is enabled). - The count is computed 'hierarchical', i.e. edges inside a cell are counted once even if the cell is instantiated multiple times. - - This method has been introduced in version 0.27. - """ - def in_(self, other: Edges) -> Edges: - r""" - @brief Returns all edges which are members of the other edge collection - This method returns all edges in self which can be found in the other edge collection as well with exactly the same geometry. - """ - def in_and_out(self, other: Edges) -> List[Edges]: - r""" - @brief Returns all polygons which are members and not members of the other region - This method is equivalent to calling \members_of and \not_members_of, but delivers both results at the same time and is more efficient than two separate calls. The first element returned is the \members_of part, the second is the \not_members_of part. - - This method has been introduced in version 0.28. - """ - @overload - def insert(self, box: Box) -> None: - r""" - @brief Inserts a box - - Inserts the edges that form the contour of the box into the edge collection. - """ - @overload - def insert(self, edge: Edge) -> None: - r""" - @brief Inserts an edge - - Inserts the edge into the edge collection. - """ - @overload - def insert(self, edges: Edges) -> None: - r""" - @brief Inserts all edges from the other edge collection into this one - This method has been introduced in version 0.25. - """ - @overload - def insert(self, edges: Sequence[Edge]) -> None: - r""" - @brief Inserts all edges from the array into this edge collection - """ - @overload - def insert(self, path: Path) -> None: - r""" - @brief Inserts a path - - Inserts the edges that form the contour of the path into the edge collection. - """ - @overload - def insert(self, polygon: Polygon) -> None: - r""" - @brief Inserts a polygon - - Inserts the edges that form the contour of the polygon into the edge collection. - """ - @overload - def insert(self, polygon: SimplePolygon) -> None: - r""" - @brief Inserts a simple polygon - - Inserts the edges that form the contour of the simple polygon into the edge collection. - """ - @overload - def insert(self, polygons: Sequence[Polygon]) -> None: - r""" - @brief Inserts all polygons from the array into this edge collection - """ - @overload - def insert(self, region: Region) -> None: - r""" - @brief Inserts a region - Inserts the edges that form the contours of the polygons from the region into the edge collection. - - This method has been introduced in version 0.25. - """ - @overload - def insert(self, shape_iterator: RecursiveShapeIterator) -> None: - r""" - @brief Inserts all shapes delivered by the recursive shape iterator into this edge collection - - For "solid" shapes (boxes, polygons, paths), this method inserts the edges that form the contour of the shape into the edge collection. - Edge shapes are inserted as such. - Text objects are not inserted, because they cannot be converted to polygons. - """ - @overload - def insert(self, shapes: Shapes) -> None: - r""" - @brief Inserts all edges from the shape collection into this edge collection - This method takes each edge from the shape collection and inserts it into the region. "Polygon-like" objects are inserted as edges forming the contours of the polygons. - Text objects are ignored. - - This method has been introduced in version 0.25. - """ - @overload - def insert(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: - r""" - @brief Inserts all shapes delivered by the recursive shape iterator into this edge collection with a transformation - - For "solid" shapes (boxes, polygons, paths), this method inserts the edges that form the contour of the shape into the edge collection. - Edge shapes are inserted as such. - Text objects are not inserted, because they cannot be converted to polygons. - This variant will apply the given transformation to the shapes. This is useful to scale the shapes to a specific database unit for example. - """ - @overload - def insert(self, shapes: Shapes, trans: ICplxTrans) -> None: - r""" - @brief Inserts all edges from the shape collection into this edge collection with complex transformation - This method acts as the version without transformation, but will apply the given complex transformation before inserting the edges. - - This method has been introduced in version 0.25. - """ - @overload - def insert(self, shapes: Shapes, trans: Trans) -> None: - r""" - @brief Inserts all edges from the shape collection into this edge collection (with transformation) - This method acts as the version without transformation, but will apply the given transformation before inserting the edges. - - This method has been introduced in version 0.25. - """ - def insert_into(self, layout: Layout, cell_index: int, layer: int) -> None: - r""" - @brief Inserts this edge collection into the given layout, below the given cell and into the given layer. - If the edge collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. - - This method has been introduced in version 0.26. - """ - @overload - def inside(self, other: Edges) -> Edges: - r""" - @brief Returns the edges of this edge collection which are inside (completely covered by) edges from the other edge collection - - @return A new edge collection containing the edges overlapping or touching edges from the other edge collection - - This method has been introduced in version 0.28. - """ - @overload - def inside(self, other: Region) -> Edges: - r""" - @brief Returns the edges from this edge collection which are inside (completely covered by) polygons from the region - - @return A new edge collection containing the edges overlapping or touching polygons from the region - - This method has been introduced in version 0.28. - """ - def inside_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: - r""" - @brief Performs an inside check with options - @param d The minimum distance for which the edges are checked - @param other The other edge collection against which to check - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The threshold angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper threshold of the projected length of one edge onto another - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. - - The 'enclosed_check' alias was introduced in version 0.27.5. - """ - def inside_outside_part(self, other: Region) -> List[Edges]: - r""" - @brief Returns the partial edges inside and outside the given region - - @return A two-element array of edge collections with the first one being the \inside_part result and the second one being the \outside_part result - - This method will compute the results simultaneously. Because this requires a single sweep only, using this method is faster than doing \inside_part and \outside_part separately. - - This method has been added in version 0.28. - """ - def inside_part(self, other: Region) -> Edges: - r""" - @brief Returns the parts of the edges of this edge collection which are inside the polygons of the region - - @return A new edge collection containing the edge parts inside the region - - This operation returns the parts of the edges which are inside the given region. - This functionality is similar to the '&' operator, but edges on the borders of the polygons are not included in the edge set. - As a side effect, the edges are made non-intersecting by introducing cut points where - edges intersect. - - This method has been introduced in version 0.24. - """ - @overload - def interacting(self, other: Edges) -> Edges: - r""" - @brief Returns the edges of this edge collection which overlap or touch edges from the other edge collection - - @return A new edge collection containing the edges overlapping or touching edges from the other edge collection - """ - @overload - def interacting(self, other: Region) -> Edges: - r""" - @brief Returns the edges from this edge collection which overlap or touch polygons from the region - - @return A new edge collection containing the edges overlapping or touching polygons from the region - """ - def intersections(self, other: Edges) -> Edges: - r""" - @brief Computes the intersections between this edges and other edges - This computation is like an AND operation, but also including crossing points between non-coincident edges as degenerated (point-like) edges. - - This method has been introduced in version 0.26.2 - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_deep(self) -> bool: - r""" - @brief Returns true if the edge collection is a deep (hierarchical) one - - This method has been added in version 0.26. - """ - def is_empty(self) -> bool: - r""" - @brief Returns true if the edge collection is empty - """ - def is_merged(self) -> bool: - r""" - @brief Returns true if the edge collection is merged - If the region is merged, coincident edges have been merged into single edges. You can ensure merged state by calling \merge. - """ - @overload - def length(self) -> int: - r""" - @brief Returns the total length of all edges in the edge collection - - Merged semantics applies for this method (see \merged_semantics= of merged semantics) - """ - @overload - def length(self, rect: Box) -> int: - r""" - @brief Returns the total length of all edges in the edge collection (restricted to a rectangle) - This version will compute the total length of all edges in the collection, restricting the computation to the given rectangle. - Edges along the border are handled in a special way: they are counted when they are oriented with their inside side toward the rectangle (in other words: outside edges must coincide with the rectangle's border in order to be counted). - - Merged semantics applies for this method (see \merged_semantics= of merged semantics) - """ - def members_of(self, other: Edges) -> Edges: - r""" - @brief Returns all edges which are members of the other edge collection - This method returns all edges in self which can be found in the other edge collection as well with exactly the same geometry. - """ - def merge(self) -> Edges: - r""" - @brief Merge the edges - - @return The edge collection after the edges have been merged (self). - - Merging joins parallel edges which overlap or touch. - Crossing edges are not merged. - If the edge collection is already merged, this method does nothing - """ - def merged(self) -> Edges: - r""" - @brief Returns the merged edge collection - - @return The edge collection after the edges have been merged. - - Merging joins parallel edges which overlap or touch. - Crossing edges are not merged. - In contrast to \merge, this method does not modify the edge collection but returns a merged copy. - """ - @overload - def move(self, v: Vector) -> Edges: - r""" - @brief Moves the edge collection - - Moves the polygon by the given offset and returns the - moved edge collection. The edge collection is overwritten. - - @param v The distance to move the edge collection. - - @return The moved edge collection (self). - - Starting with version 0.25 the displacement type is a vector. - """ - @overload - def move(self, x: int, y: int) -> Edges: - r""" - @brief Moves the edge collection - - Moves the edge collection by the given offset and returns the - moved edge collection. The edge collection is overwritten. - - @param x The x distance to move the edge collection. - @param y The y distance to move the edge collection. - - @return The moved edge collection (self). - """ - @overload - def moved(self, v: Vector) -> Edges: - r""" - @brief Returns the moved edge collection (does not modify self) - - Moves the edge collection by the given offset and returns the - moved edge collection. The edge collection is not modified. - - @param v The distance to move the edge collection. - - @return The moved edge collection. - - Starting with version 0.25 the displacement type is a vector. - """ - @overload - def moved(self, x: int, v: int) -> Edges: - r""" - @brief Returns the moved edge collection (does not modify self) - - Moves the edge collection by the given offset and returns the - moved edge collection. The edge collection is not modified. - - @param x The x distance to move the edge collection. - @param y The y distance to move the edge collection. - - @return The moved edge collection. - """ - def not_in(self, other: Edges) -> Edges: - r""" - @brief Returns all edges which are not members of the other edge collection - This method returns all edges in self which can not be found in the other edge collection with exactly the same geometry. - """ - @overload - def not_inside(self, other: Edges) -> Edges: - r""" - @brief Returns the edges of this edge collection which are not inside (completely covered by) edges from the other edge collection - - @return A new edge collection containing the edges not overlapping or touching edges from the other edge collection - - This method has been introduced in version 0.28. - """ - @overload - def not_inside(self, other: Region) -> Edges: - r""" - @brief Returns the edges from this edge collection which are not inside (completely covered by) polygons from the region - - @return A new edge collection containing the edges not overlapping or touching polygons from the region - - This method has been introduced in version 0.28. - """ - @overload - def not_interacting(self, other: Edges) -> Edges: - r""" - @brief Returns the edges of this edge collection which do not overlap or touch edges from the other edge collection - - @return A new edge collection containing the edges not overlapping or touching edges from the other edge collection - """ - @overload - def not_interacting(self, other: Region) -> Edges: - r""" - @brief Returns the edges from this edge collection which do not overlap or touch polygons from the region - - @return A new edge collection containing the edges not overlapping or touching polygons from the region - """ - def not_members_of(self, other: Edges) -> Edges: - r""" - @brief Returns all edges which are not members of the other edge collection - This method returns all edges in self which can not be found in the other edge collection with exactly the same geometry. - """ - @overload - def not_outside(self, other: Edges) -> Edges: - r""" - @brief Returns the edges of this edge collection which are not outside (completely covered by) edges from the other edge collection - - @return A new edge collection containing the edges not overlapping or touching edges from the other edge collection - - This method has been introduced in version 0.28. - """ - @overload - def not_outside(self, other: Region) -> Edges: - r""" - @brief Returns the edges from this edge collection which are not outside (completely covered by) polygons from the region - - @return A new edge collection containing the edges not overlapping or touching polygons from the region - - This method has been introduced in version 0.28. - """ - @overload - def outside(self, other: Edges) -> Edges: - r""" - @brief Returns the edges of this edge collection which are outside (completely covered by) edges from the other edge collection - - @return A new edge collection containing the edges overlapping or touching edges from the other edge collection - - This method has been introduced in version 0.28. - """ - @overload - def outside(self, other: Region) -> Edges: - r""" - @brief Returns the edges from this edge collection which are outside (completely covered by) polygons from the region - - @return A new edge collection containing the edges overlapping or touching polygons from the region - - This method has been introduced in version 0.28. - """ - def outside_part(self, other: Region) -> Edges: - r""" - @brief Returns the parts of the edges of this edge collection which are outside the polygons of the region - - @return A new edge collection containing the edge parts outside the region - - This operation returns the parts of the edges which are not inside the given region. - This functionality is similar to the '-' operator, but edges on the borders of the polygons are included in the edge set. - As a side effect, the edges are made non-intersecting by introducing cut points where - edges intersect. - - This method has been introduced in version 0.24. - """ - def overlap_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: - r""" - @brief Performs an overlap check with options - @param d The minimum distance for which the edges are checked - @param other The other edge collection against which to check - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The threshold angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper threshold of the projected length of one edge onto another - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. - """ - @overload - def pull_interacting(self, other: Edges) -> Edges: - r""" - @brief Returns all edges of "other" which are interacting with polygons of this edge set - See the other \pull_interacting version for more details. - - @return The edge collection after the edges have been selected (from other) - - Merged semantics applies for this method (see \merged_semantics= of merged semantics) - - This method has been introduced in version 0.26.1 - """ - @overload - def pull_interacting(self, other: Region) -> Region: - r""" - @brief Returns all polygons of "other" which are interacting with (overlapping, touching) edges of this edge set - The "pull_..." methods are similar to "select_..." but work the opposite way: they select shapes from the argument region rather than self. In a deep (hierarchical) context the output region will be hierarchically aligned with self, so the "pull_..." methods provide a way for re-hierarchization. - - @return The region after the polygons have been selected (from other) - - Merged semantics applies for this method (see \merged_semantics= of merged semantics) - - This method has been introduced in version 0.26.1 - """ - @overload - def select_inside(self, other: Edges) -> Edges: - r""" - @brief Selects the edges from this edge collection which are inside (completely covered by) edges from the other edge collection - - @return The edge collection after the edges have been selected (self) - - This method has been introduced in version 0.28. - """ - @overload - def select_inside(self, other: Region) -> Edges: - r""" - @brief Selects the edges from this edge collection which are inside (completely covered by) polygons from the region - - @return The edge collection after the edges have been selected (self) - - This method has been introduced in version 0.28. - """ - def select_inside_part(self, other: Region) -> Edges: - r""" - @brief Selects the parts of the edges from this edge collection which are inside the polygons of the given region - - @return The edge collection after the edges have been selected (self) - - This operation selects the parts of the edges which are inside the given region. - This functionality is similar to the '&=' operator, but edges on the borders of the polygons are not included in the edge set. - As a side effect, the edges are made non-intersecting by introducing cut points where - edges intersect. - - This method has been introduced in version 0.24. - """ - @overload - def select_interacting(self, other: Edges) -> Edges: - r""" - @brief Selects the edges from this edge collection which overlap or touch edges from the other edge collection - - @return The edge collection after the edges have been selected (self) - """ - @overload - def select_interacting(self, other: Region) -> Edges: - r""" - @brief Selects the edges from this edge collection which overlap or touch polygons from the region - - @return The edge collection after the edges have been selected (self) - """ - @overload - def select_not_inside(self, other: Edges) -> Edges: - r""" - @brief Selects the edges from this edge collection which are not inside (completely covered by) edges from the other edge collection - - @return The edge collection after the edges have been selected (self) - - This method has been introduced in version 0.28. - """ - @overload - def select_not_inside(self, other: Region) -> Edges: - r""" - @brief Selects the edges from this edge collection which are not inside (completely covered by) polygons from the region - - @return The edge collection after the edges have been selected (self) - - This method has been introduced in version 0.28. - """ - @overload - def select_not_interacting(self, other: Edges) -> Edges: - r""" - @brief Selects the edges from this edge collection which do not overlap or touch edges from the other edge collection - - @return The edge collection after the edges have been selected (self) - """ - @overload - def select_not_interacting(self, other: Region) -> Edges: - r""" - @brief Selects the edges from this edge collection which do not overlap or touch polygons from the region - - @return The edge collection after the edges have been selected (self) - """ - @overload - def select_not_outside(self, other: Edges) -> Edges: - r""" - @brief Selects the edges from this edge collection which are not outside (completely covered by) edges from the other edge collection - - @return The edge collection after the edges have been selected (self) - - This method has been introduced in version 0.28. - """ - @overload - def select_not_outside(self, other: Region) -> Edges: - r""" - @brief Selects the edges from this edge collection which are not outside (completely covered by) polygons from the region - - @return The edge collection after the edges have been selected (self) - - This method has been introduced in version 0.28. - """ - @overload - def select_outside(self, other: Edges) -> Edges: - r""" - @brief Selects the edges from this edge collection which are outside (completely covered by) edges from the other edge collection - - @return The edge collection after the edges have been selected (self) - - This method has been introduced in version 0.28. - """ - @overload - def select_outside(self, other: Region) -> Edges: - r""" - @brief Selects the edges from this edge collection which are outside (completely covered by) polygons from the region - - @return The edge collection after the edges have been selected (self) - - This method has been introduced in version 0.28. - """ - def select_outside_part(self, other: Region) -> Edges: - r""" - @brief Selects the parts of the edges from this edge collection which are outside the polygons of the given region - - @return The edge collection after the edges have been selected (self) - - This operation selects the parts of the edges which are not inside the given region. - This functionality is similar to the '-=' operator, but edges on the borders of the polygons are included in the edge set. - As a side effect, the edges are made non-intersecting by introducing cut points where - edges intersect. - - This method has been introduced in version 0.24. - """ - def separation_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: - r""" - @brief Performs an overlap check with options - @param d The minimum distance for which the edges are checked - @param other The other edge collection against which to check - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The threshold angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper threshold of the projected length of one edge onto another - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. - """ - def size(self) -> int: - r""" - @brief Returns the (flat) number of edges in the edge collection - - This returns the number of raw edges (not merged edges if merged semantics is enabled). - The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated. - - Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. - """ - def space_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: - r""" - @brief Performs a space check with options - @param d The minimum distance for which the edges are checked - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The threshold angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper threshold of the projected length of one edge onto another - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the space check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. - """ - @overload - def split_inside(self, other: Edges) -> List[Edges]: - r""" - @brief Selects the edges from this edge collection which are and are not inside (completely covered by) edges from the other collection - - @return A two-element list of edge collections (first: inside, second: non-inside) - - This method provides a faster way to compute both inside and non-inside edges compared to using separate methods. It has been introduced in version 0.28. - """ - @overload - def split_inside(self, other: Region) -> List[Edges]: - r""" - @brief Selects the edges from this edge collection which are and are not inside (completely covered by) polygons from the other region - - @return A two-element list of edge collections (first: inside, second: non-inside) - - This method provides a faster way to compute both inside and non-inside edges compared to using separate methods. It has been introduced in version 0.28. - """ - @overload - def split_interacting(self, other: Edges) -> List[Edges]: - r""" - @brief Selects the edges from this edge collection which do and do not interact with edges from the other collection - - @return A two-element list of edge collections (first: interacting, second: non-interacting) - - This method provides a faster way to compute both interacting and non-interacting edges compared to using separate methods. It has been introduced in version 0.28. - """ - @overload - def split_interacting(self, other: Region) -> List[Edges]: - r""" - @brief Selects the edges from this edge collection which do and do not interact with polygons from the other region - - @return A two-element list of edge collections (first: interacting, second: non-interacting) - - This method provides a faster way to compute both interacting and non-interacting edges compared to using separate methods. It has been introduced in version 0.28. - """ - @overload - def split_outside(self, other: Edges) -> List[Edges]: - r""" - @brief Selects the edges from this edge collection which are and are not outside (completely covered by) edges from the other collection - - @return A two-element list of edge collections (first: outside, second: non-outside) - - This method provides a faster way to compute both outside and non-outside edges compared to using separate methods. It has been introduced in version 0.28. - """ - @overload - def split_outside(self, other: Region) -> List[Edges]: - r""" - @brief Selects the edges from this edge collection which are and are not outside (completely covered by) polygons from the other region - - @return A two-element list of edge collections (first: outside, second: non-outside) - - This method provides a faster way to compute both outside and non-outside edges compared to using separate methods. It has been introduced in version 0.28. - """ - def start_segments(self, length: int, fraction: float) -> Edges: - r""" - @brief Returns edges representing a part of the edge after the start point - @return A new collection of edges representing the start part - This method allows one to specify the length of these segments in a twofold way: either as a fixed length or by specifying a fraction of the original length: - - @code - edges = ... # An edge collection - edges.start_segments(100, 0.0) # All segments have a length of 100 DBU - edges.start_segments(0, 50.0) # All segments have a length of half the original length - edges.start_segments(100, 50.0) # All segments have a length of half the original length - # or 100 DBU, whichever is larger - @/code - - It is possible to specify 0 for both values. In this case, degenerated edges (points) are delivered which specify the start positions of the edges but can't participate in some functions. - """ - def swap(self, other: Edges) -> None: - r""" - @brief Swap the contents of this edge collection with the contents of another one - This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare. - """ - @overload - def to_s(self) -> str: - r""" - @brief Converts the edge collection to a string - The length of the output is limited to 20 edges to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. - """ - @overload - def to_s(self, max_count: int) -> str: - r""" - @brief Converts the edge collection to a string - This version allows specification of the maximum number of edges contained in the string. - """ - @overload - def transform(self, t: ICplxTrans) -> Edges: - r""" - @brief Transform the edge collection with a complex transformation (modifies self) - - Transforms the edge collection with the given transformation. - This version modifies the edge collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed edge collection. - """ - @overload - def transform(self, t: IMatrix2d) -> Edges: - r""" - @brief Transform the edge collection (modifies self) - - Transforms the edge collection with the given 2d matrix transformation. - This version modifies the edge collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed edge collection. - - This variant has been introduced in version 0.27. - """ - @overload - def transform(self, t: IMatrix3d) -> Edges: - r""" - @brief Transform the edge collection (modifies self) - - Transforms the edge collection with the given 3d matrix transformation. - This version modifies the edge collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed edge collection. - - This variant has been introduced in version 0.27. - """ - @overload - def transform(self, t: Trans) -> Edges: - r""" - @brief Transform the edge collection (modifies self) - - Transforms the edge collection with the given transformation. - This version modifies the edge collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed edge collection. - """ - def transform_icplx(self, t: ICplxTrans) -> Edges: - r""" - @brief Transform the edge collection with a complex transformation (modifies self) - - Transforms the edge collection with the given transformation. - This version modifies the edge collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed edge collection. - """ - @overload - def transformed(self, t: ICplxTrans) -> Edges: - r""" - @brief Transform the edge collection with a complex transformation - - Transforms the edge collection with the given complex transformation. - Does not modify the edge collection but returns the transformed edge collection. - - @param t The transformation to apply. - - @return The transformed edge collection. - """ - @overload - def transformed(self, t: IMatrix2d) -> Edges: - r""" - @brief Transform the edge collection - - Transforms the edge collection with the given 2d matrix transformation. - Does not modify the edge collection but returns the transformed edge collection. - - @param t The transformation to apply. - - @return The transformed edge collection. - - This variant has been introduced in version 0.27. - """ - @overload - def transformed(self, t: IMatrix3d) -> Edges: - r""" - @brief Transform the edge collection - - Transforms the edge collection with the given 3d matrix transformation. - Does not modify the edge collection but returns the transformed edge collection. - - @param t The transformation to apply. - - @return The transformed edge collection. - - This variant has been introduced in version 0.27. - """ - @overload - def transformed(self, t: Trans) -> Edges: - r""" - @brief Transform the edge collection - - Transforms the edge collection with the given transformation. - Does not modify the edge collection but returns the transformed edge collection. - - @param t The transformation to apply. - - @return The transformed edge collection. - """ - def transformed_icplx(self, t: ICplxTrans) -> Edges: - r""" - @brief Transform the edge collection with a complex transformation - - Transforms the edge collection with the given complex transformation. - Does not modify the edge collection but returns the transformed edge collection. - - @param t The transformation to apply. - - @return The transformed edge collection. - """ - def width_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: - r""" - @brief Performs a width check with options - @param d The minimum width for which the edges are checked - @param whole_edges If true, deliver the whole edges - @param metrics Specify the metrics type - @param ignore_angle The threshold angle above which no check is performed - @param min_projection The lower threshold of the projected length of one edge onto another - @param max_projection The upper threshold of the projected length of one edge onto another - - If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. - - "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. - Use nil for this value to select the default (Euclidian metrics). - - "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. - Use nil for this value to select the default. - - "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. - """ - @overload - def with_angle(self, angle: float, inverse: bool) -> Edges: - r""" - @brief Filters the edges by orientation - Filters the edges in the edge collection by orientation. If "inverse" is false, only edges which have the given angle to the x-axis are returned. If "inverse" is true, edges not having the given angle are returned. - - This will select horizontal edges: - - @code - horizontal = edges.with_angle(0, false) - @/code - """ - @overload - def with_angle(self, type: Edges.EdgeType, inverse: bool) -> Edges: - r""" - @brief Filters the edges by orientation type - Filters the edges in the edge collection by orientation. If "inverse" is false, only edges which have an angle of the given type are returned. If "inverse" is true, edges which do not conform to this criterion are returned. - - This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations and are specified using one of the \OrthoEdges, \DiagonalEdges or \OrthoDiagonalEdges types. - - This method has been added in version 0.28. - """ - @overload - def with_angle(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Edges: - r""" - @brief Filters the edges by orientation - Filters the edges in the edge collection by orientation. If "inverse" is false, only edges which have an angle to the x-axis larger or equal to "min_angle" (depending on "include_min_angle") and equal or less than "max_angle" (depending on "include_max_angle") are returned. If "inverse" is true, edges which do not conform to this criterion are returned. - - With "include_min_angle" set to true (the default), the minimum angle is included in the criterion while with false, the minimum angle itself is not included. Same for "include_max_angle" where the default is false, meaning the maximum angle is not included in the range. - - The two "include.." arguments have been added in version 0.27. - """ - @overload - def with_length(self, length: int, inverse: bool) -> Edges: - r""" - @brief Filters the edges by length - Filters the edges in the edge collection by length. If "inverse" is false, only edges which have the given length are returned. If "inverse" is true, edges not having the given length are returned. - """ - @overload - def with_length(self, min_length: Any, max_length: Any, inverse: bool) -> Edges: - r""" - @brief Filters the edges by length - Filters the edges in the edge collection by length. If "inverse" is false, only edges which have a length larger or equal to "min_length" and less than "max_length" are returned. If "inverse" is true, edges not having a length less than "min_length" or larger or equal than "max_length" are returned. - - If you don't want to specify a lower or upper limit, pass nil to that parameter. - """ - -class InstElement: - r""" - @brief An element in an instantiation path - - This objects are used to reference a single instance in a instantiation path. The object is composed of a \CellInstArray object (accessible through the \cell_inst accessor) that describes the basic instance, which may be an array. The particular instance within the array can be further retrieved using the \array_member_trans, \specific_trans or \specific_cplx_trans methods. - """ - @overload - @classmethod - def new(cls) -> InstElement: - r""" - @brief Default constructor - """ - @overload - @classmethod - def new(cls, inst: Instance) -> InstElement: - r""" - @brief Create an instance element from a single instance alone - Starting with version 0.15, this method takes an \Instance object (an instance reference) as the argument. - """ - @overload - @classmethod - def new(cls, inst: Instance, a_index: int, b_index: int) -> InstElement: - r""" - @brief Create an instance element from an array instance pointing into a certain array member - Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument. - """ - @classmethod - def new_i(cls, inst: Instance) -> InstElement: - r""" - @brief Create an instance element from a single instance alone - Starting with version 0.15, this method takes an \Instance object (an instance reference) as the argument. - """ - @classmethod - def new_iab(cls, inst: Instance, a_index: int, b_index: int) -> InstElement: - r""" - @brief Create an instance element from an array instance pointing into a certain array member - Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument. - """ - def __copy__(self) -> InstElement: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> InstElement: - r""" - @brief Creates a copy of self - """ - def __eq__(self, b: object) -> bool: - r""" - @brief Equality of two InstElement objects - Note: this operator returns true if both instance elements refer to the same instance, not just identical ones. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor - """ - @overload - def __init__(self, inst: Instance) -> None: - r""" - @brief Create an instance element from a single instance alone - Starting with version 0.15, this method takes an \Instance object (an instance reference) as the argument. - """ - @overload - def __init__(self, inst: Instance, a_index: int, b_index: int) -> None: - r""" - @brief Create an instance element from an array instance pointing into a certain array member - Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument. - """ - def __lt__(self, b: InstElement) -> bool: - r""" - @brief Provides an order criterion for two InstElement objects - Note: this operator is just provided to establish any order, not a particular one. - """ - def __ne__(self, b: object) -> bool: - r""" - @brief Inequality of two InstElement objects - See the comments on the == operator. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def array_member_trans(self) -> Trans: - r""" - @brief Returns the transformation for this array member - - The array member transformation is the one applicable in addition to the global transformation for the member selected from an array. - If this instance is not an array instance, the specific transformation is a unit transformation without displacement. - """ - def assign(self, other: InstElement) -> None: - r""" - @brief Assigns another object to self - """ - def cell_inst(self) -> CellInstArray: - r""" - @brief Accessor to the cell instance (array). - - This method is equivalent to "self.inst.cell_inst" and provided for convenience. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> InstElement: - r""" - @brief Creates a copy of self - """ - def ia(self) -> int: - r""" - @brief Returns the 'a' axis index for array instances - For instance elements describing one member of an array, this attribute will deliver the a axis index addressed by this element. See \ib and \array_member_trans for further attributes applicable to array members. - If the element is a plain instance and not an array member, this attribute is a negative value. - - This method has been introduced in version 0.25. - """ - def ib(self) -> int: - r""" - @brief Returns the 'b' axis index for array instances - For instance elements describing one member of an array, this attribute will deliver the a axis index addressed by this element. See \ia and \array_member_trans for further attributes applicable to array members. - If the element is a plain instance and not an array member, this attribute is a negative value. - - This method has been introduced in version 0.25. - """ - def inst(self) -> Instance: - r""" - @brief Gets the \Instance object held in this instance path element. - - This method has been added in version 0.24. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def prop_id(self) -> int: - r""" - @brief Accessor to the property attached to this instance. - - This method is equivalent to "self.inst.prop_id" and provided for convenience. - """ - def specific_cplx_trans(self) -> ICplxTrans: - r""" - @brief Returns the specific complex transformation for this instance - - The specific transformation is the one applicable for the member selected from an array. - This is the effective transformation applied for this array member. \array_member_trans gives the transformation applied additionally to the instances' global transformation (in other words, specific_cplx_trans = array_member_trans * cell_inst.cplx_trans). - """ - def specific_trans(self) -> Trans: - r""" - @brief Returns the specific transformation for this instance - - The specific transformation is the one applicable for the member selected from an array. - This is the effective transformation applied for this array member. \array_member_trans gives the transformation applied additionally to the instances' global transformation (in other words, specific_trans = array_member_trans * cell_inst.trans). - This method delivers a simple transformation that does not include magnification components. To get these as well, use \specific_cplx_trans. - """ - -class LayerMapping: - r""" - @brief A layer mapping (source to target layout) - - A layer mapping is an association of layers in two layouts forming pairs of layers, i.e. one layer corresponds to another layer in the other layout. The LayerMapping object describes the mapping of layers of a source layout A to a target layout B. - - A layer mapping can be set up manually or using the methods \create or \create_full. - - @code - lm = RBA::LayerMapping::new - # explicit: - lm.map(2, 1) # map layer index 2 of source to 1 of target - lm.map(7, 3) # map layer index 7 of source to 3 of target - ... - # or employing the specification identity: - lm.create(target_layout, source_layout) - # plus creating layers which don't exist in the target layout yet: - new_layers = lm.create_full(target_layout, source_layout) - @/code - - A layer might not be mapped to another layer which basically means that there is no corresponding layer. - Such layers will be ignored in operations using the layer mapping. Use \create_full to ensure all layers - of the source layout are mapped. - - LayerMapping objects play a role mainly in the hierarchical copy or move operations of \Layout. However, use is not restricted to these applications. - - This class has been introduced in version 0.23. - """ - @classmethod - def new(cls) -> LayerMapping: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> LayerMapping: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> LayerMapping: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: LayerMapping) -> None: - r""" - @brief Assigns another object to self - """ - def clear(self) -> None: - r""" - @brief Clears the mapping. - """ - def create(self, layout_a: Layout, layout_b: Layout) -> None: - r""" - @brief Initialize the layer mapping from two layouts - - @param layout_a The target layout - @param layout_b The source layout - - The layer mapping is created by looking up each layer of layout_b in layout_a. All layers with matching specifications (\LayerInfo) are mapped. Layouts without a layer/datatype/name specification will not be mapped. - \create_full is a version of this method which creates new layers in layout_a if no corresponding layer is found. - """ - def create_full(self, layout_a: Layout, layout_b: Layout) -> List[int]: - r""" - @brief Initialize the layer mapping from two layouts - - @param layout_a The target layout - @param layout_b The source layout - @return A list of layers created - - The layer mapping is created by looking up each layer of layout_b in layout_a. All layers with matching specifications (\LayerInfo) are mapped. Layouts without a layer/datatype/name specification will not be mapped. - Layers with a valid specification which are not found in layout_a are created there. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> LayerMapping: - r""" - @brief Creates a copy of self - """ - def has_mapping(self, layer_index_b: int) -> bool: - r""" - @brief Determine if a layer in layout_b has a mapping to a layout_a layer. - - - @param layer_index_b The index of the layer in layout_b whose mapping is requested. - @return true, if the layer has a mapping - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def layer_mapping(self, layer_index_b: int) -> int: - r""" - @brief Determine layer mapping of a layout_b layer to the corresponding layout_a layer. - - - @param layer_index_b The index of the layer in layout_b whose mapping is requested. - @return The corresponding layer in layout_a. - """ - def map(self, layer_index_b: int, layer_index_a: int) -> None: - r""" - @brief Explicitly specify a mapping. - - - @param layer_index_b The index of the layer in layout B (the "source") - @param layer_index_a The index of the layer in layout A (the "target") - - Beside using the mapping generator algorithms provided through \create and \create_full, it is possible to explicitly specify layer mappings using this method. - """ - def table(self) -> Dict[int, int]: - r""" - @brief Returns the mapping table. - - The mapping table is a dictionary where the keys are source layout layer indexes and the values are the target layout layer indexes. - - This method has been introduced in version 0.25. - """ - -class LayerInfo: - r""" - @brief A structure encapsulating the layer properties - - The layer properties describe how a layer is stored in a GDS2 or OASIS file for example. The \LayerInfo object represents the storage properties that are attached to a layer in the database. - - In general, a layer has either a layer and a datatype number (in GDS2), a name (for example in DXF or CIF) or both (in OASIS). In the latter case, the primary identification is through layer and datatype number and the name is some annotation attached to it. A \LayerInfo object which specifies just a name returns true on \is_named?. - The \LayerInfo object can also specify an anonymous layer (use \LayerInfo#new without arguments). Such a layer will not be stored when saving the layout. They can be employed for temporary layers for example. Use \LayerInfo#anonymous? to test whether a layer does not have a specification. - - The \LayerInfo is used for example in \Layout#insert_layer to specify the properties of the new layer that will be created. The \is_equivalent? method compares two \LayerInfo objects using the layer and datatype numbers with a higher priority over the name. - """ - datatype: int - r""" - Getter: - @brief Gets the datatype - - Setter: - @brief Set the datatype - """ - layer: int - r""" - Getter: - @brief Gets the layer number - - Setter: - @brief Sets the layer number - """ - name: str - r""" - Getter: - @brief Gets the layer name - - Setter: - @brief Set the layer name - The name is set on OASIS input for example, if the layer has a name. - """ - @classmethod - def from_string(cls, s: str, as_target: Optional[bool] = ...) -> LayerInfo: - r""" - @brief Create a layer info object from a string - @param The string - @return The LayerInfo object - - If 'as_target' is true, relative specifications such as '*+1' for layer or datatype are permitted. - - This method will take strings as produced by \to_s and create a \LayerInfo object from them. The format is either "layer", "layer/datatype", "name" or "name (layer/datatype)". - - This method was added in version 0.23. - The 'as_target' argument has been added in version 0.26.5. - """ - @overload - @classmethod - def new(cls) -> LayerInfo: - r""" - @brief The default constructor. - Creates a default \LayerInfo object. - - This method was added in version 0.18. - """ - @overload - @classmethod - def new(cls, name: str) -> LayerInfo: - r""" - @brief The constructor for a named layer. - Creates a \LayerInfo object representing a named layer. - @param name The name - - This method was added in version 0.18. - """ - @overload - @classmethod - def new(cls, layer: int, datatype: int) -> LayerInfo: - r""" - @brief The constructor for a layer/datatype pair. - Creates a \LayerInfo object representing a layer and datatype. - @param layer The layer number - @param datatype The datatype number - - This method was added in version 0.18. - """ - @overload - @classmethod - def new(cls, layer: int, datatype: int, name: str) -> LayerInfo: - r""" - @brief The constructor for a named layer with layer and datatype. - Creates a \LayerInfo object representing a named layer with layer and datatype. - @param layer The layer number - @param datatype The datatype number - @param name The name - - This method was added in version 0.18. - """ - def __copy__(self) -> LayerInfo: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> LayerInfo: - r""" - @brief Creates a copy of self - """ - def __eq__(self, b: object) -> bool: - r""" - @brief Compares two layer info objects - @return True, if both are equal - - This method was added in version 0.18. - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given layer info object. This method enables layer info objects as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief The default constructor. - Creates a default \LayerInfo object. - - This method was added in version 0.18. - """ - @overload - def __init__(self, name: str) -> None: - r""" - @brief The constructor for a named layer. - Creates a \LayerInfo object representing a named layer. - @param name The name - - This method was added in version 0.18. - """ - @overload - def __init__(self, layer: int, datatype: int) -> None: - r""" - @brief The constructor for a layer/datatype pair. - Creates a \LayerInfo object representing a layer and datatype. - @param layer The layer number - @param datatype The datatype number - - This method was added in version 0.18. - """ - @overload - def __init__(self, layer: int, datatype: int, name: str) -> None: - r""" - @brief The constructor for a named layer with layer and datatype. - Creates a \LayerInfo object representing a named layer with layer and datatype. - @param layer The layer number - @param datatype The datatype number - @param name The name - - This method was added in version 0.18. - """ - def __ne__(self, b: object) -> bool: - r""" - @brief Compares two layer info objects - @return True, if both are not equal - - This method was added in version 0.18. - """ - def __str__(self, as_target: Optional[bool] = ...) -> str: - r""" - @brief Convert the layer info object to a string - @return The string - - If 'as_target' is true, wildcard and relative specifications are formatted such such. - - This method was added in version 0.18. - The 'as_target' argument has been added in version 0.26.5. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def anonymous(self) -> bool: - r""" - @brief Returns true, if the layer has no specification (i.e. is created by the default constructor). - @return True, if the layer does not have any specification. - - This method was added in version 0.23. - """ - def assign(self, other: LayerInfo) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> LayerInfo: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given layer info object. This method enables layer info objects as hash keys. - - This method has been introduced in version 0.25. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_equivalent(self, b: LayerInfo) -> bool: - r""" - @brief Equivalence of two layer info objects - @return True, if both are equivalent - - First, layer and datatype are compared. The name is of second order and used only if no layer or datatype is given. - This is basically a weak comparison that reflects the search preferences. - - This method was added in version 0.18. - """ - def is_named(self) -> bool: - r""" - @brief Returns true, if the layer is purely specified by name. - @return True, if no layer or datatype is given. - - This method was added in version 0.18. - """ - def to_s(self, as_target: Optional[bool] = ...) -> str: - r""" - @brief Convert the layer info object to a string - @return The string - - If 'as_target' is true, wildcard and relative specifications are formatted such such. - - This method was added in version 0.18. - The 'as_target' argument has been added in version 0.26.5. - """ - -class LayoutMetaInfo: - r""" - @brief A piece of layout meta information - Layout meta information is basically additional data that can be attached to a layout. Layout readers may generate meta information and some writers will add layout information to the layout object. Some writers will also read meta information to determine certain attributes. - - Multiple layout meta information objects can be attached to one layout using \Layout#add_meta_info. Meta information is identified by a unique name and carries a string value plus an optional description string. The description string is for information only and is not evaluated by code. - - See also \Layout#each_meta_info and \Layout#meta_info_value and \Layout#remove_meta_info - This class has been introduced in version 0.25. - """ - description: str - r""" - Getter: - @brief Gets the description of the layout meta info object - - Setter: - @brief Sets the description of the layout meta info object - """ - name: str - r""" - Getter: - @brief Gets the name of the layout meta info object - - Setter: - @brief Sets the name of the layout meta info object - """ - value: str - r""" - Getter: - @brief Gets the value of the layout meta info object - - Setter: - @brief Sets the value of the layout meta info object - """ - @classmethod - def new(cls, name: str, value: str, description: Optional[str] = ...) -> LayoutMetaInfo: - r""" - @brief Creates a layout meta info object - @param name The name - @param value The value - @param description An optional description text - """ - def __copy__(self) -> LayoutMetaInfo: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> LayoutMetaInfo: - r""" - @brief Creates a copy of self - """ - def __init__(self, name: str, value: str, description: Optional[str] = ...) -> None: - r""" - @brief Creates a layout meta info object - @param name The name - @param value The value - @param description An optional description text - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: LayoutMetaInfo) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> LayoutMetaInfo: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class Layout: - r""" - @brief The layout object - - This object represents a layout. - The layout object contains the cell hierarchy and - adds functionality for managing cell names and layer names. - The cell hierarchy can be changed by adding cells and cell instances. - Cell instances will virtually put the content of a cell into another cell. Many cell instances can be put into a cell thus forming repetitions of the cell content. This process can be repeated over multiple levels. In effect a cell graphs is created with parent cells and child cells. The graph must not be recursive, so there is at least one top cell, which does not have a parent cell. Multiple top cells can be present. - - \Layout is the very basic class of the layout database. It has a rich set of methods to manipulate and query the layout hierarchy, the geometrical objects, the meta information and other features of the layout database. For a discussion of the basic API and the related classes see @The Database API@. - - Usually layout objects have already been created by KLayout's application core. You can address such a layout via the \CellView object inside the \LayoutView class. For example: - - @code - active_layout = RBA::CellView::active.layout - puts "Top cell of current layout is #{active_layout.top_cell.name}" - @/code - - However, a layout can also be used standalone: - - @code - layout = RBA::Layout::new - cell = layout.create_cell("TOP") - layer = layout.layer(RBA::LayerInfo::new(1, 0)) - cell.shapes(layer).insert(RBA::Box::new(0, 0, 1000, 1000)) - layout.write("single_rect.gds") - @/code - """ - dbu: float - r""" - Getter: - @brief Gets the database unit - - The database unit is the value of one units distance in micrometers. - For numerical reasons and to be compliant with the GDS2 format, the database objects use integer coordinates. The basic unit of these coordinates is the database unit. - You can convert coordinates to micrometers by multiplying the integer value with the database unit. - Typical values for the database unit are 0.001 micrometer (one nanometer). - - Setter: - @brief Sets the database unit - - See \dbu for a description of the database unit. - """ - prop_id: int - r""" - Getter: - @brief Gets the properties ID associated with the layout - - This method has been introduced in version 0.24. - Setter: - @brief Sets the properties ID associated with the layout - This method is provided, if a properties ID has been derived already. Usually it's more convenient to use \delete_property, \set_property or \property. - - This method has been introduced in version 0.24. - """ - technology_name: str - r""" - Getter: - @brief Gets the name of the technology this layout is associated with - This method has been introduced in version 0.27. Before that, the technology has been kept in the 'technology' meta data element. - Setter: - @brief Sets the name of the technology this layout is associated with - Changing the technology name will re-assess all library references because libraries can be technology specified. Cell layouts may be substituted during this re-assessment. - - This method has been introduced in version 0.27. - """ - @overload - @classmethod - def new(cls) -> Layout: - r""" - @brief Creates a layout object - - Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application. - """ - @overload - @classmethod - def new(cls, editable: bool) -> Layout: - r""" - @brief Creates a layout object - - This constructor specifies whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods. - - This method was introduced in version 0.22. - """ - @overload - @classmethod - def new(cls, manager: Manager) -> Layout: - r""" - @brief Creates a layout object attached to a manager - - This constructor specifies a manager object which is used to store undo information for example. - - Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application. - """ - @overload - @classmethod - def new(cls, editable: bool, manager: Manager) -> Layout: - r""" - @brief Creates a layout object attached to a manager - - This constructor specifies a manager object which is used to store undo information for example. It also allows one to specify whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods. - - This method was introduced in version 0.22. - """ - def __copy__(self) -> Layout: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Layout: - r""" - @brief Creates a copy of self - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a layout object - - Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application. - """ - @overload - def __init__(self, editable: bool) -> None: - r""" - @brief Creates a layout object - - This constructor specifies whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods. - - This method was introduced in version 0.22. - """ - @overload - def __init__(self, manager: Manager) -> None: - r""" - @brief Creates a layout object attached to a manager - - This constructor specifies a manager object which is used to store undo information for example. - - Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application. - """ - @overload - def __init__(self, editable: bool, manager: Manager) -> None: - r""" - @brief Creates a layout object attached to a manager - - This constructor specifies a manager object which is used to store undo information for example. It also allows one to specify whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods. - - This method was introduced in version 0.22. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def add_cell(self, name: str) -> int: - r""" - @brief Adds a cell with the given name - @return The index of the newly created cell. - - From version 0.23 on this method is deprecated because another method exists which is more convenient because is returns a \Cell object (\create_cell). - """ - def add_lib_cell(self, library: Library, lib_cell_index: int) -> int: - r""" - @brief Imports a cell from the library - @param library The reference to the library from which to import the cell - @param lib_cell_index The index of the imported cell in the library - @return The cell index of the new proxy cell in this layout - This method imports the given cell from the library and creates a new proxy cell. - The proxy cell acts as a pointer to the actual cell which still resides in the - library (precisely: in library.layout). The name of the new cell will be the name of - library cell. - - This method has been introduced in version 0.22. - """ - def add_meta_info(self, info: LayoutMetaInfo) -> None: - r""" - @brief Adds meta information to the layout - See \LayoutMetaInfo for details about layouts and meta information. - This method has been introduced in version 0.25. - """ - @overload - def add_pcell_variant(self, pcell_id: int, parameters: Sequence[Any]) -> int: - r""" - @brief Creates a PCell variant for the given PCell ID with the given parameters - @return The cell index of the pcell variant proxy cell - This method will create a PCell variant proxy for a local PCell definition. - It will create the PCell variant for the given parameters. Note that this method - does not allow one to create PCell instances for PCells located in a library. Use - \add_pcell_variant with the library parameter for that purpose. - - The parameters are a sequence of variants which correspond to the parameters declared by the \PCellDeclaration object. - - The name of the new cell will be the name of the PCell. - If a cell with that name already exists, a new unique name is generated. - - This method has been introduced in version 0.22. - """ - @overload - def add_pcell_variant(self, library: Library, pcell_id: int, parameters: Sequence[Any]) -> int: - r""" - @brief Creates a PCell variant for a PCell located in an external library - @return The cell index of the new proxy cell in this layout - This method will import a PCell from a library and create a variant for the - given parameter set. - Technically, this method creates a proxy to the library and creates the variant - inside that library. - - The parameters are a sequence of variants which correspond to the parameters declared by the \PCellDeclaration object. - - The name of the new cell will be the name of the PCell. - If a cell with that name already exists, a new unique name is generated. - - This method has been introduced in version 0.22. - """ - @overload - def add_pcell_variant(self, pcell_id: int, parameters: Dict[str, Any]) -> int: - r""" - @brief Creates a PCell variant for the given PCell ID with the parameters given as a name/value dictionary - @return The cell index of the pcell variant proxy cell - This method will create a PCell variant proxy for a local PCell definition. - It will create the PCell variant for the given parameters. Note that this method - does not allow one to create PCell instances for PCells located in a library. Use - \add_pcell_variant with the library parameter for that purpose. - Unlike the variant using a list of parameters, this version allows specification - of the parameters with a key/value dictionary. The keys are the parameter names - as given by the PCell declaration. - - The parameters are a sequence of variants which correspond to the parameters declared by the \PCellDeclaration object. - - The name of the new cell will be the name of the PCell. - If a cell with that name already exists, a new unique name is generated. - - This method has been introduced in version 0.22. - """ - @overload - def add_pcell_variant(self, library: Library, pcell_id: int, parameters: Dict[str, Any]) -> int: - r""" - @brief Creates a PCell variant for a PCell located in an external library with the parameters given as a name/value dictionary - @return The cell index of the new proxy cell in this layout - This method will import a PCell from a library and create a variant for the - given parameter set. - Technically, this method creates a proxy to the library and creates the variant - inside that library. - Unlike the variant using a list of parameters, this version allows specification - of the parameters with a key/value dictionary. The keys are the parameter names - as given by the PCell declaration. - - The parameters are a sequence of variants which correspond to the parameters declared by the \PCellDeclaration object. - - The name of the new cell will be the name of the PCell. - If a cell with that name already exists, a new unique name is generated. - - This method has been introduced in version 0.22. - """ - def assign(self, other: Layout) -> None: - r""" - @brief Assigns another object to self - """ - @overload - def begin_shapes(self, cell: Cell, layer: int) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer - @param cell The cell object of the initial (top) cell - @param layer The layer from which to get the shapes - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version is convenience overload which takes a cell object instead of a cell index. - - This method is deprecated. Use \Cell#begin_shapes_rec instead. - - This method has been added in version 0.24. - """ - @overload - def begin_shapes(self, cell_index: int, layer: int) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer - @param cell_index The index of the initial (top) cell - @param layer The layer from which to get the shapes - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - - This method is deprecated. Use \Cell#begin_shapes_rec instead. - - This method has been added in version 0.18. - """ - @overload - def begin_shapes_overlapping(self, cell: Cell, layer: int, region: DBox) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units - @param cell The cell object for the starting cell - @param layer The layer from which to get the shapes - @param region The search region as a \DBox object in micrometer units - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box overlaps the given region. - It is convenience overload which takes a cell object instead of a cell index. - - This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. - - This variant has been added in version 0.25. - """ - @overload - def begin_shapes_overlapping(self, cell_index: int, layer: int, region: Box) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search - @param cell_index The index of the starting cell - @param layer The layer from which to get the shapes - @param region The search region - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box overlaps the given region. - - This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. - - This method has been added in version 0.18. - """ - @overload - def begin_shapes_overlapping(self, cell_index: int, layer: int, region: DBox) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units - @param cell_index The index of the starting cell - @param layer The layer from which to get the shapes - @param region The search region as a \DBox object in micrometer units - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box overlaps the given region. - - This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. - - This variant has been added in version 0.25. - """ - @overload - def begin_shapes_overlapping(self, cell_index: Cell, layer: int, region: Box) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search - @param cell The cell object for the starting cell - @param layer The layer from which to get the shapes - @param region The search region - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box overlaps the given region. - It is convenience overload which takes a cell object instead of a cell index. - - This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. - - This method has been added in version 0.24. - """ - @overload - def begin_shapes_touching(self, cell: Cell, layer: int, region: Box) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search - @param cell The cell object for the starting cell - @param layer The layer from which to get the shapes - @param region The search region - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box touches the given region. - It is convenience overload which takes a cell object instead of a cell index. - - This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. - - This method has been added in version 0.24. - """ - @overload - def begin_shapes_touching(self, cell: Cell, layer: int, region: DBox) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units - @param cell The cell object for the starting cell - @param layer The layer from which to get the shapes - @param region The search region as a \DBox object in micrometer units - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box touches the given region. - It is convenience overload which takes a cell object instead of a cell index. - - This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. - - This variant has been added in version 0.25. - """ - @overload - def begin_shapes_touching(self, cell_index: int, layer: int, region: Box) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search - @param cell_index The index of the starting cell - @param layer The layer from which to get the shapes - @param region The search region - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box touches the given region. - - This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. - - This method has been added in version 0.18. - """ - @overload - def begin_shapes_touching(self, cell_index: int, layer: int, region: DBox) -> RecursiveShapeIterator: - r""" - @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units - @param cell_index The index of the starting cell - @param layer The layer from which to get the shapes - @param region The search region as a \DBox object in micrometer units - @return A suitable iterator - - For details see the description of the \RecursiveShapeIterator class. - This version gives an iterator delivering shapes whose bounding box touches the given region. - - This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. - - This variant has been added in version 0.25. - """ - @overload - def cell(self, i: int) -> Cell: - r""" - @brief Gets a cell object from the cell index - - @param i The cell index - @return A reference to the cell (a \Cell object) - - If the cell index is not a valid cell index, this method will raise an error. Use \is_valid_cell_index? to test whether a given cell index is valid. - """ - @overload - def cell(self, name: str) -> Cell: - r""" - @brief Gets a cell object from the cell name - - @param name The cell name - @return A reference to the cell (a \Cell object) - - If name is not a valid cell name, this method will return "nil". - This method has been introduced in version 0.23 and replaces \cell_by_name. - """ - def cell_by_name(self, name: str) -> int: - r""" - @brief Gets the cell index for a given name - Returns the cell index for the cell with the given name. If no cell with this name exists, an exception is thrown. - From version 0.23 on, a version of the \cell method is provided which returns a \Cell object for the cell with the given name or "nil" if the name is not valid. This method replaces \cell_by_name and \has_cell? - """ - def cell_name(self, index: int) -> str: - r""" - @brief Gets the name for a cell with the given index - """ - @overload - def cells(self) -> int: - r""" - @brief Returns the number of cells - - @return The number of cells (the maximum cell index) - """ - @overload - def cells(self, name_filter: str) -> List[Cell]: - r""" - @brief Gets the cell objects for a given name filter - - @param name_filter The cell name filter (glob pattern) - @return A list of \Cell object of the cells matching the pattern - - This method has been introduced in version 0.27.3. - """ - def cleanup(self, cell_indexes_to_keep: Optional[Sequence[int]] = ...) -> None: - r""" - @brief Cleans up the layout - This method will remove proxy objects that are no longer in use. After changing PCell parameters such proxy objects may still be present in the layout and are cached for later reuse. Usually they are cleaned up automatically, but in a scripting context it may be useful to clean up these cells explicitly. - - Use 'cell_indexes_to_keep' for specifying a list of cell indexes of PCell variants or library proxies you don't want to be cleaned up. - - This method has been introduced in version 0.25. - """ - def clear(self) -> None: - r""" - @brief Clears the layout - - Clears the layout completely. - """ - def clear_layer(self, layer_index: int) -> None: - r""" - @brief Clears a layer - - Clears the layer: removes all shapes. - - This method was introduced in version 0.19. - - @param layer_index The index of the layer to delete. - """ - @overload - def clip(self, cell: int, box: Box) -> int: - r""" - @brief Clips the given cell by the given rectangle and produce a new cell with the clip - @param cell The cell index of the cell to clip - @param box The clip box in database units - @return The index of the new cell - - This method will cut a rectangular region given by the box from the given cell. The clip will be stored in a new cell whose index is returned. The clip will be performed hierarchically. The resulting cell will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. - This method has been added in version 0.21. - """ - @overload - def clip(self, cell: int, box: DBox) -> int: - r""" - @brief Clips the given cell by the given rectangle and produce a new cell with the clip - @param cell The cell index of the cell to clip - @param box The clip box in micrometer units - @return The index of the new cell - - This variant which takes a micrometer-unit box has been added in version 0.28. - """ - @overload - def clip(self, cell: Cell, box: Box) -> Cell: - r""" - @brief Clips the given cell by the given rectangle and produce a new cell with the clip - @param cell The cell reference of the cell to clip - @param box The clip box in database units - @return The reference to the new cell - - This variant which takes cell references instead of cell indexes has been added in version 0.28. - """ - @overload - def clip(self, cell: Cell, box: DBox) -> Cell: - r""" - @brief Clips the given cell by the given rectangle and produce a new cell with the clip - @param cell The cell reference of the cell to clip - @param box The clip box in micrometer units - @return The reference to the new cell - - This variant which takes a micrometer-unit box and cell references has been added in version 0.28. - """ - @overload - def clip_into(self, cell: int, target: Layout, box: Box) -> int: - r""" - @brief Clips the given cell by the given rectangle and produce a new cell with the clip - @param cell The cell index of the cell to clip - @param box The clip box in database units - @param target The target layout - @return The index of the new cell in the target layout - - This method will cut a rectangular region given by the box from the given cell. The clip will be stored in a new cell in the target layout. The clip will be performed hierarchically. The resulting cell will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. - - Please note that it is important that the database unit of the target layout is identical to the database unit of the source layout to achieve the desired results.This method also assumes that the target layout holds the same layers than the source layout. It will copy shapes to the same layers than they have been on the original layout. - This method has been added in version 0.21. - """ - @overload - def clip_into(self, cell: int, target: Layout, box: DBox) -> int: - r""" - @brief Clips the given cell by the given rectangle and produce a new cell with the clip - @param cell The cell index of the cell to clip - @param box The clip box in micrometer units - @param target The target layout - @return The index of the new cell in the target layout - - This variant which takes a micrometer-unit box has been added in version 0.28. - """ - @overload - def clip_into(self, cell: Cell, target: Layout, box: Box) -> Cell: - r""" - @brief Clips the given cell by the given rectangle and produce a new cell with the clip - @param cell The reference to the cell to clip - @param box The clip box in database units - @param target The target layout - @return The reference to the new cell in the target layout - - This variant which takes cell references instead of cell indexes has been added in version 0.28. - """ - @overload - def clip_into(self, cell: Cell, target: Layout, box: DBox) -> Cell: - r""" - @brief Clips the given cell by the given rectangle and produce a new cell with the clip - @param cell The reference to the cell to clip - @param box The clip box in micrometer units - @param target The target layout - @return The reference to the new cell in the target layout - - This variant which takes a micrometer-unit box and cell references has been added in version 0.28. - """ - def convert_cell_to_static(self, cell_index: int) -> int: - r""" - @brief Converts a PCell or library cell to a usual (static) cell - @return The index of the new cell - This method will create a new cell which contains the static representation of the PCell or library proxy given by "cell_index". If that cell is not a PCell or library proxy, it won't be touched and the input cell index is returned. - - This method has been added in version 0.23. - """ - def copy_layer(self, src: int, dest: int) -> None: - r""" - @brief Copies a layer - - This method was introduced in version 0.19. - - Copy a layer from the source to the target. The target is not cleared before, so that this method - merges shapes from the source with the target layer. - - @param src The layer index of the source layer. - @param dest The layer index of the destination layer. - """ - @overload - def copy_tree_shapes(self, source_layout: Layout, cell_mapping: CellMapping) -> None: - r""" - @brief Copies the shapes for all given mappings in the \CellMapping object - @param source_layout The layout where to take the shapes from - @param cell_mapping The cell mapping object that determines how cells are identified between source and target layout - - Provide a \CellMapping object to specify pairs of cells which are mapped from the source layout to this layout. When constructing such a cell mapping object for example with \CellMapping#for_multi_cells_full, use self as the target layout. During the cell mapping construction, the cell mapper will usually create a suitable target hierarchy already. After having completed the cell mapping, use \copy_tree_shapes to copy over the shapes from the source to the target layout. - - This method has been added in version 0.26.8. - """ - @overload - def copy_tree_shapes(self, source_layout: Layout, cell_mapping: CellMapping, layer_mapping: LayerMapping) -> None: - r""" - @brief Copies the shapes for all given mappings in the \CellMapping object using the given layer mapping - @param source_layout The layout where to take the shapes from - @param cell_mapping The cell mapping object that determines how cells are identified between source and target layout - @param layer_mapping Specifies which layers are copied from the source layout to the target layout - - Provide a \CellMapping object to specify pairs of cells which are mapped from the source layout to this layout. When constructing such a cell mapping object for example with \CellMapping#for_multi_cells_full, use self as the target layout. During the cell mapping construction, the cell mapper will usually create a suitable target hierarchy already. After having completed the cell mapping, use \copy_tree_shapes to copy over the shapes from the source to the target layout. - - This method has been added in version 0.26.8. - """ - def create(self) -> None: - r""" - @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. - """ - @overload - def create_cell(self, name: str) -> Cell: - r""" - @brief Creates a cell with the given name - @param name The name of the cell to create - @return The \Cell object of the newly created cell. - - If a cell with that name already exists, the unique name will be chosen for the new cell consisting of the given name plus a suitable suffix. - - This method has been introduce in version 0.23 and replaces \add_cell. - """ - @overload - def create_cell(self, name: str, lib_name: str) -> Cell: - r""" - @brief Creates a cell with the given name - @param name The name of the library cell and the name of the cell to create - @param lib_name The name of the library where to take the cell from - @return The \Cell object of the newly created cell or an existing cell if the library cell has already been used in this layout. - - Library cells are imported by creating a 'library proxy'. This is a cell which represents the library cell in the framework of the current layout. The library proxy is linked to the library and will be updated if the library cell is changed. - - This method will look up the cell by the given name in the specified library and create a new library proxy for this cell. - If the same library cell has already been used, the original library proxy is returned. Hence, strictly speaking this method does not always create a new cell but may return a reference to an existing cell. - - If the library name is not valid, nil is returned. - - This method has been introduce in version 0.24. - """ - @overload - def create_cell(self, pcell_name: str, params: Dict[str, Any]) -> Cell: - r""" - @brief Creates a cell as a PCell variant for the PCell with the given name - @param pcell_name The name of the PCell and also the name of the cell to create - @param params The PCell parameters (key/value dictionary) - @return The \Cell object of the newly created cell or an existing cell if the PCell has already been used with these parameters. - - PCells are instantiated by creating a PCell variant. A PCell variant is linked to the PCell and represents this PCell with a particular parameter set. - - This method will look up the PCell by the PCell name and create a new PCell variant for the given parameters. If the PCell has already been instantiated with the same parameters, the original variant will be returned. Hence this method is not strictly creating a cell - only if the required variant has not been created yet. - - The parameters are specified as a key/value dictionary with the names being the ones from the PCell declaration. - - If no PCell with the given name exists, nil is returned. - - This method has been introduce in version 0.24. - """ - @overload - def create_cell(self, pcell_name: str, lib_name: str, params: Dict[str, Any]) -> Cell: - r""" - @brief Creates a cell for a PCell with the given PCell name from the given library - @param pcell_name The name of the PCell and also the name of the cell to create - @param lib_name The name of the library where to take the PCell from - @param params The PCell parameters (key/value dictionary) - @return The \Cell object of the newly created cell or an existing cell if this PCell has already been used with the given parameters - - This method will look up the PCell by the PCell name in the specified library and create a new PCell variant for the given parameters plus the library proxy. The parameters must be specified as a key/value dictionary with the names being the ones from the PCell declaration. - - If no PCell with the given name exists or the library name is not valid, nil is returned. Note that this function - despite the name - may not always create a new cell, but return an existing cell if the PCell from the library has already been used with the given parameters. - - This method has been introduce in version 0.24. - """ - def delete_cell(self, cell_index: int) -> None: - r""" - @brief Deletes a cell - - This deletes a cell but not the sub cells of the cell. - These subcells will likely become new top cells unless they are used - otherwise. - All instances of this cell are deleted as well. - Hint: to delete multiple cells, use "delete_cells" which is - far more efficient in this case. - - @param cell_index The index of the cell to delete - - This method has been introduced in version 0.20. - """ - def delete_cell_rec(self, cell_index: int) -> None: - r""" - @brief Deletes a cell plus all subcells - - This deletes a cell and also all sub cells of the cell. - In contrast to \prune_cell, all cells are deleted together with their instances even if they are used otherwise. - - @param cell_index The index of the cell to delete - - This method has been introduced in version 0.20. - """ - def delete_cells(self, cell_index_list: Sequence[int]) -> None: - r""" - @brief Deletes multiple cells - - This deletes the cells but not the sub cells of these cells. - These subcells will likely become new top cells unless they are used - otherwise. - All instances of these cells are deleted as well. - - @param cell_index_list An array of cell indices of the cells to delete - - This method has been introduced in version 0.20. - """ - def delete_layer(self, layer_index: int) -> None: - r""" - @brief Deletes a layer - - This method frees the memory allocated for the shapes of this layer and remembers the - layer's index for reuse when the next layer is allocated. - - @param layer_index The index of the layer to delete. - """ - def delete_property(self, key: Any) -> None: - r""" - @brief Deletes the user property with the given key - This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. - This method may change the properties ID. - - This method has been introduced in version 0.24. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dump_mem_statistics(self, detailed: Optional[bool] = ...) -> None: - r""" - @hide - """ - def dup(self) -> Layout: - r""" - @brief Creates a copy of self - """ - def each_cell(self) -> Iterator[Cell]: - r""" - @brief Iterates the unsorted cell list - """ - def each_cell_bottom_up(self) -> Iterator[int]: - r""" - @brief Iterates the bottom-up sorted cell list - - In bottom-up traversal a cell is not delivered before - the last child cell of this cell has been delivered. - The bottom-up iterator does not deliver cells but cell - indices actually. - """ - def each_cell_top_down(self) -> Iterator[int]: - r""" - @brief Iterates the top-down sorted cell list - - The top-down cell list has the property of delivering all - cells before they are instantiated. In addition the first - cells are all top cells. There is at least one top cell. - The top-down iterator does not deliver cells but cell - indices actually. - @brief begin iterator of the top-down sorted cell list - """ - def each_meta_info(self) -> Iterator[LayoutMetaInfo]: - r""" - @brief Iterates over the meta information of the layout - See \LayoutMetaInfo for details about layouts and meta information. - - This method has been introduced in version 0.25. - """ - def each_top_cell(self) -> Iterator[int]: - r""" - @brief Iterates the top cells - A layout may have an arbitrary number of top cells. The usual case however is that there is one top cell. - """ - def end_changes(self) -> None: - r""" - @brief Cancels the "in changes" state (see "start_changes") - """ - @overload - def find_layer(self, info: LayerInfo) -> Any: - r""" - @brief Finds a layer with the given properties - - If a layer with the given properties already exists, this method will return the index of that layer.If no such layer exists, it will return nil. - - This method has been introduced in version 0.23. - """ - @overload - def find_layer(self, name: str) -> Any: - r""" - @brief Finds a layer with the given name - - If a layer with the given name already exists, this method will return the index of that layer.If no such layer exists, it will return nil. - - This method has been introduced in version 0.23. - """ - @overload - def find_layer(self, layer: int, datatype: int) -> Any: - r""" - @brief Finds a layer with the given layer and datatype number - - If a layer with the given layer/datatype already exists, this method will return the index of that layer.If no such layer exists, it will return nil. - - This method has been introduced in version 0.23. - """ - @overload - def find_layer(self, layer: int, datatype: int, name: str) -> Any: - r""" - @brief Finds a layer with the given layer and datatype number and name - - If a layer with the given layer/datatype/name already exists, this method will return the index of that layer.If no such layer exists, it will return nil. - - This method has been introduced in version 0.23. - """ - def flatten(self, cell_index: int, levels: int, prune: bool) -> None: - r""" - @brief Flattens the given cell - - This method propagates all shapes and instances from the specified number of hierarchy levels below into the given cell. - It also removes the instances of the cells from which the shapes came from, but does not remove the cells themselves if prune is set to false. - If prune is set to true, these cells are removed if not used otherwise. - - @param cell_index The cell which should be flattened - @param levels The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.) - @param prune Set to true to remove orphan cells. - - This method has been introduced in version 0.20. - """ - def flatten_into(self, source_cell_index: int, target_cell_index: int, trans: ICplxTrans, levels: int) -> None: - r""" - @brief Flattens the given cell into another cell - - This method works like 'flatten', but allows specification of a target cell which can be different from the source cell plus a transformation which is applied for all shapes and instances in the target cell. - - In contrast to the 'flatten' method, the source cell is not modified. - - @param source_cell_index The source cell which should be flattened - @param target_cell_index The target cell into which the resulting objects are written - @param trans The transformation to apply on the output shapes and instances - @param levels The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.) - - This method has been introduced in version 0.24. - """ - def get_info(self, index: int) -> LayerInfo: - r""" - @brief Gets the info structure for a specified layer - """ - def guiding_shape_layer(self) -> int: - r""" - @brief Returns the index of the guiding shape layer - The guiding shape layer is used to store guiding shapes for PCells. - - This method has been added in version 0.22. - """ - def has_cell(self, name: str) -> bool: - r""" - @brief Returns true if a cell with a given name exists - Returns true, if the layout has a cell with the given name - """ - def has_prop_id(self) -> bool: - r""" - @brief Returns true, if the layout has user properties - - This method has been introduced in version 0.24. - """ - @overload - def insert(self, cell_index: int, layer: int, edge_pairs: EdgePairs) -> None: - r""" - @brief Inserts an edge pair collection into the given cell and layer - If the edge pair collection is (conceptionally) flat, it will be inserted into the cell's shapes list as a flat sequence of edge pairs. - If the edge pair collection is deep (hierarchical), it will create a subhierarchy below the given cell and it's edge pairs will be put into the respective cells. Suitable subcells will be picked for inserting the edge pairs. If a hierarchy already exists below the given cell, the algorithm will try to reuse this hierarchy. - - This method has been introduced in version 0.27. - """ - @overload - def insert(self, cell_index: int, layer: int, edges: Edges) -> None: - r""" - @brief Inserts an edge collection into the given cell and layer - If the edge collection is (conceptionally) flat, it will be inserted into the cell's shapes list as a flat sequence of edges. - If the edge collection is deep (hierarchical), it will create a subhierarchy below the given cell and it's edges will be put into the respective cells. Suitable subcells will be picked for inserting the edges. If a hierarchy already exists below the given cell, the algorithm will try to reuse this hierarchy. - - This method has been introduced in version 0.26. - """ - @overload - def insert(self, cell_index: int, layer: int, region: Region) -> None: - r""" - @brief Inserts a region into the given cell and layer - If the region is (conceptionally) a flat region, it will be inserted into the cell's shapes list as a flat sequence of polygons. - If the region is a deep (hierarchical) region, it will create a subhierarchy below the given cell and it's shapes will be put into the respective cells. Suitable subcells will be picked for inserting the shapes. If a hierarchy already exists below the given cell, the algorithm will try to reuse this hierarchy. - - This method has been introduced in version 0.26. - """ - @overload - def insert(self, cell_index: int, layer: int, texts: Texts) -> None: - r""" - @brief Inserts an text collection into the given cell and layer - If the text collection is (conceptionally) flat, it will be inserted into the cell's shapes list as a flat sequence of texts. - If the text collection is deep (hierarchical), it will create a subhierarchy below the given cell and it's texts will be put into the respective cells. Suitable subcells will be picked for inserting the texts. If a hierarchy already exists below the given cell, the algorithm will try to reuse this hierarchy. - - This method has been introduced in version 0.27. - """ - def insert_layer(self, props: LayerInfo) -> int: - r""" - @brief Inserts a new layer with the given properties - @return The index of the newly created layer - """ - def insert_layer_at(self, index: int, props: LayerInfo) -> None: - r""" - @brief Inserts a new layer with the given properties at the given index - This method will associate the given layer info with the given layer index. If a layer with that index already exists, this method will change the properties of the layer with that index. Otherwise a new layer is created. - """ - def insert_special_layer(self, props: LayerInfo) -> int: - r""" - @brief Inserts a new special layer with the given properties - - Special layers can be used to represent objects that should not participate in normal viewing or other related operations. Special layers are not reported as valid layers. - - @return The index of the newly created layer - """ - def insert_special_layer_at(self, index: int, props: LayerInfo) -> None: - r""" - @brief Inserts a new special layer with the given properties at the given index - - See \insert_special_layer for a description of special layers. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_editable(self) -> bool: - r""" - @brief Returns a value indicating whether the layout is editable. - @return True, if the layout is editable. - If a layout is editable, in general manipulation methods are enabled and some optimizations are disabled (i.e. shape arrays are expanded). - - This method has been introduced in version 0.22. - """ - def is_free_layer(self, layer_index: int) -> bool: - r""" - @brief Returns true, if a layer index is a free (unused) layer index - - @return true, if this is the case - - This method has been introduced in version 0.26. - """ - def is_special_layer(self, layer_index: int) -> bool: - r""" - @brief Returns true, if a layer index is a special layer index - - @return true, if this is the case - """ - def is_valid_cell_index(self, cell_index: int) -> bool: - r""" - @brief Returns true, if a cell index is a valid index - - @return true, if this is the case - This method has been added in version 0.20. - """ - def is_valid_layer(self, layer_index: int) -> bool: - r""" - @brief Returns true, if a layer index is a valid normal layout layer index - - @return true, if this is the case - """ - @overload - def layer(self) -> int: - r""" - @brief Creates a new internal layer - - This method will create a new internal layer and return the layer index for this layer. - The layer does not have any properties attached to it. That means, it is not going to be saved to a layout file unless it is given database properties with \set_info. - - This method is equivalent to "layer(RBA::LayerInfo::new())". - - This method has been introduced in version 0.25. - """ - @overload - def layer(self, info: LayerInfo) -> int: - r""" - @brief Finds or creates a layer with the given properties - - If a layer with the given properties already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned. If "info" is anonymous (info.anonymous? is true), a new layer will always be created. - - This method has been introduced in version 0.23. - """ - @overload - def layer(self, name: str) -> int: - r""" - @brief Finds or creates a layer with the given name - - If a layer with the given name already exists, this method will return the index of that layer.If no such layer exists, a new one with this name will be created and its index will be returned. - - This method has been introduced in version 0.23. - """ - @overload - def layer(self, layer: int, datatype: int) -> int: - r""" - @brief Finds or creates a layer with the given layer and datatype number - - If a layer with the given layer/datatype already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned. - - This method has been introduced in version 0.23. - """ - @overload - def layer(self, layer: int, datatype: int, name: str) -> int: - r""" - @brief Finds or creates a layer with the given layer and datatype number and name - - If a layer with the given layer/datatype/name already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned. - - This method has been introduced in version 0.23. - """ - def layer_indexes(self) -> List[int]: - r""" - @brief Gets a list of valid layer's indices - This method returns an array with layer indices representing valid layers. - - This method has been introduced in version 0.19. - """ - def layer_indices(self) -> List[int]: - r""" - @brief Gets a list of valid layer's indices - This method returns an array with layer indices representing valid layers. - - This method has been introduced in version 0.19. - """ - def layer_infos(self) -> List[LayerInfo]: - r""" - @brief Gets a list of valid layer's properties - The method returns an array with layer properties representing valid layers. - The sequence and length of this list corresponds to that of \layer_indexes. - - This method has been introduced in version 0.25. - """ - def layers(self) -> int: - r""" - @brief Returns the number of layers - The number of layers reports the maximum (plus 1) layer index used so far. Not all of the layers with an index in the range of 0 to layers-1 needs to be a valid layer. These layers can be either valid, special or unused. Use \is_valid_layer? and \is_special_layer? to test for the first two states. - """ - def library(self) -> Library: - r""" - @brief Gets the library this layout lives in or nil if the layout is not part of a library - This attribute has been introduced in version 0.27.5. - """ - def meta_info_value(self, name: str) -> str: - r""" - @brief Gets the meta information value for a given name - See \LayoutMetaInfo for details about layouts and meta information. - - If no meta information with the given name exists, an empty string will be returned. - - This method has been introduced in version 0.25. - """ - def move_layer(self, src: int, dest: int) -> None: - r""" - @brief Moves a layer - - This method was introduced in version 0.19. - - Move a layer from the source to the target. The target is not cleared before, so that this method - merges shapes from the source with the target layer. The source layer is empty after that operation. - - @param src The layer index of the source layer. - @param dest The layer index of the destination layer. - """ - @overload - def move_tree_shapes(self, source_layout: Layout, cell_mapping: CellMapping) -> None: - r""" - @brief Moves the shapes for all given mappings in the \CellMapping object - - This method acts like the corresponding \copy_tree_shapes method, but removes the shapes from the source layout after they have been copied. - - This method has been added in version 0.26.8. - """ - @overload - def move_tree_shapes(self, source_layout: Layout, cell_mapping: CellMapping, layer_mapping: LayerMapping) -> None: - r""" - @brief Moves the shapes for all given mappings in the \CellMapping object using the given layer mapping - - This method acts like the corresponding \copy_tree_shapes method, but removes the shapes from the source layout after they have been copied. - - This method has been added in version 0.26.8. - """ - @overload - def multi_clip(self, cell: int, boxes: Sequence[Box]) -> List[int]: - r""" - @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. - @param cell The cell index of the cell to clip - @param boxes The clip boxes in database units - @return The indexes of the new cells - - This method will cut rectangular regions given by the boxes from the given cell. The clips will be stored in a new cells whose indexed are returned. The clips will be performed hierarchically. The resulting cells will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This version is somewhat more efficient than doing individual clips because the clip cells may share clipped versions of child cells. - - This method has been added in version 0.21. - """ - @overload - def multi_clip(self, cell: int, boxes: Sequence[DBox]) -> List[int]: - r""" - @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. - @param cell The cell index of the cell to clip - @param boxes The clip boxes in micrometer units - @return The indexes of the new cells - - This variant which takes micrometer-unit boxes has been added in version 0.28. - """ - @overload - def multi_clip(self, cell: Cell, boxes: Sequence[Box]) -> List[Cell]: - r""" - @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. - @param cell The reference to the cell to clip - @param boxes The clip boxes in database units - @return The references to the new cells - - This variant which takes cell references has been added in version 0.28. - """ - @overload - def multi_clip(self, cell: Cell, boxes: Sequence[DBox]) -> List[Cell]: - r""" - @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. - @param cell The reference to the cell to clip - @param boxes The clip boxes in micrometer units - @return The references to the new cells - - This variant which takes cell references and micrometer-unit boxes has been added in version 0.28. - """ - @overload - def multi_clip_into(self, cell: int, target: Layout, boxes: Sequence[Box]) -> List[int]: - r""" - @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. - @param cell The cell index of the cell to clip - @param boxes The clip boxes in database units - @param target The target layout - @return The indexes of the new cells - - This method will cut rectangular regions given by the boxes from the given cell. The clips will be stored in a new cells in the given target layout. The clips will be performed hierarchically. The resulting cells will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This version is somewhat more efficient than doing individual clips because the clip cells may share clipped versions of child cells. - - Please note that it is important that the database unit of the target layout is identical to the database unit of the source layout to achieve the desired results. This method also assumes that the target layout holds the same layers than the source layout. It will copy shapes to the same layers than they have been on the original layout. - - This method has been added in version 0.21. - """ - @overload - def multi_clip_into(self, cell: int, target: Layout, boxes: Sequence[DBox]) -> List[int]: - r""" - @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. - @param cell The cell index of the cell to clip - @param boxes The clip boxes in database units - @param target The target layout - @return The indexes of the new cells - - This variant which takes micrometer-unit boxes has been added in version 0.28. - """ - @overload - def multi_clip_into(self, cell: Cell, target: Layout, boxes: Sequence[Box]) -> List[Cell]: - r""" - @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. - @param cell The reference the cell to clip - @param boxes The clip boxes in database units - @param target The target layout - @return The references to the new cells - - This variant which takes cell references boxes has been added in version 0.28. - """ - @overload - def multi_clip_into(self, cell: Cell, target: Layout, boxes: Sequence[DBox]) -> List[Cell]: - r""" - @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. - @param cell The reference the cell to clip - @param boxes The clip boxes in micrometer units - @param target The target layout - @return The references to the new cells - - This variant which takes cell references and micrometer-unit boxes has been added in version 0.28. - """ - @overload - def pcell_declaration(self, name: str) -> PCellDeclaration_Native: - r""" - @brief Gets a reference to the PCell declaration for the PCell with the given name - Returns a reference to the local PCell declaration with the given name. If the name - is not a valid PCell name, this method returns nil. - - Usually this method is used on library layouts that define - PCells. Note that this method cannot be used on the layouts using the PCell from - a library. - - This method has been introduced in version 0.22. - """ - @overload - def pcell_declaration(self, pcell_id: int) -> PCellDeclaration_Native: - r""" - @brief Gets a reference to the PCell declaration for the PCell with the given PCell ID. - Returns a reference to the local PCell declaration with the given PCell id. If the parameter - is not a valid PCell ID, this method returns nil. The PCell ID is the number returned - by \register_pcell for example. - - Usually this method is used on library layouts that define - PCells. Note that this method cannot be used on the layouts using the PCell from - a library. - - This method has been introduced in version 0.22. - """ - def pcell_id(self, name: str) -> int: - r""" - @brief Gets the ID of the PCell with the given name - This method is equivalent to 'pcell_declaration(name).id'. - - This method has been introduced in version 0.22. - """ - def pcell_ids(self) -> List[int]: - r""" - @brief Gets the IDs of the PCells registered in the layout - Returns an array of PCell IDs. - - This method has been introduced in version 0.24. - """ - def pcell_names(self) -> List[str]: - r""" - @brief Gets the names of the PCells registered in the layout - Returns an array of PCell names. - - This method has been introduced in version 0.24. - """ - def properties(self, properties_id: int) -> List[Any]: - r""" - @brief Gets the properties set for a given properties ID - - Basically performs the backward conversion of the 'properties_id' method. Given a properties ID, returns the properties set as an array of pairs of variants. In this array, each key and the value are stored as pairs (arrays with two elements). - If the properties ID is not valid, an empty array is returned. - - @param properties_id The properties ID to get the properties for - @return The array of variants (see \properties_id) - """ - def properties_id(self, properties: Sequence[Any]) -> int: - r""" - @brief Gets the properties ID for a given properties set - - Before a set of properties can be attached to a shape, it must be converted into an ID that is unique for that set. The properties set must be given as a list of pairs of variants, each pair describing a name and a value. The name acts as the key for the property and does not need to be a string (it can be an integer or double value as well). - The backward conversion can be performed with the 'properties' method. - - @param properties The array of pairs of variants (both elements can be integer, double or string) - @return The unique properties ID for that set - """ - def property(self, key: Any) -> Any: - r""" - @brief Gets the user property with the given key - This method is a convenience method that gets the property with the given key. If no property with that key exists, it will return nil. Using that method is more convenient than using the properties ID to retrieve the property value. - This method has been introduced in version 0.24. - """ - def prune_cell(self, cell_index: int, levels: int) -> None: - r""" - @brief Deletes a cell plus subcells not used otherwise - - This deletes a cell and also all sub cells of the cell which are not used otherwise. - The number of hierarchy levels to consider can be specified as well. One level of hierarchy means that only the direct children of the cell are deleted with the cell itself. - All instances of this cell are deleted as well. - - @param cell_index The index of the cell to delete - @param levels The number of hierarchy levels to consider (-1: all, 0: none, 1: one level etc.) - - This method has been introduced in version 0.20. - """ - def prune_subcells(self, cell_index: int, levels: int) -> None: - r""" - @brief Deletes all sub cells of the cell which are not used otherwise down to the specified level of hierarchy - - This deletes all sub cells of the cell which are not used otherwise. - All instances of the deleted cells are deleted as well. - It is possible to specify how many levels of hierarchy below the given root cell are considered. - - @param cell_index The root cell from which to delete a sub cells - @param levels The number of hierarchy levels to consider (-1: all, 0: none, 1: one level etc.) - - This method has been introduced in version 0.20. - """ - @overload - def read(self, filename: str) -> LayerMap: - r""" - @brief Load the layout from the given file - The format of the file is determined automatically and automatic unzipping is provided. No particular options can be specified. - @param filename The name of the file to load. - @return A layer map that contains the mapping used by the reader including the layers that have been created. - This method has been added in version 0.18. - """ - @overload - def read(self, filename: str, options: LoadLayoutOptions) -> LayerMap: - r""" - @brief Load the layout from the given file with options - The format of the file is determined automatically and automatic unzipping is provided. In this version, some reader options can be specified. @param filename The name of the file to load. - @param options The options object specifying further options for the reader. - @return A layer map that contains the mapping used by the reader including the layers that have been created. - This method has been added in version 0.18. - """ - def refresh(self) -> None: - r""" - @brief Calls \Cell#refresh on all cells inside this layout - This method is useful to recompute all PCells from a layout. Note that this does not update PCells which are linked from a library. To recompute PCells from a library, you need to use \Library#refresh on the library object from which the PCells are imported. - - This method has been introduced in version 0.27.9. - """ - def register_pcell(self, name: str, declaration: PCellDeclaration_Native) -> int: - r""" - @brief Registers a PCell declaration under the given name - Registers a local PCell in the current layout. If a declaration with that name - already exists, it is replaced with the new declaration. - - This method has been introduced in version 0.22. - """ - def remove_meta_info(self, name: str) -> None: - r""" - @brief Removes meta information from the layout - See \LayoutMetaInfo for details about layouts and meta information. - This method has been introduced in version 0.25. - """ - def rename_cell(self, index: int, name: str) -> None: - r""" - @brief Renames the cell with given index - The cell with the given index is renamed to the given name. NOTE: it is not ensured that the name is unique. This method allows assigning identical names to different cells which usually breaks things. - Consider using \unique_cell_name to generate truely unique names. - """ - @overload - def scale_and_snap(self, cell: Cell, grid: int, mult: int, div: int) -> None: - r""" - @brief Scales and snaps the layout below a given cell by the given rational factor and snaps to the given grid - - This method is useful to scale a layout by a non-integer factor. The scale factor is given by the rational number mult / div. After scaling, the layout will be snapped to the given grid. - - Snapping happens 'as-if-flat' - that is, touching edges will stay touching, regardless of their hierarchy path. To achieve this, this method usually needs to produce cell variants. - - This method has been introduced in version 0.26.1. - """ - @overload - def scale_and_snap(self, cell_index: int, grid: int, mult: int, div: int) -> None: - r""" - @brief Scales and snaps the layout below a given cell by the given rational factor and snaps to the given grid - - Like the other version of \scale_and_snap, but taking a cell index for the argument. - - This method has been introduced in version 0.26.1. - """ - def set_info(self, index: int, props: LayerInfo) -> None: - r""" - @brief Sets the info structure for a specified layer - """ - def set_property(self, key: Any, value: Any) -> None: - r""" - @brief Sets the user property with the given key to the given value - This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. - This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. - This method has been introduced in version 0.24. - """ - def start_changes(self) -> None: - r""" - @brief Signals the start of an operation bringing the layout into invalid state - - This method should be called whenever the layout is - about to be brought into an invalid state. After calling - this method, \under_construction? returns true which - tells foreign code (i.e. the asynchronous painter or the cell tree view) - not to use this layout object. - - This state is cancelled by the \end_changes method. - The start_changes method can be called multiple times - and must be cancelled the same number of times. - - This method can be used to speed up certain operations. For example iterating over the layout with a \RecursiveShapeIterator while modifying other layers of the layout can be very inefficient, because inside the loop the layout's state is invalidate and updated frequently. - Putting a update and start_changes sequence before the loop (use both methods in that order!) and a end_changes call after the loop can improve the performance dramatically. - - In addition, it can be necessary to prevent redraw operations in certain cases by using start_changes .. end_changes, in particular when it is possible to put a layout object into an invalid state temporarily. - - While the layout is under construction \update can be called to update the internal state explicitly if required. - This for example might be necessary to update the cell bounding boxes or to redo the sorting for region queries. - """ - def swap_layers(self, a: int, b: int) -> None: - r""" - @brief Swap two layers - - Swaps the shapes of both layers. - - This method was introduced in version 0.19. - - @param a The first of the layers to swap. - @param b The second of the layers to swap. - """ - def technology(self) -> Technology: - r""" - @brief Gets the \Technology object of the technology this layout is associated with or nil if the layout is not associated with a technology - This method has been introduced in version 0.27. Before that, the technology has been kept in the 'technology' meta data element. - """ - def top_cell(self) -> Cell: - r""" - @brief Returns the top cell object - @return The \Cell object of the top cell - If the layout has a single top cell, this method returns the top cell's \Cell object. - If the layout does not have a top cell, this method returns "nil". If the layout has multiple - top cells, this method raises an error. - - This method has been introduced in version 0.23. - """ - def top_cells(self) -> List[Cell]: - r""" - @brief Returns the top cell objects - @return The \Cell objects of the top cells - This method returns and array of \Cell objects representing the top cells of the layout. - This array can be empty, if the layout does not have a top cell (i.e. no cell at all). - - This method has been introduced in version 0.23. - """ - @overload - def transform(self, trans: DCplxTrans) -> None: - r""" - @brief Transforms the layout with the given complex integer transformation, which is in micrometer units - This variant will internally translate the transformation's displacement into database units. Apart from that, it behaves identical to the version with a \ICplxTrans argument. - - This method has been introduced in version 0.23. - """ - @overload - def transform(self, trans: DTrans) -> None: - r""" - @brief Transforms the layout with the given transformation, which is in micrometer units - This variant will internally translate the transformation's displacement into database units. Apart from that, it behaves identical to the version with a \Trans argument. - - This variant has been introduced in version 0.25. - """ - @overload - def transform(self, trans: ICplxTrans) -> None: - r""" - @brief Transforms the layout with the given complex integer transformation - - This method has been introduced in version 0.23. - """ - @overload - def transform(self, trans: Trans) -> None: - r""" - @brief Transforms the layout with the given transformation - - This method has been introduced in version 0.23. - """ - def under_construction(self) -> bool: - r""" - @brief Returns true if the layout object is under construction - - A layout object is either under construction if a transaction - is ongoing or the layout is brought into invalid state by - "start_changes". - """ - def unique_cell_name(self, name: str) -> str: - r""" - @brief Creates a new unique cell name from the given name - @return A unique name derived from the argument - - If a cell with the given name exists, a suffix will be added to make the name unique. Otherwise, the argument will be returned unchanged. - - The returned name can be used to rename cells without risk of creating name clashes. - - This method has been introduced in version 0.28. - """ - def update(self) -> None: - r""" - @brief Updates the internals of the layout - This method updates the internal state of the layout. Usually this is done automatically - This method is provided to ensure this explicitly. This can be useful while using \start_changes and \end_changes to wrap a performance-critical operation. See \start_changes for more details. - """ - @overload - def write(self, filename: str) -> None: - r""" - @brief Writes the layout to a stream file - @param filename The file to which to write the layout - """ - @overload - def write(self, filename: str, options: SaveLayoutOptions) -> None: - r""" - @brief Writes the layout to a stream file - @param filename The file to which to write the layout - @param options The option set to use for writing. See \SaveLayoutOptions for details - - This version automatically determines the compression mode from the file name. The file is written with zlib compression if the suffix is ".gz" or ".gzip". - - This variant has been introduced in version 0.23. - """ - @overload - def write(self, filename: str, gzip: bool, options: SaveLayoutOptions) -> None: - r""" - @brief Writes the layout to a stream file - @param filename The file to which to write the layout - @param gzip Ignored - @param options The option set to use for writing. See \SaveLayoutOptions for details - - Starting with version 0.23, this variant is deprecated since the more convenient variant with two parameters automatically determines the compression mode from the file name. The gzip parameter is ignored staring with version 0.23. - """ - -class SaveLayoutOptions: - r""" - @brief Options for saving layouts - - This class describes the various options for saving a layout to a stream file (GDS2, OASIS and others). - There are: layers to be saved, cell or cells to be saved, scale factor, format, database unit - and format specific options. - - Usually the default constructor provides a suitable object. Please note, that the format written is "GDS2" by default. Either explicitly set a format using \format= or derive the format from the file name using \set_format_from_filename. - - The layers are specified by either selecting all layers or by defining layer by layer using the - \add_layer method. \select_all_layers will explicitly select all layers for saving, \deselect_all_layers will explicitly clear the list of layers. - - Cells are selected in a similar fashion: by default, all cells are selected. Using \add_cell, specific - cells can be selected for saving. All these cells plus their hierarchy will then be written to the stream file. - - """ - cif_blank_separator: bool - r""" - Getter: - @brief Gets a flag indicating whether blanks shall be used as x/y separator characters - See \cif_blank_separator= method for a description of that property. - This property has been added in version 0.23.10. - - The predicate version (cif_blank_separator?) has been added in version 0.25.1. - - Setter: - @brief Sets a flag indicating whether blanks shall be used as x/y separator characters - If this property is set to true, the x and y coordinates are separated with blank characters rather than comma characters. - This property has been added in version 0.23.10. - """ - cif_dummy_calls: bool - r""" - Getter: - @brief Gets a flag indicating whether dummy calls shall be written - See \cif_dummy_calls= method for a description of that property. - This property has been added in version 0.23.10. - - The predicate version (cif_blank_separator?) has been added in version 0.25.1. - - Setter: - @brief Sets a flag indicating whether dummy calls shall be written - If this property is set to true, dummy calls will be written in the top level entity of the CIF file calling every top cell. - This option is useful for enhanced compatibility with other tools. - - This property has been added in version 0.23.10. - """ - dbu: float - r""" - Getter: - @brief Get the explicit database unit if one is set - - See \dbu= for a description of that attribute. - - Setter: - @brief Set the database unit to be used in the stream file - - By default, the database unit of the layout is used. This method allows one to explicitly use a different - database unit. A scale factor is introduced automatically which scales all layout objects accordingly so their physical dimensions remain the same. When scaling to a larger database unit or one that is not an integer fraction of the original one, rounding errors may occur and the layout may become slightly distorted. - """ - dxf_polygon_mode: int - r""" - Getter: - @brief Specifies how to write polygons. - See \dxf_polygon_mode= for a description of this property. - - This property has been added in version 0.21.3. - - Setter: - @brief Specifies how to write polygons. - The mode is 0 (write POLYLINE entities), 1 (write LWPOLYLINE entities), 2 (decompose into SOLID entities), 3 (write HATCH entities), or 4 (write LINE entities). - - This property has been added in version 0.21.3. '4', in version 0.25.6. - """ - format: str - r""" - Getter: - @brief Gets the format name - - See \format= for a description of that method. - - Setter: - @brief Select a format - The format string can be either "GDS2", "OASIS", "CIF" or "DXF". Other formats may be available if - a suitable plugin is installed. - """ - gds2_libname: str - r""" - Getter: - @brief Get the library name - See \gds2_libname= method for a description of the library name. - This property has been added in version 0.18. - - Setter: - @brief Set the library name - - The library name is the string written into the LIBNAME records of the GDS file. - The library name should not be an empty string and is subject to certain limitations in the character choice. - - This property has been added in version 0.18. - """ - gds2_max_cellname_length: int - r""" - Getter: - @brief Get the maximum length of cell names - See \gds2_max_cellname_length= method for a description of the maximum cell name length. - This property has been added in version 0.18. - - Setter: - @brief Maximum length of cell names - - This property describes the maximum number of characters for cell names. - Longer cell names will be shortened. - - This property has been added in version 0.18. - """ - gds2_max_vertex_count: int - r""" - Getter: - @brief Gets the maximum number of vertices for polygons to write - See \gds2_max_vertex_count= method for a description of the maximum vertex count. - This property has been added in version 0.18. - - Setter: - @brief Sets the maximum number of vertices for polygons to write - This property describes the maximum number of point for polygons in GDS2 files. - Polygons with more points will be split. - The minimum value for this property is 4. The maximum allowed value is about 4000 or 8000, depending on the - GDS2 interpretation. If \gds2_multi_xy_records is true, this - property is not used. Instead, the number of points is unlimited. - - This property has been added in version 0.18. - """ - gds2_multi_xy_records: bool - r""" - Getter: - @brief Gets the property enabling multiple XY records for BOUNDARY elements - See \gds2_multi_xy_records= method for a description of this property. - This property has been added in version 0.18. - - Setter: - @brief Uses multiple XY records in BOUNDARY elements for unlimited large polygons - - Setting this property to true allows producing polygons with an unlimited number of points - at the cost of incompatible formats. Setting it to true disables the \gds2_max_vertex_count setting. - - This property has been added in version 0.18. - """ - gds2_no_zero_length_paths: bool - r""" - Getter: - @brief Gets a value indicating whether zero-length paths are eliminated - - This property has been added in version 0.23. - - Setter: - @brief Eliminates zero-length paths if true - - If this property is set to true, paths with zero length will be converted to BOUNDARY objects. - - - This property has been added in version 0.23. - """ - gds2_resolve_skew_arrays: bool - r""" - Getter: - @brief Gets a value indicating whether to resolve skew arrays into single instances - See \gds2_resolve_skew_arrays= method for a description of this property. - This property has been added in version 0.27.1. - - Setter: - @brief Resolves skew arrays into single instances - - Setting this property to true will make skew (non-orthogonal) arrays being resolved into single instances. - Skew arrays happen if either the row or column vector isn't parallel to x or y axis. Such arrays can cause problems with some legacy software and can be disabled with this option. - - This property has been added in version 0.27.1. - """ - gds2_user_units: float - r""" - Getter: - @brief Get the user units - See \gds2_user_units= method for a description of the user units. - This property has been added in version 0.18. - - Setter: - @brief Set the users units to write into the GDS file - - The user units of a GDS file are rarely used and usually are set to 1 (micron). - The intention of the user units is to specify the display units. KLayout ignores the user unit and uses microns as the display unit. - The user unit must be larger than zero. - - This property has been added in version 0.18. - """ - gds2_write_cell_properties: bool - r""" - Getter: - @brief Gets a value indicating whether cell properties are written - - This property has been added in version 0.23. - - Setter: - @brief Enables writing of cell properties if set to true - - If this property is set to true, cell properties will be written as PROPATTR/PROPVALUE records immediately following the BGNSTR records. This is a non-standard extension and is therefore disabled by default. - - - This property has been added in version 0.23. - """ - gds2_write_file_properties: bool - r""" - Getter: - @brief Gets a value indicating whether layout properties are written - - This property has been added in version 0.24. - - Setter: - @brief Enables writing of file properties if set to true - - If this property is set to true, layout properties will be written as PROPATTR/PROPVALUE records immediately following the BGNLIB records. This is a non-standard extension and is therefore disabled by default. - - - This property has been added in version 0.24. - """ - gds2_write_timestamps: bool - r""" - Getter: - @brief Gets a value indicating whether the current time is written into the GDS2 timestamp fields - - This property has been added in version 0.21.16. - - Setter: - @brief Writes the current time into the GDS2 timestamps if set to true - - If this property is set to false, the time fields will all be zero. This somewhat simplifies compare and diff applications. - - - This property has been added in version 0.21.16. - """ - keep_instances: bool - r""" - Getter: - @brief Gets a flag indicating whether instances will be kept even if the target cell is dropped - - See \keep_instances= for details about this flag. - - This method was introduced in version 0.23. - - Setter: - @brief Enables or disables instances for dropped cells - - If this flag is set to true, instances for cells will be written, even if the cell is dropped. That may happen, if cells are selected with \select_this_cell or \add_this_cell or \no_empty_cells is used. Even if cells called by such cells are not selected, instances will be written for that cell if "keep_instances" is true. That feature is supported by the GDS format currently and results in "ghost cells" which have instances but no cell definition. - - The default value is false (instances of dropped cells are not written). - - This method was introduced in version 0.23. - """ - mag_lambda: float - r""" - Getter: - @brief Gets the lambda value - See \mag_lambda= method for a description of this attribute. - This property has been added in version 0.26.2. - - Setter: - @brief Specifies the lambda value to used for writing - - The lambda value is the basic unit of the layout. - The layout is brought to units of this value. If the layout is not on-grid on this unit, snapping will happen. If the value is less or equal to zero, KLayout will use the lambda value stored inside the layout set by a previous read operation of a MAGIC file. The lambda value is stored in the Layout object as the "lambda" metadata attribute. - - This property has been added in version 0.26.2. - """ - mag_tech: str - r""" - Getter: - @brief Gets the technology string used for writing - See \mag_tech= method for a description of this attribute. - This property has been added in version 0.26.2. - - Setter: - @brief Specifies the technology string used for writing - - If this string is empty, the writer will try to obtain the technology from the "technology" metadata attribute of the layout. - - This property has been added in version 0.26.2. - """ - mag_write_timestamp: bool - r""" - Getter: - @brief Gets a value indicating whether to write a timestamp - See \write_timestamp= method for a description of this attribute. - - This property has been added in version 0.26.2. - - Setter: - @brief Specifies whether to write a timestamp - - If this attribute is set to false, the timestamp written is 0. This is not permitted in the strict sense, but simplifies comparison of Magic files. - - This property has been added in version 0.26.2. - """ - no_empty_cells: bool - r""" - Getter: - @brief Returns a flag indicating whether empty cells are not written. - - Setter: - @brief Don't write empty cells if this flag is set - - By default, all cells are written (no_empty_cells is false). - This applies to empty cells which do not contain shapes for the specified layers as well as cells which are empty because they reference empty cells only. - """ - oasis_compression_level: int - r""" - Getter: - @brief Get the OASIS compression level - See \oasis_compression_level= method for a description of the OASIS compression level. - Setter: - @brief Set the OASIS compression level - The OASIS compression level is an integer number between 0 and 10. 0 basically is no compression, 1 produces shape arrays in a simple fashion. 2 and higher compression levels will use a more elaborate algorithm to find shape arrays which uses 2nd and further neighbor distances. The higher the level, the higher the memory requirements and run times. - """ - oasis_permissive: bool - r""" - Getter: - @brief Gets the OASIS permissive mode - See \oasis_permissive= method for a description of this predicate. - This method has been introduced in version 0.25.1. - Setter: - @brief Sets OASIS permissive mode - If this flag is true, certain shapes which cannot be written to OASIS are reported as warnings, not as errors. For example, paths with odd width (are rounded) or polygons with less than three points (are skipped). - - This method has been introduced in version 0.25.1. - """ - oasis_recompress: bool - r""" - Getter: - @brief Gets the OASIS recompression mode - See \oasis_recompress= method for a description of this predicate. - This method has been introduced in version 0.23. - Setter: - @brief Sets OASIS recompression mode - If this flag is true, shape arrays already existing will be resolved and compression is applied to the individual shapes again. If this flag is false (the default), shape arrays already existing will be written as such. - - This method has been introduced in version 0.23. - """ - oasis_strict_mode: bool - r""" - Getter: - @brief Gets a value indicating whether to write strict-mode OASIS files - - Setter: - @brief Sets a value indicating whether to write strict-mode OASIS files - Setting this property clears all format specific options for other formats such as GDS. - """ - oasis_substitution_char: str - r""" - Getter: - @brief Gets the substitution character - - See \oasis_substitution_char for details. This attribute has been introduced in version 0.23. - - Setter: - @brief Sets the substitution character for a-strings and n-strings - The substitution character is used in place of invalid characters. The value of this attribute is a string which is either empty or a single character. If the string is empty, no substitution is made at the risk of producing invalid OASIS files. - - This attribute has been introduce in version 0.23. - """ - oasis_write_cblocks: bool - r""" - Getter: - @brief Gets a value indicating whether to write compressed CBLOCKS per cell - - Setter: - @brief Sets a value indicating whether to write compressed CBLOCKS per cell - Setting this property clears all format specific options for other formats such as GDS. - """ - oasis_write_cell_bounding_boxes: bool - r""" - Getter: - @brief Gets a value indicating whether cell bounding boxes are written - See \oasis_write_cell_bounding_boxes= method for a description of this flag. - This method has been introduced in version 0.24.3. - Setter: - @brief Sets a value indicating whether cell bounding boxes are written - If this value is set to true, cell bounding boxes are written (S_BOUNDING_BOX). The S_BOUNDING_BOX properties will be attached to the CELLNAME records. - - Setting this value to true will also enable writing of other standard properties like S_TOP_CELL (see \oasis_write_std_properties=). - By default, cell bounding boxes are not written, but standard properties are. - - This method has been introduced in version 0.24.3. - """ - oasis_write_std_properties: bool - r""" - Getter: - @brief Gets a value indicating whether standard properties will be written - See \oasis_write_std_properties= method for a description of this flag. - This method has been introduced in version 0.24. - Setter: - @brief Sets a value indicating whether standard properties will be written - If this value is false, no standard properties are written. If true, S_TOP_CELL and some other global standard properties are written. In addition, \oasis_write_cell_bounding_boxes= can be used to write cell bounding boxes using S_BOUNDING_BOX. - - By default, this flag is true and standard properties are written. - - Setting this property to false clears the oasis_write_cell_bounding_boxes flag too. - - This method has been introduced in version 0.24. - """ - oasis_write_std_properties_ext: int - r""" - Getter: - @hide - Setter: - @hide - """ - scale_factor: float - r""" - Getter: - @brief Gets the scaling factor currently set - - Setter: - @brief Set the scaling factor for the saving - - Using a scaling factor will scale all objects accordingly. This scale factor adds to a potential scaling implied by using an explicit database unit. - - Be aware that rounding effects may occur if fractional scaling factors are used. - - By default, no scaling is applied. - """ - write_context_info: bool - r""" - Getter: - @brief Gets a flag indicating whether context information will be stored - - See \write_context_info= for details about this flag. - - This method was introduced in version 0.23. - - Setter: - @brief Enables or disables context information - - If this flag is set to false, no context information for PCell or library cell instances is written. Those cells will be converted to plain cells and KLayout will not be able to restore the identity of those cells. Use this option to enforce compatibility with other tools that don't understand the context information of KLayout. - - The default value is true (context information is stored). Not all formats support context information, hence that flag has no effect for formats like CIF or DXF. - - This method was introduced in version 0.23. - """ - @classmethod - def new(cls) -> SaveLayoutOptions: - r""" - @brief Default constructor - - This will initialize the scale factor to 1.0, the database unit is set to - "same as original" and all layers are selected as well as all cells. - The default format is GDS2. - """ - def __copy__(self) -> SaveLayoutOptions: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> SaveLayoutOptions: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Default constructor - - This will initialize the scale factor to 1.0, the database unit is set to - "same as original" and all layers are selected as well as all cells. - The default format is GDS2. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def add_cell(self, cell_index: int) -> None: - r""" - @brief Add a cell (plus hierarchy) to be saved - - - The index of the cell must be a valid index in the context of the layout that will be saved. - This method clears the 'select all cells' flag. - - This method also implicitly adds the children of that cell. A method that does not add the children in \add_this_cell. - """ - def add_layer(self, layer_index: int, properties: LayerInfo) -> None: - r""" - @brief Add a layer to be saved - - - Adds the layer with the given index to the layer list that will be written. - If all layers have been selected previously, all layers will - be unselected first and only the new layer remains. - - The 'properties' argument can be used to assign different layer properties than the ones - present in the layout. Pass a default \LayerInfo object to this argument to use the - properties from the layout object. Construct a valid \LayerInfo object with explicit layer, - datatype and possibly a name to override the properties stored in the layout. - """ - def add_this_cell(self, cell_index: int) -> None: - r""" - @brief Adds a cell to be saved - - - The index of the cell must be a valid index in the context of the layout that will be saved. - This method clears the 'select all cells' flag. - Unlike \add_cell, this method does not implicitly add all children of that cell. - - This method has been added in version 0.23. - """ - def assign(self, other: SaveLayoutOptions) -> None: - r""" - @brief Assigns another object to self - """ - def clear_cells(self) -> None: - r""" - @brief Clears all cells to be saved - - This method can be used to ensure that no cell is selected before \add_cell is called to specify a cell. - This method clears the 'select all cells' flag. - - This method has been added in version 0.22. - """ - def create(self) -> None: - r""" - @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. - """ - def deselect_all_layers(self) -> None: - r""" - @brief Unselect all layers: no layer will be saved - - This method will clear all layers selected with \add_layer so far and clear the 'select all layers' flag. - Using this method is the only way to save a layout without any layers. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> SaveLayoutOptions: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def select_all_cells(self) -> None: - r""" - @brief Select all cells to save - - This method will clear all cells specified with \add_cells so far and set the 'select all cells' flag. - This is the default. - """ - def select_all_layers(self) -> None: - r""" - @brief Select all layers to be saved - - This method will clear all layers selected with \add_layer so far and set the 'select all layers' flag. - This is the default. - """ - def select_cell(self, cell_index: int) -> None: - r""" - @brief Selects a cell to be saved (plus hierarchy below) - - - This method is basically a convenience method that combines \clear_cells and \add_cell. - This method clears the 'select all cells' flag. - - This method has been added in version 0.22. - """ - def select_this_cell(self, cell_index: int) -> None: - r""" - @brief Selects a cell to be saved - - - This method is basically a convenience method that combines \clear_cells and \add_this_cell. - This method clears the 'select all cells' flag. - - This method has been added in version 0.23. - """ - def set_format_from_filename(self, filename: str) -> bool: - r""" - @brief Select a format from the given file name - - This method will set the format according to the file's extension. - - This method has been introduced in version 0.22. Beginning with version 0.23, this method always returns true, since the only consumer for the return value, Layout#write, now ignores that parameter and automatically determines the compression mode from the file name. - """ - -class LayoutQueryIterator: - r""" - @brief Provides the results of the query - - This object is used by \LayoutQuery#each to deliver the results of a query in an iterative fashion. See \LayoutQuery for a detailed description of the query interface. - - The LayoutQueryIterator class has been introduced in version 0.25. - """ - @classmethod - def new(cls) -> LayoutQueryIterator: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def cell(self) -> Any: - r""" - @brief A shortcut for 'get("cell")' - """ - def cell_index(self) -> Any: - r""" - @brief A shortcut for 'get("cell_index")' - """ - def create(self) -> None: - r""" - @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. - """ - def data(self) -> Any: - r""" - @brief A shortcut for 'get("data")' - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dtrans(self) -> Any: - r""" - @brief A shortcut for 'get("dtrans")' - """ - def get(self, name: str) -> Any: - r""" - @brief Gets the query property with the given name - The query properties available can be obtained from the query object using \LayoutQuery#property_names. - Some shortcut methods are available. For example, the \data method provides a shortcut for 'get("data")'. - - If a property with the given name is not available, nil will be returned. - """ - def initial_cell(self) -> Any: - r""" - @brief A shortcut for 'get("initial_cell")' - """ - def initial_cell_index(self) -> Any: - r""" - @brief A shortcut for 'get("initial_cell_index")' - """ - def inst(self) -> Any: - r""" - @brief A shortcut for 'get("inst")' - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def layer_index(self) -> Any: - r""" - @brief A shortcut for 'get("layer_index")' - """ - def layout(self) -> Layout: - r""" - @brief Gets the layout the query acts on - """ - def parent_cell(self) -> Any: - r""" - @brief A shortcut for 'get("parent_cell")' - """ - def parent_cell_index(self) -> Any: - r""" - @brief A shortcut for 'get("parent_cell_index")' - """ - def path_dtrans(self) -> Any: - r""" - @brief A shortcut for 'get("path_dtrans")' - """ - def path_trans(self) -> Any: - r""" - @brief A shortcut for 'get("path_trans")' - """ - def query(self) -> LayoutQuery: - r""" - @brief Gets the query the iterator follows on - """ - def shape(self) -> Any: - r""" - @brief A shortcut for 'get("shape")' - """ - def trans(self) -> Any: - r""" - @brief A shortcut for 'get("trans")' - """ - -class LayoutQuery: - r""" - @brief A layout query - Layout queries are the backbone of the "Search & replace" feature. Layout queries allow retrieval of data from layouts and manipulation of layouts. This object provides script binding for this feature. - Layout queries are used by first creating a query object. Depending on the nature of the query, either \execute or \each can be used to execute the query. \execute will run the query and return once the query is finished. \execute is useful for running queries that don't return results such as "delete" or "with ... do" queries. - \each can be used when the results of the query need to be retrieved. - - The \each method will call a block a of code for every result available. It will provide a \LayoutQueryIterator object that allows accessing the results of the query. Depending on the query, different attributes of the iterator object will be available. For example, "select" queries will fill the "data" attribute with an array of values corresponding to the columns of the selection. - - Here is some sample code: - @code - ly = RBA::CellView::active.layout - q = RBA::LayoutQuery::new("select cell.name, cell.bbox from *") - q.each(ly) do |iter| - puts "cell name: #{iter.data[0]}, bounding box: #{iter.data[1]}" - end - @/code - - The LayoutQuery class has been introduced in version 0.25. - """ - @classmethod - def new(cls, query: str) -> LayoutQuery: - r""" - @brief Creates a new query object from the given query string - """ - def __init__(self, query: str) -> None: - r""" - @brief Creates a new query object from the given query string - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def each(self, layout: Layout, context: Optional[tl.ExpressionContext] = ...) -> Iterator[LayoutQueryIterator]: - r""" - @brief Executes the query and delivered the results iteratively. - The argument to the block is a \LayoutQueryIterator object which can be asked for specific results. - - The context argument allows supplying an expression execution context. This context can be used for example to supply variables for the execution. It has been added in version 0.26. - """ - def execute(self, layout: Layout, context: Optional[tl.ExpressionContext] = ...) -> None: - r""" - @brief Executes the query - - This method can be used to execute "active" queries such - as "delete" or "with ... do". - It is basically equivalent to iterating over the query until it is - done. - - The context argument allows supplying an expression execution context. This context can be used for example to supply variables for the execution. It has been added in version 0.26. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def property_names(self) -> List[str]: - r""" - @brief Gets a list of property names available. - The list of properties available from the query depends on the nature of the query. This method allows detection of the properties available. Within the query, all of these properties can be obtained from the query iterator using \LayoutQueryIterator#get. - """ - -class Library: - r""" - @brief A Library - - A library is basically a wrapper around a layout object. The layout object - provides cells and potentially PCells that can be imported into other layouts. - - The library provides a name which is used to identify the library and a description - which is used for identifying the library in a user interface. - - After a library is created and the layout is filled, it must be registered using the register method. - - This class has been introduced in version 0.22. - """ - description: str - r""" - Getter: - @brief Returns the libraries' description text - - Setter: - @brief Sets the libraries' description text - """ - technology: str - r""" - Getter: - @brief Returns name of the technology the library is associated with - If this attribute is a non-empty string, this library is only offered for selection if the current layout uses this technology. - - This attribute has been introduced in version 0.25. In version 0.27 this attribute is deprecated as a library can now be associated with multiple technologies. - Setter: - @brief sets the name of the technology the library is associated with - - See \technology for details. This attribute has been introduced in version 0.25. In version 0.27, a library can be associated with multiple technologies and this method will revert the selection to a single one. Passing an empty string is equivalent to \clear_technologies. - """ - @classmethod - def library_by_id(cls, id: int) -> Library: - r""" - @brief Gets the library object for the given ID - If the ID is not valid, nil is returned. - - This method has been introduced in version 0.27. - """ - @classmethod - def library_by_name(cls, name: str, for_technology: Optional[str] = ...) -> Library: - r""" - @brief Gets a library by name - Returns the library object for the given name. If the name is not a valid - library name, nil is returned. - - Different libraries can be registered under the same names for different technologies. When a technology name is given in 'for_technologies', the first library matching this technology is returned. If no technology is given, the first library is returned. - - The technology selector has been introduced in version 0.27. - """ - @classmethod - def library_ids(cls) -> List[int]: - r""" - @brief Returns a list of valid library IDs. - See \library_names for the reasoning behind this method. - This method has been introduced in version 0.27. - """ - @classmethod - def library_names(cls) -> List[str]: - r""" - @brief Returns a list of the names of all libraries registered in the system. - - NOTE: starting with version 0.27, the name of a library does not need to be unique if libraries are associated with specific technologies. This method will only return the names and it's not possible not unambiguously derive the library object. It is recommended to use \library_ids and \library_by_id to obtain the library unambiguously. - """ - @classmethod - def new(cls) -> Library: - r""" - @brief Creates a new, empty library - """ - def __copy__(self) -> Library: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Library: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new, empty library - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def add_technology(self, tech: str) -> None: - r""" - @brief Additionally associates the library with the given technology. - See also \clear_technologies. - - This method has been introduced in version 0.27 - """ - def assign(self, other: Library) -> None: - r""" - @brief Assigns another object to self - """ - def clear_technologies(self) -> None: - r""" - @brief Clears the list of technologies the library is associated with. - See also \add_technology. - - This method has been introduced in version 0.27 - """ - def create(self) -> None: - r""" - @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. - """ - def delete(self) -> None: - r""" - @brief Deletes the library - - This method will delete the library object. Library proxies pointing to this library will become invalid and the library object cannot be used any more after calling this method. - - This method has been introduced in version 0.25. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> Library: - r""" - @brief Creates a copy of self - """ - def for_technologies(self) -> bool: - r""" - @brief Returns a value indicating whether the library is associated with any technology. - The method is equivalent to checking whether the \technologies list is empty. - - This method has been introduced in version 0.27 - """ - def id(self) -> int: - r""" - @brief Returns the library's ID - The ID is set when the library is registered and cannot be changed - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_for_technology(self, tech: str) -> bool: - r""" - @brief Returns a value indicating whether the library is associated with the given technology. - This method has been introduced in version 0.27 - """ - def layout(self) -> Layout: - r""" - @brief The layout object where the cells reside that this library defines - """ - def layout_const(self) -> Layout: - r""" - @brief The layout object where the cells reside that this library defines (const version) - """ - def name(self) -> str: - r""" - @brief Returns the libraries' name - The name is set when the library is registered and cannot be changed - """ - def refresh(self) -> None: - r""" - @brief Updates all layouts using this library. - This method will retire cells or update layouts in the attached clients. - It will also recompute the PCells inside the library. - This method has been introduced in version 0.27.8. - """ - def register(self, name: str) -> None: - r""" - @brief Registers the library with the given name - - This method can be called in the constructor to register the library after - the layout object has been filled with content. If a library with that name - already exists for the same technologies, it will be replaced with this library. - - This method will set the libraries' name. - - The technology specific behaviour has been introduced in version 0.27. - """ - def technologies(self) -> List[str]: - r""" - @brief Gets the list of technologies this library is associated with. - This method has been introduced in version 0.27 - """ - -class PCellDeclaration_Native: - r""" - @hide - @alias PCellDeclaration - """ - @classmethod - def new(cls) -> PCellDeclaration_Native: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> PCellDeclaration_Native: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> PCellDeclaration_Native: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: PCellDeclaration_Native) -> None: - r""" - @brief Assigns another object to self - """ - def callback(self, layout: Layout, name: str, states: PCellParameterStates) -> None: - r""" - """ - def can_create_from_shape(self, layout: Layout, shape: Shape, layer: int) -> bool: - r""" - """ - def coerce_parameters(self, layout: Layout, parameters: Sequence[Any]) -> List[Any]: - r""" - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def display_text(self, parameters: Sequence[Any]) -> str: - r""" - """ - def dup(self) -> PCellDeclaration_Native: - r""" - @brief Creates a copy of self - """ - def get_layers(self, parameters: Sequence[Any]) -> List[LayerInfo]: - r""" - """ - def get_parameters(self) -> List[PCellParameterDeclaration]: - r""" - """ - def id(self) -> int: - r""" - @brief Gets the integer ID of the PCell declaration - This ID is used to identify the PCell in the context of a Layout object for example - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def layout(self) -> Layout: - r""" - @brief Gets the Layout object the PCell is registered in or nil if it is not registered yet. - This attribute has been added in version 0.27.5. - """ - def name(self) -> str: - r""" - @brief Gets the name of the PCell - """ - def parameters_from_shape(self, layout: Layout, shape: Shape, layer: int) -> List[Any]: - r""" - """ - def produce(self, layout: Layout, layers: Sequence[int], parameters: Sequence[Any], cell: Cell) -> None: - r""" - """ - def transformation_from_shape(self, layout: Layout, shape: Shape, layer: int) -> Trans: - r""" - """ - def wants_lazy_evaluation(self) -> bool: - r""" - """ - -class PCellParameterState: - r""" - @brief Provides access to the attributes of a single parameter within \PCellParameterStates. - - See \PCellParameterStates for details about this feature. - - This class has been introduced in version 0.28. - """ - class ParameterStateIcon: - r""" - @brief This enum specifies the icon shown next to the parameter in PCell parameter list. - - This enum was introduced in version 0.28. - """ - ErrorIcon: ClassVar[PCellParameterState.ParameterStateIcon] - r""" - @brief An icon indicating an error is shown - """ - InfoIcon: ClassVar[PCellParameterState.ParameterStateIcon] - r""" - @brief A general 'information' icon is shown - """ - NoIcon: ClassVar[PCellParameterState.ParameterStateIcon] - r""" - @brief No icon is shown for the parameter - """ - WarningIcon: ClassVar[PCellParameterState.ParameterStateIcon] - r""" - @brief An icon indicating a warning is shown - """ - @overload - @classmethod - def new(cls, i: int) -> PCellParameterState.ParameterStateIcon: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> PCellParameterState.ParameterStateIcon: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: PCellParameterState.ParameterStateIcon) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - ErrorIcon: ClassVar[PCellParameterState.ParameterStateIcon] - r""" - @brief An icon indicating an error is shown - """ - InfoIcon: ClassVar[PCellParameterState.ParameterStateIcon] - r""" - @brief A general 'information' icon is shown - """ - NoIcon: ClassVar[PCellParameterState.ParameterStateIcon] - r""" - @brief No icon is shown for the parameter - """ - WarningIcon: ClassVar[PCellParameterState.ParameterStateIcon] - r""" - @brief An icon indicating a warning is shown - """ - enabled: bool - r""" - Getter: - @brief Gets a value indicating whether the parameter is enabled in the parameter form - - Setter: - @brief Sets a value indicating whether the parameter is enabled in the parameter form - """ - @property - def icon(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the icon for the parameter - """ - readonly: bool - r""" - Getter: - @brief Gets a value indicating whether the parameter is read-only (not editable) in the parameter form - - Setter: - @brief Sets a value indicating whether the parameter is made read-only (not editable) in the parameter form - """ - tooltip: str - r""" - Getter: - @brief Gets the tool tip text - - Setter: - @brief Sets the tool tip text - - The tool tip is shown when hovering over the parameter label or edit field. - """ - value: Any - r""" - Getter: - @brief Gets the value of the parameter - - Setter: - @brief Sets the value of the parameter - """ - visible: bool - r""" - Getter: - @brief Gets a value indicating whether the parameter is visible in the parameter form - - Setter: - @brief Sets a value indicating whether the parameter is visible in the parameter form - """ - @classmethod - def new(cls) -> PCellParameterState: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> PCellParameterState: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> PCellParameterState: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: PCellParameterState) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> PCellParameterState: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_enabled(self) -> bool: - r""" - @brief Gets a value indicating whether the parameter is enabled in the parameter form - """ - def is_readonly(self) -> bool: - r""" - @brief Gets a value indicating whether the parameter is read-only (not editable) in the parameter form - """ - def is_visible(self) -> bool: - r""" - @brief Gets a value indicating whether the parameter is visible in the parameter form - """ - -class PCellParameterStates: - r""" - @brief Provides access to the parameter states inside a 'callback' implementation of a PCell - - Example: enables or disables a parameter 'n' based on the value: - - @code - n_param = states.parameter("n") - n_param.enabled = n_param.value > 1.0 - @/code - - This class has been introduced in version 0.28. - """ - @classmethod - def new(cls) -> PCellParameterStates: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> PCellParameterStates: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> PCellParameterStates: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: PCellParameterStates) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> PCellParameterStates: - r""" - @brief Creates a copy of self - """ - def has_parameter(self, name: str) -> bool: - r""" - @brief Gets a value indicating whether a parameter with that name exists - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def parameter(self, name: str) -> PCellParameterState: - r""" - @brief Gets the parameter by name - - This will return a \PCellParameterState object that can be used to manipulate the parameter state. - """ - -class PCellDeclaration(PCellDeclaration_Native): - r""" - @brief A PCell declaration providing the parameters and code to produce the PCell - - A PCell declaration is basically the recipe of how to create a PCell layout from - a parameter set. The declaration includes - - @ul - @li Parameters: names, types, default values @/li - @li Layers: the layers the PCell wants to create @/li - @li Code: a production callback that is called whenever a PCell is instantiated with a certain parameter set @/li - @li Display name: the name that is shown for a given PCell instance @/li - @/ul - - All these declarations are implemented by deriving from the PCellDeclaration class - and reimplementing the specific methods. Reimplementing the \display_name method is - optional. The default implementation creates a name from the PCell name plus the - parameters. - - By supplying the information about the layers it wants to create, KLayout is able to - call the production callback with a defined set of the layer ID's which are already - mapped to valid actual layout layers. - - This class has been introduced in version 0.22. - """ - def _assign(self, other: PCellDeclaration_Native) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> PCellDeclaration: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def callback(self, arg0: Layout, arg1: str, arg2: PCellParameterStates) -> None: - r""" - @hide - """ - def can_create_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> bool: - r""" - @hide - """ - def display_text(self, arg0: Sequence[Any]) -> str: - r""" - @hide - """ - def get_parameters(self) -> List[PCellParameterDeclaration]: - r""" - @hide - """ - def parameters_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> List[Any]: - r""" - @hide - """ - def produce(self, arg0: Layout, arg1: Sequence[int], arg2: Sequence[Any], arg3: Cell) -> None: - r""" - @hide - """ - def transformation_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> Trans: - r""" - @hide - """ - def wants_lazy_evaluation(self) -> bool: - r""" - @hide - """ - -class PCellParameterDeclaration: - r""" - @brief A PCell parameter declaration - - This class declares a PCell parameter by providing a name, the type and a value - and additional - information like description, unit string and default value. It is used in the \PCellDeclaration class to - deliver the necessary information. - - This class has been introduced in version 0.22. - """ - TypeBoolean: ClassVar[int] - r""" - @brief Type code: boolean data - """ - TypeCallback: ClassVar[int] - r""" - @brief Type code: a button triggering a callback - - This code has been introduced in version 0.28. - """ - TypeDouble: ClassVar[int] - r""" - @brief Type code: floating-point data - """ - TypeInt: ClassVar[int] - r""" - @brief Type code: integer data - """ - TypeLayer: ClassVar[int] - r""" - @brief Type code: a layer (a \LayerInfo object) - """ - TypeList: ClassVar[int] - r""" - @brief Type code: a list of variants - """ - TypeNone: ClassVar[int] - r""" - @brief Type code: unspecific type - """ - TypeShape: ClassVar[int] - r""" - @brief Type code: a guiding shape (Box, Edge, Point, Polygon or Path) - """ - TypeString: ClassVar[int] - r""" - @brief Type code: string data - """ - default: Any - r""" - Getter: - @brief Gets the default value - - Setter: - @brief Sets the default value - If a default value is defined, it will be used to initialize the parameter value - when a PCell is created. - """ - description: str - r""" - Getter: - @brief Gets the description text - - Setter: - @brief Sets the description - """ - hidden: bool - r""" - Getter: - @brief Returns true, if the parameter is a hidden parameter that should not be shown in the user interface - By making a parameter hidden, it is possible to create internal parameters which cannot be - edited. - - Setter: - @brief Makes the parameter hidden if this attribute is set to true - """ - name: str - r""" - Getter: - @brief Gets the name - - Setter: - @brief Sets the name - """ - readonly: bool - r""" - Getter: - @brief Returns true, if the parameter is a read-only parameter - By making a parameter read-only, it is shown but cannot be - edited. - - Setter: - @brief Makes the parameter read-only if this attribute is set to true - """ - type: int - r""" - Getter: - @brief Gets the type - The type is one of the T... constants. - Setter: - @brief Sets the type - """ - unit: str - r""" - Getter: - @brief Gets the unit string - - Setter: - @brief Sets the unit string - The unit string is shown right to the edit fields for numeric parameters. - """ - @overload - @classmethod - def new(cls, name: str, type: int, description: str) -> PCellParameterDeclaration: - r""" - @brief Create a new parameter declaration with the given name and type - @param name The parameter name - @param type One of the Type... constants describing the type of the parameter - @param description The description text - """ - @overload - @classmethod - def new(cls, name: str, type: int, description: str, default: Any) -> PCellParameterDeclaration: - r""" - @brief Create a new parameter declaration with the given name, type and default value - @param name The parameter name - @param type One of the Type... constants describing the type of the parameter - @param description The description text - @param default The default (initial) value - """ - @overload - @classmethod - def new(cls, name: str, type: int, description: str, default: Any, unit: str) -> PCellParameterDeclaration: - r""" - @brief Create a new parameter declaration with the given name, type, default value and unit string - @param name The parameter name - @param type One of the Type... constants describing the type of the parameter - @param description The description text - @param default The default (initial) value - @param unit The unit string - """ - def __copy__(self) -> PCellParameterDeclaration: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> PCellParameterDeclaration: - r""" - @brief Creates a copy of self - """ - @overload - def __init__(self, name: str, type: int, description: str) -> None: - r""" - @brief Create a new parameter declaration with the given name and type - @param name The parameter name - @param type One of the Type... constants describing the type of the parameter - @param description The description text - """ - @overload - def __init__(self, name: str, type: int, description: str, default: Any) -> None: - r""" - @brief Create a new parameter declaration with the given name, type and default value - @param name The parameter name - @param type One of the Type... constants describing the type of the parameter - @param description The description text - @param default The default (initial) value - """ - @overload - def __init__(self, name: str, type: int, description: str, default: Any, unit: str) -> None: - r""" - @brief Create a new parameter declaration with the given name, type, default value and unit string - @param name The parameter name - @param type One of the Type... constants describing the type of the parameter - @param description The description text - @param default The default (initial) value - @param unit The unit string - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def add_choice(self, description: str, value: Any) -> None: - r""" - @brief Add a new value to the list of choices - This method will add the given value with the given description to the list of - choices. If choices are defined, KLayout will show a drop-down box instead of an - entry field in the parameter user interface. - """ - def assign(self, other: PCellParameterDeclaration) -> None: - r""" - @brief Assigns another object to self - """ - def choice_descriptions(self) -> List[str]: - r""" - @brief Returns a list of choice descriptions - """ - def choice_values(self) -> List[Any]: - r""" - @brief Returns a list of choice values - """ - def clear_choices(self) -> None: - r""" - @brief Clears the list of choices - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> PCellParameterDeclaration: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class Manager: - r""" - @brief A transaction manager class - - Manager objects control layout and potentially other objects in the layout database and queue operations to form transactions. A transaction is a sequence of operations that can be undone or redone. - - In order to equip a layout object with undo/redo support, instantiate the layout object with a manager attached and embrace the operations to undo/redo with transaction/commit calls. - - The use of transactions is subject to certain constraints, i.e. transacted sequences may not be mixed with non-transacted ones. - - This class has been introduced in version 0.19. - """ - @classmethod - def new(cls) -> Manager: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> Manager: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Manager: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Manager) -> None: - r""" - @brief Assigns another object to self - """ - def commit(self) -> None: - r""" - @brief Close a transaction. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> Manager: - r""" - @brief Creates a copy of self - """ - def has_redo(self) -> bool: - r""" - @brief Determine if a transaction is available for 'redo' - - @return True, if a transaction is available. - """ - def has_undo(self) -> bool: - r""" - @brief Determine if a transaction is available for 'undo' - - @return True, if a transaction is available. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def redo(self) -> None: - r""" - @brief Redo the next available transaction - - The next transaction is redone with this method. - The 'has_redo' method can be used to determine whether - there are transactions to undo. - """ - @overload - def transaction(self, description: str) -> int: - r""" - @brief Begin a transaction - - - This call will open a new transaction. A transaction consists - of a set of operations issued with the 'queue' method. - A transaction is closed with the 'commit' method. - - @param description The description for this transaction. - - @return The ID of the transaction (can be used to join other transactions with this one) - """ - @overload - def transaction(self, description: str, join_with: int) -> int: - r""" - @brief Begin a joined transaction - - - This call will open a new transaction and join if with the previous transaction. - The ID of the previous transaction must be equal to the ID given with 'join_with'. - - This overload was introduced in version 0.22. - - @param description The description for this transaction (ignored if joined). - @param description The ID of the previous transaction. - - @return The ID of the new transaction (can be used to join more) - """ - def transaction_for_redo(self) -> str: - r""" - @brief Return the description of the next transaction for 'redo' - """ - def transaction_for_undo(self) -> str: - r""" - @brief Return the description of the next transaction for 'undo' - """ - def undo(self) -> None: - r""" - @brief Undo the current transaction - - The current transaction is undone with this method. - The 'has_undo' method can be used to determine whether - there are transactions to undo. - """ - -class Matrix2d: - r""" - @brief A 2d matrix object used mainly for representing rotation and shear transformations. - - This object represents a 2x2 matrix. This matrix is used to implement affine transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation and shear. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification and shear. - - The matrix is a generalization of the transformations and is of limited use in a layout database context. It is useful however to implement shear transformations on polygons, edges and polygon or edge collections. - - This class was introduced in version 0.22. - """ - @overload - @classmethod - def new(cls) -> Matrix2d: - r""" - @brief Create a new Matrix2d representing a unit transformation - """ - @overload - @classmethod - def new(cls, m: float) -> Matrix2d: - r""" - @brief Create a new Matrix2d representing an isotropic magnification - @param m The magnification - """ - @overload - @classmethod - def new(cls, t: DCplxTrans) -> Matrix2d: - r""" - @brief Create a new Matrix2d from the given complex transformation@param t The transformation from which to create the matrix (not taking into account the displacement) - """ - @overload - @classmethod - def new(cls, mx: float, my: float) -> Matrix2d: - r""" - @brief Create a new Matrix2d representing an anisotropic magnification - @param mx The magnification in x direction - @param my The magnification in y direction - """ - @overload - @classmethod - def new(cls, m11: float, m12: float, m21: float, m22: float) -> Matrix2d: - r""" - @brief Create a new Matrix2d from the four coefficients - """ - @overload - @classmethod - def newc(cls, mag: float, rotation: float, mirror: bool) -> Matrix2d: - r""" - @brief Create a new Matrix2d representing an isotropic magnification, rotation and mirroring - @param mag The magnification in x direction - @param rotation The rotation angle (in degree) - @param mirror The mirror flag (at x axis) - - This constructor is provided to construct a matrix similar to the complex transformation. - This constructor is called 'newc' to distinguish it from the constructors taking matrix coefficients ('c' is for composite). - The order of execution of the operations is mirror, magnification, rotation (as for complex transformations). - """ - @overload - @classmethod - def newc(cls, shear: float, mx: float, my: float, rotation: float, mirror: bool) -> Matrix2d: - r""" - @brief Create a new Matrix2d representing a shear, anisotropic magnification, rotation and mirroring - @param shear The shear angle - @param mx The magnification in x direction - @param my The magnification in y direction - @param rotation The rotation angle (in degree) - @param mirror The mirror flag (at x axis) - - The order of execution of the operations is mirror, magnification, shear and rotation. - This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). - """ - def __add__(self, m: Matrix2d) -> Matrix2d: - r""" - @brief Sum of two matrices. - @param m The other matrix. - @return The (element-wise) sum of self+m - """ - def __copy__(self) -> Matrix2d: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Matrix2d: - r""" - @brief Creates a copy of self - """ - @overload - def __init__(self) -> None: - r""" - @brief Create a new Matrix2d representing a unit transformation - """ - @overload - def __init__(self, m: float) -> None: - r""" - @brief Create a new Matrix2d representing an isotropic magnification - @param m The magnification - """ - @overload - def __init__(self, t: DCplxTrans) -> None: - r""" - @brief Create a new Matrix2d from the given complex transformation@param t The transformation from which to create the matrix (not taking into account the displacement) - """ - @overload - def __init__(self, mx: float, my: float) -> None: - r""" - @brief Create a new Matrix2d representing an anisotropic magnification - @param mx The magnification in x direction - @param my The magnification in y direction - """ - @overload - def __init__(self, m11: float, m12: float, m21: float, m22: float) -> None: - r""" - @brief Create a new Matrix2d from the four coefficients - """ - @overload - def __mul__(self, box: DBox) -> DBox: - r""" - @brief Transforms a box with this matrix. - @param box The box to transform. - @return The transformed box - - Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. - """ - @overload - def __mul__(self, e: DEdge) -> DEdge: - r""" - @brief Transforms an edge with this matrix. - @param e The edge to transform. - @return The transformed edge - """ - @overload - def __mul__(self, m: Matrix2d) -> Matrix2d: - r""" - @brief Product of two matrices. - @param m The other matrix. - @return The matrix product self*m - """ - @overload - def __mul__(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - @overload - def __mul__(self, p: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon with this matrix. - @param p The polygon to transform. - @return The transformed polygon - """ - @overload - def __mul__(self, p: DSimplePolygon) -> DSimplePolygon: - r""" - @brief Transforms a simple polygon with this matrix. - @param p The simple polygon to transform. - @return The transformed simple polygon - """ - @overload - def __mul__(self, v: DVector) -> DVector: - r""" - @brief Transforms a vector with this matrix. - @param v The vector to transform. - @return The transformed vector - """ - @overload - def __rmul__(self, box: DBox) -> DBox: - r""" - @brief Transforms a box with this matrix. - @param box The box to transform. - @return The transformed box - - Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. - """ - @overload - def __rmul__(self, e: DEdge) -> DEdge: - r""" - @brief Transforms an edge with this matrix. - @param e The edge to transform. - @return The transformed edge - """ - @overload - def __rmul__(self, m: Matrix2d) -> Matrix2d: - r""" - @brief Product of two matrices. - @param m The other matrix. - @return The matrix product self*m - """ - @overload - def __rmul__(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - @overload - def __rmul__(self, p: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon with this matrix. - @param p The polygon to transform. - @return The transformed polygon - """ - @overload - def __rmul__(self, p: DSimplePolygon) -> DSimplePolygon: - r""" - @brief Transforms a simple polygon with this matrix. - @param p The simple polygon to transform. - @return The transformed simple polygon - """ - @overload - def __rmul__(self, v: DVector) -> DVector: - r""" - @brief Transforms a vector with this matrix. - @param v The vector to transform. - @return The transformed vector - """ - def __str__(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def angle(self) -> float: - r""" - @brief Returns the rotation angle of the rotation component of this matrix. - @return The angle in degree. - The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. - """ - def assign(self, other: Matrix2d) -> None: - r""" - @brief Assigns another object to self - """ - def cplx_trans(self) -> DCplxTrans: - r""" - @brief Converts this matrix to a complex transformation (if possible). - @return The complex transformation. - This method is successful only if the matrix does not contain shear components and the magnification must be isotropic. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> Matrix2d: - r""" - @brief Creates a copy of self - """ - def inverted(self) -> Matrix2d: - r""" - @brief The inverse of this matrix. - @return The inverse of this matrix - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_mirror(self) -> bool: - r""" - @brief Returns the mirror flag of this matrix. - @return True if this matrix has a mirror component. - The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. - """ - def m(self, i: int, j: int) -> float: - r""" - @brief Gets the m coefficient with the given index. - @return The coefficient [i,j] - """ - def m11(self) -> float: - r""" - @brief Gets the m11 coefficient. - @return The value of the m11 coefficient - """ - def m12(self) -> float: - r""" - @brief Gets the m12 coefficient. - @return The value of the m12 coefficient - """ - def m21(self) -> float: - r""" - @brief Gets the m21 coefficient. - @return The value of the m21 coefficient - """ - def m22(self) -> float: - r""" - @brief Gets the m22 coefficient. - @return The value of the m22 coefficient - """ - def mag_x(self) -> float: - r""" - @brief Returns the x magnification of the magnification component of this matrix. - @return The magnification factor. - The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation. - """ - def mag_y(self) -> float: - r""" - @brief Returns the y magnification of the magnification component of this matrix. - @return The magnification factor. - The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation. - """ - def shear_angle(self) -> float: - r""" - @brief Returns the magnitude of the shear component of this matrix. - @return The shear angle in degree. - The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. - The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree. - """ - def to_s(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ - def trans(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - -class IMatrix2d: - r""" - @brief A 2d matrix object used mainly for representing rotation and shear transformations (integer coordinate version). - - This object represents a 2x2 matrix. This matrix is used to implement affine transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation and shear. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification and shear. - - The integer variant was introduced in version 0.27. - """ - @overload - @classmethod - def new(cls) -> IMatrix2d: - r""" - @brief Create a new Matrix2d representing a unit transformation - """ - @overload - @classmethod - def new(cls, m: float) -> IMatrix2d: - r""" - @brief Create a new Matrix2d representing an isotropic magnification - @param m The magnification - """ - @overload - @classmethod - def new(cls, t: DCplxTrans) -> IMatrix2d: - r""" - @brief Create a new Matrix2d from the given complex transformation@param t The transformation from which to create the matrix (not taking into account the displacement) - """ - @overload - @classmethod - def new(cls, mx: float, my: float) -> IMatrix2d: - r""" - @brief Create a new Matrix2d representing an anisotropic magnification - @param mx The magnification in x direction - @param my The magnification in y direction - """ - @overload - @classmethod - def new(cls, m11: float, m12: float, m21: float, m22: float) -> IMatrix2d: - r""" - @brief Create a new Matrix2d from the four coefficients - """ - @overload - @classmethod - def newc(cls, mag: float, rotation: float, mirror: bool) -> IMatrix2d: - r""" - @brief Create a new Matrix2d representing an isotropic magnification, rotation and mirroring - @param mag The magnification in x direction - @param rotation The rotation angle (in degree) - @param mirror The mirror flag (at x axis) - - This constructor is provided to construct a matrix similar to the complex transformation. - This constructor is called 'newc' to distinguish it from the constructors taking matrix coefficients ('c' is for composite). - The order of execution of the operations is mirror, magnification, rotation (as for complex transformations). - """ - @overload - @classmethod - def newc(cls, shear: float, mx: float, my: float, rotation: float, mirror: bool) -> IMatrix2d: - r""" - @brief Create a new Matrix2d representing a shear, anisotropic magnification, rotation and mirroring - @param shear The shear angle - @param mx The magnification in x direction - @param my The magnification in y direction - @param rotation The rotation angle (in degree) - @param mirror The mirror flag (at x axis) - - The order of execution of the operations is mirror, magnification, shear and rotation. - This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). - """ - def __add__(self, m: IMatrix2d) -> IMatrix2d: - r""" - @brief Sum of two matrices. - @param m The other matrix. - @return The (element-wise) sum of self+m - """ - def __copy__(self) -> IMatrix2d: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> IMatrix2d: - r""" - @brief Creates a copy of self - """ - @overload - def __init__(self) -> None: - r""" - @brief Create a new Matrix2d representing a unit transformation - """ - @overload - def __init__(self, m: float) -> None: - r""" - @brief Create a new Matrix2d representing an isotropic magnification - @param m The magnification - """ - @overload - def __init__(self, t: DCplxTrans) -> None: - r""" - @brief Create a new Matrix2d from the given complex transformation@param t The transformation from which to create the matrix (not taking into account the displacement) - """ - @overload - def __init__(self, mx: float, my: float) -> None: - r""" - @brief Create a new Matrix2d representing an anisotropic magnification - @param mx The magnification in x direction - @param my The magnification in y direction - """ - @overload - def __init__(self, m11: float, m12: float, m21: float, m22: float) -> None: - r""" - @brief Create a new Matrix2d from the four coefficients - """ - @overload - def __mul__(self, box: Box) -> Box: - r""" - @brief Transforms a box with this matrix. - @param box The box to transform. - @return The transformed box - - Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. - """ - @overload - def __mul__(self, e: Edge) -> Edge: - r""" - @brief Transforms an edge with this matrix. - @param e The edge to transform. - @return The transformed edge - """ - @overload - def __mul__(self, m: IMatrix2d) -> IMatrix2d: - r""" - @brief Product of two matrices. - @param m The other matrix. - @return The matrix product self*m - """ - @overload - def __mul__(self, p: Point) -> Point: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - @overload - def __mul__(self, p: Polygon) -> Polygon: - r""" - @brief Transforms a polygon with this matrix. - @param p The polygon to transform. - @return The transformed polygon - """ - @overload - def __mul__(self, p: SimplePolygon) -> SimplePolygon: - r""" - @brief Transforms a simple polygon with this matrix. - @param p The simple polygon to transform. - @return The transformed simple polygon - """ - @overload - def __mul__(self, v: Vector) -> Vector: - r""" - @brief Transforms a vector with this matrix. - @param v The vector to transform. - @return The transformed vector - """ - @overload - def __rmul__(self, box: Box) -> Box: - r""" - @brief Transforms a box with this matrix. - @param box The box to transform. - @return The transformed box - - Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. - """ - @overload - def __rmul__(self, e: Edge) -> Edge: - r""" - @brief Transforms an edge with this matrix. - @param e The edge to transform. - @return The transformed edge - """ - @overload - def __rmul__(self, m: IMatrix2d) -> IMatrix2d: - r""" - @brief Product of two matrices. - @param m The other matrix. - @return The matrix product self*m - """ - @overload - def __rmul__(self, p: Point) -> Point: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - @overload - def __rmul__(self, p: Polygon) -> Polygon: - r""" - @brief Transforms a polygon with this matrix. - @param p The polygon to transform. - @return The transformed polygon - """ - @overload - def __rmul__(self, p: SimplePolygon) -> SimplePolygon: - r""" - @brief Transforms a simple polygon with this matrix. - @param p The simple polygon to transform. - @return The transformed simple polygon - """ - @overload - def __rmul__(self, v: Vector) -> Vector: - r""" - @brief Transforms a vector with this matrix. - @param v The vector to transform. - @return The transformed vector - """ - def __str__(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def angle(self) -> float: - r""" - @brief Returns the rotation angle of the rotation component of this matrix. - @return The angle in degree. - The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. - """ - def assign(self, other: IMatrix2d) -> None: - r""" - @brief Assigns another object to self - """ - def cplx_trans(self) -> ICplxTrans: - r""" - @brief Converts this matrix to a complex transformation (if possible). - @return The complex transformation. - This method is successful only if the matrix does not contain shear components and the magnification must be isotropic. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> IMatrix2d: - r""" - @brief Creates a copy of self - """ - def inverted(self) -> IMatrix2d: - r""" - @brief The inverse of this matrix. - @return The inverse of this matrix - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_mirror(self) -> bool: - r""" - @brief Returns the mirror flag of this matrix. - @return True if this matrix has a mirror component. - The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. - """ - def m(self, i: int, j: int) -> float: - r""" - @brief Gets the m coefficient with the given index. - @return The coefficient [i,j] - """ - def m11(self) -> float: - r""" - @brief Gets the m11 coefficient. - @return The value of the m11 coefficient - """ - def m12(self) -> float: - r""" - @brief Gets the m12 coefficient. - @return The value of the m12 coefficient - """ - def m21(self) -> float: - r""" - @brief Gets the m21 coefficient. - @return The value of the m21 coefficient - """ - def m22(self) -> float: - r""" - @brief Gets the m22 coefficient. - @return The value of the m22 coefficient - """ - def mag_x(self) -> float: - r""" - @brief Returns the x magnification of the magnification component of this matrix. - @return The magnification factor. - The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation. - """ - def mag_y(self) -> float: - r""" - @brief Returns the y magnification of the magnification component of this matrix. - @return The magnification factor. - The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation. - """ - def shear_angle(self) -> float: - r""" - @brief Returns the magnitude of the shear component of this matrix. - @return The shear angle in degree. - The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. - The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree. - """ - def to_s(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ - def trans(self, p: Point) -> Point: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - -class Matrix3d: - r""" - @brief A 3d matrix object used mainly for representing rotation, shear, displacement and perspective transformations. - - This object represents a 3x3 matrix. This matrix is used to implement generic geometrical transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation, shear, displacement and perspective distortion. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification, shear, displacement and perspective distortion. - - This class was introduced in version 0.22. - """ - AdjustAll: ClassVar[int] - r""" - @brief Mode for \adjust: currently equivalent to \adjust_perspective - """ - AdjustDisplacement: ClassVar[int] - r""" - @brief Mode for \adjust: adjust displacement only - """ - AdjustMagnification: ClassVar[int] - r""" - @brief Mode for \adjust: adjust rotation, mirror option and magnification - """ - AdjustNone: ClassVar[int] - r""" - @brief Mode for \adjust: adjust nothing - """ - AdjustPerspective: ClassVar[int] - r""" - @brief Mode for \adjust: adjust whole matrix including perspective transformation - """ - AdjustRotation: ClassVar[int] - r""" - @brief Mode for \adjust: adjust rotation only - """ - AdjustRotationMirror: ClassVar[int] - r""" - @brief Mode for \adjust: adjust rotation and mirror option - """ - AdjustShear: ClassVar[int] - r""" - @brief Mode for \adjust: adjust rotation, mirror option, magnification and shear - """ - @overload - @classmethod - def new(cls) -> Matrix3d: - r""" - @brief Create a new Matrix3d representing a unit transformation - """ - @overload - @classmethod - def new(cls, m: float) -> Matrix3d: - r""" - @brief Create a new Matrix3d representing a magnification - @param m The magnification - """ - @overload - @classmethod - def new(cls, t: DCplxTrans) -> Matrix3d: - r""" - @brief Create a new Matrix3d from the given complex transformation@param t The transformation from which to create the matrix - """ - @overload - @classmethod - def new(cls, m11: float, m12: float, m21: float, m22: float) -> Matrix3d: - r""" - @brief Create a new Matrix3d from the four coefficients of a Matrix2d - """ - @overload - @classmethod - def new(cls, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> Matrix3d: - r""" - @brief Create a new Matrix3d from the four coefficients of a Matrix2d plus a displacement - """ - @overload - @classmethod - def new(cls, m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> Matrix3d: - r""" - @brief Create a new Matrix3d from the nine matrix coefficients - """ - @overload - @classmethod - def newc(cls, mag: float, rotation: float, mirrx: bool) -> Matrix3d: - r""" - @brief Create a new Matrix3d representing a isotropic magnification, rotation and mirroring - @param mag The magnification - @param rotation The rotation angle (in degree) - @param mirrx The mirror flag (at x axis) - - The order of execution of the operations is mirror, magnification and rotation. - This constructor is called 'newc' to distinguish it from the constructors taking coefficients ('c' is for composite). - """ - @overload - @classmethod - def newc(cls, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> Matrix3d: - r""" - @brief Create a new Matrix3d representing a shear, anisotropic magnification, rotation and mirroring - @param shear The shear angle - @param mx The magnification in x direction - @param mx The magnification in y direction - @param rotation The rotation angle (in degree) - @param mirrx The mirror flag (at x axis) - - The order of execution of the operations is mirror, magnification, rotation and shear. - This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). - """ - @overload - @classmethod - def newc(cls, u: DVector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> Matrix3d: - r""" - @brief Create a new Matrix3d representing a displacement, shear, anisotropic magnification, rotation and mirroring - @param u The displacement - @param shear The shear angle - @param mx The magnification in x direction - @param mx The magnification in y direction - @param rotation The rotation angle (in degree) - @param mirrx The mirror flag (at x axis) - - The order of execution of the operations is mirror, magnification, rotation, shear and displacement. - This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). - - Starting with version 0.25 the displacement is of vector type. - """ - @overload - @classmethod - def newc(cls, tx: float, ty: float, z: float, u: DVector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> Matrix3d: - r""" - @brief Create a new Matrix3d representing a perspective distortion, displacement, shear, anisotropic magnification, rotation and mirroring - @param tx The perspective tilt angle x (around the y axis) - @param ty The perspective tilt angle y (around the x axis) - @param z The observer distance at which the tilt angles are given - @param u The displacement - @param shear The shear angle - @param mx The magnification in x direction - @param mx The magnification in y direction - @param rotation The rotation angle (in degree) - @param mirrx The mirror flag (at x axis) - - The order of execution of the operations is mirror, magnification, rotation, shear, perspective distortion and displacement. - This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). - - The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles for different observer distances. Hence, the observer distance must be given at which the tilt angles are given. If the magnitude of the tilt angle is not important, z can be set to 1. - - Starting with version 0.25 the displacement is of vector type. - """ - def __add__(self, m: Matrix3d) -> Matrix3d: - r""" - @brief Sum of two matrices. - @param m The other matrix. - @return The (element-wise) sum of self+m - """ - def __copy__(self) -> Matrix3d: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Matrix3d: - r""" - @brief Creates a copy of self - """ - @overload - def __init__(self) -> None: - r""" - @brief Create a new Matrix3d representing a unit transformation - """ - @overload - def __init__(self, m: float) -> None: - r""" - @brief Create a new Matrix3d representing a magnification - @param m The magnification - """ - @overload - def __init__(self, t: DCplxTrans) -> None: - r""" - @brief Create a new Matrix3d from the given complex transformation@param t The transformation from which to create the matrix - """ - @overload - def __init__(self, m11: float, m12: float, m21: float, m22: float) -> None: - r""" - @brief Create a new Matrix3d from the four coefficients of a Matrix2d - """ - @overload - def __init__(self, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> None: - r""" - @brief Create a new Matrix3d from the four coefficients of a Matrix2d plus a displacement - """ - @overload - def __init__(self, m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> None: - r""" - @brief Create a new Matrix3d from the nine matrix coefficients - """ - @overload - def __mul__(self, box: DBox) -> DBox: - r""" - @brief Transforms a box with this matrix. - @param box The box to transform. - @return The transformed box - - Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. - """ - @overload - def __mul__(self, e: DEdge) -> DEdge: - r""" - @brief Transforms an edge with this matrix. - @param e The edge to transform. - @return The transformed edge - """ - @overload - def __mul__(self, m: Matrix3d) -> Matrix3d: - r""" - @brief Product of two matrices. - @param m The other matrix. - @return The matrix product self*m - """ - @overload - def __mul__(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - @overload - def __mul__(self, p: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon with this matrix. - @param p The polygon to transform. - @return The transformed polygon - """ - @overload - def __mul__(self, p: DSimplePolygon) -> DSimplePolygon: - r""" - @brief Transforms a simple polygon with this matrix. - @param p The simple polygon to transform. - @return The transformed simple polygon - """ - @overload - def __mul__(self, v: DVector) -> DVector: - r""" - @brief Transforms a vector with this matrix. - @param v The vector to transform. - @return The transformed vector - """ - @overload - def __rmul__(self, box: DBox) -> DBox: - r""" - @brief Transforms a box with this matrix. - @param box The box to transform. - @return The transformed box - - Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. - """ - @overload - def __rmul__(self, e: DEdge) -> DEdge: - r""" - @brief Transforms an edge with this matrix. - @param e The edge to transform. - @return The transformed edge - """ - @overload - def __rmul__(self, m: Matrix3d) -> Matrix3d: - r""" - @brief Product of two matrices. - @param m The other matrix. - @return The matrix product self*m - """ - @overload - def __rmul__(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - @overload - def __rmul__(self, p: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon with this matrix. - @param p The polygon to transform. - @return The transformed polygon - """ - @overload - def __rmul__(self, p: DSimplePolygon) -> DSimplePolygon: - r""" - @brief Transforms a simple polygon with this matrix. - @param p The simple polygon to transform. - @return The transformed simple polygon - """ - @overload - def __rmul__(self, v: DVector) -> DVector: - r""" - @brief Transforms a vector with this matrix. - @param v The vector to transform. - @return The transformed vector - """ - def __str__(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def adjust(self, landmarks_before: Sequence[DPoint], landmarks_after: Sequence[DPoint], flags: int, fixed_point: int) -> None: - r""" - @brief Adjust a 3d matrix to match the given set of landmarks - - This function tries to adjust the matrix - such, that either the matrix is changed as little as possible (if few landmarks are given) - or that the "after" landmarks will match as close as possible to the "before" landmarks - (if the problem is overdetermined). - - @param landmarks_before The points before the transformation. - @param landmarks_after The points after the transformation. - @param mode Selects the adjustment mode. Must be one of the Adjust... constants. - @param fixed_point The index of the fixed point (one that is definitely mapped to the target) or -1 if there is none - """ - def angle(self) -> float: - r""" - @brief Returns the rotation angle of the rotation component of this matrix. - @return The angle in degree. - See the description of this class for details about the basic transformations. - """ - def assign(self, other: Matrix3d) -> None: - r""" - @brief Assigns another object to self - """ - def cplx_trans(self) -> DCplxTrans: - r""" - @brief Converts this matrix to a complex transformation (if possible). - @return The complex transformation. - This method is successful only if the matrix does not contain shear or perspective distortion components and the magnification must be isotropic. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def disp(self) -> DVector: - r""" - @brief Returns the displacement vector of this transformation. - - Starting with version 0.25 this method returns a vector type instead of a point. - @return The displacement vector. - """ - def dup(self) -> Matrix3d: - r""" - @brief Creates a copy of self - """ - def inverted(self) -> Matrix3d: - r""" - @brief The inverse of this matrix. - @return The inverse of this matrix - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_mirror(self) -> bool: - r""" - @brief Returns the mirror flag of this matrix. - @return True if this matrix has a mirror component. - See the description of this class for details about the basic transformations. - """ - def m(self, i: int, j: int) -> float: - r""" - @brief Gets the m coefficient with the given index. - @return The coefficient [i,j] - """ - def mag_x(self) -> float: - r""" - @brief Returns the x magnification of the magnification component of this matrix. - @return The magnification factor. - """ - def mag_y(self) -> float: - r""" - @brief Returns the y magnification of the magnification component of this matrix. - @return The magnification factor. - """ - def shear_angle(self) -> float: - r""" - @brief Returns the magnitude of the shear component of this matrix. - @return The shear angle in degree. - The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree.See the description of this class for details about the basic transformations. - """ - def to_s(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ - def trans(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - def tx(self, z: float) -> float: - r""" - @brief Returns the perspective tilt angle tx. - @param z The observer distance at which the tilt angle is computed. - @return The tilt angle tx. - The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1. - """ - def ty(self, z: float) -> float: - r""" - @brief Returns the perspective tilt angle ty. - @param z The observer distance at which the tilt angle is computed. - @return The tilt angle ty. - The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1. - """ - -class IMatrix3d: - r""" - @brief A 3d matrix object used mainly for representing rotation, shear, displacement and perspective transformations (integer coordinate version). - - This object represents a 3x3 matrix. This matrix is used to implement generic geometrical transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation, shear, displacement and perspective distortion. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification, shear, displacement and perspective distortion. - - The integer variant was introduced in version 0.27. - """ - @overload - @classmethod - def new(cls) -> IMatrix3d: - r""" - @brief Create a new Matrix3d representing a unit transformation - """ - @overload - @classmethod - def new(cls, m: float) -> IMatrix3d: - r""" - @brief Create a new Matrix3d representing a magnification - @param m The magnification - """ - @overload - @classmethod - def new(cls, t: ICplxTrans) -> IMatrix3d: - r""" - @brief Create a new Matrix3d from the given complex transformation@param t The transformation from which to create the matrix - """ - @overload - @classmethod - def new(cls, m11: float, m12: float, m21: float, m22: float) -> IMatrix3d: - r""" - @brief Create a new Matrix3d from the four coefficients of a Matrix2d - """ - @overload - @classmethod - def new(cls, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> IMatrix3d: - r""" - @brief Create a new Matrix3d from the four coefficients of a Matrix2d plus a displacement - """ - @overload - @classmethod - def new(cls, m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> IMatrix3d: - r""" - @brief Create a new Matrix3d from the nine matrix coefficients - """ - @overload - @classmethod - def newc(cls, mag: float, rotation: float, mirrx: bool) -> IMatrix3d: - r""" - @brief Create a new Matrix3d representing a isotropic magnification, rotation and mirroring - @param mag The magnification - @param rotation The rotation angle (in degree) - @param mirrx The mirror flag (at x axis) - - The order of execution of the operations is mirror, magnification and rotation. - This constructor is called 'newc' to distinguish it from the constructors taking coefficients ('c' is for composite). - """ - @overload - @classmethod - def newc(cls, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> IMatrix3d: - r""" - @brief Create a new Matrix3d representing a shear, anisotropic magnification, rotation and mirroring - @param shear The shear angle - @param mx The magnification in x direction - @param mx The magnification in y direction - @param rotation The rotation angle (in degree) - @param mirrx The mirror flag (at x axis) - - The order of execution of the operations is mirror, magnification, rotation and shear. - This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). - """ - @overload - @classmethod - def newc(cls, u: Vector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> IMatrix3d: - r""" - @brief Create a new Matrix3d representing a displacement, shear, anisotropic magnification, rotation and mirroring - @param u The displacement - @param shear The shear angle - @param mx The magnification in x direction - @param mx The magnification in y direction - @param rotation The rotation angle (in degree) - @param mirrx The mirror flag (at x axis) - - The order of execution of the operations is mirror, magnification, rotation, shear and displacement. - This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). - - Starting with version 0.25 the displacement is of vector type. - """ - @overload - @classmethod - def newc(cls, tx: float, ty: float, z: float, u: Vector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> IMatrix3d: - r""" - @brief Create a new Matrix3d representing a perspective distortion, displacement, shear, anisotropic magnification, rotation and mirroring - @param tx The perspective tilt angle x (around the y axis) - @param ty The perspective tilt angle y (around the x axis) - @param z The observer distance at which the tilt angles are given - @param u The displacement - @param shear The shear angle - @param mx The magnification in x direction - @param mx The magnification in y direction - @param rotation The rotation angle (in degree) - @param mirrx The mirror flag (at x axis) - - The order of execution of the operations is mirror, magnification, rotation, shear, perspective distortion and displacement. - This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). - - The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles for different observer distances. Hence, the observer distance must be given at which the tilt angles are given. If the magnitude of the tilt angle is not important, z can be set to 1. - - Starting with version 0.25 the displacement is of vector type. - """ - def __add__(self, m: IMatrix3d) -> IMatrix3d: - r""" - @brief Sum of two matrices. - @param m The other matrix. - @return The (element-wise) sum of self+m - """ - def __copy__(self) -> IMatrix3d: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> IMatrix3d: - r""" - @brief Creates a copy of self - """ - @overload - def __init__(self) -> None: - r""" - @brief Create a new Matrix3d representing a unit transformation - """ - @overload - def __init__(self, m: float) -> None: - r""" - @brief Create a new Matrix3d representing a magnification - @param m The magnification - """ - @overload - def __init__(self, t: ICplxTrans) -> None: - r""" - @brief Create a new Matrix3d from the given complex transformation@param t The transformation from which to create the matrix - """ - @overload - def __init__(self, m11: float, m12: float, m21: float, m22: float) -> None: - r""" - @brief Create a new Matrix3d from the four coefficients of a Matrix2d - """ - @overload - def __init__(self, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> None: - r""" - @brief Create a new Matrix3d from the four coefficients of a Matrix2d plus a displacement - """ - @overload - def __init__(self, m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> None: - r""" - @brief Create a new Matrix3d from the nine matrix coefficients - """ - @overload - def __mul__(self, box: Box) -> Box: - r""" - @brief Transforms a box with this matrix. - @param box The box to transform. - @return The transformed box - - Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. - """ - @overload - def __mul__(self, e: Edge) -> Edge: - r""" - @brief Transforms an edge with this matrix. - @param e The edge to transform. - @return The transformed edge - """ - @overload - def __mul__(self, m: IMatrix3d) -> IMatrix3d: - r""" - @brief Product of two matrices. - @param m The other matrix. - @return The matrix product self*m - """ - @overload - def __mul__(self, p: Point) -> Point: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - @overload - def __mul__(self, p: Polygon) -> Polygon: - r""" - @brief Transforms a polygon with this matrix. - @param p The polygon to transform. - @return The transformed polygon - """ - @overload - def __mul__(self, p: SimplePolygon) -> SimplePolygon: - r""" - @brief Transforms a simple polygon with this matrix. - @param p The simple polygon to transform. - @return The transformed simple polygon - """ - @overload - def __mul__(self, v: Vector) -> Vector: - r""" - @brief Transforms a vector with this matrix. - @param v The vector to transform. - @return The transformed vector - """ - @overload - def __rmul__(self, box: Box) -> Box: - r""" - @brief Transforms a box with this matrix. - @param box The box to transform. - @return The transformed box - - Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. - """ - @overload - def __rmul__(self, e: Edge) -> Edge: - r""" - @brief Transforms an edge with this matrix. - @param e The edge to transform. - @return The transformed edge - """ - @overload - def __rmul__(self, m: IMatrix3d) -> IMatrix3d: - r""" - @brief Product of two matrices. - @param m The other matrix. - @return The matrix product self*m - """ - @overload - def __rmul__(self, p: Point) -> Point: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - @overload - def __rmul__(self, p: Polygon) -> Polygon: - r""" - @brief Transforms a polygon with this matrix. - @param p The polygon to transform. - @return The transformed polygon - """ - @overload - def __rmul__(self, p: SimplePolygon) -> SimplePolygon: - r""" - @brief Transforms a simple polygon with this matrix. - @param p The simple polygon to transform. - @return The transformed simple polygon - """ - @overload - def __rmul__(self, v: Vector) -> Vector: - r""" - @brief Transforms a vector with this matrix. - @param v The vector to transform. - @return The transformed vector - """ - def __str__(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def angle(self) -> float: - r""" - @brief Returns the rotation angle of the rotation component of this matrix. - @return The angle in degree. - See the description of this class for details about the basic transformations. - """ - def assign(self, other: IMatrix3d) -> None: - r""" - @brief Assigns another object to self - """ - def cplx_trans(self) -> DCplxTrans: - r""" - @brief Converts this matrix to a complex transformation (if possible). - @return The complex transformation. - This method is successful only if the matrix does not contain shear or perspective distortion components and the magnification must be isotropic. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def disp(self) -> Vector: - r""" - @brief Returns the displacement vector of this transformation. - - Starting with version 0.25 this method returns a vector type instead of a point. - @return The displacement vector. - """ - def dup(self) -> IMatrix3d: - r""" - @brief Creates a copy of self - """ - def inverted(self) -> IMatrix3d: - r""" - @brief The inverse of this matrix. - @return The inverse of this matrix - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_mirror(self) -> bool: - r""" - @brief Returns the mirror flag of this matrix. - @return True if this matrix has a mirror component. - See the description of this class for details about the basic transformations. - """ - def m(self, i: int, j: int) -> float: - r""" - @brief Gets the m coefficient with the given index. - @return The coefficient [i,j] - """ - def mag_x(self) -> float: - r""" - @brief Returns the x magnification of the magnification component of this matrix. - @return The magnification factor. - """ - def mag_y(self) -> float: - r""" - @brief Returns the y magnification of the magnification component of this matrix. - @return The magnification factor. - """ - def shear_angle(self) -> float: - r""" - @brief Returns the magnitude of the shear component of this matrix. - @return The shear angle in degree. - The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree.See the description of this class for details about the basic transformations. - """ - def to_s(self) -> str: - r""" - @brief Convert the matrix to a string. - @return The string representing this matrix - """ - def trans(self, p: Point) -> Point: - r""" - @brief Transforms a point with this matrix. - @param p The point to transform. - @return The transformed point - """ - def tx(self, z: float) -> float: - r""" - @brief Returns the perspective tilt angle tx. - @param z The observer distance at which the tilt angle is computed. - @return The tilt angle tx. - The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1. - """ - def ty(self, z: float) -> float: - r""" - @brief Returns the perspective tilt angle ty. - @param z The observer distance at which the tilt angle is computed. - @return The tilt angle ty. - The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1. - """ - -class Path: - r""" - @brief A path class - - A path consists of an sequence of line segments forming the 'spine' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the 'begin extension') and the end point can be pulled forward somewhat (by the 'end extension'). - - A path may have round ends for special purposes. In particular, a round-ended path with a single point can represent a circle. Round-ended paths should have being and end extensions equal to half the width. Non-round-ended paths with a single point are allowed but the definition of the resulting shape in not well defined and may differ in other tools. - - See @The Database API@ for more details about the database objects. - """ - bgn_ext: int - r""" - Getter: - @brief Get the begin extension - - Setter: - @brief Set the begin extension - """ - end_ext: int - r""" - Getter: - @brief Get the end extension - - Setter: - @brief Set the end extension - """ - points: int - r""" - Getter: - @brief Get the number of points - Setter: - @brief Set the points of the path - @param p An array of points to assign to the path's spine - """ - round: bool - r""" - Getter: - @brief Returns true, if the path has round ends - - Setter: - @brief Set the 'round ends' flag - A path with round ends show half circles at the ends, instead of square or rectangular ends. Paths with this flag set should use a begin and end extension of half the width (see \bgn_ext and \end_ext). The interpretation of such paths in other tools may differ otherwise. - """ - width: int - r""" - Getter: - @brief Get the width - - Setter: - @brief Set the width - """ - @classmethod - def from_dpath(cls, dpath: DPath) -> Path: - r""" - @brief Creates an integer coordinate path from a floating-point coordinate path - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. - """ - @classmethod - def from_s(cls, s: str) -> Path: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - @overload - @classmethod - def new(cls) -> Path: - r""" - @brief Default constructor: creates an empty (invalid) path with width 0 - """ - @overload - @classmethod - def new(cls, dpath: DPath) -> Path: - r""" - @brief Creates an integer coordinate path from a floating-point coordinate path - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. - """ - @overload - @classmethod - def new(cls, pts: Sequence[Point], width: int) -> Path: - r""" - @brief Constructor given the points of the path's spine and the width - - - @param pts The points forming the spine of the path - @param width The width of the path - """ - @overload - @classmethod - def new(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> Path: - r""" - @brief Constructor given the points of the path's spine, the width and the extensions - - - @param pts The points forming the spine of the path - @param width The width of the path - @param bgn_ext The begin extension of the path - @param end_ext The end extension of the path - """ - @overload - @classmethod - def new(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> Path: - r""" - @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag - - - @param pts The points forming the spine of the path - @param width The width of the path - @param bgn_ext The begin extension of the path - @param end_ext The end extension of the path - @param round If this flag is true, the path will get rounded ends - """ - @classmethod - def new_pw(cls, pts: Sequence[Point], width: int) -> Path: - r""" - @brief Constructor given the points of the path's spine and the width - - - @param pts The points forming the spine of the path - @param width The width of the path - """ - @classmethod - def new_pwx(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> Path: - r""" - @brief Constructor given the points of the path's spine, the width and the extensions - - - @param pts The points forming the spine of the path - @param width The width of the path - @param bgn_ext The begin extension of the path - @param end_ext The end extension of the path - """ - @classmethod - def new_pwxr(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> Path: - r""" - @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag - - - @param pts The points forming the spine of the path - @param width The width of the path - @param bgn_ext The begin extension of the path - @param end_ext The end extension of the path - @param round If this flag is true, the path will get rounded ends - """ - def __copy__(self) -> Path: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Path: - r""" - @brief Creates a copy of self - """ - def __eq__(self, p: object) -> bool: - r""" - @brief Equality test - @param p The object to compare against - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates an empty (invalid) path with width 0 - """ - @overload - def __init__(self, dpath: DPath) -> None: - r""" - @brief Creates an integer coordinate path from a floating-point coordinate path - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. - """ - @overload - def __init__(self, pts: Sequence[Point], width: int) -> None: - r""" - @brief Constructor given the points of the path's spine and the width - - - @param pts The points forming the spine of the path - @param width The width of the path - """ - @overload - def __init__(self, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> None: - r""" - @brief Constructor given the points of the path's spine, the width and the extensions - - - @param pts The points forming the spine of the path - @param width The width of the path - @param bgn_ext The begin extension of the path - @param end_ext The end extension of the path - """ - @overload - def __init__(self, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> None: - r""" - @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag - - - @param pts The points forming the spine of the path - @param width The width of the path - @param bgn_ext The begin extension of the path - @param end_ext The end extension of the path - @param round If this flag is true, the path will get rounded ends - """ - def __lt__(self, p: Path) -> bool: - r""" - @brief Less operator - @param p The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order - """ - def __mul__(self, f: float) -> Path: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __ne__(self, p: object) -> bool: - r""" - @brief Inequality test - @param p The object to compare against - """ - def __rmul__(self, f: float) -> Path: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __str__(self) -> str: - r""" - @brief Convert to a string - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def area(self) -> int: - r""" - @brief Returns the approximate area of the path - This method returns the approximate value of the area. It is computed from the length times the width. end extensions are taken into account correctly, but not effects of the corner interpolation. - This method was added in version 0.22. - """ - def assign(self, other: Path) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> Box: - r""" - @brief Returns the bounding box of the path - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> Path: - r""" - @brief Creates a copy of self - """ - def each_point(self) -> Iterator[Point]: - r""" - @brief Get the points that make up the path's spine - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_round(self) -> bool: - r""" - @brief Returns true, if the path has round ends - """ - def length(self) -> int: - r""" - @brief Returns the length of the path - the length of the path is determined by summing the lengths of the segments and adding begin and end extensions. For round-ended paths the length of the paths between the tips of the ends. - - This method was added in version 0.23. - """ - @overload - def move(self, p: Vector) -> Path: - r""" - @brief Moves the path. - - Moves the path by the given offset and returns the - moved path. The path is overwritten. - - @param p The distance to move the path. - - @return The moved path. - """ - @overload - def move(self, dx: int, dy: int) -> Path: - r""" - @brief Moves the path. - - Moves the path by the given offset and returns the - moved path. The path is overwritten. - - @param dx The x distance to move the path. - @param dy The y distance to move the path. - - @return The moved path. - - This version has been added in version 0.23. - """ - @overload - def moved(self, p: Vector) -> Path: - r""" - @brief Returns the moved path (does not change self) - - Moves the path by the given offset and returns the - moved path. The path is not modified. - - @param p The distance to move the path. - - @return The moved path. - """ - @overload - def moved(self, dx: int, dy: int) -> Path: - r""" - @brief Returns the moved path (does not change self) - - Moves the path by the given offset and returns the - moved path. The path is not modified. - - @param dx The x distance to move the path. - @param dy The y distance to move the path. - - @return The moved path. - - This version has been added in version 0.23. - """ - def num_points(self) -> int: - r""" - @brief Get the number of points - """ - def perimeter(self) -> int: - r""" - @brief Returns the approximate perimeter of the path - This method returns the approximate value of the perimeter. It is computed from the length and the width. end extensions are taken into account correctly, but not effects of the corner interpolation. - This method was added in version 0.24.4. - """ - def polygon(self) -> Polygon: - r""" - @brief Convert the path to a polygon - The returned polygon is not guaranteed to be non-self overlapping. This may happen if the path overlaps itself or contains very short segments. - """ - def round_corners(self, radius: float, npoints: int) -> Path: - r""" - @brief Creates a new path whose corners are interpolated with circular bends - - @param radius The radius of the bends - @param npoints The number of points (per full circle) used for interpolating the bends - - This method has been introduced in version 0.25. - """ - def simple_polygon(self) -> SimplePolygon: - r""" - @brief Convert the path to a simple polygon - The returned polygon is not guaranteed to be non-selfoverlapping. This may happen if the path overlaps itself or contains very short segments. - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DPath: - r""" - @brief Converts the path to a floating-point coordinate path - - The database unit can be specified to translate the integer-coordinate path into a floating-point coordinate path in micron units. The database unit is basically a scaling factor. - - This method has been introduced in version 0.25. - """ - def to_s(self) -> str: - r""" - @brief Convert to a string - """ - @overload - def transformed(self, t: CplxTrans) -> DPath: - r""" - @brief Transform the path. - - Transforms the path with the given complex transformation. - Does not modify the path but returns the transformed path. - - @param t The transformation to apply. - - @return The transformed path. - """ - @overload - def transformed(self, t: ICplxTrans) -> Path: - r""" - @brief Transform the path. - - Transforms the path with the given complex transformation. - Does not modify the path but returns the transformed path. - - @param t The transformation to apply. - - @return The transformed path (in this case an integer coordinate path). - - This method has been introduced in version 0.18. - """ - @overload - def transformed(self, t: Trans) -> Path: - r""" - @brief Transform the path. - - Transforms the path with the given transformation. - Does not modify the path but returns the transformed path. - - @param t The transformation to apply. - - @return The transformed path. - """ - def transformed_cplx(self, t: CplxTrans) -> DPath: - r""" - @brief Transform the path. - - Transforms the path with the given complex transformation. - Does not modify the path but returns the transformed path. - - @param t The transformation to apply. - - @return The transformed path. - """ - class DPath: r""" @brief A path class @@ -19356,18 +9287,6 @@ class DPath: This method was added in version 0.23. """ @overload - def move(self, p: DVector) -> DPath: - r""" - @brief Moves the path. - - Moves the path by the given offset and returns the - moved path. The path is overwritten. - - @param p The distance to move the path. - - @return The moved path. - """ - @overload def move(self, dx: float, dy: float) -> DPath: r""" @brief Moves the path. @@ -19383,12 +9302,12 @@ class DPath: This version has been added in version 0.23. """ @overload - def moved(self, p: DVector) -> DPath: + def move(self, p: DVector) -> DPath: r""" - @brief Returns the moved path (does not change self) + @brief Moves the path. Moves the path by the given offset and returns the - moved path. The path is not modified. + moved path. The path is overwritten. @param p The distance to move the path. @@ -19409,6 +9328,18 @@ class DPath: This version has been added in version 0.23. """ + @overload + def moved(self, p: DVector) -> DPath: + r""" + @brief Returns the moved path (does not change self) + + Moves the path by the given offset and returns the + moved path. The path is not modified. + + @param p The distance to move the path. + + @return The moved path. + """ def num_points(self) -> int: r""" @brief Get the number of points @@ -19831,367 +9762,57 @@ class DPoint: This method returns a vector representing the distance from (0,0) to the point.This method has been introduced in version 0.25. """ -class Point: +class DPolygon: r""" - @brief An integer point class - Points represent a coordinate in the two-dimensional coordinate space of layout. They are not geometrical objects by itself. But they are frequently used in the database API for various purposes. + @brief A polygon class - See @The Database API@ for more details about the database objects. - """ - x: int - r""" - Getter: - @brief Accessor to the x coordinate - - Setter: - @brief Write accessor to the x coordinate - """ - y: int - r""" - Getter: - @brief Accessor to the y coordinate - - Setter: - @brief Write accessor to the y coordinate - """ - @classmethod - def from_dpoint(cls, dpoint: DPoint) -> Point: - r""" - @brief Creates an integer coordinate point from a floating-point coordinate point - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'. - """ - @classmethod - def from_s(cls, s: str) -> Point: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - @overload - @classmethod - def new(cls) -> Point: - r""" - @brief Default constructor: creates a point at 0,0 - """ - @overload - @classmethod - def new(cls, dpoint: DPoint) -> Point: - r""" - @brief Creates an integer coordinate point from a floating-point coordinate point - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'. - """ - @overload - @classmethod - def new(cls, v: Vector) -> Point: - r""" - @brief Default constructor: creates a point at from an vector - This constructor is equivalent to computing point(0,0)+v. - This method has been introduced in version 0.25. - """ - @overload - @classmethod - def new(cls, x: int, y: int) -> Point: - r""" - @brief Constructor for a point from two coordinate values - - """ - def __add__(self, v: Vector) -> Point: - r""" - @brief Adds a vector to a point - - - Adds vector v to self by adding the coordinates. - - Starting with version 0.25, this method expects a vector argument. - """ - def __copy__(self) -> Point: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Point: - r""" - @brief Creates a copy of self - """ - def __eq__(self, p: object) -> bool: - r""" - @brief Equality test operator - - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given point. This method enables points as hash keys. - - This method has been introduced in version 0.25. - """ - def __imul__(self, f: float) -> Point: - r""" - @brief Scaling by some factor - - - Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates a point at 0,0 - """ - @overload - def __init__(self, dpoint: DPoint) -> None: - r""" - @brief Creates an integer coordinate point from a floating-point coordinate point - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'. - """ - @overload - def __init__(self, v: Vector) -> None: - r""" - @brief Default constructor: creates a point at from an vector - This constructor is equivalent to computing point(0,0)+v. - This method has been introduced in version 0.25. - """ - @overload - def __init__(self, x: int, y: int) -> None: - r""" - @brief Constructor for a point from two coordinate values - - """ - def __itruediv__(self, d: float) -> Point: - r""" - @brief Division by some divisor - - - Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. - """ - def __lt__(self, p: Point) -> bool: - r""" - @brief "less" comparison operator - - - This operator is provided to establish a sorting - order - """ - def __mul__(self, f: float) -> Point: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __ne__(self, p: object) -> bool: - r""" - @brief Inequality test operator - - """ - def __neg__(self) -> Point: - r""" - @brief Compute the negative of a point - - - Returns a new point with -x, -y. - - This method has been added in version 0.23. - """ - def __rmul__(self, f: float) -> Point: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - def __str__(self, dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion. - If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - @overload - def __sub__(self, p: Point) -> Vector: - r""" - @brief Subtract one point from another - - - Subtract point p from self by subtracting the coordinates. This renders a vector. - - Starting with version 0.25, this method renders a vector. - """ - @overload - def __sub__(self, v: Vector) -> Point: - r""" - @brief Subtract one vector from a point - - - Subtract vector v from from self by subtracting the coordinates. This renders a point. - - This method has been added in version 0.27. - """ - def __truediv__(self, d: float) -> Point: - r""" - @brief Division by some divisor - - - Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def abs(self) -> float: - r""" - @brief The absolute value of the point (Euclidian distance to 0,0) - - The returned value is 'sqrt(x*x+y*y)'. - - This method has been introduced in version 0.23. - """ - def assign(self, other: Point) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def distance(self, d: Point) -> float: - r""" - @brief The Euclidian distance to another point - - - @param d The other point to compute the distance to. - """ - def dup(self) -> Point: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given point. This method enables points as hash keys. - - This method has been introduced in version 0.25. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def sq_abs(self) -> float: - r""" - @brief The square of the absolute value of the point (Euclidian distance to 0,0) - - The returned value is 'x*x+y*y'. - - This method has been introduced in version 0.23. - """ - def sq_distance(self, d: Point) -> float: - r""" - @brief The square Euclidian distance to another point - - - @param d The other point to compute the distance to. - """ - def to_dtype(self, dbu: Optional[float] = ...) -> DPoint: - r""" - @brief Converts the point to a floating-point coordinate point - - The database unit can be specified to translate the integer-coordinate point into a floating-point coordinate point in micron units. The database unit is basically a scaling factor. - - This method has been introduced in version 0.25. - """ - def to_s(self, dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion. - If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - def to_v(self) -> Vector: - r""" - @brief Turns the point into a vector - This method returns a vector representing the distance from (0,0) to the point.This method has been introduced in version 0.25. - """ - -class SimplePolygon: - r""" - @brief A simple polygon class - - A simple polygon consists of an outer hull only. To support polygons with holes, use \Polygon. - The hull contour consists of several points. The point + A polygon consists of an outer hull and zero to many + holes. Each contour consists of several points. The point list is normalized such that the leftmost, lowest point is the first one. The orientation is normalized such that - the orientation of the hull contour is clockwise. + the orientation of the hull contour is clockwise, while + the orientation of the holes is counterclockwise. - It is in no way checked that the contours are not overlapping + It is in no way checked that the contours are not overlapping. This must be ensured by the user of the object when filling the contours. - The \SimplePolygon class stores coordinates in integer format. A class that stores floating-point coordinates is \DSimplePolygon. + A polygon can be asked for the number of holes using the \holes method. \each_point_hull delivers the points of the hull contour. \each_point_hole delivers the points of a specific hole. \each_edge delivers the edges (point-to-point connections) of both hull and holes. \bbox delivers the bounding box, \area the area and \perimeter the perimeter of the polygon. + + Here's an example of how to create a polygon: + + @code + hull = [ RBA::DPoint::new(0, 0), RBA::DPoint::new(6000, 0), + RBA::DPoint::new(6000, 3000), RBA::DPoint::new(0, 3000) ] + hole1 = [ RBA::DPoint::new(1000, 1000), RBA::DPoint::new(2000, 1000), + RBA::DPoint::new(2000, 2000), RBA::DPoint::new(1000, 2000) ] + hole2 = [ RBA::DPoint::new(3000, 1000), RBA::DPoint::new(4000, 1000), + RBA::DPoint::new(4000, 2000), RBA::DPoint::new(3000, 2000) ] + poly = RBA::DPolygon::new(hull) + poly.insert_hole(hole1) + poly.insert_hole(hole2) + + # ask the polygon for some properties + poly.holes # -> 2 + poly.area # -> 16000000.0 + poly.perimeter # -> 26000.0 + poly.bbox # -> (0,0;6000,3000) + @/code + + The \DPolygon class stores coordinates in floating-point format which gives a higher precision for some operations. A class that stores integer coordinates is \Polygon. See @The Database API@ for more details about the database objects. """ @property - def points(self) -> None: + def hull(self) -> None: r""" WARNING: This variable can only be set, not retrieved. - @brief Sets the points of the simple polygon - - @param pts An array of points to assign to the simple polygon - - See the constructor description for details about raw mode. + @brief Sets the points of the hull of polygon + @param p An array of points to assign to the polygon's hull + The 'assign_hull' variant is provided in analogy to 'assign_hole'. """ @classmethod - def ellipse(cls, box: Box, n: int) -> SimplePolygon: + def ellipse(cls, box: DBox, n: int) -> DPolygon: r""" @brief Creates a simple polygon approximating an ellipse @@ -20201,68 +9822,72 @@ class SimplePolygon: This method has been introduced in version 0.23. """ @classmethod - def from_dpoly(cls, dpolygon: DSimplePolygon) -> SimplePolygon: + def from_ipoly(cls, polygon: Polygon) -> DPolygon: r""" - @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + @brief Creates a floating-point coordinate polygon from an integer coordinate polygon - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'. """ @classmethod - def from_s(cls, s: str) -> SimplePolygon: + def from_s(cls, s: str) -> DPolygon: r""" - @brief Creates an object from a string + @brief Creates a polygon from a string Creates the object from a string representation (as returned by \to_s) This method has been added in version 0.23. """ @overload @classmethod - def new(cls) -> SimplePolygon: + def new(cls) -> DPolygon: r""" - @brief Default constructor: creates an empty (invalid) polygon + @brief Creates an empty (invalid) polygon """ @overload @classmethod - def new(cls, box: Box) -> SimplePolygon: + def new(cls, box: DBox) -> DPolygon: r""" - @brief Constructor converting a box to a polygon + @brief Creates a polygon from a box @param box The box to convert to a polygon """ @overload @classmethod - def new(cls, dpolygon: DSimplePolygon) -> SimplePolygon: + def new(cls, polygon: Polygon) -> DPolygon: r""" - @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + @brief Creates a floating-point coordinate polygon from an integer coordinate polygon - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'. """ @overload @classmethod - def new(cls, pts: Sequence[Point], raw: Optional[bool] = ...) -> SimplePolygon: + def new(cls, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> DPolygon: r""" - @brief Constructor given the points of the simple polygon + @brief Creates a polygon from a point array for the hull - @param pts The points forming the simple polygon - @param raw If true, the points are taken as they are (see below) + @param pts The points forming the polygon hull + @param raw If true, the point list won't be modified (see \assign_hull) - If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. - - Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. - - The 'raw' argument has been added in version 0.24. + The 'raw' argument was added in version 0.24. """ - def __copy__(self) -> SimplePolygon: + @overload + @classmethod + def new(cls, sp: DSimplePolygon) -> DPolygon: + r""" + @brief Creates a polygon from a simple polygon + @param sp The simple polygon that is converted into the polygon + This method was introduced in version 0.22. + """ + def __copy__(self) -> DPolygon: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> SimplePolygon: + def __deepcopy__(self) -> DPolygon: r""" @brief Creates a copy of self """ def __eq__(self, p: object) -> bool: r""" - @brief Returns a value indicating whether self is equal to p + @brief Returns a value indicating whether the polygons are equal @param p The object to compare against """ def __hash__(self) -> int: @@ -20275,45 +9900,46 @@ class SimplePolygon: @overload def __init__(self) -> None: r""" - @brief Default constructor: creates an empty (invalid) polygon + @brief Creates an empty (invalid) polygon """ @overload - def __init__(self, box: Box) -> None: + def __init__(self, box: DBox) -> None: r""" - @brief Constructor converting a box to a polygon + @brief Creates a polygon from a box @param box The box to convert to a polygon """ @overload - def __init__(self, dpolygon: DSimplePolygon) -> None: + def __init__(self, polygon: Polygon) -> None: r""" - @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + @brief Creates a floating-point coordinate polygon from an integer coordinate polygon - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'. """ @overload - def __init__(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: + def __init__(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: r""" - @brief Constructor given the points of the simple polygon + @brief Creates a polygon from a point array for the hull - @param pts The points forming the simple polygon - @param raw If true, the points are taken as they are (see below) + @param pts The points forming the polygon hull + @param raw If true, the point list won't be modified (see \assign_hull) - If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. - - Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. - - The 'raw' argument has been added in version 0.24. + The 'raw' argument was added in version 0.24. """ - def __lt__(self, p: SimplePolygon) -> bool: + @overload + def __init__(self, sp: DSimplePolygon) -> None: + r""" + @brief Creates a polygon from a simple polygon + @param sp The simple polygon that is converted into the polygon + This method was introduced in version 0.22. + """ + def __lt__(self, p: DPolygon) -> bool: r""" @brief Returns a value indicating whether self is less than p @param p The object to compare against This operator is provided to establish some, not necessarily a certain sorting order - - This method has been introduced in version 0.25. """ - def __mul__(self, f: float) -> SimplePolygon: + def __mul__(self, f: float) -> DPolygon: r""" @brief Scales the polygon by some factor @@ -20321,10 +9947,10 @@ class SimplePolygon: """ def __ne__(self, p: object) -> bool: r""" - @brief Returns a value indicating whether self is not equal to p + @brief Returns a value indicating whether the polygons are not equal @param p The object to compare against """ - def __rmul__(self, f: float) -> SimplePolygon: + def __rmul__(self, f: float) -> DPolygon: r""" @brief Scales the polygon by some factor @@ -20371,29 +9997,65 @@ class SimplePolygon: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def area(self) -> int: + def area(self) -> float: r""" @brief Gets the area of the polygon - The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise. + The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise.Orientation is ensured automatically in most cases. """ - def area2(self) -> int: + def area2(self) -> float: r""" @brief Gets the double area of the polygon This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. This method has been introduced in version 0.26.1 """ - def assign(self, other: SimplePolygon) -> None: + def assign(self, other: DPolygon) -> None: r""" @brief Assigns another object to self """ - def bbox(self) -> Box: + @overload + def assign_hole(self, n: int, b: DBox) -> None: r""" - @brief Returns the bounding box of the simple polygon + @brief Sets the box as the given hole of the polygon + @param n The index of the hole to which the points should be assigned + @param b The box to assign to the polygon's hole + If the hole index is not valid, this method does nothing. + This method was introduced in version 0.23. + """ + @overload + def assign_hole(self, n: int, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: + r""" + @brief Sets the points of the given hole of the polygon + @param n The index of the hole to which the points should be assigned + @param p An array of points to assign to the polygon's hole + @param raw If true, the points won't be compressed (see \assign_hull) + If the hole index is not valid, this method does nothing. + + This method was introduced in version 0.18. + The 'raw' argument was added in version 0.24. + """ + def assign_hull(self, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: + r""" + @brief Sets the points of the hull of polygon + @param p An array of points to assign to the polygon's hull + @param raw If true, the points won't be compressed + + If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. + + Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. + + The 'assign_hull' variant is provided in analogy to 'assign_hole'. + + The 'raw' argument was added in version 0.24. + """ + def bbox(self) -> DBox: + r""" + @brief Returns the bounding box of the polygon + The bounding box is the box enclosing all points of the polygon. """ def compress(self, remove_reflected: bool) -> None: r""" - @brief Compressed the simple polygon. + @brief Compresses the polygon. This method removes redundant points from the polygon, such as points being on a line formed by two other points. If remove_reflected is true, points are also removed if the two adjacent edges form a spike. @@ -20419,17 +10081,37 @@ class SimplePolygon: 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. """ - def dup(self) -> SimplePolygon: + def dup(self) -> DPolygon: r""" @brief Creates a copy of self """ - def each_edge(self) -> Iterator[Edge]: + @overload + def each_edge(self) -> Iterator[DEdge]: r""" - @brief Iterates over the edges that make up the simple polygon + @brief Iterates over the edges that make up the polygon + + This iterator will deliver all edges, including those of the holes. Hole edges are oriented counterclockwise while hull edges are oriented clockwise. """ - def each_point(self) -> Iterator[Point]: + @overload + def each_edge(self, contour: int) -> Iterator[DEdge]: r""" - @brief Iterates over the points that make up the simple polygon + @brief Iterates over the edges of one contour of the polygon + + @param contour The contour number (0 for hull, 1 for first hole ...) + + This iterator will deliver all edges of the contour specified by the contour parameter. The hull has contour number 0, the first hole has contour 1 etc. + Hole edges are oriented counterclockwise while hull edges are oriented clockwise. + + This method was introduced in version 0.24. + """ + def each_point_hole(self, n: int) -> Iterator[DPoint]: + r""" + @brief Iterates over the points that make up the nth hole + The hole number must be less than the number of holes (see \holes) + """ + def each_point_hull(self) -> Iterator[DPoint]: + r""" + @brief Iterates over the points that make up the hull """ def extract_rad(self) -> List[Any]: r""" @@ -20462,14 +10144,34 @@ class SimplePolygon: This method has been introduced in version 0.25. """ - def inside(self, p: Point) -> bool: + def holes(self) -> int: r""" - @brief Gets a value indicating whether the given point is inside the polygon - If the given point is inside or on the edge the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. + @brief Returns the number of holes + """ + @overload + def insert_hole(self, b: DBox) -> None: + r""" + @brief Inserts a hole from the given box + @param b The box to insert as a new hole + This method was introduced in version 0.23. + """ + @overload + def insert_hole(self, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: + r""" + @brief Inserts a hole with the given points + @param p An array of points to insert as a new hole + @param raw If true, the points won't be compressed (see \assign_hull) + + The 'raw' argument was added in version 0.24. + """ + def inside(self, p: DPoint) -> bool: + r""" + @brief Tests, if the given point is inside the polygon + If the given point is inside or on the edge of the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. """ def is_box(self) -> bool: r""" - @brief Returns a value indicating whether the polygon is a simple box. + @brief Returns true, if the polygon is a simple box. A polygon is a box if it is identical to it's bounding box. @@ -20499,115 +10201,21 @@ class SimplePolygon: @brief Returns a value indicating whether the polygon is rectilinear """ @overload - def minkowski_sum(self, b: Box, resolve_holes: bool) -> Polygon: + def move(self, p: DVector) -> DPolygon: r""" - @brief Computes the Minkowski sum of a polygon and a box + @brief Moves the polygon. - @param b The box. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + Moves the polygon by the given offset and returns the + moved polygon. The polygon is overwritten. - @return The new polygon representing the Minkowski sum of self and b. + @param p The distance to move the polygon. - This method was introduced in version 0.22. + @return The moved polygon (self). + + This method has been introduced in version 0.23. """ @overload - def minkowski_sum(self, c: Sequence[Point], resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and a contour of points (a trace) - - @param c The contour (a series of points forming the trace). - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and c. - - This method was introduced in version 0.22. - """ - @overload - def minkowski_sum(self, e: Edge, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and an edge - - @param e The edge. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and e. - - This method was introduced in version 0.22. - """ - @overload - def minkowski_sum(self, p: SimplePolygon, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and a polygon - - @param p The other polygon. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and p. - - This method was introduced in version 0.22. - """ - @overload - def minkowsky_sum(self, b: Box, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and a box - - @param b The box. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and b. - - This method was introduced in version 0.22. - """ - @overload - def minkowsky_sum(self, c: Sequence[Point], resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and a contour of points (a trace) - - @param c The contour (a series of points forming the trace). - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and c. - - This method was introduced in version 0.22. - """ - @overload - def minkowsky_sum(self, e: Edge, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and an edge - - @param e The edge. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and e. - - This method was introduced in version 0.22. - """ - @overload - def minkowsky_sum(self, p: SimplePolygon, resolve_holes: bool) -> Polygon: - r""" - @brief Computes the Minkowski sum of a polygon and a polygon - - @param p The other polygon. - @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. - - @return The new polygon representing the Minkowski sum of self and p. - - This method was introduced in version 0.22. - """ - @overload - def move(self, p: Vector) -> SimplePolygon: - r""" - @brief Moves the simple polygon. - - Moves the simple polygon by the given offset and returns the - moved simple polygon. The polygon is overwritten. - - @param p The distance to move the simple polygon. - - @return The moved simple polygon. - """ - @overload - def move(self, x: int, y: int) -> SimplePolygon: + def move(self, x: float, y: float) -> DPolygon: r""" @brief Moves the polygon. @@ -20620,19 +10228,21 @@ class SimplePolygon: @return The moved polygon (self). """ @overload - def moved(self, p: Vector) -> SimplePolygon: + def moved(self, p: DVector) -> DPolygon: r""" - @brief Returns the moved simple polygon + @brief Returns the moved polygon (does not modify self) - Moves the simple polygon by the given offset and returns the - moved simple polygon. The polygon is not modified. + Moves the polygon by the given offset and returns the + moved polygon. The polygon is not modified. - @param p The distance to move the simple polygon. + @param p The distance to move the polygon. - @return The moved simple polygon. + @return The moved polygon. + + This method has been introduced in version 0.23. """ @overload - def moved(self, x: int, y: int) -> SimplePolygon: + def moved(self, x: float, y: float) -> DPolygon: r""" @brief Returns the moved polygon (does not modify self) @@ -20648,20 +10258,41 @@ class SimplePolygon: """ def num_points(self) -> int: r""" - @brief Gets the number of points + @brief Gets the total number of points (hull plus holes) + This method was introduced in version 0.18. """ - def perimeter(self) -> int: + def num_points_hole(self, n: int) -> int: + r""" + @brief Gets the number of points of the given hole + The argument gives the index of the hole of which the number of points are requested. The index must be less than the number of holes (see \holes). + """ + def num_points_hull(self) -> int: + r""" + @brief Gets the number of points of the hull + """ + def perimeter(self) -> float: r""" @brief Gets the perimeter of the polygon The perimeter is sum of the lengths of all edges making up the polygon. + + This method has been introduce in version 0.23. """ - def point(self, p: int) -> Point: + def point_hole(self, n: int, p: int) -> DPoint: r""" - @brief Gets a specific point of the contour@param p The index of the point to get + @brief Gets a specific point of a hole + @param n The index of the hole to which the points should be assigned + @param p The index of the point to get + If the index of the point or of the hole is not valid, a default value is returned. + This method was introduced in version 0.18. + """ + def point_hull(self, p: int) -> DPoint: + r""" + @brief Gets a specific point of the hull + @param p The index of the point to get If the index of the point is not a valid index, a default value is returned. This method was introduced in version 0.18. """ - def round_corners(self, rinner: float, router: float, n: int) -> SimplePolygon: + def round_corners(self, rinner: float, router: float, n: int) -> DPolygon: r""" @brief Rounds the corners of the polygon @@ -20673,20 +10304,100 @@ class SimplePolygon: @return The new polygon. - This method was introduced in version 0.22 for integer coordinates and in 0.25 for all coordinate types. + This method was introduced in version 0.20 for integer coordinates and in 0.25 for all coordinate types. """ - def set_points(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: + @overload + def size(self, d: float, mode: Optional[int] = ...) -> None: r""" - @brief Sets the points of the simple polygon + @brief Sizes the polygon (biasing) - @param pts An array of points to assign to the simple polygon - @param raw If true, the points are taken as they are + Shifts the contour outwards (d>0) or inwards (d<0). + This method is equivalent to + @code + size(d, d, mode) + @/code - See the constructor description for details about raw mode. + See \size for a detailed description. - This method has been added in version 0.24. + This method has been introduced in version 0.23. """ - def split(self) -> List[SimplePolygon]: + @overload + def size(self, dv: Vector, mode: Optional[int] = ...) -> None: + r""" + @brief Sizes the polygon (biasing) + + This method is equivalent to + @code + size(dv.x, dv.y, mode) + @/code + + See \size for a detailed description. + + This version has been introduced in version 0.28. + """ + @overload + def size(self, dx: float, dy: float, mode: int) -> None: + r""" + @brief Sizes the polygon (biasing) + + Shifts the contour outwards (dx,dy>0) or inwards (dx,dy<0). + dx is the sizing in x-direction and dy is the sizing in y-direction. The sign of dx and dy should be identical. + The sizing operation create invalid (self-overlapping, reverse oriented) contours. + + The mode defines at which bending angle cutoff occurs + (0:>0, 1:>45, 2:>90, 3:>135, 4:>approx. 168, other:>approx. 179) + + In order to obtain a proper polygon in the general case, the + sized polygon must be merged in 'greater than zero' wrap count mode. This is necessary since in the general case, + sizing can be complicated operation which lets a single polygon fall apart into disjoint pieces for example. + This can be achieved using the \EdgeProcessor class for example: + + @code + poly = ... # a RBA::Polygon + poly.size(-50, 2) + ep = RBA::EdgeProcessor::new + # result is an array of RBA::Polygon objects + result = ep.simple_merge_p2p([ poly ], false, false, 1) + @/code + """ + @overload + def sized(self, d: float, mode: Optional[int] = ...) -> DPolygon: + r""" + @brief Sizes the polygon (biasing) without modifying self + + Shifts the contour outwards (d>0) or inwards (d<0). + This method is equivalent to + @code + sized(d, d, mode) + @/code + + See \size and \sized for a detailed description. + """ + @overload + def sized(self, dv: Vector, mode: Optional[int] = ...) -> DPolygon: + r""" + @brief Sizes the polygon (biasing) without modifying self + + This method is equivalent to + @code + sized(dv.x, dv.y, mode) + @/code + + See \size and \sized for a detailed description. + + This version has been introduced in version 0.28. + """ + @overload + def sized(self, dx: float, dy: float, mode: int) -> DPolygon: + r""" + @brief Sizes the polygon (biasing) without modifying self + + This method applies sizing to the polygon but does not modify self. Instead a sized copy is returned. + See \size for a description of the operation. + + This method has been introduced in version 0.23. + """ + def split(self) -> List[DPolygon]: r""" @brief Splits the polygon into two or more parts This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. @@ -20695,11 +10406,11 @@ class SimplePolygon: This method has been introduced in version 0.25.3. """ - def to_dtype(self, dbu: Optional[float] = ...) -> DSimplePolygon: + def to_itype(self, dbu: Optional[float] = ...) -> Polygon: r""" - @brief Converts the polygon to a floating-point coordinate polygon + @brief Converts the polygon to an integer coordinate polygon - The database unit can be specified to translate the integer-coordinate polygon into a floating-point coordinate polygon in micron units. The database unit is basically a scaling factor. + The database unit can be specified to translate the floating-point coordinate polygon in micron units to an integer-coordinate polygon in database units. The polygons coordinates will be divided by the database unit. This method has been introduced in version 0.25. """ @@ -20708,7 +10419,7 @@ class SimplePolygon: @brief Returns a string representing the polygon """ @overload - def touches(self, box: Box) -> bool: + def touches(self, box: DBox) -> bool: r""" @brief Returns true, if the polygon touches the given box. The box and the polygon touch if they overlap or their contours share at least one point. @@ -20716,7 +10427,7 @@ class SimplePolygon: This method was introduced in version 0.25.1. """ @overload - def touches(self, edge: Edge) -> bool: + def touches(self, edge: DEdge) -> bool: r""" @brief Returns true, if the polygon touches the given edge. The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. @@ -20724,7 +10435,7 @@ class SimplePolygon: This method was introduced in version 0.25.1. """ @overload - def touches(self, polygon: Polygon) -> bool: + def touches(self, polygon: DPolygon) -> bool: r""" @brief Returns true, if the polygon touches the other polygon. The polygons touch if they overlap or their contours share at least one point. @@ -20732,7 +10443,7 @@ class SimplePolygon: This method was introduced in version 0.25.1. """ @overload - def touches(self, simple_polygon: SimplePolygon) -> bool: + def touches(self, simple_polygon: DSimplePolygon) -> bool: r""" @brief Returns true, if the polygon touches the other polygon. The polygons touch if they overlap or their contours share at least one point. @@ -20740,11 +10451,11 @@ class SimplePolygon: This method was introduced in version 0.25.1. """ @overload - def transform(self, t: ICplxTrans) -> SimplePolygon: + def transform(self, t: DCplxTrans) -> DPolygon: r""" - @brief Transforms the simple polygon with a complex transformation (in-place) + @brief Transforms the polygon with a complex transformation (in-place) - Transforms the simple polygon with the given complex transformation. + Transforms the polygon with the given complex transformation. Modifies self and returns self. An out-of-place version which does not modify self is \transformed. @param t The transformation to apply. @@ -20752,11 +10463,11 @@ class SimplePolygon: This method has been introduced in version 0.24. """ @overload - def transform(self, t: Trans) -> SimplePolygon: + def transform(self, t: DTrans) -> DPolygon: r""" - @brief Transforms the simple polygon (in-place) + @brief Transforms the polygon (in-place) - Transforms the simple polygon with the given transformation. + Transforms the polygon with the given transformation. Modifies self and returns self. An out-of-place version which does not modify self is \transformed. @param t The transformation to apply. @@ -20764,55 +10475,52 @@ class SimplePolygon: This method has been introduced in version 0.24. """ @overload - def transformed(self, t: CplxTrans) -> DSimplePolygon: + def transformed(self, t: DCplxTrans) -> DPolygon: r""" - @brief Transforms the simple polygon. + @brief Transforms the polygon with a complex transformation - Transforms the simple polygon with the given complex transformation. - Does not modify the simple polygon but returns the transformed polygon. + Transforms the polygon with the given complex transformation. + Does not modify the polygon but returns the transformed polygon. @param t The transformation to apply. - @return The transformed simple polygon. + @return The transformed polygon. With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. """ @overload - def transformed(self, t: ICplxTrans) -> SimplePolygon: + def transformed(self, t: DTrans) -> DPolygon: r""" - @brief Transforms the simple polygon. + @brief Transforms the polygon - Transforms the simple polygon with the given complex transformation. - Does not modify the simple polygon but returns the transformed polygon. + Transforms the polygon with the given transformation. + Does not modify the polygon but returns the transformed polygon. @param t The transformation to apply. - @return The transformed simple polygon (in this case an integer coordinate object). - - This method has been introduced in version 0.18. + @return The transformed polygon. """ @overload - def transformed(self, t: Trans) -> SimplePolygon: + def transformed(self, t: VCplxTrans) -> Polygon: r""" - @brief Transforms the simple polygon. + @brief Transforms the polygon with the given complex transformation - Transforms the simple polygon with the given transformation. - Does not modify the simple polygon but returns the transformed polygon. - @param t The transformation to apply. + @param t The magnifying transformation to apply + @return The transformed polygon (in this case an integer coordinate polygon) - @return The transformed simple polygon. + This method has been introduced in version 0.25. """ - def transformed_cplx(self, t: CplxTrans) -> DSimplePolygon: + def transformed_cplx(self, t: DCplxTrans) -> DPolygon: r""" - @brief Transforms the simple polygon. + @brief Transforms the polygon with a complex transformation - Transforms the simple polygon with the given complex transformation. - Does not modify the simple polygon but returns the transformed polygon. + Transforms the polygon with the given complex transformation. + Does not modify the polygon but returns the transformed polygon. @param t The transformation to apply. - @return The transformed simple polygon. + @return The transformed polygon. With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. """ @@ -21368,6 +11076,26381 @@ class DSimplePolygon: With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. """ +class DText: + r""" + @brief A text object + + A text object has a point (location), a text, a text transformation, + a text size and a font id. Text size and font id are provided to be + be able to render the text correctly. + Text objects are used as labels (i.e. for pins) or to indicate a particular position. + + The \DText class uses floating-point coordinates. A class that operates with integer coordinates is \Text. + + See @The Database API@ for more details about the database objects. + """ + HAlignCenter: ClassVar[HAlign] + r""" + @brief Centered horizontal alignment + """ + HAlignLeft: ClassVar[HAlign] + r""" + @brief Left horizontal alignment + """ + HAlignRight: ClassVar[HAlign] + r""" + @brief Right horizontal alignment + """ + NoHAlign: ClassVar[HAlign] + r""" + @brief Undefined horizontal alignment + """ + NoVAlign: ClassVar[VAlign] + r""" + @brief Undefined vertical alignment + """ + VAlignBottom: ClassVar[VAlign] + r""" + @brief Bottom vertical alignment + """ + VAlignCenter: ClassVar[VAlign] + r""" + @brief Centered vertical alignment + """ + VAlignTop: ClassVar[VAlign] + r""" + @brief Top vertical alignment + """ + font: int + r""" + Getter: + @brief Gets the font number + See \font= for a description of this property. + Setter: + @brief Sets the font number + The font number does not play a role for KLayout. This property is provided for compatibility with other systems which allow using different fonts for the text objects. + """ + halign: HAlign + r""" + Getter: + @brief Gets the horizontal alignment + + See \halign= for a description of this property. + + Setter: + @brief Sets the horizontal alignment + + This property specifies how the text is aligned relative to the anchor point. + This property has been introduced in version 0.22 and extended to enums in 0.28. + """ + size: float + r""" + Getter: + @brief Gets the text height + + Setter: + @brief Sets the text height of this object + """ + string: str + r""" + Getter: + @brief Get the text string + + Setter: + @brief Assign a text string to this object + """ + trans: DTrans + r""" + Getter: + @brief Gets the transformation + + Setter: + @brief Assign a transformation (text position and orientation) to this object + """ + valign: VAlign + r""" + Getter: + @brief Gets the vertical alignment + + See \valign= for a description of this property. + + Setter: + @brief Sets the vertical alignment + + This is the version accepting integer values. It's provided for backward compatibility. + """ + x: float + r""" + Getter: + @brief Gets the x location of the text + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the x location of the text + + This method has been introduced in version 0.23. + """ + y: float + r""" + Getter: + @brief Gets the y location of the text + + This method has been introduced in version 0.23. + + Setter: + @brief Sets the y location of the text + + This method has been introduced in version 0.23. + """ + @classmethod + def from_s(cls, s: str) -> DText: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DText: + r""" + @brief Default constructor + + Creates a text with unit transformation and empty text. + """ + @overload + @classmethod + def new(cls, Text: Text) -> DText: + r""" + @brief Creates a floating-point coordinate text from an integer coordinate text + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itext'. + """ + @overload + @classmethod + def new(cls, string: str, trans: DTrans) -> DText: + r""" + @brief Constructor with string and transformation + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. + """ + @overload + @classmethod + def new(cls, string: str, trans: DTrans, height: float, font: int) -> DText: + r""" + @brief Constructor with string, transformation, text height and font + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. + """ + @overload + @classmethod + def new(cls, string: str, x: float, y: float) -> DText: + r""" + @brief Constructor with string and location + + + A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. + + This method has been introduced in version 0.23. + """ + def __copy__(self) -> DText: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DText: + r""" + @brief Creates a copy of self + """ + def __eq__(self, text: object) -> bool: + r""" + @brief Equality + + + Return true, if this text object and the given text are equal + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given text object. This method enables texts as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor + + Creates a text with unit transformation and empty text. + """ + @overload + def __init__(self, Text: Text) -> None: + r""" + @brief Creates a floating-point coordinate text from an integer coordinate text + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itext'. + """ + @overload + def __init__(self, string: str, trans: DTrans) -> None: + r""" + @brief Constructor with string and transformation + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. + """ + @overload + def __init__(self, string: str, trans: DTrans, height: float, font: int) -> None: + r""" + @brief Constructor with string, transformation, text height and font + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. + """ + @overload + def __init__(self, string: str, x: float, y: float) -> None: + r""" + @brief Constructor with string and location + + + A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. + + This method has been introduced in version 0.23. + """ + def __lt__(self, t: DText) -> bool: + r""" + @brief Less operator + @param t The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + """ + def __ne__(self, text: object) -> bool: + r""" + @brief Inequality + + + Return true, if this text object and the given text are not equal + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief Converts the object to a string. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DText) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> DBox: + r""" + @brief Gets the bounding box of the text + The bounding box of the text is a single point - the location of the text. Both points of the box are identical. + + This method has been added in version 0.28. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DText: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given text object. This method enables texts as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + @overload + def move(self, distance: DVector) -> DText: + r""" + @brief Moves the text by a certain distance (modifies self) + + + Moves the text by a given offset and returns the moved + text. Does not check for coordinate overflows. + + @param p The offset to move the text. + + @return A reference to this text object + """ + @overload + def move(self, dx: float, dy: float) -> DText: + r""" + @brief Moves the text by a certain distance (modifies self) + + + Moves the text by a given distance in x and y direction and returns the moved + text. Does not check for coordinate overflows. + + @param dx The x distance to move the text. + @param dy The y distance to move the text. + + @return A reference to this text object + + This method was introduced in version 0.23. + """ + @overload + def moved(self, distance: DVector) -> DText: + r""" + @brief Returns the text moved by a certain distance (does not modify self) + + + Moves the text by a given offset and returns the moved + text. Does not modify *this. Does not check for coordinate + overflows. + + @param p The offset to move the text. + + @return The moved text. + """ + @overload + def moved(self, dx: float, dy: float) -> DText: + r""" + @brief Returns the text moved by a certain distance (does not modify self) + + + Moves the text by a given offset and returns the moved + text. Does not modify *this. Does not check for coordinate + overflows. + + @param dx The x distance to move the text. + @param dy The y distance to move the text. + + @return The moved text. + + This method was introduced in version 0.23. + """ + def position(self) -> DPoint: + r""" + @brief Gets the position of the text + + This convenience method has been added in version 0.28. + """ + def to_itype(self, dbu: Optional[float] = ...) -> Text: + r""" + @brief Converts the text to an integer coordinate text + + The database unit can be specified to translate the floating-point coordinate Text in micron units to an integer-coordinate text in database units. The text's coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief Converts the object to a string. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def transformed(self, t: DCplxTrans) -> DText: + r""" + @brief Transforms the text with the given complex transformation + + + @param t The magnifying transformation to apply + @return The transformed text (a DText now) + """ + @overload + def transformed(self, t: DTrans) -> DText: + r""" + @brief Transforms the text with the given simple transformation + + + @param t The transformation to apply + @return The transformed text + """ + @overload + def transformed(self, t: VCplxTrans) -> Text: + r""" + @brief Transforms the text with the given complex transformation + + + @param t The magnifying transformation to apply + @return The transformed text (in this case an integer coordinate text) + + This method has been introduced in version 0.25. + """ + +class DTrans: + r""" + @brief A simple transformation + + Simple transformations only provide rotations about angles which a multiples of 90 degree. + Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). + These can be combined with a displacement which is applied after the rotation/mirror. + This version acts on floating-point coordinates. A version for integer coordinates is \Trans. + + Here are some examples for using the DTrans class: + + @code + t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction + # the inverse: -> "r0 0,-100" + t.inverted.to_s + # concatenation: -> "r90 -100,0" + (RBA::DTrans::new(RBA::DTrans::R90) * t).to_s + # apply to a point: -> "0,100" + RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) + @/code + + See @The Database API@ for more details about the database objects. + """ + M0: ClassVar[DTrans] + r""" + @brief A constant giving "mirrored at the x-axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M135: ClassVar[DTrans] + r""" + @brief A constant giving "mirrored at the 135 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M45: ClassVar[DTrans] + r""" + @brief A constant giving "mirrored at the 45 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M90: ClassVar[DTrans] + r""" + @brief A constant giving "mirrored at the y (90 degree) axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R0: ClassVar[DTrans] + r""" + @brief A constant giving "unrotated" (unit) transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R180: ClassVar[DTrans] + r""" + @brief A constant giving "rotated by 180 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R270: ClassVar[DTrans] + r""" + @brief A constant giving "rotated by 270 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R90: ClassVar[DTrans] + r""" + @brief A constant giving "rotated by 90 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + angle: int + r""" + Getter: + @brief Gets the angle in units of 90 degree + + This value delivers the rotation component. In addition, a mirroring at the x axis may be applied before if the \is_mirror? property is true. + Setter: + @brief Sets the angle in units of 90 degree + @param a The new angle + + This method was introduced in version 0.20. + """ + disp: DVector + r""" + Getter: + @brief Gets to the displacement vector + + Staring with version 0.25 the displacement type is a vector. + Setter: + @brief Sets the displacement + @param u The new displacement + + This method was introduced in version 0.20. + Staring with version 0.25 the displacement type is a vector. + """ + mirror: bool + r""" + Getter: + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + Setter: + @brief Sets the mirror flag + "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + + This method was introduced in version 0.20. + """ + rot: int + r""" + Getter: + @brief Gets the angle/mirror code + + The angle/mirror code is one of the constants R0, R90, R180, R270, M0, M45, M90 and M135. rx is the rotation by an angle of x counter clockwise. mx is the mirroring at the axis given by the angle x (to the x-axis). + Setter: + @brief Sets the angle/mirror code + @param r The new angle/rotation code (see \rot property) + + This method was introduced in version 0.20. + """ + @classmethod + def from_itrans(cls, trans: Trans) -> DTrans: + r""" + @brief Creates a floating-point coordinate transformation from an integer coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @classmethod + def from_s(cls, s: str) -> DTrans: + r""" + @brief Creates a transformation from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> DTrans: + r""" + @brief Creates a unit transformation + """ + @overload + @classmethod + def new(cls, c: DTrans, u: Optional[DVector] = ...) -> DTrans: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + @classmethod + def new(cls, c: DTrans, x: float, y: float) -> DTrans: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + @classmethod + def new(cls, rot: int, mirr: Optional[bool] = ..., u: Optional[DVector] = ...) -> DTrans: + r""" + @brief Creates a transformation using angle and mirror flag + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + @classmethod + def new(cls, rot: int, mirr: bool, x: float, y: float) -> DTrans: + r""" + @brief Creates a transformation using angle and mirror flag and two coordinate values for displacement + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param x The horizontal displacement + @param y The vertical displacement + """ + @overload + @classmethod + def new(cls, trans: Trans) -> DTrans: + r""" + @brief Creates a floating-point coordinate transformation from an integer coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @overload + @classmethod + def new(cls, u: DVector) -> DTrans: + r""" + @brief Creates a transformation using a displacement only + + @param u The displacement + """ + @overload + @classmethod + def new(cls, x: float, y: float) -> DTrans: + r""" + @brief Creates a transformation using a displacement given as two coordinates + + @param x The horizontal displacement + @param y The vertical displacement + """ + def __copy__(self) -> DTrans: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DTrans: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Tests for equality + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a unit transformation + """ + @overload + def __init__(self, c: DTrans, u: Optional[DVector] = ...) -> None: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + def __init__(self, c: DTrans, x: float, y: float) -> None: + r""" + @brief Creates a transformation from another transformation plus a displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + def __init__(self, rot: int, mirr: Optional[bool] = ..., u: Optional[DVector] = ...) -> None: + r""" + @brief Creates a transformation using angle and mirror flag + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, rot: int, mirr: bool, x: float, y: float) -> None: + r""" + @brief Creates a transformation using angle and mirror flag and two coordinate values for displacement + + The sequence of operations is: mirroring at x axis, + rotation, application of displacement. + + @param rot The rotation in units of 90 degree + @param mirrx True, if mirrored at x axis + @param x The horizontal displacement + @param y The vertical displacement + """ + @overload + def __init__(self, trans: Trans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from an integer coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + """ + @overload + def __init__(self, u: DVector) -> None: + r""" + @brief Creates a transformation using a displacement only + + @param u The displacement + """ + @overload + def __init__(self, x: float, y: float) -> None: + r""" + @brief Creates a transformation using a displacement given as two coordinates + + @param x The horizontal displacement + @param y The vertical displacement + """ + def __lt__(self, other: DTrans) -> bool: + r""" + @brief Provides a 'less' criterion for sorting + This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. + """ + @overload + def __mul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __mul__(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, t: DTrans) -> DTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Tests for inequality + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __rmul__(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DTrans) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def ctrans(self, d: float) -> float: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DTrans: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> DTrans: + r""" + @brief Inverts the transformation (in place) + + Inverts the transformation and replaces this object by the + inverted one. + + @return The inverted transformation + """ + def inverted(self) -> DTrans: + r""" + @brief Returns the inverted transformation + Returns the inverted transformation + + @return The inverted transformation + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_mirror(self) -> bool: + r""" + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + """ + def to_itype(self, dbu: Optional[float] = ...) -> Trans: + r""" + @brief Converts the transformation to an integer coordinate transformation + + The database unit can be specified to translate the floating-point coordinate transformation in micron units to an integer-coordinate transformation in database units. The transformation's' coordinates will be divided by the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def trans(self, box: DBox) -> DBox: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, edge: DEdge) -> DEdge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def trans(self, path: DPath) -> DPath: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, polygon: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, text: DText) -> DText: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + +class DVector: + r""" + @brief A vector class with double (floating-point) coordinates + A vector is a distance in cartesian, 2 dimensional space. A vector is given by two coordinates (x and y) and represents the distance between two points. Being the distance, transformations act differently on vectors: the displacement is not applied. + Vectors are not geometrical objects by itself. But they are frequently used in the database API for various purposes. Other than the integer variant (\Vector), points with floating-point coordinates can represent fractions of a database unit or vectors in physical (micron) units. + + This class has been introduced in version 0.25. + + See @The Database API@ for more details about the database objects. + """ + x: float + r""" + Getter: + @brief Accessor to the x coordinate + + Setter: + @brief Write accessor to the x coordinate + """ + y: float + r""" + Getter: + @brief Accessor to the y coordinate + + Setter: + @brief Write accessor to the y coordinate + """ + @classmethod + def from_s(cls, s: str) -> DVector: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + """ + @overload + @classmethod + def new(cls) -> DVector: + r""" + @brief Default constructor: creates a null vector with coordinates (0,0) + """ + @overload + @classmethod + def new(cls, p: DPoint) -> DVector: + r""" + @brief Default constructor: creates a vector from a point + This constructor is equivalent to computing p-point(0,0). + This method has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, vector: Vector) -> DVector: + r""" + @brief Creates a floating-point coordinate vector from an integer coordinate vector + """ + @overload + @classmethod + def new(cls, x: float, y: float) -> DVector: + r""" + @brief Constructor for a vector from two coordinate values + + """ + @overload + def __add__(self, p: DPoint) -> DPoint: + r""" + @brief Adds a vector and a point + + + Returns the point p shifted by the vector. + """ + @overload + def __add__(self, v: DVector) -> DVector: + r""" + @brief Adds two vectors + + + Adds vector v to self by adding the coordinates. + """ + def __copy__(self) -> DVector: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DVector: + r""" + @brief Creates a copy of self + """ + def __eq__(self, v: object) -> bool: + r""" + @brief Equality test operator + + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given vector. This method enables vectors as hash keys. + + This method has been introduced in version 0.25. + """ + def __imul__(self, f: float) -> DVector: + r""" + @brief Scaling by some factor + + + Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates a null vector with coordinates (0,0) + """ + @overload + def __init__(self, p: DPoint) -> None: + r""" + @brief Default constructor: creates a vector from a point + This constructor is equivalent to computing p-point(0,0). + This method has been introduced in version 0.25. + """ + @overload + def __init__(self, vector: Vector) -> None: + r""" + @brief Creates a floating-point coordinate vector from an integer coordinate vector + """ + @overload + def __init__(self, x: float, y: float) -> None: + r""" + @brief Constructor for a vector from two coordinate values + + """ + def __itruediv__(self, d: float) -> DVector: + r""" + @brief Division by some divisor + + + Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. + """ + def __lt__(self, v: DVector) -> bool: + r""" + @brief "less" comparison operator + + + This operator is provided to establish a sorting + order + """ + @overload + def __mul__(self, f: float) -> DVector: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __mul__(self, v: DVector) -> float: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ + def __ne__(self, v: object) -> bool: + r""" + @brief Inequality test operator + + """ + def __neg__(self) -> DVector: + r""" + @brief Compute the negative of a vector + + + Returns a new vector with -x,-y. + """ + @overload + def __rmul__(self, f: float) -> DVector: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __rmul__(self, v: DVector) -> float: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def __sub__(self, v: DVector) -> DVector: + r""" + @brief Subtract two vectors + + + Subtract vector v from self by subtracting the coordinates. + """ + def __truediv__(self, d: float) -> DVector: + r""" + @brief Division by some divisor + + + Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def abs(self) -> float: + r""" + @brief Returns the length of the vector + 'abs' is an alias provided for compatibility with the former point type. + """ + def assign(self, other: DVector) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DVector: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given vector. This method enables vectors as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def length(self) -> float: + r""" + @brief Returns the length of the vector + 'abs' is an alias provided for compatibility with the former point type. + """ + def sprod(self, v: DVector) -> float: + r""" + @brief Computes the scalar product between self and the given vector + + + The scalar product of a and b is defined as: vp = ax*bx+ay*by. + """ + def sprod_sign(self, v: DVector) -> int: + r""" + @brief Computes the scalar product between self and the given vector and returns a value indicating the sign of the product + + + @return 1 if the scalar product is positive, 0 if it is zero and -1 if it is negative. + """ + def sq_abs(self) -> float: + r""" + @brief The square length of the vector + 'sq_abs' is an alias provided for compatibility with the former point type. + """ + def sq_length(self) -> float: + r""" + @brief The square length of the vector + 'sq_abs' is an alias provided for compatibility with the former point type. + """ + def to_itype(self, dbu: Optional[float] = ...) -> Vector: + r""" + @brief Converts the point to an integer coordinate point + + The database unit can be specified to translate the floating-point coordinate vector in micron units to an integer-coordinate vector in database units. The vector's' coordinates will be divided by the database unit. + """ + def to_p(self) -> DPoint: + r""" + @brief Turns the vector into a point + This method returns the point resulting from adding the vector to (0,0). + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def vprod(self, v: DVector) -> float: + r""" + @brief Computes the vector product between self and the given vector + + + The vector product of a and b is defined as: vp = ax*by-ay*bx. + """ + def vprod_sign(self, v: DVector) -> int: + r""" + @brief Computes the vector product between self and the given vector and returns a value indicating the sign of the product + + + @return 1 if the vector product is positive, 0 if it is zero and -1 if it is negative. + """ + +class DeepShapeStore: + r""" + @brief An opaque layout heap for the deep region processor + + This class is used for keeping intermediate, hierarchical data for the deep region processor. It is used in conjunction with the region constructor to create a deep (hierarchical) region. + @code + layout = ... # a layout + layer = ... # a layer + cell = ... # a cell (initial cell for the deep region) + dss = RBA::DeepShapeStore::new + region = RBA::Region::new(cell.begin(layer), dss) + @/code + + The DeepShapeStore object also supplies some configuration options for the operations acting on the deep regions. See for example \threads=. + + This class has been introduced in version 0.26. + """ + @property + def subcircuit_hierarchy_for_nets(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets a value indicating whether to build a subcircuit hierarchy per net + + + This flag is used to determine the way, net subcircuit hierarchies are built: + when true, subcells are created for subcircuits on a net. Otherwise the net + shapes are produced flat inside the cell they appear on. + + This attribute has been introduced in version 0.28.4 + """ + max_area_ratio: float + r""" + Getter: + @brief Gets the max. area ratio. + + Setter: + @brief Sets the max. area ratio for bounding box vs. polygon area + + This parameter is used to simplify complex polygons. It is used by + create_polygon_layer with the default parameters. It's also used by + boolean operations when they deliver their output. + """ + max_vertex_count: int + r""" + Getter: + @brief Gets the maximum vertex count. + + Setter: + @brief Sets the maximum vertex count default value + + This parameter is used to simplify complex polygons. It is used by + create_polygon_layer with the default parameters. It's also used by + boolean operations when they deliver their output. + """ + reject_odd_polygons: bool + r""" + Getter: + @brief Gets a flag indicating whether to reject odd polygons. + This attribute has been introduced in version 0.27. + Setter: + @brief Sets a flag indicating whether to reject odd polygons + + Some kind of 'odd' (e.g. non-orientable) polygons may spoil the functionality because they cannot be handled properly. By using this flag, the shape store we reject these kind of polygons. The default is 'accept' (without warning). + + This attribute has been introduced in version 0.27. + """ + text_enlargement: int + r""" + Getter: + @brief Gets the text enlargement value. + + Setter: + @brief Sets the text enlargement value + + If set to a non-negative value, text objects are converted to boxes with the + given enlargement (width = 2 * enlargement). The box centers are identical + to the original location of the text. + If this value is negative (the default), texts are ignored. + """ + text_property_name: Any + r""" + Getter: + @brief Gets the text property name. + + Setter: + @brief Sets the text property name. + + If set to a non-null variant, text strings are attached to the generated boxes + as properties with this particular name. This option has an effect only if the + text_enlargement property is not negative. + By default, the name is empty. + """ + threads: int + r""" + Getter: + @brief Gets the number of threads. + + Setter: + @brief Sets the number of threads to allocate for the hierarchical processor + """ + @classmethod + def instance_count(cls) -> int: + r""" + @hide + """ + @classmethod + def new(cls) -> DeepShapeStore: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_breakout_cell(self, layout_index: int, cell_index: Sequence[int]) -> None: + r""" + @brief Adds a cell indexe to the breakout cell list for the given layout inside the store + See \clear_breakout_cells for an explanation of breakout cells. + + This method has been added in version 0.26.1 + """ + @overload + def add_breakout_cells(self, layout_index: int, cells: Sequence[int]) -> None: + r""" + @brief Adds cell indexes to the breakout cell list for the given layout inside the store + See \clear_breakout_cells for an explanation of breakout cells. + + This method has been added in version 0.26.1 + """ + @overload + def add_breakout_cells(self, layout_index: int, pattern: str) -> None: + r""" + @brief Adds cells (given by a cell name pattern) to the breakout cell list for the given layout inside the store + See \clear_breakout_cells for an explanation of breakout cells. + + This method has been added in version 0.26.1 + """ + @overload + def add_breakout_cells(self, pattern: str) -> None: + r""" + @brief Adds cells (given by a cell name pattern) to the breakout cell list to all layouts inside the store + See \clear_breakout_cells for an explanation of breakout cells. + + This method has been added in version 0.26.1 + """ + @overload + def clear_breakout_cells(self) -> None: + r""" + @brief Clears the breakout cells + See the other variant of \clear_breakout_cells for details. + + This method has been added in version 0.26.1 + """ + @overload + def clear_breakout_cells(self, layout_index: int) -> None: + r""" + @brief Clears the breakout cells + Breakout cells are a feature by which hierarchy handling can be disabled for specific cells. If cells are specified as breakout cells, they don't interact with neighbor or parent cells, hence are virtually isolated. Breakout cells are useful to shortcut hierarchy evaluation for cells which are otherwise difficult to handle. An example are memory array cells with overlaps to their neighbors: a precise handling of such cells would generate variants and the boundary of the array. Although precise, this behavior leads to partial flattening and propagation of shapes. In consequence, this will also result in wrong device detection in LVS applications. In such cases, these array cells can be declared 'breakout cells' which makes them isolated entities and variant generation does not happen. + + See also \set_breakout_cells and \add_breakout_cells. + + This method has been added in version 0.26.1 + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_singular(self) -> bool: + r""" + @brief Gets a value indicating whether there is a single layout variant + + Specifically for network extraction, singular DSS objects are required. Multiple layouts may be present if different sources of layouts have been used. Such DSS objects are not usable for network extraction. + """ + def pop_state(self) -> None: + r""" + @brief Restores the store's state on the state state + This will restore the state pushed by \push_state. + + This method has been added in version 0.26.1 + """ + def push_state(self) -> None: + r""" + @brief Pushes the store's state on the state state + This will save the stores state (\threads, \max_vertex_count, \max_area_ratio, breakout cells ...) on the state stack. \pop_state can be used to restore the state. + + This method has been added in version 0.26.1 + """ + @overload + def set_breakout_cells(self, layout_index: int, cells: Sequence[int]) -> None: + r""" + @brief Sets the breakout cell list (as cell indexes) for the given layout inside the store + See \clear_breakout_cells for an explanation of breakout cells. + + This method has been added in version 0.26.1 + """ + @overload + def set_breakout_cells(self, layout_index: int, pattern: str) -> None: + r""" + @brief Sets the breakout cell list (as cell name pattern) for the given layout inside the store + See \clear_breakout_cells for an explanation of breakout cells. + + This method has been added in version 0.26.1 + """ + @overload + def set_breakout_cells(self, pattern: str) -> None: + r""" + @brief Sets the breakout cell list (as cell name pattern) for the all layouts inside the store + See \clear_breakout_cells for an explanation of breakout cells. + + This method has been added in version 0.26.1 + """ + +class Device(NetlistObject): + r""" + @brief A device inside a circuit. + Device object represent atomic devices such as resistors, diodes or transistors. The \Device class represents a particular device with specific parameters. The type of device is represented by a \DeviceClass object. Device objects live in \Circuit objects, the device class objects live in the \Netlist object. + + Devices connect to nets through terminals. Terminals are described by a terminal ID which is essentially the zero-based index of the terminal. Terminal definitions can be obtained from the device class using the \DeviceClass#terminal_definitions method. + + Devices connect to nets through the \Device#connect_terminal method. Device terminals can be disconnected using \Device#disconnect_terminal. + + Device objects are created inside a circuit with \Circuit#create_device. + + This class has been added in version 0.26. + """ + device_abstract: DeviceAbstract + r""" + Getter: + @brief Gets the device abstract for this device instance. + See \DeviceAbstract for more details. + + Setter: + @hide + Provided for test purposes mainly. Be careful with pointers! + """ + name: str + r""" + Getter: + @brief Gets the name of the device. + + Setter: + @brief Sets the name of the device. + Device names are used to name a device inside a netlist file. Device names should be unique within a circuit. + """ + trans: DCplxTrans + r""" + Getter: + @brief Gets the location of the device. + See \trans= for details about this method. + Setter: + @brief Sets the location of the device. + The device location is essentially describing the position of the device. The position is typically the center of some recognition shape. In this case the transformation is a plain displacement to the center of this shape. + """ + def _assign(self, other: NetlistObject) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> Device: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_combined_abstract(self, ref: DeviceAbstractRef) -> None: + r""" + @hide + Provided for test purposes mainly. + """ + def add_reconnected_terminal_for(self, outer_terminal: int, descriptor: DeviceReconnectedTerminal) -> None: + r""" + @hide + Provided for test purposes mainly. + """ + @overload + def circuit(self) -> Circuit: + r""" + @brief Gets the circuit the device lives in. + """ + @overload + def circuit(self) -> Circuit: + r""" + @brief Gets the circuit the device lives in (non-const version). + + This constness variant has been introduced in version 0.26.8 + """ + def clear_combined_abstracts(self) -> None: + r""" + @hide + Provided for test purposes mainly. + """ + def clear_reconnected_terminals(self) -> None: + r""" + @hide + Provided for test purposes mainly. + """ + @overload + def connect_terminal(self, terminal_id: int, net: Net) -> None: + r""" + @brief Connects the given terminal to the specified net. + """ + @overload + def connect_terminal(self, terminal_name: str, net: Net) -> None: + r""" + @brief Connects the given terminal to the specified net. + This version accepts a terminal name. If the name is not a valid terminal name, an exception is raised. + If the terminal has been connected to a global net, it will be disconnected from there. + """ + def device_class(self) -> DeviceClass: + r""" + @brief Gets the device class the device belongs to. + """ + @overload + def disconnect_terminal(self, terminal_id: int) -> None: + r""" + @brief Disconnects the given terminal from any net. + If the terminal has been connected to a global, this connection will be disconnected too. + """ + @overload + def disconnect_terminal(self, terminal_name: str) -> None: + r""" + @brief Disconnects the given terminal from any net. + This version accepts a terminal name. If the name is not a valid terminal name, an exception is raised. + """ + def each_combined_abstract(self) -> Iterator[DeviceAbstractRef]: + r""" + @brief Iterates over the combined device specifications. + This feature applies to combined devices. This iterator will deliver all device abstracts present in addition to the default device abstract. + """ + def each_reconnected_terminal_for(self, terminal_id: int) -> Iterator[DeviceReconnectedTerminal]: + r""" + @brief Iterates over the reconnected terminal specifications for a given outer terminal. + This feature applies to combined devices. This iterator will deliver all device-to-abstract terminal reroutings. + """ + def expanded_name(self) -> str: + r""" + @brief Gets the expanded name of the device. + The expanded name takes the name of the device. If the name is empty, the numeric ID will be used to build a name. + """ + def id(self) -> int: + r""" + @brief Gets the device ID. + The ID is a unique integer which identifies the device. + It can be used to retrieve the device from the circuit using \Circuit#device_by_id. + When assigned, the device ID is not 0. + """ + def is_combined_device(self) -> bool: + r""" + @brief Returns true, if the device is a combined device. + Combined devices feature multiple device abstracts and device-to-abstract terminal connections. + See \each_reconnected_terminal and \each_combined_abstract for more details. + """ + @overload + def net_for_terminal(self, terminal_id: int) -> Net: + r""" + @brief Gets the net connected to the specified terminal. + If the terminal is not connected, nil is returned for the net. + """ + @overload + def net_for_terminal(self, terminal_id: int) -> Net: + r""" + @brief Gets the net connected to the specified terminal (non-const version). + If the terminal is not connected, nil is returned for the net. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def net_for_terminal(self, terminal_name: str) -> Net: + r""" + @brief Gets the net connected to the specified terminal. + If the terminal is not connected, nil is returned for the net. + + This convenience method has been introduced in version 0.27.3. + """ + @overload + def net_for_terminal(self, terminal_name: str) -> Net: + r""" + @brief Gets the net connected to the specified terminal (non-const version). + If the terminal is not connected, nil is returned for the net. + + This convenience method has been introduced in version 0.27.3. + """ + @overload + def parameter(self, param_id: int) -> float: + r""" + @brief Gets the parameter value for the given parameter ID. + """ + @overload + def parameter(self, param_name: str) -> float: + r""" + @brief Gets the parameter value for the given parameter name. + If the parameter name is not valid, an exception is thrown. + """ + @overload + def set_parameter(self, param_id: int, value: float) -> None: + r""" + @brief Sets the parameter value for the given parameter ID. + """ + @overload + def set_parameter(self, param_name: str, value: float) -> None: + r""" + @brief Sets the parameter value for the given parameter name. + If the parameter name is not valid, an exception is thrown. + """ + +class DeviceAbstract: + r""" + @brief A geometrical device abstract + This class represents the geometrical model for the device. It links into the extracted layout to a cell which holds the terminal shapes for the device. + + This class has been added in version 0.26. + """ + name: str + r""" + Getter: + @brief Gets the name of the device abstract. + + Setter: + @brief Sets the name of the device abstract. + Device names are used to name a device abstract inside a netlist file. Device names should be unique within a netlist. + """ + @classmethod + def new(cls) -> DeviceAbstract: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> DeviceAbstract: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DeviceAbstract: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DeviceAbstract) -> None: + r""" + @brief Assigns another object to self + """ + def cell_index(self) -> int: + r""" + @brief Gets the cell index of the device abstract. + This is the cell that represents the device. + """ + def cluster_id_for_terminal(self, terminal_id: int) -> int: + r""" + @brief Gets the cluster ID for the given terminal. + The cluster ID links the terminal to geometrical shapes within the clusters of the cell (see \cell_index) + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def device_class(self) -> DeviceClass: + r""" + @brief Gets the device class of the device. + """ + def dup(self) -> DeviceAbstract: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + @overload + def netlist(self) -> Netlist: + r""" + @brief Gets the netlist the device abstract lives in (non-const version). + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def netlist(self) -> Netlist: + r""" + @brief Gets the netlist the device abstract lives in. + """ + +class DeviceAbstractRef: + r""" + @brief Describes an additional device abstract reference for combined devices. + Combined devices are implemented as a generalization of the device abstract concept in \Device. For combined devices, multiple \DeviceAbstract references are present. This class describes such an additional reference. A reference is a pointer to an abstract plus a transformation by which the abstract is transformed geometrically as compared to the first (initial) abstract. + + This class has been introduced in version 0.26. + """ + device_abstract: DeviceAbstract + r""" + Getter: + @brief The getter for the device abstract reference. + See the class description for details. + Setter: + @brief The setter for the device abstract reference. + See the class description for details. + """ + trans: DCplxTrans + r""" + Getter: + @brief The getter for the relative transformation of the instance. + See the class description for details. + Setter: + @brief The setter for the relative transformation of the instance. + See the class description for details. + """ + @classmethod + def new(cls) -> DeviceAbstractRef: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> DeviceAbstractRef: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DeviceAbstractRef: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DeviceAbstractRef) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DeviceAbstractRef: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class DeviceClass: + r""" + @brief A class describing a specific type of device. + Device class objects live in the context of a \Netlist object. After a device class is created, it must be added to the netlist using \Netlist#add. The netlist will own the device class object. When the netlist is destroyed, the device class object will become invalid. + + The \DeviceClass class is the base class for other device classes. + + This class has been added in version 0.26. In version 0.27.3, the 'GenericDeviceClass' has been integrated with \DeviceClass and the device class was made writeable in most respects. This enables manipulating built-in device classes. + """ + combiner: GenericDeviceCombiner + r""" + Getter: + @brief Gets a device combiner or nil if none is registered. + + This method has been added in version 0.27.3. + + Setter: + @brief Specifies a device combiner (parallel or serial device combination). + + You can assign nil for the combiner to remove it. + + In special cases, you can even implement a custom combiner by deriving your own comparer from the \GenericDeviceCombiner class. + + This method has been added in version 0.27.3. + """ + @property + def supports_parallel_combination(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Specifies whether the device supports parallel device combination. + Parallel device combination means that all terminals of two combination candidates are connected to the same nets. If the device does not support this combination mode, this predicate can be set to false. This will make the device extractor skip the combination test in parallel mode and improve performance somewhat. + + This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + """ + @property + def supports_serial_combination(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Specifies whether the device supports serial device combination. + Serial device combination means that the devices are connected by internal nodes. If the device does not support this combination mode, this predicate can be set to false. This will make the device extractor skip the combination test in serial mode and improve performance somewhat. + + This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + """ + description: str + r""" + Getter: + @brief Gets the description text of the device class. + Setter: + @brief Sets the description of the device class. + """ + equal_parameters: EqualDeviceParameters + r""" + Getter: + @brief Gets the device parameter comparer for netlist verification or nil if no comparer is registered. + See \equal_parameters= for the setter. + + This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + + Setter: + @brief Specifies a device parameter comparer for netlist verification. + By default, all devices are compared with all parameters. If you want to select only certain parameters for comparison or use a fuzzy compare criterion, use an \EqualDeviceParameters object and assign it to the device class of one netlist. You can also chain multiple \EqualDeviceParameters objects with the '+' operator for specifying multiple parameters in the equality check. + + You can assign nil for the parameter comparer to remove it. + + In special cases, you can even implement a custom compare scheme by deriving your own comparer from the \GenericDeviceParameterCompare class. + + This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + """ + name: str + r""" + Getter: + @brief Gets the name of the device class. + Setter: + @brief Sets the name of the device class. + """ + strict: bool + r""" + Getter: + @brief Gets a value indicating whether this class performs strict terminal mapping + See \strict= for details about this attribute. + Setter: + @brief Sets a value indicating whether this class performs strict terminal mapping + + Classes with this flag set never allow terminal swapping, even if the device symmetry supports that. If two classes are involved in a netlist compare, + terminal swapping will be disabled if one of the classes is in strict mode. + + By default, device classes are not strict and terminal swapping is allowed as far as the device symmetry supports that. + """ + @classmethod + def new(cls) -> DeviceClass: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> DeviceClass: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DeviceClass: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_parameter(self, parameter_def: DeviceParameterDefinition) -> None: + r""" + @brief Adds the given parameter definition to the device class + This method will define a new parameter. The new parameter is added at the end of existing parameters. The parameter definition object passed as the argument is modified to contain the new ID of the parameter. + The parameter is copied into the device class. Modifying the parameter object later does not have the effect of changing the parameter definition. + + This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + """ + def add_terminal(self, terminal_def: DeviceTerminalDefinition) -> None: + r""" + @brief Adds the given terminal definition to the device class + This method will define a new terminal. The new terminal is added at the end of existing terminals. The terminal definition object passed as the argument is modified to contain the new ID of the terminal. + + The terminal is copied into the device class. Modifying the terminal object later does not have the effect of changing the terminal definition. + + This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + """ + def assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def clear_equivalent_terminal_ids(self) -> None: + r""" + @brief Clears all equivalent terminal ids + + This method has been added in version 0.27.3. + """ + def clear_parameters(self) -> None: + r""" + @brief Clears the list of parameters + + This method has been added in version 0.27.3. + """ + def clear_terminals(self) -> None: + r""" + @brief Clears the list of terminals + + This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DeviceClass: + r""" + @brief Creates a copy of self + """ + @overload + def enable_parameter(self, parameter_id: int, enable: bool) -> None: + r""" + @brief Enables or disables a parameter. + Some parameters are 'secondary' parameters which are extracted but not handled in device compare and are not shown in the netlist browser. For example, the 'W' parameter of the resistor is such a secondary parameter. This method allows turning a parameter in a primary one ('enable') or into a secondary one ('disable'). + + This method has been introduced in version 0.27.3. + """ + @overload + def enable_parameter(self, parameter_name: str, enable: bool) -> None: + r""" + @brief Enables or disables a parameter. + Some parameters are 'secondary' parameters which are extracted but not handled in device compare and are not shown in the netlist browser. For example, the 'W' parameter of the resistor is such a secondary parameter. This method allows turning a parameter in a primary one ('enable') or into a secondary one ('disable'). + + This version accepts a parameter name. + + This method has been introduced in version 0.27.3. + """ + def equivalent_terminal_id(self, original_id: int, equivalent_id: int) -> None: + r""" + @brief Specifies a terminal to be equivalent to another. + Use this method to specify two terminals to be exchangeable. For example to make S and D of a MOS transistor equivalent, call this method with S and D terminal IDs. In netlist matching, S will be translated to D and thus made equivalent to D. + + Note that terminal equivalence is not effective if the device class operates in strict mode (see \DeviceClass#strict=). + + This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. + """ + def has_parameter(self, name: str) -> bool: + r""" + @brief Returns true, if the device class has a parameter with the given name. + """ + def has_terminal(self, name: str) -> bool: + r""" + @brief Returns true, if the device class has a terminal with the given name. + """ + def id(self) -> int: + r""" + @brief Gets the unique ID of the device class + The ID is a unique integer that identifies the device class. Use the ID to check for object identity - i.e. to determine whether two devices share the same device class. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def netlist(self) -> Netlist: + r""" + @brief Gets the netlist the device class lives in. + """ + @overload + def parameter_definition(self, parameter_id: int) -> DeviceParameterDefinition: + r""" + @brief Gets the parameter definition object for a given ID. + Parameter definition IDs are used in some places to reference a specific parameter of a device. This method obtains the corresponding definition object. + """ + @overload + def parameter_definition(self, parameter_name: str) -> DeviceParameterDefinition: + r""" + @brief Gets the parameter definition object for a given ID. + Parameter definition IDs are used in some places to reference a specific parameter of a device. This method obtains the corresponding definition object. + This version accepts a parameter name. + + This method has been introduced in version 0.27.3. + """ + def parameter_definitions(self) -> List[DeviceParameterDefinition]: + r""" + @brief Gets the list of parameter definitions of the device. + See the \DeviceParameterDefinition class description for details. + """ + def parameter_id(self, name: str) -> int: + r""" + @brief Returns the parameter ID of the parameter with the given name. + An exception is thrown if there is no parameter with the given name. Use \has_parameter to check whether the name is a valid parameter name. + """ + def terminal_definition(self, terminal_id: int) -> DeviceTerminalDefinition: + r""" + @brief Gets the terminal definition object for a given ID. + Terminal definition IDs are used in some places to reference a specific terminal of a device. This method obtains the corresponding definition object. + """ + def terminal_definitions(self) -> List[DeviceTerminalDefinition]: + r""" + @brief Gets the list of terminal definitions of the device. + See the \DeviceTerminalDefinition class description for details. + """ + def terminal_id(self, name: str) -> int: + r""" + @brief Returns the terminal ID of the terminal with the given name. + An exception is thrown if there is no terminal with the given name. Use \has_terminal to check whether the name is a valid terminal name. + """ + +class DeviceClassBJT3Transistor(DeviceClass): + r""" + @brief A device class for a bipolar transistor. + This class describes a bipolar transistor. Bipolar transistors have tree terminals: the collector (C), the base (B) and the emitter (E). + Multi-emitter transistors are resolved in individual devices. + The parameters are AE, AB and AC for the emitter, base and collector areas in square micrometers and PE, PB and PC for the emitter, base and collector perimeters in micrometers. + In addition, the emitter count (NE) is given. The emitter count is 1 always for a transistor extracted initially. Upon combination of devices, the emitter counts are added, thus forming multi-emitter devices. + + This class has been introduced in version 0.26. + """ + PARAM_AB: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter AB (base area) + """ + PARAM_AC: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter AC (collector area) + """ + PARAM_AE: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter AE (emitter area) + """ + PARAM_NE: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter NE (emitter count) + """ + PARAM_PB: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter PB (base perimeter) + """ + PARAM_PC: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter PC (collector perimeter) + """ + PARAM_PE: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter PE (emitter perimeter) + """ + TERMINAL_B: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal B (base) + """ + TERMINAL_C: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal C (collector) + """ + TERMINAL_E: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal E (emitter) + """ + def _assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> DeviceClassBJT3Transistor: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceClassBJT4Transistor(DeviceClassBJT3Transistor): + r""" + @brief A device class for a 4-terminal bipolar transistor. + This class describes a bipolar transistor with a substrate terminal. A device class for a bipolar transistor without a substrate terminal is \DeviceClassBJT3Transistor. + The additional terminal is 'S' for the substrate terminal. + BJT4 transistors combine in parallel if both substrate terminals are connected to the same net. + + This class has been introduced in version 0.26. + """ + TERMINAL_S: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal S + """ + def _assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> DeviceClassBJT4Transistor: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceClassCapacitor(DeviceClass): + r""" + @brief A device class for a capacitor. + This describes a capacitor. Capacitors are defined by their combination behavior and the basic parameter 'C' which is the capacitance in Farad. + + A capacitor has two terminals, A and B. + The parameters of a capacitor are C (the value in Farad) and A and P (area and perimeter in square micrometers and micrometers respectively). + + This class has been introduced in version 0.26. + """ + PARAM_A: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter A + """ + PARAM_C: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter C + """ + PARAM_P: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter P + """ + TERMINAL_A: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal A + """ + TERMINAL_B: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal B + """ + def _assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> DeviceClassCapacitor: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceClassCapacitorWithBulk(DeviceClassCapacitor): + r""" + @brief A device class for a capacitor with a bulk terminal (substrate, well). + This class is similar to \DeviceClassCapacitor, but provides an additional terminal (BULK) for the well or substrate the capacitor is embedded in. + + The additional terminal is 'W' for the well/substrate terminal. + + This class has been introduced in version 0.26. + """ + TERMINAL_W: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal W (well, bulk) + """ + def _assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> DeviceClassCapacitorWithBulk: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceClassDiode(DeviceClass): + r""" + @brief A device class for a diode. + This class describes a diode. + A diode has two terminals, A (anode) and C (cathode). + It has two parameters: The diode area in square micrometers (A) and the diode area perimeter in micrometers (P). + + Diodes only combine when parallel and in the same direction. In this case, their areas and perimeters are added. + This class has been introduced in version 0.26. + """ + PARAM_A: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter A + """ + PARAM_P: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter P + """ + TERMINAL_A: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal A + """ + TERMINAL_C: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal C + """ + def _assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> DeviceClassDiode: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceClassFactory: + r""" + @brief A factory for creating specific device classes for the standard device extractors + Use a reimplementation of this class to provide a device class generator for built-in device extractors such as \DeviceExtractorMOS3Transistor. The constructor of this extractor has a 'factory' parameter which takes an object of \DeviceClassFactory type. + + If such an object is provided, this factory is used to create the actual device class. The following code shows an example: + + @code + class MyClass < RBA::DeviceClassMOS3Transistor + ... overrides some methods ... + end + + class MyFactory < RBA::DeviceClassFactory + def create_class + MyClass.new + end + end + + extractor = RBA::DeviceExtractorMOS3Transistor::new("NMOS", false, MyFactory.new) + @/code + + When using a factory with a device extractor, make sure it creates a corresponding device class, e.g. for the \DeviceExtractorMOS3Transistor extractor create a device class derived from \DeviceClassMOS3Transistor. + + This class has been introduced in version 0.27.3. + """ + @classmethod + def new(cls) -> DeviceClassFactory: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> DeviceClassFactory: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DeviceClassFactory: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DeviceClassFactory) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DeviceClassFactory: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class DeviceClassInductor(DeviceClass): + r""" + @brief A device class for an inductor. + This class describes an inductor. Inductors are defined by their combination behavior and the basic parameter 'L' which is the inductance in Henry. + + An inductor has two terminals, A and B. + + This class has been introduced in version 0.26. + """ + PARAM_L: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter L + """ + TERMINAL_A: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal A + """ + TERMINAL_B: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal B + """ + def _assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> DeviceClassInductor: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceClassMOS3Transistor(DeviceClass): + r""" + @brief A device class for a 3-terminal MOS transistor. + This class describes a MOS transistor without a bulk terminal. A device class for a MOS transistor with a bulk terminal is \DeviceClassMOS4Transistor. MOS transistors are defined by their combination behavior and the basic parameters. + + The parameters are L, W, AS, AD, PS and PD for the gate length and width in micrometers, source and drain area in square micrometers and the source and drain perimeter in micrometers. + + The terminals are S, G and D for source, gate and drain. + + MOS transistors combine in parallel mode, when both gate lengths are identical and their gates are connected (source and drain can be swapped). In this case, their widths and source and drain areas are added. + + This class has been introduced in version 0.26. + """ + PARAM_AD: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter AD + """ + PARAM_AS: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter AS + """ + PARAM_L: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter L + """ + PARAM_PD: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter PD + """ + PARAM_PS: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter PS + """ + PARAM_W: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter W + """ + TERMINAL_D: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal D + """ + TERMINAL_G: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal G + """ + TERMINAL_S: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal S + """ + def _assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> DeviceClassMOS3Transistor: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def join_split_gates(self, circuit: Circuit) -> None: + r""" + @brief Joins source/drain nets from 'split gate' transistor strings on the given circuit + This method has been introduced in version 0.27.9 + """ + +class DeviceClassMOS4Transistor(DeviceClassMOS3Transistor): + r""" + @brief A device class for a 4-terminal MOS transistor. + This class describes a MOS transistor with a bulk terminal. A device class for a MOS transistor without a bulk terminal is \DeviceClassMOS3Transistor. MOS transistors are defined by their combination behavior and the basic parameters. + + The additional terminal is 'B' for the bulk terminal. + MOS4 transistors combine in parallel if both bulk terminals are connected to the same net. + + This class has been introduced in version 0.26. + """ + TERMINAL_B: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal B + """ + def _assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> DeviceClassMOS4Transistor: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceClassResistor(DeviceClass): + r""" + @brief A device class for a resistor. + This class describes a resistor. Resistors are defined by their combination behavior and the basic parameter 'R' which is the resistance in Ohm. + + A resistor has two terminals, A and B. + The parameters of a resistor are R (the value in Ohms), L and W (length and width in micrometers) and A and P (area and perimeter in square micrometers and micrometers respectively). + + This class has been introduced in version 0.26. + """ + PARAM_A: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter A + """ + PARAM_L: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter L + """ + PARAM_P: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter P + """ + PARAM_R: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter R + """ + PARAM_W: ClassVar[int] + r""" + @brief A constant giving the parameter ID for parameter W + """ + TERMINAL_A: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal A + """ + TERMINAL_B: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal B + """ + def _assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> DeviceClassResistor: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceClassResistorWithBulk(DeviceClassResistor): + r""" + @brief A device class for a resistor with a bulk terminal (substrate, well). + This class is similar to \DeviceClassResistor, but provides an additional terminal (BULK) for the well or substrate the resistor is embedded in. + + The additional terminal is 'W' for the well/substrate terminal. + + This class has been introduced in version 0.26. + """ + TERMINAL_W: ClassVar[int] + r""" + @brief A constant giving the terminal ID for terminal W (well, bulk) + """ + def _assign(self, other: DeviceClass) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> DeviceClassResistorWithBulk: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceExtractorBJT3Transistor(DeviceExtractorBase): + r""" + @brief A device extractor for a bipolar transistor (BJT) + + This class supplies the generic extractor for a bipolar transistor device. + + Extraction of vertical and lateral transistors is supported through a generic geometry model: The basic area is the base area. A marker shape must be provided for this area. The emitter of the transistor is defined by emitter layer shapes inside the base area. Multiple emitter shapes can be present. In this case, multiple transistor devices sharing the same base and collector are generated. + Finally, a collector layer can be given. If non-empty, the parts inside the base region will define the collector terminals. If empty, the collector is formed by the substrate. In this case, the base region will be output to the 'tC' terminal output layer. This layer then needs to be connected to a global net to form the net connection. + + The device class produced by this extractor is \DeviceClassBJT3Transistor. + The extractor delivers these parameters: + + @ul + @li 'AE', 'AB' and 'AC' - the emitter, base and collector areas in square micrometer units @/li + @li 'PE', 'PB' and 'PC' - the emitter, base and collector perimeters in micrometer units @/li + @li 'NE' - emitter count (initially 1 but increases when devices are combined) @/li + @/ul + + The device layer names are: + + @ul + @li 'E' - emitter. @/li + @li 'B' - base. @/li + @li 'C' - collector. @/li + @/ul + + The terminals are output on these layers: + @ul + @li 'tE' - emitter. Default output is 'E'. @/li + @li 'tB' - base. Default output is 'B'. @/li + @li 'tC' - collector. Default output is 'C'. @/li + @/ul + + This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls, name: str, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorBJT3Transistor: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def __init__(self, name: str, factory: Optional[DeviceClassFactory] = ...) -> None: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceExtractorBJT4Transistor(DeviceExtractorBJT3Transistor): + r""" + @brief A device extractor for a four-terminal bipolar transistor (BJT) + + This class supplies the generic extractor for a bipolar transistor device. + It is based on the \DeviceExtractorBJT3Transistor class with the extension of a substrate terminal and corresponding substrate terminal output (annotation) layer. + + Two new layers are introduced: + + @ul + @li 'S' - the bulk (substrate) layer. Currently this layer is ignored and can be empty. @/li@li 'tS' - the bulk terminal output layer (defaults to 'S'). @/li@/ul + + The bulk terminal layer ('tS') can be an empty layer representing the wafer substrate. + In this use mode the substrate terminal shapes will be produced on the 'tS' layer. This + layer then needs to be connected to a global net to establish the net connection. + + The device class produced by this extractor is \DeviceClassBJT4Transistor. + The This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls, name: str, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorBJT4Transistor: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def __init__(self, name: str, factory: Optional[DeviceClassFactory] = ...) -> None: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceExtractorBase: + r""" + @brief The base class for all device extractors. + This is an abstract base class for device extractors. See \GenericDeviceExtractor for a generic class which you can reimplement to supply your own customized device extractor. In many cases using one of the preconfigured specific device extractors may be useful already and it's not required to implement a custom one. For an example about a preconfigured device extractor see \DeviceExtractorMOS3Transistor. + + This class cannot and should not be instantiated explicitly. Use one of the subclasses instead. + + This class has been introduced in version 0.26. + """ + name: str + r""" + Getter: + @brief Gets the name of the device extractor and the device class. + Setter: + @brief Sets the name of the device extractor and the device class. + """ + @classmethod + def new(cls) -> DeviceExtractorBase: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def device_class(self) -> DeviceClass: + r""" + @brief Gets the device class used during extraction + The attribute will hold the actual device class used in the device extraction. It is valid only after 'extract_devices'. + + This method has been added in version 0.27.3. + """ + def each_error(self) -> Iterator[NetlistDeviceExtractorError]: + r""" + @brief Iterates over all errors collected in the device extractor. + """ + def each_layer_definition(self) -> Iterator[NetlistDeviceExtractorLayerDefinition]: + r""" + @brief Iterates over all layer definitions. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def test_initialize(self, netlist: Netlist) -> None: + r""" + @hide + """ + +class DeviceExtractorCapacitor(DeviceExtractorBase): + r""" + @brief A device extractor for a two-terminal capacitor + + This class supplies the generic extractor for a capacitor device. + The device is defined by two geometry layers forming the 'plates' of the capacitor. + The capacitance is computed from the overlapping area of the plates using 'C = A * area_cap' (area_cap is the capacitance per square micrometer area). + + Although 'area_cap' can be given in any unit, Farad should be preferred as this is the convention used for output into a netlist. + + The device class produced by this extractor is \DeviceClassCapacitor. + The extractor produces three parameters: + + @ul + @li 'C' - the capacitance @/li + @li 'A' - the capacitor's area in square micrometer units @/li + @li 'P' - the capacitor's perimeter in micrometer units @/li + @/ul + + The device layer names are: + + @ul + @li 'P1', 'P2' - the two plates. @/li + @/ul + + The terminals are output on these layers: + @ul + @li 'tA', 'tB' - the two terminals. Defaults to 'P1' and 'P2'. @/li + @/ul + + This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls, name: str, area_cap: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorCapacitor: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def __init__(self, name: str, area_cap: float, factory: Optional[DeviceClassFactory] = ...) -> None: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceExtractorCapacitorWithBulk(DeviceExtractorBase): + r""" + @brief A device extractor for a capacitor with a bulk terminal + + This class supplies the generic extractor for a capacitor device including a bulk terminal. + The device is defined the same way than devices are defined for \DeviceExtractorCapacitor. + + The device class produced by this extractor is \DeviceClassCapacitorWithBulk. + The extractor produces three parameters: + + @ul + @li 'C' - the capacitance @/li + @li 'A' - the capacitor's area in square micrometer units @/li + @li 'P' - the capacitor's perimeter in micrometer units @/li + @/ul + + The device layer names are: + + @ul + @li 'P1', 'P2' - the two plates. @/li + @li 'W' - well, bulk. Currently this layer is ignored for the extraction and can be empty. @/li + @/ul + + The terminals are output on these layers: + @ul + @li 'tA', 'tB' - the two terminals. Defaults to 'P1' and 'P2'. @/li + @li 'tW' - the bulk terminal (copy of the resistor area). @/li + @/ul + + The bulk terminal layer can be an empty layer representing the substrate. In this case, it needs to be connected globally. + + This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorCapacitorWithBulk: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def __init__(self, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> None: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceExtractorDiode(DeviceExtractorBase): + r""" + @brief A device extractor for a planar diode + + This class supplies the generic extractor for a planar diode. + The diode is defined by two layers whose overlap area forms + the diode. The p-type layer forms the anode, the n-type layer + the cathode. + + The device class produced by this extractor is \DeviceClassDiode. + The extractor extracts the two parameters of this class: + + @ul + @li 'A' - the diode area in square micrometer units. @/li + @li 'P' - the diode perimeter in micrometer units. @/li + @/ul + + The device layers are: + + @ul + @li 'P' - the p doped area. @/li + @li 'N' - the n doped area. @/li + @/ul + + The diode region is defined by the overlap of p and n regions. + + The terminal output layers are: + + @ul + @li 'tA' - anode. Defaults to 'P'. @/li + @li 'tC' - cathode. Defaults to 'N'. @/li + @/ul + + This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls, name: str, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorDiode: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def __init__(self, name: str, factory: Optional[DeviceClassFactory] = ...) -> None: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceExtractorMOS3Transistor(DeviceExtractorBase): + r""" + @brief A device extractor for a three-terminal MOS transistor + + This class supplies the generic extractor for a MOS device. + The device is defined by two basic input layers: the diffusion area + (source and drain) and the gate area. It requires a third layer + (poly) to put the gate terminals on. The separation between poly + and allows separating the device recognition layer (gate) from the + conductive layer. + + The device class produced by this extractor is \DeviceClassMOS3Transistor. + + The extractor delivers six parameters: + + @ul + @li 'L' - the gate length in micrometer units @/li + @li 'W' - the gate width in micrometer units @/li + @li 'AS' and 'AD' - the source and drain region areas in square micrometers @/li + @li 'PS' and 'PD' - the source and drain region perimeters in micrometer units @/li + @/ul + + The device layer names are: + + @ul + @li In strict mode: 'S' (source), 'D' (drain) and 'G' (gate). @/li + @li In non-strict mode: 'SD' (source and drain) and 'G' (gate). @/li + @/ul + + The terminals are output on these layers: + @ul + @li 'tS' - source. Default output is 'S' (strict mode) or 'SD' (otherwise). @/li + @li 'tD' - drain. Default output is 'D' (strict mode) or 'SD' (otherwise). @/li + @li 'tG' - gate. Default output is 'G'. @/li + @/ul + + The source/drain (diffusion) area is distributed on the number of gates connecting to + the particular source or drain area. + + This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorMOS3Transistor: + r""" + @brief Creates a new device extractor with the given name. + If \strict is true, the MOS device extraction will happen in strict mode. That is, source and drain are not interchangeable. + + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def __init__(self, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> None: + r""" + @brief Creates a new device extractor with the given name. + If \strict is true, the MOS device extraction will happen in strict mode. That is, source and drain are not interchangeable. + + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def strict(self) -> bool: + r""" + @brief Returns a value indicating whether extraction happens in strict mode. + """ + +class DeviceExtractorMOS4Transistor(DeviceExtractorBase): + r""" + @brief A device extractor for a four-terminal MOS transistor + + This class supplies the generic extractor for a MOS device. + It is based on the \DeviceExtractorMOS3Transistor class with the extension of a bulk terminal and corresponding bulk terminal output (annotation) layer. + + The parameters of a MOS4 device are the same than for MOS3 devices. For the device layers the bulk layer is added. + + @ul + @li 'B' (bulk) - currently this layer is not used and can be empty. @/li + @/ul + + The bulk terminals are output on this layer: + @ul + @li 'tB' - bulk terminal (a copy of the gate shape). Default output is 'B'. @/li + @/ul + + The bulk terminal layer can be empty. In this case, it needs + to be connected to a global net to establish the net connection. + + The device class produced by this extractor is \DeviceClassMOS4Transistor. + + This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorMOS4Transistor: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def __init__(self, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> None: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceExtractorResistor(DeviceExtractorBase): + r""" + @brief A device extractor for a two-terminal resistor + + This class supplies the generic extractor for a resistor device. + The device is defined by two geometry layers: the resistor 'wire' and two contacts per wire. The contacts should be attached to the ends of the wire. The wire length and width is computed from the edge lengths between the contacts and along the contacts respectively. + + This simple computation is precise only when the resistor shape is a rectangle. + + Using the given sheet resistance, the resistance value is computed by 'R = L / W * sheet_rho'. + + The device class produced by this extractor is \DeviceClassResistor. + The extractor produces three parameters: + + @ul + @li 'R' - the resistance in Ohm @/li + @li 'A' - the resistor's area in square micrometer units @/li + @li 'P' - the resistor's perimeter in micrometer units @/li + @/ul + + The device layer names are: + + @ul + @li 'R' - resistor path. This is the geometry that defines the resistor's current path. @/li + @li 'C' - contacts. These areas form the contact regions at the ends of the resistor path. @/li + @/ul + + The terminals are output on these layers: + @ul + @li 'tA', 'tB' - the two terminals of the resistor. @/li + @/ul + + This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorResistor: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def __init__(self, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> None: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceExtractorResistorWithBulk(DeviceExtractorBase): + r""" + @brief A device extractor for a resistor with a bulk terminal + + This class supplies the generic extractor for a resistor device including a bulk terminal. + The device is defined the same way than devices are defined for \DeviceExtractorResistor. + + The device class produced by this extractor is \DeviceClassResistorWithBulk. + The extractor produces three parameters: + + @ul + @li 'R' - the resistance in Ohm @/li + @li 'A' - the resistor's area in square micrometer units @/li + @li 'P' - the resistor's perimeter in micrometer units @/li + @/ul + + The device layer names are: + + @ul + @li 'R' - resistor path. This is the geometry that defines the resistor's current path. @/li + @li 'C' - contacts. These areas form the contact regions at the ends of the resistor path. @/li + @li 'W' - well, bulk. Currently this layer is ignored for the extraction and can be empty. @/li + @/ul + + The terminals are output on these layers: + @ul + @li 'tA', 'tB' - the two terminals of the resistor. @/li + @li 'tW' - the bulk terminal (copy of the resistor area). @/li + @/ul + + The bulk terminal layer can be an empty layer representing the substrate. In this case, it needs to be connected globally. + + This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorResistorWithBulk: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def __init__(self, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> None: + r""" + @brief Creates a new device extractor with the given name + For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class DeviceParameterDefinition: + r""" + @brief A parameter descriptor + This class is used inside the \DeviceClass class to describe a parameter of the device. + + This class has been added in version 0.26. + """ + default_value: float + r""" + Getter: + @brief Gets the default value of the parameter. + Setter: + @brief Sets the default value of the parameter. + The default value is used to initialize parameters of \Device objects. + """ + description: str + r""" + Getter: + @brief Gets the description of the parameter. + Setter: + @brief Sets the description of the parameter. + """ + is_primary: bool + r""" + Getter: + @brief Gets a value indicating whether the parameter is a primary parameter + See \is_primary= for details about this predicate. + Setter: + @brief Sets a value indicating whether the parameter is a primary parameter + If this flag is set to true (the default), the parameter is considered a primary parameter. + Only primary parameters are compared by default. + """ + name: str + r""" + Getter: + @brief Gets the name of the parameter. + Setter: + @brief Sets the name of the parameter. + """ + @classmethod + def new(cls, name: str, description: Optional[str] = ..., default_value: Optional[float] = ..., is_primary: Optional[bool] = ..., si_scaling: Optional[float] = ...) -> DeviceParameterDefinition: + r""" + @brief Creates a new parameter definition. + @param name The name of the parameter + @param description The human-readable description + @param default_value The initial value + @param is_primary True, if the parameter is a primary parameter (see \is_primary=) + @param si_scaling The scaling factor to SI units + """ + def __copy__(self) -> DeviceParameterDefinition: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DeviceParameterDefinition: + r""" + @brief Creates a copy of self + """ + def __init__(self, name: str, description: Optional[str] = ..., default_value: Optional[float] = ..., is_primary: Optional[bool] = ..., si_scaling: Optional[float] = ...) -> None: + r""" + @brief Creates a new parameter definition. + @param name The name of the parameter + @param description The human-readable description + @param default_value The initial value + @param is_primary True, if the parameter is a primary parameter (see \is_primary=) + @param si_scaling The scaling factor to SI units + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DeviceParameterDefinition) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DeviceParameterDefinition: + r""" + @brief Creates a copy of self + """ + def id(self) -> int: + r""" + @brief Gets the ID of the parameter. + The ID of the parameter is used in some places to refer to a specific parameter (e.g. in the \NetParameterRef object). + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def si_scaling(self) -> float: + r""" + @brief Gets the scaling factor to SI units. + For parameters in micrometers for example, this factor will be 1e-6. + """ + +class DeviceReconnectedTerminal: + r""" + @brief Describes a terminal rerouting in combined devices. + Combined devices are implemented as a generalization of the device abstract concept in \Device. For combined devices, multiple \DeviceAbstract references are present. To support different combination schemes, device-to-abstract routing is supported. Parallel combinations will route all outer terminals to corresponding terminals of all device abstracts (because of terminal swapping these may be different ones). + + This object describes one route to an abstract's terminal. The device index is 0 for the main device abstract and 1 for the first combined device abstract. + + This class has been introduced in version 0.26. + """ + device_index: int + r""" + Getter: + @brief The device abstract index getter. + See the class description for details. + Setter: + @brief The device abstract index setter. + See the class description for details. + """ + other_terminal_id: int + r""" + Getter: + @brief The getter for the abstract's connected terminal. + See the class description for details. + Setter: + @brief The setter for the abstract's connected terminal. + See the class description for details. + """ + @classmethod + def new(cls) -> DeviceReconnectedTerminal: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> DeviceReconnectedTerminal: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DeviceReconnectedTerminal: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DeviceReconnectedTerminal) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DeviceReconnectedTerminal: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class DeviceTerminalDefinition: + r""" + @brief A terminal descriptor + This class is used inside the \DeviceClass class to describe a terminal of the device. + + This class has been added in version 0.26. + """ + description: str + r""" + Getter: + @brief Gets the description of the terminal. + Setter: + @brief Sets the description of the terminal. + """ + name: str + r""" + Getter: + @brief Gets the name of the terminal. + Setter: + @brief Sets the name of the terminal. + """ + @classmethod + def new(cls, name: str, description: Optional[str] = ...) -> DeviceTerminalDefinition: + r""" + @brief Creates a new terminal definition. + """ + def __copy__(self) -> DeviceTerminalDefinition: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DeviceTerminalDefinition: + r""" + @brief Creates a copy of self + """ + def __init__(self, name: str, description: Optional[str] = ...) -> None: + r""" + @brief Creates a new terminal definition. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DeviceTerminalDefinition) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DeviceTerminalDefinition: + r""" + @brief Creates a copy of self + """ + def id(self) -> int: + r""" + @brief Gets the ID of the terminal. + The ID of the terminal is used in some places to refer to a specific terminal (e.g. in the \NetTerminalRef object). + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class Edge: + r""" + @brief An edge class + + An edge is a connection between points, usually participating in a larger context such as a polygon. An edge has a defined direction (from p1 to p2). Edges play a role in the database as parts of polygons and to describe a line through both points. + Although supported, edges are rarely used as individual database objects. + + See @The Database API@ for more details about the database objects like the Edge class. + """ + p1: Point + r""" + Getter: + @brief The first point. + + Setter: + @brief Sets the first point. + This method has been added in version 0.23. + """ + p2: Point + r""" + Getter: + @brief The second point. + + Setter: + @brief Sets the second point. + This method has been added in version 0.23. + """ + x1: int + r""" + Getter: + @brief Shortcut for p1.x + + Setter: + @brief Sets p1.x + This method has been added in version 0.23. + """ + x2: int + r""" + Getter: + @brief Shortcut for p2.x + + Setter: + @brief Sets p2.x + This method has been added in version 0.23. + """ + y1: int + r""" + Getter: + @brief Shortcut for p1.y + + Setter: + @brief Sets p1.y + This method has been added in version 0.23. + """ + y2: int + r""" + Getter: + @brief Shortcut for p2.y + + Setter: + @brief Sets p2.y + This method has been added in version 0.23. + """ + @classmethod + def from_dedge(cls, dedge: DEdge) -> Edge: + r""" + @brief Creates an integer coordinate edge from a floating-point coordinate edge + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge'. + """ + @classmethod + def from_s(cls, s: str) -> Edge: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> Edge: + r""" + @brief Default constructor: creates a degenerated edge 0,0 to 0,0 + """ + @overload + @classmethod + def new(cls, dedge: DEdge) -> Edge: + r""" + @brief Creates an integer coordinate edge from a floating-point coordinate edge + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge'. + """ + @overload + @classmethod + def new(cls, p1: Point, p2: Point) -> Edge: + r""" + @brief Constructor with two points + + Two points are given to create a new edge. + """ + @overload + @classmethod + def new(cls, x1: int, y1: int, x2: int, y2: int) -> Edge: + r""" + @brief Constructor with two coordinates given as single values + + Two points are given to create a new edge. + """ + @classmethod + def new_pp(cls, p1: Point, p2: Point) -> Edge: + r""" + @brief Constructor with two points + + Two points are given to create a new edge. + """ + @classmethod + def new_xyxy(cls, x1: int, y1: int, x2: int, y2: int) -> Edge: + r""" + @brief Constructor with two coordinates given as single values + + Two points are given to create a new edge. + """ + def __copy__(self) -> Edge: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Edge: + r""" + @brief Creates a copy of self + """ + def __eq__(self, e: object) -> bool: + r""" + @brief Equality test + @param e The object to compare against + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given edge. This method enables edges as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates a degenerated edge 0,0 to 0,0 + """ + @overload + def __init__(self, dedge: DEdge) -> None: + r""" + @brief Creates an integer coordinate edge from a floating-point coordinate edge + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge'. + """ + @overload + def __init__(self, p1: Point, p2: Point) -> None: + r""" + @brief Constructor with two points + + Two points are given to create a new edge. + """ + @overload + def __init__(self, x1: int, y1: int, x2: int, y2: int) -> None: + r""" + @brief Constructor with two coordinates given as single values + + Two points are given to create a new edge. + """ + def __lt__(self, e: Edge) -> bool: + r""" + @brief Less operator + @param e The object to compare against + @return True, if the edge is 'less' as the other edge with respect to first and second point + """ + def __mul__(self, scale_factor: float) -> Edge: + r""" + @brief Scale edge + + The * operator scales self with the given factor. + + This method has been introduced in version 0.22. + + @param scale_factor The scaling factor + + @return The scaled edge + """ + def __ne__(self, e: object) -> bool: + r""" + @brief Inequality test + @param e The object to compare against + """ + def __rmul__(self, scale_factor: float) -> Edge: + r""" + @brief Scale edge + + The * operator scales self with the given factor. + + This method has been introduced in version 0.22. + + @param scale_factor The scaling factor + + @return The scaled edge + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief Returns a string representing the edge + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Edge) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Return the bounding box of the edge. + """ + def clipped(self, box: Box) -> Any: + r""" + @brief Returns the edge clipped at the given box + + @param box The clip box. + @return The clipped edge or nil if the edge does not intersect with the box. + + This method has been introduced in version 0.26.2. + """ + def clipped_line(self, box: Box) -> Any: + r""" + @brief Returns the line through the edge clipped at the given box + + @param box The clip box. + @return The part of the line through the box or nil if the line does not intersect with the box. + + In contrast to \clipped, this method will consider the edge extended infinitely (a "line"). The returned edge will be the part of this line going through the box. + + This method has been introduced in version 0.26.2. + """ + def coincident(self, e: Edge) -> bool: + r""" + @brief Coincidence check. + + Checks whether a edge is coincident with another edge. + Coincidence is defined by being parallel and that + at least one point of one edge is on the other edge. + + @param e the edge to test with + + @return True if the edges are coincident. + """ + def contains(self, p: Point) -> bool: + r""" + @brief Test whether a point is on an edge. + + A point is on a edge if it is on (or at least closer + than a grid point to) the edge. + + @param p The point to test with the edge. + + @return True if the point is on the edge. + """ + def contains_excl(self, p: Point) -> bool: + r""" + @brief Test whether a point is on an edge excluding the endpoints. + + A point is on a edge if it is on (or at least closer + than a grid point to) the edge. + + @param p The point to test with the edge. + + @return True if the point is on the edge but not equal p1 or p2. + """ + def create(self) -> None: + r""" + @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. + """ + def crossed_by(self, e: Edge) -> bool: + r""" + @brief Check, if an edge is cut by a line (given by an edge) + + This method returns true if p1 is in one semispace + while p2 is in the other or one of them is on the line + through the edge "e" + + @param e The edge representing the line that the edge must be crossing. + """ + def crossing_point(self, e: Edge) -> Point: + r""" + @brief Returns the crossing point on two edges. + + This method delivers the point where the given edge (self) crosses the line given by the edge in argument "e". If self does not cross this line, the result is undefined. See \crossed_by? for a description of the crossing predicate. + + @param e The edge representing the line that self must be crossing. + @return The point where self crosses the line given by "e". + + This method has been introduced in version 0.19. + """ + def cut_point(self, e: Edge) -> Any: + r""" + @brief Returns the intersection point of the lines through the two edges. + + This method delivers the intersection point between the lines through the two edges. If the lines are parallel and do not intersect, the result will be nil. + In contrast to \intersection_point, this method will regard the edges as infinitely extended and intersection is not confined to the edge span. + + @param e The edge to test. + @return The point where the lines intersect. + + This method has been introduced in version 0.27.1. + """ + def d(self) -> Vector: + r""" + @brief Gets the edge extension as a vector. + This method is equivalent to p2 - p1. + This method has been introduced in version 0.26.2. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def distance(self, p: Point) -> int: + r""" + @brief Distance between the edge and a point. + + Returns the distance between the edge and the point. The + distance is signed which is negative if the point is to the + "right" of the edge and positive if the point is to the "left". + The distance is measured by projecting the point onto the + line through the edge. If the edge is degenerated, the distance + is not defined. + + @param p The point to test. + + @return The distance + """ + def distance_abs(self, p: Point) -> int: + r""" + @brief Absolute distance between the edge and a point. + + Returns the distance between the edge and the point. + + @param p The point to test. + + @return The distance + """ + def dup(self) -> Edge: + r""" + @brief Creates a copy of self + """ + def dx(self) -> int: + r""" + @brief The horizontal extend of the edge. + """ + def dx_abs(self) -> int: + r""" + @brief The absolute value of the horizontal extend of the edge. + """ + def dy(self) -> int: + r""" + @brief The vertical extend of the edge. + """ + def dy_abs(self) -> int: + r""" + @brief The absolute value of the vertical extend of the edge. + """ + def enlarge(self, p: Vector) -> Edge: + r""" + @brief Enlarges the edge. + + Enlarges the edge by the given distance and returns the + enlarged edge. The edge is overwritten. + Enlargement means + that the first point is shifted by -p, the second by p. + + @param p The distance to move the edge points. + + @return The enlarged edge. + """ + def enlarged(self, p: Vector) -> Edge: + r""" + @brief Returns the enlarged edge (does not modify self) + + Enlarges the edge by the given offset and returns the + enlarged edge. The edge is not modified. Enlargement means + that the first point is shifted by -p, the second by p. + + @param p The distance to move the edge points. + + @return The enlarged edge. + """ + def extend(self, d: int) -> Edge: + r""" + @brief Extends the edge (modifies self) + + Extends the edge by the given distance and returns the + extended edge. The edge is not modified. Extending means + that the first point is shifted by -d along the edge, the second by d. + The length of the edge will increase by 2*d. + + \extended is a version that does not modify self but returns the extended edges. + + This method has been introduced in version 0.23. + + @param d The distance by which to shift the end points. + + @return The extended edge (self). + """ + def extended(self, d: int) -> Edge: + r""" + @brief Returns the extended edge (does not modify self) + + Extends the edge by the given distance and returns the + extended edge. The edge is not modified. Extending means + that the first point is shifted by -d along the edge, the second by d. + The length of the edge will increase by 2*d. + + \extend is a version that modifies self (in-place). + + This method has been introduced in version 0.23. + + @param d The distance by which to shift the end points. + + @return The extended edge. + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given edge. This method enables edges as hash keys. + + This method has been introduced in version 0.25. + """ + def intersect(self, e: Edge) -> bool: + r""" + @brief Intersection test. + + Returns true if the edges intersect. Two edges intersect if they share at least one point. + If the edges coincide, they also intersect. + For degenerated edges, the intersection is mapped to + point containment tests. + + @param e The edge to test. + """ + def intersection_point(self, e: Edge) -> Any: + r""" + @brief Returns the intersection point of two edges. + + This method delivers the intersection point. If the edges do not intersect, the result will be nil. + + @param e The edge to test. + @return The point where the edges intersect. + + This method has been introduced in version 0.19. + From version 0.26.2, this method will return nil in case of non-intersection. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_degenerate(self) -> bool: + r""" + @brief Test for degenerated edge + + An edge is degenerate, if both end and start point are identical. + """ + def is_parallel(self, e: Edge) -> bool: + r""" + @brief Test for being parallel + + @param e The edge to test against + + @return True if both edges are parallel + """ + def length(self) -> int: + r""" + @brief The length of the edge + """ + @overload + def move(self, dx: int, dy: int) -> Edge: + r""" + @brief Moves the edge. + + Moves the edge by the given offset and returns the + moved edge. The edge is overwritten. + + @param dx The x distance to move the edge. + @param dy The y distance to move the edge. + + @return The moved edge. + + This version has been added in version 0.23. + """ + @overload + def move(self, p: Vector) -> Edge: + r""" + @brief Moves the edge. + + Moves the edge by the given offset and returns the + moved edge. The edge is overwritten. + + @param p The distance to move the edge. + + @return The moved edge. + """ + @overload + def moved(self, dx: int, dy: int) -> Edge: + r""" + @brief Returns the moved edge (does not modify self) + + Moves the edge by the given offset and returns the + moved edge. The edge is not modified. + + @param dx The x distance to move the edge. + @param dy The y distance to move the edge. + + @return The moved edge. + + This version has been added in version 0.23. + """ + @overload + def moved(self, p: Vector) -> Edge: + r""" + @brief Returns the moved edge (does not modify self) + + Moves the edge by the given offset and returns the + moved edge. The edge is not modified. + + @param p The distance to move the edge. + + @return The moved edge. + """ + def ortho_length(self) -> int: + r""" + @brief The orthogonal length of the edge ("manhattan-length") + + @return The orthogonal length (abs(dx)+abs(dy)) + """ + def shift(self, d: int) -> Edge: + r""" + @brief Shifts the edge (modifies self) + + Shifts the edge by the given distance and returns the + shifted edge. The edge is not modified. Shifting by a positive value will produce an edge which is shifted by d to the left. Shifting by a negative value will produce an edge which is shifted by d to the right. + + \shifted is a version that does not modify self but returns the extended edges. + + This method has been introduced in version 0.23. + + @param d The distance by which to shift the edge. + + @return The shifted edge (self). + """ + def shifted(self, d: int) -> Edge: + r""" + @brief Returns the shifted edge (does not modify self) + + Shifts the edge by the given distance and returns the + shifted edge. The edge is not modified. Shifting by a positive value will produce an edge which is shifted by d to the left. Shifting by a negative value will produce an edge which is shifted by d to the right. + + \shift is a version that modifies self (in-place). + + This method has been introduced in version 0.23. + + @param d The distance by which to shift the edge. + + @return The shifted edge. + """ + def side_of(self, p: Point) -> int: + r""" + @brief Indicates at which side the point is located relative to the edge. + + Returns 1 if the point is "left" of the edge, 0 if on + and -1 if the point is "right" of the edge. + + @param p The point to test. + + @return The side value + """ + def sq_length(self) -> int: + r""" + @brief The square of the length of the edge + """ + def swap_points(self) -> Edge: + r""" + @brief Swap the points of the edge + + This version modifies self. A version that does not modify self is \swapped_points. Swapping the points basically reverses the direction of the edge. + + This method has been introduced in version 0.23. + """ + def swapped_points(self) -> Edge: + r""" + @brief Returns an edge in which both points are swapped + + Swapping the points basically reverses the direction of the edge. + + This method has been introduced in version 0.23. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DEdge: + r""" + @brief Converts the edge to a floating-point coordinate edge + + The database unit can be specified to translate the integer-coordinate edge into a floating-point coordinate edge in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief Returns a string representing the edge + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def transformed(self, t: CplxTrans) -> DEdge: + r""" + @brief Transform the edge. + + Transforms the edge with the given complex transformation. + Does not modify the edge but returns the transformed edge. + + @param t The transformation to apply. + + @return The transformed edge. + """ + @overload + def transformed(self, t: ICplxTrans) -> Edge: + r""" + @brief Transform the edge. + + Transforms the edge with the given complex transformation. + Does not modify the edge but returns the transformed edge. + + @param t The transformation to apply. + + @return The transformed edge (in this case an integer coordinate edge). + + This method has been introduced in version 0.18. + """ + @overload + def transformed(self, t: Trans) -> Edge: + r""" + @brief Transform the edge. + + Transforms the edge with the given transformation. + Does not modify the edge but returns the transformed edge. + + @param t The transformation to apply. + + @return The transformed edge. + """ + def transformed_cplx(self, t: CplxTrans) -> DEdge: + r""" + @brief Transform the edge. + + Transforms the edge with the given complex transformation. + Does not modify the edge but returns the transformed edge. + + @param t The transformation to apply. + + @return The transformed edge. + """ + +class EdgePair: + r""" + @brief An edge pair (a pair of two edges) + Edge pairs are objects representing two edges or parts of edges. They play a role mainly in the context of DRC functions, where they specify a DRC violation by connecting two edges which violate the condition checked. Within the framework of polygon and edge collections which provide DRC functionality, edges pairs are used in the form of edge pair collections (\EdgePairs). + + Edge pairs basically consist of two edges, called first and second. If created by a two-layer DRC function, the first edge will correspond to edges from the first layer and the second to edges from the second layer. + + This class has been introduced in version 0.23. + """ + first: Edge + r""" + Getter: + @brief Gets the first edge + + Setter: + @brief Sets the first edge + """ + second: Edge + r""" + Getter: + @brief Gets the second edge + + Setter: + @brief Sets the second edge + """ + symmetric: bool + r""" + Getter: + @brief Returns a value indicating whether the edge pair is symmetric + For symmetric edge pairs, the edges are commutable. Specifically, a symmetric edge pair with (e1,e2) is identical to (e2,e1). Symmetric edge pairs are generated by some checks for which there is no directed error marker (width, space, notch, isolated). + + Symmetric edge pairs have been introduced in version 0.27. + + Setter: + @brief Sets a value indicating whether the edge pair is symmetric + See \symmetric? for a description of this attribute. + + Symmetric edge pairs have been introduced in version 0.27. + """ + @classmethod + def from_s(cls, s: str) -> EdgePair: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> EdgePair: + r""" + @brief Default constructor + + This constructor creates an default edge pair. + """ + @overload + @classmethod + def new(cls, dedge_pair: DEdgePair) -> EdgePair: + r""" + @brief Creates an integer coordinate edge pair from a floating-point coordinate edge pair + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge_pair'. + """ + @overload + @classmethod + def new(cls, first: Edge, second: Edge, symmetric: Optional[bool] = ...) -> EdgePair: + r""" + @brief Constructor from two edges + + This constructor creates an edge pair from the two edges given. + See \symmetric? for a description of this attribute. + """ + def __copy__(self) -> EdgePair: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> EdgePair: + r""" + @brief Creates a copy of self + """ + def __eq__(self, box: object) -> bool: + r""" + @brief Equality + Returns true, if this edge pair and the given one are equal + + This method has been introduced in version 0.25. + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given edge pair. This method enables edge pairs as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor + + This constructor creates an default edge pair. + """ + @overload + def __init__(self, dedge_pair: DEdgePair) -> None: + r""" + @brief Creates an integer coordinate edge pair from a floating-point coordinate edge pair + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge_pair'. + """ + @overload + def __init__(self, first: Edge, second: Edge, symmetric: Optional[bool] = ...) -> None: + r""" + @brief Constructor from two edges + + This constructor creates an edge pair from the two edges given. + See \symmetric? for a description of this attribute. + """ + def __lt__(self, box: EdgePair) -> bool: + r""" + @brief Less operator + Returns true, if this edge pair is 'less' with respect to first and second edge + + This method has been introduced in version 0.25. + """ + def __ne__(self, box: object) -> bool: + r""" + @brief Inequality + Returns true, if this edge pair and the given one are not equal + + This method has been introduced in version 0.25. + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief Returns a string representing the edge pair + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def area(self) -> int: + r""" + @brief Gets the area between the edges of the edge pair + + This attribute has been introduced in version 0.28. + """ + def assign(self, other: EdgePair) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Gets the bounding box of the edge pair + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> EdgePair: + r""" + @brief Creates a copy of self + """ + def greater(self) -> Edge: + r""" + @brief Gets the 'greater' edge for symmetric edge pairs + As first and second edges are commutable for symmetric edge pairs (see \symmetric?), this accessor allows retrieving a 'second' edge in a way independent on the actual assignment. + + This read-only attribute has been introduced in version 0.27. + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given edge pair. This method enables edge pairs as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def lesser(self) -> Edge: + r""" + @brief Gets the 'lesser' edge for symmetric edge pairs + As first and second edges are commutable for symmetric edge pairs (see \symmetric?), this accessor allows retrieving a 'first' edge in a way independent on the actual assignment. + + This read-only attribute has been introduced in version 0.27. + """ + def normalized(self) -> EdgePair: + r""" + @brief Normalizes the edge pair + This method normalized the edge pair such that when connecting the edges at their + start and end points a closed loop is formed which is oriented clockwise. To achieve this, the points of the first and/or first and second edge are swapped. Normalization is a first step recommended before converting an edge pair to a polygon, because that way the polygons won't be self-overlapping and the enlargement parameter is applied properly. + """ + def perimeter(self) -> int: + r""" + @brief Gets the perimeter of the edge pair + + The perimeter is defined as the sum of the lengths of both edges ('active perimeter'). + + This attribute has been introduced in version 0.28. + """ + def polygon(self, e: int) -> Polygon: + r""" + @brief Convert an edge pair to a polygon + The polygon is formed by connecting the end and start points of the edges. It is recommended to use \normalized before converting the edge pair to a polygon. + + The enlargement parameter applies the specified enlargement parallel and perpendicular to the edges. Basically this introduces a bias which blows up edge pairs by the specified amount. That parameter is useful to convert degenerated edge pairs to valid polygons, i.e. edge pairs with coincident edges and edge pairs consisting of two point-like edges. + + Another version for converting edge pairs to simple polygons is \simple_polygon which renders a \SimplePolygon object. + @param e The enlargement (set to zero for exact representation) + """ + def simple_polygon(self, e: int) -> SimplePolygon: + r""" + @brief Convert an edge pair to a simple polygon + The polygon is formed by connecting the end and start points of the edges. It is recommended to use \normalized before converting the edge pair to a polygon. + + The enlargement parameter applies the specified enlargement parallel and perpendicular to the edges. Basically this introduces a bias which blows up edge pairs by the specified amount. That parameter is useful to convert degenerated edge pairs to valid polygons, i.e. edge pairs with coincident edges and edge pairs consisting of two point-like edges. + + Another version for converting edge pairs to polygons is \polygon which renders a \Polygon object. + @param e The enlargement (set to zero for exact representation) + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DEdgePair: + r""" + @brief Converts the edge pair to a floating-point coordinate edge pair + + The database unit can be specified to translate the integer-coordinate edge pair into a floating-point coordinate edge pair in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief Returns a string representing the edge pair + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def transformed(self, t: CplxTrans) -> DEdgePair: + r""" + @brief Returns the transformed edge pair + + Transforms the edge pair with the given complex transformation. + Does not modify the edge pair but returns the transformed edge. + + @param t The transformation to apply. + + @return The transformed edge pair + """ + @overload + def transformed(self, t: ICplxTrans) -> EdgePair: + r""" + @brief Returns the transformed edge pair + + Transforms the edge pair with the given complex transformation. + Does not modify the edge pair but returns the transformed edge. + + @param t The transformation to apply. + + @return The transformed edge pair (in this case an integer coordinate edge pair). + """ + @overload + def transformed(self, t: Trans) -> EdgePair: + r""" + @brief Returns the transformed pair + + Transforms the edge pair with the given transformation. + Does not modify the edge pair but returns the transformed edge. + + @param t The transformation to apply. + + @return The transformed edge pair + """ + +class EdgePairs(ShapeCollection): + r""" + @brief EdgePairs (a collection of edge pairs) + + Edge pairs are used mainly in the context of the DRC functions (width_check, space_check etc.) of \Region and \Edges. A single edge pair represents two edges participating in a DRC violation. In the two-layer checks (inside, overlap) The first edge represents an edge from the first layer and the second edge an edge from the second layer. For single-layer checks (width, space) the order of the edges is arbitrary. + + This class has been introduced in version 0.23. + """ + @overload + @classmethod + def new(cls) -> EdgePairs: + r""" + @brief Default constructor + + This constructor creates an empty edge pair collection. + """ + @overload + @classmethod + def new(cls, array: Sequence[EdgePair]) -> EdgePairs: + r""" + @brief Constructor from an edge pair array + + This constructor creates an edge pair collection from an array of \EdgePair objects. + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, edge_pair: EdgePair) -> EdgePairs: + r""" + @brief Constructor from a single edge pair object + + This constructor creates an edge pair collection with a single edge pair. + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator) -> EdgePairs: + r""" + @brief Constructor from a hierarchical shape set + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + Only edge pairs are taken from the shape set and other shapes are ignored. + This method allows feeding the edge pair collection from a hierarchy of cells. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> EdgePairs: + r""" + @brief Creates a hierarchical edge pair collection from an original layer + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical edge pair collection which supports hierarchical operations. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> EdgePairs: + r""" + @brief Creates a hierarchical edge pair collection from an original layer with a transformation + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical edge pair collection which supports hierarchical operations. + The transformation is useful to scale to a specific database unit for example. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> EdgePairs: + r""" + @brief Constructor from a hierarchical shape set with a transformation + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + Only edge pairs are taken from the shape set and other shapes are ignored. + The given transformation is applied to each edge pair taken. + This method allows feeding the edge pair collection from a hierarchy of cells. + The transformation is useful to scale to a specific database unit for example. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shapes: Shapes) -> EdgePairs: + r""" + @brief Shapes constructor + + This constructor creates an edge pair collection from a \Shapes collection. + + This constructor has been introduced in version 0.26. + """ + def __add__(self, other: EdgePairs) -> EdgePairs: + r""" + @brief Returns the combined edge pair collection of self and the other one + + @return The resulting edge pair collection + + This operator adds the edge pairs of the other collection to self and returns a new combined set. + + This method has been introduced in version 0.24. + """ + def __copy__(self) -> EdgePairs: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> EdgePairs: + r""" + @brief Creates a copy of self + """ + def __getitem__(self, n: int) -> EdgePair: + r""" + @brief Returns the nth edge pair + + This method returns nil if the index is out of range. It is available for flat edge pairs only - i.e. those for which \has_valid_edge_pairs? is true. Use \flatten to explicitly flatten an edge pair collection. + + The \each iterator is the more general approach to access the edge pairs. + """ + def __iadd__(self, other: EdgePairs) -> EdgePairs: + r""" + @brief Adds the edge pairs of the other edge pair collection to self + + @return The edge pair collection after modification (self) + + This operator adds the edge pairs of the other collection to self. + + This method has been introduced in version 0.24. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor + + This constructor creates an empty edge pair collection. + """ + @overload + def __init__(self, array: Sequence[EdgePair]) -> None: + r""" + @brief Constructor from an edge pair array + + This constructor creates an edge pair collection from an array of \EdgePair objects. + + This constructor has been introduced in version 0.26. + """ + @overload + def __init__(self, edge_pair: EdgePair) -> None: + r""" + @brief Constructor from a single edge pair object + + This constructor creates an edge pair collection with a single edge pair. + + This constructor has been introduced in version 0.26. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator) -> None: + r""" + @brief Constructor from a hierarchical shape set + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + Only edge pairs are taken from the shape set and other shapes are ignored. + This method allows feeding the edge pair collection from a hierarchy of cells. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> None: + r""" + @brief Creates a hierarchical edge pair collection from an original layer + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical edge pair collection which supports hierarchical operations. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> None: + r""" + @brief Creates a hierarchical edge pair collection from an original layer with a transformation + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical edge pair collection which supports hierarchical operations. + The transformation is useful to scale to a specific database unit for example. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: + r""" + @brief Constructor from a hierarchical shape set with a transformation + + This constructor creates an edge pair collection from the shapes delivered by the given recursive shape iterator. + Only edge pairs are taken from the shape set and other shapes are ignored. + The given transformation is applied to each edge pair taken. + This method allows feeding the edge pair collection from a hierarchy of cells. + The transformation is useful to scale to a specific database unit for example. + Edge pairs in layout objects are somewhat special as most formats don't support reading or writing of edge pairs. Still they are useful objects and can be created and manipulated inside layouts. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::EdgePairs::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + + This constructor has been introduced in version 0.26. + """ + @overload + def __init__(self, shapes: Shapes) -> None: + r""" + @brief Shapes constructor + + This constructor creates an edge pair collection from a \Shapes collection. + + This constructor has been introduced in version 0.26. + """ + def __iter__(self) -> Iterator[EdgePair]: + r""" + @brief Returns each edge pair of the edge pair collection + """ + def __len__(self) -> int: + r""" + @brief Returns the (flat) number of edge pairs in the edge pair collection + + The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ + def __str__(self) -> str: + r""" + @brief Converts the edge pair collection to a string + The length of the output is limited to 20 edge pairs to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: ShapeCollection) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Return the bounding box of the edge pair collection + The bounding box is the box enclosing all points of all edge pairs. + """ + def clear(self) -> None: + r""" + @brief Clears the edge pair collection + """ + def count(self) -> int: + r""" + @brief Returns the (flat) number of edge pairs in the edge pair collection + + The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ + def create(self) -> None: + r""" + @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. + """ + def data_id(self) -> int: + r""" + @brief Returns the data ID (a unique identifier for the underlying data storage) + + This method has been added in version 0.26. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def disable_progress(self) -> None: + r""" + @brief Disable progress reporting + Calling this method will disable progress reporting. See \enable_progress. + """ + def dup(self) -> EdgePairs: + r""" + @brief Creates a copy of self + """ + def each(self) -> Iterator[EdgePair]: + r""" + @brief Returns each edge pair of the edge pair collection + """ + def edges(self) -> Edges: + r""" + @brief Decomposes the edge pairs into single edges + @return An edge collection containing the individual edges + """ + def enable_progress(self, label: str) -> None: + r""" + @brief Enable progress reporting + After calling this method, the edge pair collection will report the progress through a progress bar while expensive operations are running. + The label is a text which is put in front of the progress bar. + Using a progress bar will imply a performance penalty of a few percent typically. + """ + def enable_properties(self) -> None: + r""" + @brief Enables properties for the given container. + This method has an effect mainly on original layers and will import properties from such layers. By default, properties are not enabled on original layers. Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key. + + This method has been introduced in version 0.28.4. + """ + @overload + def extents(self) -> Region: + r""" + @brief Returns a region with the bounding boxes of the edge pairs + This method will return a region consisting of the bounding boxes of the edge pairs. + The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. + """ + @overload + def extents(self, d: int) -> Region: + r""" + @brief Returns a region with the enlarged bounding boxes of the edge pairs + This method will return a region consisting of the bounding boxes of the edge pairs enlarged by the given distance d. + The enlargement is specified per edge, i.e the width and height will be increased by 2*d. + The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. + """ + @overload + def extents(self, dx: int, dy: int) -> Region: + r""" + @brief Returns a region with the enlarged bounding boxes of the edge pairs + This method will return a region consisting of the bounding boxes of the edge pairs enlarged by the given distance dx in x direction and dy in y direction. + The enlargement is specified per edge, i.e the width will be increased by 2*dx. + The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. + """ + def filter_properties(self, keys: Sequence[Any]) -> None: + r""" + @brief Filters properties by certain keys. + Calling this method on a container will reduce the properties to values with name keys from the 'keys' list. + As a side effect, this method enables properties on original layers. + + This method has been introduced in version 0.28.4. + """ + def first_edges(self) -> Edges: + r""" + @brief Returns the first one of all edges + @return An edge collection containing the first edges + """ + def flatten(self) -> None: + r""" + @brief Explicitly flattens an edge pair collection + + If the collection is already flat (i.e. \has_valid_edge_pairs? returns true), this method will not change the collection. + + This method has been introduced in version 0.26. + """ + def has_valid_edge_pairs(self) -> bool: + r""" + @brief Returns true if the edge pair collection is flat and individual edge pairs can be accessed randomly + + This method has been introduced in version 0.26. + """ + def hier_count(self) -> int: + r""" + @brief Returns the (hierarchical) number of edge pairs in the edge pair collection + + The count is computed 'hierarchical', i.e. edge pairs inside a cell are counted once even if the cell is instantiated multiple times. + + This method has been introduced in version 0.27. + """ + @overload + def insert(self, edge_pair: EdgePair) -> None: + r""" + @brief Inserts an edge pair into the collection + """ + @overload + def insert(self, edge_pairs: EdgePairs) -> None: + r""" + @brief Inserts all edge pairs from the other edge pair collection into this edge pair collection + This method has been introduced in version 0.25. + """ + @overload + def insert(self, first: Edge, second: Edge) -> None: + r""" + @brief Inserts an edge pair into the collection + """ + def insert_into(self, layout: Layout, cell_index: int, layer: int) -> None: + r""" + @brief Inserts this edge pairs into the given layout, below the given cell and into the given layer. + If the edge pair collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. + + This method has been introduced in version 0.26. + """ + def insert_into_as_polygons(self, layout: Layout, cell_index: int, layer: int, e: int) -> None: + r""" + @brief Inserts this edge pairs into the given layout, below the given cell and into the given layer. + If the edge pair collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. + + The edge pairs will be converted to polygons with the enlargement value given be 'e'. + + This method has been introduced in version 0.26. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_deep(self) -> bool: + r""" + @brief Returns true if the edge pair collection is a deep (hierarchical) one + + This method has been added in version 0.26. + """ + def is_empty(self) -> bool: + r""" + @brief Returns true if the collection is empty + """ + def map_properties(self, key_map: Dict[Any, Any]) -> None: + r""" + @brief Maps properties by name key. + Calling this method on a container will reduce the properties to values with name keys from the 'keys' hash and renames the properties. Properties not listed in the key map will be removed. + As a side effect, this method enables properties on original layers. + + This method has been introduced in version 0.28.4. + """ + @overload + def move(self, p: Vector) -> EdgePairs: + r""" + @brief Moves the edge pair collection + + Moves the edge pairs by the given offset and returns the + moved edge pair collection. The edge pair collection is overwritten. + + @param p The distance to move the edge pairs. + + @return The moved edge pairs (self). + + Starting with version 0.25 the displacement is of vector type. + """ + @overload + def move(self, x: int, y: int) -> EdgePairs: + r""" + @brief Moves the edge pair collection + + Moves the edge pairs by the given offset and returns the + moved edge pairs. The edge pair collection is overwritten. + + @param x The x distance to move the edge pairs. + @param y The y distance to move the edge pairs. + + @return The moved edge pairs (self). + """ + @overload + def moved(self, p: Vector) -> EdgePairs: + r""" + @brief Returns the moved edge pair collection (does not modify self) + + Moves the edge pairs by the given offset and returns the + moved edge pairs. The edge pair collection is not modified. + + @param p The distance to move the edge pairs. + + @return The moved edge pairs. + + Starting with version 0.25 the displacement is of vector type. + """ + @overload + def moved(self, x: int, y: int) -> EdgePairs: + r""" + @brief Returns the moved edge pair collection (does not modify self) + + Moves the edge pairs by the given offset and returns the + moved edge pairs. The edge pair collection is not modified. + + @param x The x distance to move the edge pairs. + @param y The y distance to move the edge pairs. + + @return The moved edge pairs. + """ + @overload + def polygons(self) -> Region: + r""" + @brief Converts the edge pairs to polygons + This method creates polygons from the edge pairs. Each polygon will be a triangle or quadrangle which connects the start and end points of the edges forming the edge pair. + """ + @overload + def polygons(self, e: int) -> Region: + r""" + @brief Converts the edge pairs to polygons + This method creates polygons from the edge pairs. Each polygon will be a triangle or quadrangle which connects the start and end points of the edges forming the edge pair. This version allows one to specify an enlargement which is applied to the edges. The length of the edges is modified by applying the enlargement and the edges are shifted by the enlargement. By specifying an enlargement it is possible to give edge pairs an area which otherwise would not have one (coincident edges, two point-like edges). + """ + def remove_properties(self) -> None: + r""" + @brief Removes properties for the given container. + This will remove all properties on the given container. + + This method has been introduced in version 0.28.4. + """ + def second_edges(self) -> Edges: + r""" + @brief Returns the second one of all edges + @return An edge collection containing the second edges + """ + def size(self) -> int: + r""" + @brief Returns the (flat) number of edge pairs in the edge pair collection + + The count is computed 'as if flat', i.e. edge pairs inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ + def swap(self, other: EdgePairs) -> None: + r""" + @brief Swap the contents of this collection with the contents of another collection + This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare. + """ + @overload + def to_s(self) -> str: + r""" + @brief Converts the edge pair collection to a string + The length of the output is limited to 20 edge pairs to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. + """ + @overload + def to_s(self, max_count: int) -> str: + r""" + @brief Converts the edge pair collection to a string + This version allows specification of the maximum number of edge pairs contained in the string. + """ + @overload + def transform(self, t: ICplxTrans) -> EdgePairs: + r""" + @brief Transform the edge pair collection with a complex transformation (modifies self) + + Transforms the edge pair collection with the given transformation. + This version modifies the edge pair collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed edge pair collection. + """ + @overload + def transform(self, t: IMatrix2d) -> EdgePairs: + r""" + @brief Transform the edge pair collection (modifies self) + + Transforms the edge pair collection with the given 2d matrix transformation. + This version modifies the edge pair collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed edge pair collection. + + This variant has been introduced in version 0.27. + """ + @overload + def transform(self, t: IMatrix3d) -> EdgePairs: + r""" + @brief Transform the edge pair collection (modifies self) + + Transforms the edge pair collection with the given 3d matrix transformation. + This version modifies the edge pair collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed edge pair collection. + + This variant has been introduced in version 0.27. + """ + @overload + def transform(self, t: Trans) -> EdgePairs: + r""" + @brief Transform the edge pair collection (modifies self) + + Transforms the edge pair collection with the given transformation. + This version modifies the edge pair collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed edge pair collection. + """ + def transform_icplx(self, t: ICplxTrans) -> EdgePairs: + r""" + @brief Transform the edge pair collection with a complex transformation (modifies self) + + Transforms the edge pair collection with the given transformation. + This version modifies the edge pair collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed edge pair collection. + """ + @overload + def transformed(self, t: ICplxTrans) -> EdgePairs: + r""" + @brief Transform the edge pair collection with a complex transformation + + Transforms the edge pairs with the given complex transformation. + Does not modify the edge pair collection but returns the transformed edge pairs. + + @param t The transformation to apply. + + @return The transformed edge pairs. + """ + @overload + def transformed(self, t: IMatrix2d) -> EdgePairs: + r""" + @brief Transform the edge pair collection + + Transforms the edge pairs with the given 2d matrix transformation. + Does not modify the edge pair collection but returns the transformed edge pairs. + + @param t The transformation to apply. + + @return The transformed edge pairs. + + This variant has been introduced in version 0.27. + """ + @overload + def transformed(self, t: IMatrix3d) -> EdgePairs: + r""" + @brief Transform the edge pair collection + + Transforms the edge pairs with the given 3d matrix transformation. + Does not modify the edge pair collection but returns the transformed edge pairs. + + @param t The transformation to apply. + + @return The transformed edge pairs. + + This variant has been introduced in version 0.27. + """ + @overload + def transformed(self, t: Trans) -> EdgePairs: + r""" + @brief Transform the edge pair collection + + Transforms the edge pairs with the given transformation. + Does not modify the edge pair collection but returns the transformed edge pairs. + + @param t The transformation to apply. + + @return The transformed edge pairs. + """ + def transformed_icplx(self, t: ICplxTrans) -> EdgePairs: + r""" + @brief Transform the edge pair collection with a complex transformation + + Transforms the edge pairs with the given complex transformation. + Does not modify the edge pair collection but returns the transformed edge pairs. + + @param t The transformation to apply. + + @return The transformed edge pairs. + """ + @overload + def with_angle(self, angle: float, inverse: bool) -> EdgePairs: + r""" + @brief Filter the edge pairs by orientation of their edges + Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with at least one edge having the given angle to the x-axis are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + This will filter edge pairs with at least one horizontal edge: + + @code + horizontal = edge_pairs.with_angle(0, false) + @/code + + Note that the inverse @b result @/b of \with_angle is delivered by \with_angle_both with the inverse flag set as edge pairs are unselected when both edges fail to meet the criterion. + I.e + + @code + result = edge_pairs.with_angle(0, false) + others = edge_pairs.with_angle_both(0, true) + @/code + + This method has been added in version 0.27.1. + """ + @overload + def with_angle(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Filter the edge pairs by orientation of their edges + Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with at least one edge having an angle between min_angle and max_angle are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + With "include_min_angle" set to true (the default), the minimum angle is included in the criterion while with false, the minimum angle itself is not included. Same for "include_max_angle" where the default is false, meaning the maximum angle is not included in the range. + + Note that the inverse @b result @/b of \with_angle is delivered by \with_angle_both with the inverse flag set as edge pairs are unselected when both edges fail to meet the criterion. + I.e + + @code + result = edge_pairs.with_angle(0, 45, false) + others = edge_pairs.with_angle_both(0, 45, true) + @/code + + This method has been added in version 0.27.1. + """ + @overload + def with_angle(self, type: Edges.EdgeType, inverse: bool) -> EdgePairs: + r""" + @brief Filter the edge pairs by orientation of their edges + Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with at least one edge having an angle of the given type are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations and are specified using one of the \Edges#OrthoEdges, \Edges#DiagonalEdges or \Edges#OrthoDiagonalEdges types. + + Note that the inverse @b result @/b of \with_angle is delivered by \with_angle_both with the inverse flag set as edge pairs are unselected when both edges fail to meet the criterion. + I.e + + @code + result = edge_pairs.with_angle(RBA::Edges::Ortho, false) + others = edge_pairs.with_angle_both(RBA::Edges::Ortho, true) + @/code + + This method has been added in version 0.28. + """ + @overload + def with_angle_both(self, angle: float, inverse: bool) -> EdgePairs: + r""" + @brief Filter the edge pairs by orientation of both of their edges + Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with both edges having the given angle to the x-axis are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + This will filter edge pairs with at least one horizontal edge: + + @code + horizontal = edge_pairs.with_angle_both(0, false) + @/code + + Note that the inverse @b result @/b of \with_angle_both is delivered by \with_angle with the inverse flag set as edge pairs are unselected when one edge fails to meet the criterion. + I.e + + @code + result = edge_pairs.with_angle_both(0, false) + others = edge_pairs.with_angle(0, true) + @/code + + This method has been added in version 0.27.1. + """ + @overload + def with_angle_both(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Filter the edge pairs by orientation of both of their edges + Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with both edges having an angle between min_angle and max_angle are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + With "include_min_angle" set to true (the default), the minimum angle is included in the criterion while with false, the minimum angle itself is not included. Same for "include_max_angle" where the default is false, meaning the maximum angle is not included in the range. + + Note that the inverse @b result @/b of \with_angle_both is delivered by \with_angle with the inverse flag set as edge pairs are unselected when one edge fails to meet the criterion. + I.e + + @code + result = edge_pairs.with_angle_both(0, 45, false) + others = edge_pairs.with_angle(0, 45, true) + @/code + + This method has been added in version 0.27.1. + """ + @overload + def with_angle_both(self, type: Edges.EdgeType, inverse: bool) -> EdgePairs: + r""" + @brief Filter the edge pairs by orientation of their edges + Filters the edge pairs in the edge pair collection by orientation. If "inverse" is false, only edge pairs with both edges having an angle of the given type are returned. If "inverse" is true, edge pairs not fulfilling this criterion for both edges are returned. + + This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations and are specified using one of the \Edges#OrthoEdges, \Edges#DiagonalEdges or \Edges#OrthoDiagonalEdges types. + + Note that the inverse @b result @/b of \with_angle_both is delivered by \with_angle with the inverse flag set as edge pairs are unselected when one edge fails to meet the criterion. + I.e + + @code + result = edge_pairs.with_angle_both(RBA::Edges::Ortho, false) + others = edge_pairs.with_angle(RBA::Edges::Ortho, true) + @/code + + This method has been added in version 0.28. + """ + @overload + def with_area(self, area: int, inverse: bool) -> EdgePairs: + r""" + @brief Filters the edge pairs by the enclosed area + Filters the edge pairs in the edge pair collection by enclosed area. If "inverse" is false, only edge pairs with the given area are returned. If "inverse" is true, edge pairs not with the given area are returned. + + This method has been added in version 0.27.2. + """ + @overload + def with_area(self, min_area: int, max_area: int, inverse: bool) -> EdgePairs: + r""" + @brief Filters the edge pairs by the enclosed area + Filters the edge pairs in the edge pair collection by enclosed area. If "inverse" is false, only edge pairs with an area between min_area and max_area (max_area itself is excluded) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + This method has been added in version 0.27.2. + """ + @overload + def with_distance(self, distance: int, inverse: bool) -> EdgePairs: + r""" + @brief Filters the edge pairs by the distance of the edges + Filters the edge pairs in the edge pair collection by distance of the edges. If "inverse" is false, only edge pairs where both edges have the given distance are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + Distance is measured as the shortest distance between any of the points on the edges. + + This method has been added in version 0.27.1. + """ + @overload + def with_distance(self, min_distance: Any, max_distance: Any, inverse: bool) -> EdgePairs: + r""" + @brief Filters the edge pairs by the distance of the edges + Filters the edge pairs in the edge pair collection by distance of the edges. If "inverse" is false, only edge pairs where both edges have a distance between min_distance and max_distance (max_distance itself is excluded) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + Distance is measured as the shortest distance between any of the points on the edges. + + This method has been added in version 0.27.1. + """ + @overload + def with_internal_angle(self, angle: float, inverse: bool) -> EdgePairs: + r""" + @brief Filters the edge pairs by the angle between their edges + Filters the edge pairs in the edge pair collection by the angle between their edges. If "inverse" is false, only edge pairs with the given angle are returned. If "inverse" is true, edge pairs not with the given angle are returned. + + The angle is measured between the two edges. It is between 0 (parallel or anti-parallel edges) and 90 degree (perpendicular edges). + + This method has been added in version 0.27.2. + """ + @overload + def with_internal_angle(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> EdgePairs: + r""" + @brief Filters the edge pairs by the angle between their edges + Filters the edge pairs in the edge pair collection by the angle between their edges. If "inverse" is false, only edge pairs with an angle between min_angle and max_angle (max_angle itself is excluded) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + The angle is measured between the two edges. It is between 0 (parallel or anti-parallel edges) and 90 degree (perpendicular edges). + + With "include_min_angle" set to true (the default), the minimum angle is included in the criterion while with false, the minimum angle itself is not included. Same for "include_max_angle" where the default is false, meaning the maximum angle is not included in the range. + + This method has been added in version 0.27.2. + """ + @overload + def with_length(self, length: int, inverse: bool) -> EdgePairs: + r""" + @brief Filters the edge pairs by length of one of their edges + Filters the edge pairs in the edge pair collection by length of at least one of their edges. If "inverse" is false, only edge pairs with at least one edge having the given length are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + This method has been added in version 0.27.1. + """ + @overload + def with_length(self, min_length: Any, max_length: Any, inverse: bool) -> EdgePairs: + r""" + @brief Filters the edge pairs by length of one of their edges + Filters the edge pairs in the edge pair collection by length of at least one of their edges. If "inverse" is false, only edge pairs with at least one edge having a length between min_length and max_length (excluding max_length itself) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + This method has been added in version 0.27.1. + """ + @overload + def with_length_both(self, length: int, inverse: bool) -> EdgePairs: + r""" + @brief Filters the edge pairs by length of both of their edges + Filters the edge pairs in the edge pair collection by length of both of their edges. If "inverse" is false, only edge pairs where both edges have the given length are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + This method has been added in version 0.27.1. + """ + @overload + def with_length_both(self, min_length: Any, max_length: Any, inverse: bool) -> EdgePairs: + r""" + @brief Filters the edge pairs by length of both of their edges + Filters the edge pairs in the edge pair collection by length of both of their edges. If "inverse" is false, only edge pairs with both edges having a length between min_length and max_length (excluding max_length itself) are returned. If "inverse" is true, edge pairs not fulfilling this criterion are returned. + + If you don't want to specify a lower or upper limit, pass nil to that parameter. + + This method has been added in version 0.27.1. + """ + +class EdgeProcessor: + r""" + @brief The edge processor (boolean, sizing, merge) + + The edge processor implements the boolean and edge set operations (size, merge). Because the edge processor might allocate resources which can be reused in later operations, it is implemented as an object that can be used several times. + + Here is a simple example of how to use the edge processor: + + @code + ep = RBA::EdgeProcessor::new + # Prepare two boxes + a = [ RBA::Polygon::new(RBA::Box::new(0, 0, 300, 300)) ] + b = [ RBA::Polygon::new(RBA::Box::new(100, 100, 200, 200)) ] + # Run an XOR -> creates a polygon with a hole, since the 'resolve_holes' parameter + # is false: + out = ep.boolean_p2p(a, b, RBA::EdgeProcessor::ModeXor, false, false) + out.to_s # -> [(0,0;0,300;300,300;300,0/100,100;200,100;200,200;100,200)] + @/code + """ + ModeANotB: ClassVar[int] + r""" + @brief boolean method's mode value for A NOT B operation + """ + ModeAnd: ClassVar[int] + r""" + @brief boolean method's mode value for AND operation + """ + ModeBNotA: ClassVar[int] + r""" + @brief boolean method's mode value for B NOT A operation + """ + ModeOr: ClassVar[int] + r""" + @brief boolean method's mode value for OR operation + """ + ModeXor: ClassVar[int] + r""" + @brief boolean method's mode value for XOR operation + """ + @classmethod + def mode_and(cls) -> int: + r""" + @brief boolean method's mode value for AND operation + """ + @classmethod + def mode_anotb(cls) -> int: + r""" + @brief boolean method's mode value for A NOT B operation + """ + @classmethod + def mode_bnota(cls) -> int: + r""" + @brief boolean method's mode value for B NOT A operation + """ + @classmethod + def mode_or(cls) -> int: + r""" + @brief boolean method's mode value for OR operation + """ + @classmethod + def mode_xor(cls) -> int: + r""" + @brief boolean method's mode value for XOR operation + """ + @classmethod + def new(cls) -> EdgeProcessor: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> EdgeProcessor: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> EdgeProcessor: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: EdgeProcessor) -> None: + r""" + @brief Assigns another object to self + """ + @overload + def boolean(self, a: Sequence[Edge], b: Sequence[Edge], mode: int) -> List[Edge]: + r""" + @brief Boolean operation for a set of given edges, creating edges + + This method computes the result for the given boolean operation on two sets of edges. + The input edges must form closed contours where holes and hulls must be oriented differently. + The input edges are processed with a simple non-zero wrap count rule as a whole. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input edges (first operand) + @param b The input edges (second operand) + @param mode The boolean mode (one of the Mode.. values) + @return The output edges + """ + @overload + def boolean(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int) -> List[Edge]: + r""" + @brief Boolean operation for a set of given polygons, creating edges + + This method computes the result for the given boolean operation on two sets of polygons. + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a Boolean operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input polygons (first operand) + @param b The input polygons (second operand) + @param mode The boolean mode + @return The output edges + """ + def boolean_e2e(self, a: Sequence[Edge], b: Sequence[Edge], mode: int) -> List[Edge]: + r""" + @brief Boolean operation for a set of given edges, creating edges + + This method computes the result for the given boolean operation on two sets of edges. + The input edges must form closed contours where holes and hulls must be oriented differently. + The input edges are processed with a simple non-zero wrap count rule as a whole. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input edges (first operand) + @param b The input edges (second operand) + @param mode The boolean mode (one of the Mode.. values) + @return The output edges + """ + def boolean_e2p(self, a: Sequence[Edge], b: Sequence[Edge], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Boolean operation for a set of given edges, creating polygons + + This method computes the result for the given boolean operation on two sets of edges. + The input edges must form closed contours where holes and hulls must be oriented differently. + The input edges are processed with a simple non-zero wrap count rule as a whole. + + This method produces polygons on output and allows fine-tuning of the parameters for that purpose. + + Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input polygons (first operand) + @param b The input polygons (second operand) + @param mode The boolean mode (one of the Mode.. values) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + def boolean_p2e(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int) -> List[Edge]: + r""" + @brief Boolean operation for a set of given polygons, creating edges + + This method computes the result for the given boolean operation on two sets of polygons. + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a Boolean operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'boolean'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input polygons (first operand) + @param b The input polygons (second operand) + @param mode The boolean mode + @return The output edges + """ + def boolean_p2p(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Boolean operation for a set of given polygons, creating polygons + + This method computes the result for the given boolean operation on two sets of polygons. + This method produces polygons on output and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a Boolean operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input polygons (first operand) + @param b The input polygons (second operand) + @param mode The boolean mode (one of the Mode.. values) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def boolean_to_polygon(self, a: Sequence[Edge], b: Sequence[Edge], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Boolean operation for a set of given edges, creating polygons + + This method computes the result for the given boolean operation on two sets of edges. + The input edges must form closed contours where holes and hulls must be oriented differently. + The input edges are processed with a simple non-zero wrap count rule as a whole. + + This method produces polygons on output and allows fine-tuning of the parameters for that purpose. + + Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input polygons (first operand) + @param b The input polygons (second operand) + @param mode The boolean mode (one of the Mode.. values) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def boolean_to_polygon(self, a: Sequence[Polygon], b: Sequence[Polygon], mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Boolean operation for a set of given polygons, creating polygons + + This method computes the result for the given boolean operation on two sets of polygons. + This method produces polygons on output and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a Boolean operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'boolean_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param a The input polygons (first operand) + @param b The input polygons (second operand) + @param mode The boolean mode (one of the Mode.. values) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def disable_progress(self) -> None: + r""" + @brief Disable progress reporting + Calling this method will stop the edge processor from showing a progress bar. See \enable_progress. + + This method has been introduced in version 0.23. + """ + def dup(self) -> EdgeProcessor: + r""" + @brief Creates a copy of self + """ + def enable_progress(self, label: str) -> None: + r""" + @brief Enable progress reporting + After calling this method, the edge processor will report the progress through a progress bar. + The label is a text which is put in front of the progress bar. + Using a progress bar will imply a performance penalty of a few percent typically. + + This method has been introduced in version 0.23. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def merge(self, in_: Sequence[Polygon], min_wc: int) -> List[Edge]: + r""" + @brief Merge the given polygons + + In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. + Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the + hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps + of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping + polygons do not contribute to higher wrap count areas. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + Prior to version 0.21 this method was called 'merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + @return The output edges + """ + def merge_p2e(self, in_: Sequence[Polygon], min_wc: int) -> List[Edge]: + r""" + @brief Merge the given polygons + + In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. + Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the + hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps + of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping + polygons do not contribute to higher wrap count areas. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + Prior to version 0.21 this method was called 'merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + @return The output edges + """ + def merge_p2p(self, in_: Sequence[Polygon], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given polygons + + In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. + Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the + hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps + of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping + polygons do not contribute to higher wrap count areas. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + Prior to version 0.21 this method was called 'merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + def merge_to_polygon(self, in_: Sequence[Polygon], min_wc: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given polygons + + In contrast to "simple_merge", this merge implementation considers each polygon individually before merging them. + Thus self-overlaps are effectively removed before the output is computed and holes are correctly merged with the + hull. In addition, this method allows selecting areas with a higher wrap count which in turn allows computing overlaps + of polygons on the same layer. Because this method merges the polygons before the overlap is computed, self-overlapping + polygons do not contribute to higher wrap count areas. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + Prior to version 0.21 this method was called 'merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param min_wc The minimum wrap count for output (0: all polygons, 1: at least two overlapping) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge(self, in_: Sequence[Edge]) -> List[Edge]: + r""" + @brief Merge the given edges in a simple "non-zero wrapcount" fashion + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input edges + @return The output edges + """ + @overload + def simple_merge(self, in_: Sequence[Edge], mode: int) -> List[Edge]: + r""" + @brief Merge the given polygons and specify the merge mode + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input edges + @return The output edges + """ + @overload + def simple_merge(self, in_: Sequence[Polygon]) -> List[Edge]: + r""" + @brief Merge the given polygons in a simple "non-zero wrapcount" fashion + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @return The output edges + """ + @overload + def simple_merge(self, in_: Sequence[Polygon], mode: int) -> List[Edge]: + r""" + @brief Merge the given polygons and specify the merge mode + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input polygons + @return The output edges + """ + @overload + def simple_merge_e2e(self, in_: Sequence[Edge]) -> List[Edge]: + r""" + @brief Merge the given edges in a simple "non-zero wrapcount" fashion + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input edges + @return The output edges + """ + @overload + def simple_merge_e2e(self, in_: Sequence[Edge], mode: int) -> List[Edge]: + r""" + @brief Merge the given polygons and specify the merge mode + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input edges + @return The output edges + """ + @overload + def simple_merge_e2p(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given edges in a simple "non-zero wrapcount" fashion into polygons + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input edges + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge_e2p(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: + r""" + @brief Merge the given polygons and specify the merge mode + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input edges + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge_p2e(self, in_: Sequence[Polygon]) -> List[Edge]: + r""" + @brief Merge the given polygons in a simple "non-zero wrapcount" fashion + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @return The output edges + """ + @overload + def simple_merge_p2e(self, in_: Sequence[Polygon], mode: int) -> List[Edge]: + r""" + @brief Merge the given polygons and specify the merge mode + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input polygons + @return The output edges + """ + @overload + def simple_merge_p2p(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given polygons in a simple "non-zero wrapcount" fashion into polygons + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge_p2p(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: + r""" + @brief Merge the given polygons and specify the merge mode + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input polygons + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge_to_polygon(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given edges in a simple "non-zero wrapcount" fashion into polygons + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input edges + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge_to_polygon(self, in_: Sequence[Edge], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: + r""" + @brief Merge the given polygons and specify the merge mode + + The edges provided must form valid closed contours. Contours oriented differently "cancel" each other. + Overlapping contours are merged when the orientation is the same. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input edges + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge_to_polygon(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Merge the given polygons in a simple "non-zero wrapcount" fashion into polygons + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + Prior to version 0.21 this method was called 'simple_merge_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def simple_merge_to_polygon(self, in_: Sequence[Polygon], resolve_holes: bool, min_coherence: bool, mode: int) -> List[Polygon]: + r""" + @brief Merge the given polygons and specify the merge mode + + The wrapcount is computed over all polygons, i.e. overlapping polygons may "cancel" if they + have different orientation (since a polygon is oriented by construction that is not easy to achieve). + The other merge operation provided for this purpose is "merge" which normalizes each polygon individually before + merging them. "simple_merge" is somewhat faster and consumes less memory. + + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + This is a convenience method that bundles filling of the edges, processing with + a SimpleMerge operator and puts the result into an output vector. + + This method has been added in version 0.22. + + The mode specifies the rule to use when producing output. A value of 0 specifies the even-odd rule. A positive value specifies the wrap count threshold (positive only). A negative value specifies the threshold of the absolute value of the wrap count (i.e. -1 is non-zero rule). + + @param mode See description + @param in The input polygons + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def size(self, in_: Sequence[Polygon], d: int, mode: int) -> List[Edge]: + r""" + @brief Size the given polygons (isotropic) + + This method is equivalent to calling the anisotropic version with identical dx and dy. + + Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param d The sizing value in x direction + @param mode The sizing mode + @return The output edges + """ + @overload + def size(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int) -> List[Edge]: + r""" + @brief Size the given polygons + + This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied + on the individual result polygons of the merge step. The result may contain overlapping contours, but no self-overlaps. + + dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). + The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both + dx and dy. + + The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param dx The sizing value in x direction + @param dy The sizing value in y direction + @param mode The sizing mode (standard is 2) + @return The output edges + """ + @overload + def size_p2e(self, in_: Sequence[Polygon], d: int, mode: int) -> List[Edge]: + r""" + @brief Size the given polygons (isotropic) + + This method is equivalent to calling the anisotropic version with identical dx and dy. + + Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param d The sizing value in x direction + @param mode The sizing mode + @return The output edges + """ + @overload + def size_p2e(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int) -> List[Edge]: + r""" + @brief Size the given polygons + + This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied + on the individual result polygons of the merge step. The result may contain overlapping contours, but no self-overlaps. + + dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). + The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both + dx and dy. + + The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. + The result is presented as a set of edges forming closed contours. Hulls are oriented clockwise while + holes are oriented counter-clockwise. + + Prior to version 0.21 this method was called 'size'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param dx The sizing value in x direction + @param dy The sizing value in y direction + @param mode The sizing mode (standard is 2) + @return The output edges + """ + @overload + def size_p2p(self, in_: Sequence[Polygon], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Size the given polygons into polygons (isotropic) + + This method is equivalent to calling the anisotropic version with identical dx and dy. + + Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param d The sizing value in x direction + @param mode The sizing mode + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def size_p2p(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Size the given polygons into polygons + + This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied + on the individual result polygons of the merge step. The result may contain overlapping polygons, but no self-overlapping ones. + Polygon overlap occurs if the polygons are close enough, so a positive sizing makes polygons overlap. + + dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). + The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both + dx and dy. + + The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param dx The sizing value in x direction + @param dy The sizing value in y direction + @param mode The sizing mode (standard is 2) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def size_to_polygon(self, in_: Sequence[Polygon], d: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Size the given polygons into polygons (isotropic) + + This method is equivalent to calling the anisotropic version with identical dx and dy. + + Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param d The sizing value in x direction + @param mode The sizing mode + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + @overload + def size_to_polygon(self, in_: Sequence[Polygon], dx: int, dy: int, mode: int, resolve_holes: bool, min_coherence: bool) -> List[Polygon]: + r""" + @brief Size the given polygons into polygons + + This method sizes a set of polygons. Before the sizing is applied, the polygons are merged. After that, sizing is applied + on the individual result polygons of the merge step. The result may contain overlapping polygons, but no self-overlapping ones. + Polygon overlap occurs if the polygons are close enough, so a positive sizing makes polygons overlap. + + dx and dy describe the sizing. A positive value indicates oversize (outwards) while a negative one describes undersize (inwards). + The sizing applied can be chosen differently in x and y direction. In this case, the sign must be identical for both + dx and dy. + + The 'mode' parameter describes the corner fill strategy. Mode 0 connects all corner segments directly. Mode 1 is the 'octagon' strategy in which square corners are interpolated with a partial octagon. Mode 2 is the standard mode in which corners are filled by expanding edges unless these edges form a sharp bend with an angle of more than 90 degree. In that case, the corners are cut off. In Mode 3, no cutoff occurs up to a bending angle of 135 degree. Mode 4 and 5 are even more aggressive and allow very sharp bends without cutoff. This strategy may produce long spikes on sharply bending corners. + This method produces polygons and allows fine-tuning of the parameters for that purpose. + + Prior to version 0.21 this method was called 'size_to_polygon'. Is was renamed to avoid ambiguities for empty input arrays. The old version is still available but deprecated. + + @param in The input polygons + @param dx The sizing value in x direction + @param dy The sizing value in y direction + @param mode The sizing mode (standard is 2) + @param resolve_holes true, if holes should be resolved into the hull + @param min_coherence true, if touching corners should be resolved into less connected contours + @return The output polygons + """ + +class Edges(ShapeCollection): + r""" + @brief A collection of edges (Not necessarily describing closed contours) + + + This class was introduced to simplify operations on edges sets. See \Edge for a description of the individual edge object. The edge collection contains an arbitrary number of edges and supports operations to select edges by various criteria, produce polygons from the edges by applying an extension, filtering edges against other edges collections and checking geometrical relations to other edges (DRC functionality). + + The edge collection is supposed to work closely with the \Region polygon set. Both are related, although the edge collection has a lower rank since it potentially represents a disconnected collection of edges. Edge collections may form closed contours, for example immediately after they have been derived from a polygon set using \Region#edges. But this state is volatile and can easily be destroyed by filtering edges. Hence the connected state does not play an important role in the edge collection's API. + + Edge collections may also contain points (degenerated edges with identical start and end points). Such point-like objects participate in some although not all methods of the edge collection class. + Edge collections can be used in two different flavors: in raw mode or merged semantics. With merged semantics (the default), connected edges are considered to belong together and are effectively merged. + Overlapping parts are counted once in that mode. Dot-like edges are not considered in merged semantics. + In raw mode (without merged semantics), each edge is considered as it is. Overlaps between edges + may exists and merging has to be done explicitly using the \merge method. The semantics can be + selected using \merged_semantics=. + + + This class has been introduced in version 0.23. + """ + class EdgeType: + r""" + @brief This enum specifies the the edge type for edge angle filters. + + This enum was introduced in version 0.28. + """ + DiagonalEdges: ClassVar[Edges.EdgeType] + r""" + @brief Diagonal edges are selected (-45 and 45 degree) + """ + OrthoDiagonalEdges: ClassVar[Edges.EdgeType] + r""" + @brief Diagonal or orthogonal edges are selected (0, 90, -45 and 45 degree) + """ + OrthoEdges: ClassVar[Edges.EdgeType] + r""" + @brief Horizontal and vertical edges are selected + """ + @overload + @classmethod + def new(cls, i: int) -> Edges.EdgeType: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> Edges.EdgeType: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: Edges.EdgeType) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + DiagonalEdges: ClassVar[Edges.EdgeType] + r""" + @brief Diagonal edges are selected (-45 and 45 degree) + """ + DifferentPropertiesConstraint: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are different + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are different. Properties are generated on the output shapes where applicable. + """ + DifferentPropertiesConstraintDrop: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are different + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are the same. No properties are generated on the output shapes. + """ + Euclidian: ClassVar[Metrics] + r""" + @brief Specifies Euclidian metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by: + + @code + d = sqrt(dx^2 + dy^2) + @/code + + All points within a circle with radius d around one point are considered to have a smaller distance than d. + """ + IgnoreProperties: ClassVar[PropertyConstraint] + r""" + @brief Specifies to ignore properties + When using this constraint - for example on a boolean operation - properties are ignored and are not generated in the output. + """ + NoPropertyConstraint: ClassVar[PropertyConstraint] + r""" + @brief Specifies not to apply any property constraint + When using this constraint - for example on a boolean operation - shapes are considered regardless of their user properties. Properties are generated on the output shapes where applicable. + """ + OrthoDiagonalEdges: ClassVar[Edges.EdgeType] + r""" + @brief Diagonal or orthogonal edges are selected (0, 90, -45 and 45 degree) + """ + OrthoEdges: ClassVar[Edges.EdgeType] + r""" + @brief Horizontal and vertical edges are selected + """ + Projection: ClassVar[Metrics] + r""" + @brief Specifies projected distance metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other. + """ + SamePropertiesConstraint: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are the same + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are the same. Properties are generated on the output shapes where applicable. + """ + SamePropertiesConstraintDrop: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are the same + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are the same. No properties are generated on the output shapes. + """ + Square: ClassVar[Metrics] + r""" + @brief Specifies square metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies square metrics, i.e. the distance between two points is measured by: + + @code + d = max(abs(dx), abs(dy)) + @/code + + All points within a square with length 2*d around one point are considered to have a smaller distance than d in this metrics. + """ + merged_semantics: bool + r""" + Getter: + @brief Gets a flag indicating whether merged semantics is enabled + See \merged_semantics= for a description of this attribute. + + Setter: + @brief Enable or disable merged semantics + If merged semantics is enabled (the default), colinear, connected or overlapping edges will be considered + as single edges. + """ + @overload + @classmethod + def new(cls) -> Edges: + r""" + @brief Default constructor + + This constructor creates an empty edge collection. + """ + @overload + @classmethod + def new(cls, array: Sequence[Edge]) -> Edges: + r""" + @brief Constructor from an edge array + + This constructor creates an edge collection from an array of edges. + """ + @overload + @classmethod + def new(cls, array: Sequence[Polygon]) -> Edges: + r""" + @brief Constructor from a polygon array + + This constructor creates an edge collection from an array of polygons. + The edges form the contours of the polygons. + """ + @overload + @classmethod + def new(cls, box: Box) -> Edges: + r""" + @brief Box constructor + + This constructor creates an edge collection from a box. + The edges form the contour of the box. + """ + @overload + @classmethod + def new(cls, edge: Edge) -> Edges: + r""" + @brief Constructor from a single edge + + This constructor creates an edge collection with a single edge. + """ + @overload + @classmethod + def new(cls, path: Path) -> Edges: + r""" + @brief Path constructor + + This constructor creates an edge collection from a path. + The edges form the contour of the path. + """ + @overload + @classmethod + def new(cls, polygon: Polygon) -> Edges: + r""" + @brief Polygon constructor + + This constructor creates an edge collection from a polygon. + The edges form the contour of the polygon. + """ + @overload + @classmethod + def new(cls, polygon: SimplePolygon) -> Edges: + r""" + @brief Simple polygon constructor + + This constructor creates an edge collection from a simple polygon. + The edges form the contour of the polygon. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, as_edges: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor of a flat edge collection from a hierarchical shape set + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into a flat edge set. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Edges::new(layout.begin_shapes(cell, layer), false) + @/code + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, as_edges: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor of a hierarchical edge collection + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into the hierarchical edge set. + The edges remain within their original hierarchy unless other operations require the edges to be moved in the hierarchy. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Edges::new(layout.begin_shapes(cell, layer), dss, false) + @/code + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + + This special constructor will create a deep edge set from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + region = RBA::Region::new(iter, dss, "*") # all texts + region = RBA::Region::new(iter, dss, "A*") # all texts starting with an 'A' + region = RBA::Region::new(iter, dss, "A*", false) # all texts exactly matching 'A*' + @/code + + This method has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor of a hierarchical edge collection with a transformation + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into the hierarchical edge set. + The edges remain within their original hierarchy unless other operations require the edges to be moved in the hierarchy. + The transformation is useful to scale to a specific database unit for example. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Edges::new(layout.begin_shapes(cell, layer), dss, RBA::ICplxTrans::new(layout.dbu / dbu), false) + @/code + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + + This special constructor will create dot-like edges from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + dots = RBA::Edges::new(iter, "*") # all texts + dots = RBA::Edges::new(iter, "A*") # all texts starting with an 'A' + dots = RBA::Edges::new(iter, "A*", false) # all texts exactly matching 'A*' + @/code + + This method has been introduced in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor of a flat edge collection from a hierarchical shape set with a transformation + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into a flat edge set. + The transformation is useful to scale to a specific database unit for example. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Edges::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + """ + @overload + @classmethod + def new(cls, shapes: Shapes, as_edges: Optional[bool] = ...) -> Edges: + r""" + @brief Constructor of a flat edge collection from a \Shapes container + + If 'as_edges' is true, the shapes from the container will be converted to edges (i.e. polygon contours to edges). Otherwise, only edges will be taken from the container. + + This method has been introduced in version 0.26. + """ + def __add__(self, other: Edges) -> Edges: + r""" + @brief Returns the combined edge set of self and the other one + + @return The resulting edge set + + This operator adds the edges of the other edge set to self and returns a new combined edge set. This usually creates unmerged edge sets and edges may overlap. Use \merge if you want to ensure the result edge set is merged. + """ + @overload + def __and__(self, other: Edges) -> Edges: + r""" + @brief Returns the boolean AND between self and the other edge collection + + @return The result of the boolean AND operation + + The boolean AND operation will return all parts of the edges in this collection which are coincident with parts of the edges in the other collection.The result will be a merged edge collection. + """ + @overload + def __and__(self, other: Region) -> Edges: + r""" + @brief Returns the parts of the edges inside the given region + + @return The edges inside the given region + + This operation returns the parts of the edges which are inside the given region. + Edges on the borders of the polygons are included in the edge set. + As a side effect, the edges are made non-intersecting by introducing cut points where + edges intersect. + + This method has been introduced in version 0.24. + """ + def __copy__(self) -> Edges: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Edges: + r""" + @brief Creates a copy of self + """ + def __getitem__(self, n: int) -> Edge: + r""" + @brief Returns the nth edge of the collection + + This method returns nil if the index is out of range. It is available for flat edge collections only - i.e. those for which \has_valid_edges? is true. Use \flatten to explicitly flatten an edge collection. + This method returns the raw edge (not merged edges, even if merged semantics is enabled). + + The \each iterator is the more general approach to access the edges. + """ + def __iadd__(self, other: Edges) -> Edges: + r""" + @brief Adds the edges of the other edge collection to self + + @return The edge set after modification (self) + + This operator adds the edges of the other edge set to self. This usually creates unmerged edge sets and edges may overlap. Use \merge if you want to ensure the result edge set is merged. + """ + @overload + def __iand__(self, other: Edges) -> Edges: + r""" + @brief Performs the boolean AND between self and the other edge collection + + @return The edge collection after modification (self) + + The boolean AND operation will return all parts of the edges in this collection which are coincident with parts of the edges in the other collection.The result will be a merged edge collection. + """ + @overload + def __iand__(self, other: Region) -> Edges: + r""" + @brief Selects the parts of the edges inside the given region + + @return The edge collection after modification (self) + + This operation selects the parts of the edges which are inside the given region. + Edges on the borders of the polygons are included in the edge set. + As a side effect, the edges are made non-intersecting by introducing cut points where + edges intersect. + + This method has been introduced in version 0.24. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor + + This constructor creates an empty edge collection. + """ + @overload + def __init__(self, array: Sequence[Edge]) -> None: + r""" + @brief Constructor from an edge array + + This constructor creates an edge collection from an array of edges. + """ + @overload + def __init__(self, array: Sequence[Polygon]) -> None: + r""" + @brief Constructor from a polygon array + + This constructor creates an edge collection from an array of polygons. + The edges form the contours of the polygons. + """ + @overload + def __init__(self, box: Box) -> None: + r""" + @brief Box constructor + + This constructor creates an edge collection from a box. + The edges form the contour of the box. + """ + @overload + def __init__(self, edge: Edge) -> None: + r""" + @brief Constructor from a single edge + + This constructor creates an edge collection with a single edge. + """ + @overload + def __init__(self, path: Path) -> None: + r""" + @brief Path constructor + + This constructor creates an edge collection from a path. + The edges form the contour of the path. + """ + @overload + def __init__(self, polygon: Polygon) -> None: + r""" + @brief Polygon constructor + + This constructor creates an edge collection from a polygon. + The edges form the contour of the polygon. + """ + @overload + def __init__(self, polygon: SimplePolygon) -> None: + r""" + @brief Simple polygon constructor + + This constructor creates an edge collection from a simple polygon. + The edges form the contour of the polygon. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, as_edges: Optional[bool] = ...) -> None: + r""" + @brief Constructor of a flat edge collection from a hierarchical shape set + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into a flat edge set. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Edges::new(layout.begin_shapes(cell, layer), false) + @/code + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, as_edges: Optional[bool] = ...) -> None: + r""" + @brief Constructor of a hierarchical edge collection + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into the hierarchical edge set. + The edges remain within their original hierarchy unless other operations require the edges to be moved in the hierarchy. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Edges::new(layout.begin_shapes(cell, layer), dss, false) + @/code + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, expr: str, as_pattern: Optional[bool] = ...) -> None: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param dss The \DeepShapeStore object that acts as a heap for hierarchical operations. + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + + This special constructor will create a deep edge set from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + region = RBA::Region::new(iter, dss, "*") # all texts + region = RBA::Region::new(iter, dss, "A*") # all texts starting with an 'A' + region = RBA::Region::new(iter, dss, "A*", false) # all texts exactly matching 'A*' + @/code + + This method has been introduced in version 0.26. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> None: + r""" + @brief Constructor of a hierarchical edge collection with a transformation + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into the hierarchical edge set. + The edges remain within their original hierarchy unless other operations require the edges to be moved in the hierarchy. + The transformation is useful to scale to a specific database unit for example. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Edges::new(layout.begin_shapes(cell, layer), dss, RBA::ICplxTrans::new(layout.dbu / dbu), false) + @/code + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ...) -> None: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + + This special constructor will create dot-like edges from the text objects delivered by the shape iterator. Each text object will give a degenerated edge (a dot) that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + dots = RBA::Edges::new(iter, "*") # all texts + dots = RBA::Edges::new(iter, "A*") # all texts starting with an 'A' + dots = RBA::Edges::new(iter, "A*", false) # all texts exactly matching 'A*' + @/code + + This method has been introduced in version 0.26. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans, as_edges: Optional[bool] = ...) -> None: + r""" + @brief Constructor of a flat edge collection from a hierarchical shape set with a transformation + + This constructor creates an edge collection from the shapes delivered by the given recursive shape iterator. + It feeds the shapes from a hierarchy of cells into a flat edge set. + The transformation is useful to scale to a specific database unit for example. + + Text objects are not inserted, because they cannot be converted to edges. + Edge objects are inserted as such. If "as_edges" is true, "solid" objects (boxes, polygons, paths) are converted to edges which form the hull of these objects. If "as_edges" is false, solid objects are ignored. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Edges::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + """ + @overload + def __init__(self, shapes: Shapes, as_edges: Optional[bool] = ...) -> None: + r""" + @brief Constructor of a flat edge collection from a \Shapes container + + If 'as_edges' is true, the shapes from the container will be converted to edges (i.e. polygon contours to edges). Otherwise, only edges will be taken from the container. + + This method has been introduced in version 0.26. + """ + def __ior__(self, other: Edges) -> Edges: + r""" + @brief Performs the boolean OR between self and the other edge set + + @return The edge collection after modification (self) + + The boolean OR is implemented by merging the edges of both edge sets. To simply join the edge collections without merging, the + operator is more efficient. + """ + @overload + def __isub__(self, other: Edges) -> Edges: + r""" + @brief Performs the boolean NOT between self and the other edge collection + + @return The edge collection after modification (self) + + The boolean NOT operation will return all parts of the edges in this collection which are not coincident with parts of the edges in the other collection.The result will be a merged edge collection. + """ + @overload + def __isub__(self, other: Region) -> Edges: + r""" + @brief Selects the parts of the edges outside the given region + + @return The edge collection after modification (self) + + This operation selects the parts of the edges which are outside the given region. + Edges on the borders of the polygons are not included in the edge set. + As a side effect, the edges are made non-intersecting by introducing cut points where + edges intersect. + + This method has been introduced in version 0.24. + """ + def __iter__(self) -> Iterator[Edge]: + r""" + @brief Returns each edge of the region + """ + def __ixor__(self, other: Edges) -> Edges: + r""" + @brief Performs the boolean XOR between self and the other edge collection + + @return The edge collection after modification (self) + + The boolean XOR operation will return all parts of the edges in this and the other collection except the parts where both are coincident. + The result will be a merged edge collection. + """ + def __len__(self) -> int: + r""" + @brief Returns the (flat) number of edges in the edge collection + + This returns the number of raw edges (not merged edges if merged semantics is enabled). + The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ + def __or__(self, other: Edges) -> Edges: + r""" + @brief Returns the boolean OR between self and the other edge set + + @return The resulting edge collection + + The boolean OR is implemented by merging the edges of both edge sets. To simply join the edge collections without merging, the + operator is more efficient. + """ + def __str__(self) -> str: + r""" + @brief Converts the edge collection to a string + The length of the output is limited to 20 edges to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. + """ + @overload + def __sub__(self, other: Edges) -> Edges: + r""" + @brief Returns the boolean NOT between self and the other edge collection + + @return The result of the boolean NOT operation + + The boolean NOT operation will return all parts of the edges in this collection which are not coincident with parts of the edges in the other collection.The result will be a merged edge collection. + """ + @overload + def __sub__(self, other: Region) -> Edges: + r""" + @brief Returns the parts of the edges outside the given region + + @return The edges outside the given region + + This operation returns the parts of the edges which are outside the given region. + Edges on the borders of the polygons are not included in the edge set. + As a side effect, the edges are made non-intersecting by introducing cut points where + edges intersect. + + This method has been introduced in version 0.24. + """ + def __xor__(self, other: Edges) -> Edges: + r""" + @brief Returns the boolean XOR between self and the other edge collection + + @return The result of the boolean XOR operation + + The boolean XOR operation will return all parts of the edges in this and the other collection except the parts where both are coincident. + The result will be a merged edge collection. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def andnot(self, other: Edges) -> List[Edges]: + r""" + @brief Returns the boolean AND and NOT between self and the other edge set + + @return A two-element array of edge collections with the first one being the AND result and the second one being the NOT result + + This method will compute the boolean AND and NOT between two edge sets simultaneously. Because this requires a single sweep only, using this method is faster than doing AND and NOT separately. + + This method has been added in version 0.28. + """ + @overload + def andnot(self, other: Region) -> List[Edges]: + r""" + @brief Returns the boolean AND and NOT between self and the region + + @return A two-element array of edge collections with the first one being the AND result and the second one being the NOT result + + This method will compute the boolean AND and NOT simultaneously. Because this requires a single sweep only, using this method is faster than doing AND and NOT separately. + + This method has been added in version 0.28. + """ + def assign(self, other: ShapeCollection) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Returns the bounding box of the edge collection + The bounding box is the box enclosing all points of all edges. + """ + def centers(self, length: int, fraction: float) -> Edges: + r""" + @brief Returns edges representing the center part of the edges + @return A new collection of edges representing the part around the center + This method allows one to specify the length of these segments in a twofold way: either as a fixed length or by specifying a fraction of the original length: + + @code + edges = ... # An edge collection + edges.centers(100, 0.0) # All segments have a length of 100 DBU + edges.centers(0, 50.0) # All segments have a length of half the original length + edges.centers(100, 50.0) # All segments have a length of half the original length + # or 100 DBU, whichever is larger + @/code + + It is possible to specify 0 for both values. In this case, degenerated edges (points) are delivered which specify the centers of the edges but can't participate in some functions. + """ + def clear(self) -> None: + r""" + @brief Clears the edge collection + """ + def count(self) -> int: + r""" + @brief Returns the (flat) number of edges in the edge collection + + This returns the number of raw edges (not merged edges if merged semantics is enabled). + The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ + def create(self) -> None: + r""" + @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. + """ + def data_id(self) -> int: + r""" + @brief Returns the data ID (a unique identifier for the underlying data storage) + + This method has been added in version 0.26. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def disable_progress(self) -> None: + r""" + @brief Disable progress reporting + Calling this method will disable progress reporting. See \enable_progress. + """ + def dup(self) -> Edges: + r""" + @brief Creates a copy of self + """ + def each(self) -> Iterator[Edge]: + r""" + @brief Returns each edge of the region + """ + def each_merged(self) -> Iterator[Edge]: + r""" + @brief Returns each edge of the region + + In contrast to \each, this method delivers merged edges if merge semantics applies while \each delivers the original edges only. + + This method has been introduced in version 0.25. + """ + def enable_progress(self, label: str) -> None: + r""" + @brief Enable progress reporting + After calling this method, the edge collection will report the progress through a progress bar while expensive operations are running. + The label is a text which is put in front of the progress bar. + Using a progress bar will imply a performance penalty of a few percent typically. + """ + def enable_properties(self) -> None: + r""" + @brief Enables properties for the given container. + This method has an effect mainly on original layers and will import properties from such layers. By default, properties are not enabled on original layers. Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key. + + This method has been introduced in version 0.28.4. + """ + def enclosed_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: + r""" + @brief Performs an inside check with options + @param d The minimum distance for which the edges are checked + @param other The other edge collection against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The threshold angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper threshold of the projected length of one edge onto another + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. + + The 'enclosed_check' alias was introduced in version 0.27.5. + """ + def enclosing_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: + r""" + @brief Performs an enclosing check with options + @param d The minimum distance for which the edges are checked + @param other The other edge collection against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The threshold angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper threshold of the projected length of one edge onto another + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. + """ + def end_segments(self, length: int, fraction: float) -> Edges: + r""" + @brief Returns edges representing a part of the edge before the end point + @return A new collection of edges representing the end part + This method allows one to specify the length of these segments in a twofold way: either as a fixed length or by specifying a fraction of the original length: + + @code + edges = ... # An edge collection + edges.end_segments(100, 0.0) # All segments have a length of 100 DBU + edges.end_segments(0, 50.0) # All segments have a length of half the original length + edges.end_segments(100, 50.0) # All segments have a length of half the original length + # or 100 DBU, whichever is larger + @/code + + It is possible to specify 0 for both values. In this case, degenerated edges (points) are delivered which specify the end positions of the edges but can't participate in some functions. + """ + def extended(self, b: int, e: int, o: int, i: int, join: bool) -> Region: + r""" + @brief Returns a region with shapes representing the edges with the specified extensions + @param b the parallel extension at the start point of the edge + @param e the parallel extension at the end point of the edge + @param o the perpendicular extension to the "outside" (left side as seen in the direction of the edge) + @param i the perpendicular extension to the "inside" (right side as seen in the direction of the edge) + @param join If true, connected edges are joined before the extension is applied + @return A region containing the polygons representing these extended edges + This is a generic version of \extended_in and \extended_out. It allows one to specify extensions for all four directions of an edge and to join the edges before the extension is applied. + + For degenerated edges forming a point, a rectangle with the b, e, o and i used as left, right, top and bottom distance to the center point of this edge is created. + + If join is true and edges form a closed loop, the b and e parameters are ignored and a rim polygon is created that forms the loop with the outside and inside extension given by o and i. + """ + def extended_in(self, e: int) -> Region: + r""" + @brief Returns a region with shapes representing the edges with the given width + @param e The extension width + @return A region containing the polygons representing these extended edges + The edges are extended to the "inside" by the given distance "e". The distance will be applied to the right side as seen in the direction of the edge. By definition, this is the side pointing to the inside of the polygon if the edge was derived from a polygon. + + Other versions of this feature are \extended_out and \extended. + """ + def extended_out(self, e: int) -> Region: + r""" + @brief Returns a region with shapes representing the edges with the given width + @param e The extension width + @return A region containing the polygons representing these extended edges + The edges are extended to the "outside" by the given distance "e". The distance will be applied to the left side as seen in the direction of the edge. By definition, this is the side pointing to the outside of the polygon if the edge was derived from a polygon. + + Other versions of this feature are \extended_in and \extended. + """ + @overload + def extents(self) -> Region: + r""" + @brief Returns a region with the bounding boxes of the edges + This method will return a region consisting of the bounding boxes of the edges. + The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. + """ + @overload + def extents(self, d: int) -> Region: + r""" + @brief Returns a region with the enlarged bounding boxes of the edges + This method will return a region consisting of the bounding boxes of the edges enlarged by the given distance d. + The enlargement is specified per edge, i.e the width and height will be increased by 2*d. + The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. + """ + @overload + def extents(self, dx: int, dy: int) -> Region: + r""" + @brief Returns a region with the enlarged bounding boxes of the edges + This method will return a region consisting of the bounding boxes of the edges enlarged by the given distance dx in x direction and dy in y direction. + The enlargement is specified per edge, i.e the width will be increased by 2*dx. + The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. + """ + def filter_properties(self, keys: Sequence[Any]) -> None: + r""" + @brief Filters properties by certain keys. + Calling this method on a container will reduce the properties to values with name keys from the 'keys' list. + As a side effect, this method enables properties on original layers. + + This method has been introduced in version 0.28.4. + """ + def flatten(self) -> None: + r""" + @brief Explicitly flattens an edge collection + + If the collection is already flat (i.e. \has_valid_edges? returns true), this method will not change it. + + This method has been introduced in version 0.26. + """ + def has_valid_edges(self) -> bool: + r""" + @brief Returns true if the edge collection is flat and individual edges can be accessed randomly + + This method has been introduced in version 0.26. + """ + def hier_count(self) -> int: + r""" + @brief Returns the (hierarchical) number of edges in the edge collection + + This returns the number of raw edges (not merged edges if merged semantics is enabled). + The count is computed 'hierarchical', i.e. edges inside a cell are counted once even if the cell is instantiated multiple times. + + This method has been introduced in version 0.27. + """ + def in_(self, other: Edges) -> Edges: + r""" + @brief Returns all edges which are members of the other edge collection + This method returns all edges in self which can be found in the other edge collection as well with exactly the same geometry. + """ + def in_and_out(self, other: Edges) -> List[Edges]: + r""" + @brief Returns all polygons which are members and not members of the other region + This method is equivalent to calling \members_of and \not_members_of, but delivers both results at the same time and is more efficient than two separate calls. The first element returned is the \members_of part, the second is the \not_members_of part. + + This method has been introduced in version 0.28. + """ + @overload + def insert(self, box: Box) -> None: + r""" + @brief Inserts a box + + Inserts the edges that form the contour of the box into the edge collection. + """ + @overload + def insert(self, edge: Edge) -> None: + r""" + @brief Inserts an edge + + Inserts the edge into the edge collection. + """ + @overload + def insert(self, edges: Edges) -> None: + r""" + @brief Inserts all edges from the other edge collection into this one + This method has been introduced in version 0.25. + """ + @overload + def insert(self, edges: Sequence[Edge]) -> None: + r""" + @brief Inserts all edges from the array into this edge collection + """ + @overload + def insert(self, path: Path) -> None: + r""" + @brief Inserts a path + + Inserts the edges that form the contour of the path into the edge collection. + """ + @overload + def insert(self, polygon: Polygon) -> None: + r""" + @brief Inserts a polygon + + Inserts the edges that form the contour of the polygon into the edge collection. + """ + @overload + def insert(self, polygon: SimplePolygon) -> None: + r""" + @brief Inserts a simple polygon + + Inserts the edges that form the contour of the simple polygon into the edge collection. + """ + @overload + def insert(self, polygons: Sequence[Polygon]) -> None: + r""" + @brief Inserts all polygons from the array into this edge collection + """ + @overload + def insert(self, region: Region) -> None: + r""" + @brief Inserts a region + Inserts the edges that form the contours of the polygons from the region into the edge collection. + + This method has been introduced in version 0.25. + """ + @overload + def insert(self, shape_iterator: RecursiveShapeIterator) -> None: + r""" + @brief Inserts all shapes delivered by the recursive shape iterator into this edge collection + + For "solid" shapes (boxes, polygons, paths), this method inserts the edges that form the contour of the shape into the edge collection. + Edge shapes are inserted as such. + Text objects are not inserted, because they cannot be converted to polygons. + """ + @overload + def insert(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: + r""" + @brief Inserts all shapes delivered by the recursive shape iterator into this edge collection with a transformation + + For "solid" shapes (boxes, polygons, paths), this method inserts the edges that form the contour of the shape into the edge collection. + Edge shapes are inserted as such. + Text objects are not inserted, because they cannot be converted to polygons. + This variant will apply the given transformation to the shapes. This is useful to scale the shapes to a specific database unit for example. + """ + @overload + def insert(self, shapes: Shapes) -> None: + r""" + @brief Inserts all edges from the shape collection into this edge collection + This method takes each edge from the shape collection and inserts it into the region. "Polygon-like" objects are inserted as edges forming the contours of the polygons. + Text objects are ignored. + + This method has been introduced in version 0.25. + """ + @overload + def insert(self, shapes: Shapes, trans: ICplxTrans) -> None: + r""" + @brief Inserts all edges from the shape collection into this edge collection with complex transformation + This method acts as the version without transformation, but will apply the given complex transformation before inserting the edges. + + This method has been introduced in version 0.25. + """ + @overload + def insert(self, shapes: Shapes, trans: Trans) -> None: + r""" + @brief Inserts all edges from the shape collection into this edge collection (with transformation) + This method acts as the version without transformation, but will apply the given transformation before inserting the edges. + + This method has been introduced in version 0.25. + """ + def insert_into(self, layout: Layout, cell_index: int, layer: int) -> None: + r""" + @brief Inserts this edge collection into the given layout, below the given cell and into the given layer. + If the edge collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. + + This method has been introduced in version 0.26. + """ + @overload + def inside(self, other: Edges) -> Edges: + r""" + @brief Returns the edges of this edge collection which are inside (completely covered by) edges from the other edge collection + + @return A new edge collection containing the edges overlapping or touching edges from the other edge collection + + This method has been introduced in version 0.28. + """ + @overload + def inside(self, other: Region) -> Edges: + r""" + @brief Returns the edges from this edge collection which are inside (completely covered by) polygons from the region + + @return A new edge collection containing the edges overlapping or touching polygons from the region + + This method has been introduced in version 0.28. + """ + def inside_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: + r""" + @brief Performs an inside check with options + @param d The minimum distance for which the edges are checked + @param other The other edge collection against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The threshold angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper threshold of the projected length of one edge onto another + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. + + The 'enclosed_check' alias was introduced in version 0.27.5. + """ + def inside_outside_part(self, other: Region) -> List[Edges]: + r""" + @brief Returns the partial edges inside and outside the given region + + @return A two-element array of edge collections with the first one being the \inside_part result and the second one being the \outside_part result + + This method will compute the results simultaneously. Because this requires a single sweep only, using this method is faster than doing \inside_part and \outside_part separately. + + This method has been added in version 0.28. + """ + def inside_part(self, other: Region) -> Edges: + r""" + @brief Returns the parts of the edges of this edge collection which are inside the polygons of the region + + @return A new edge collection containing the edge parts inside the region + + This operation returns the parts of the edges which are inside the given region. + This functionality is similar to the '&' operator, but edges on the borders of the polygons are not included in the edge set. + As a side effect, the edges are made non-intersecting by introducing cut points where + edges intersect. + + This method has been introduced in version 0.24. + """ + @overload + def interacting(self, other: Edges) -> Edges: + r""" + @brief Returns the edges of this edge collection which overlap or touch edges from the other edge collection + + @return A new edge collection containing the edges overlapping or touching edges from the other edge collection + """ + @overload + def interacting(self, other: Region) -> Edges: + r""" + @brief Returns the edges from this edge collection which overlap or touch polygons from the region + + @return A new edge collection containing the edges overlapping or touching polygons from the region + """ + def intersections(self, other: Edges) -> Edges: + r""" + @brief Computes the intersections between this edges and other edges + This computation is like an AND operation, but also including crossing points between non-coincident edges as degenerated (point-like) edges. + + This method has been introduced in version 0.26.2 + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_deep(self) -> bool: + r""" + @brief Returns true if the edge collection is a deep (hierarchical) one + + This method has been added in version 0.26. + """ + def is_empty(self) -> bool: + r""" + @brief Returns true if the edge collection is empty + """ + def is_merged(self) -> bool: + r""" + @brief Returns true if the edge collection is merged + If the region is merged, coincident edges have been merged into single edges. You can ensure merged state by calling \merge. + """ + @overload + def length(self) -> int: + r""" + @brief Returns the total length of all edges in the edge collection + + Merged semantics applies for this method (see \merged_semantics= of merged semantics) + """ + @overload + def length(self, rect: Box) -> int: + r""" + @brief Returns the total length of all edges in the edge collection (restricted to a rectangle) + This version will compute the total length of all edges in the collection, restricting the computation to the given rectangle. + Edges along the border are handled in a special way: they are counted when they are oriented with their inside side toward the rectangle (in other words: outside edges must coincide with the rectangle's border in order to be counted). + + Merged semantics applies for this method (see \merged_semantics= of merged semantics) + """ + def map_properties(self, key_map: Dict[Any, Any]) -> None: + r""" + @brief Maps properties by name key. + Calling this method on a container will reduce the properties to values with name keys from the 'keys' hash and renames the properties. Properties not listed in the key map will be removed. + As a side effect, this method enables properties on original layers. + + This method has been introduced in version 0.28.4. + """ + def members_of(self, other: Edges) -> Edges: + r""" + @brief Returns all edges which are members of the other edge collection + This method returns all edges in self which can be found in the other edge collection as well with exactly the same geometry. + """ + def merge(self) -> Edges: + r""" + @brief Merge the edges + + @return The edge collection after the edges have been merged (self). + + Merging joins parallel edges which overlap or touch. + Crossing edges are not merged. + If the edge collection is already merged, this method does nothing + """ + def merged(self) -> Edges: + r""" + @brief Returns the merged edge collection + + @return The edge collection after the edges have been merged. + + Merging joins parallel edges which overlap or touch. + Crossing edges are not merged. + In contrast to \merge, this method does not modify the edge collection but returns a merged copy. + """ + @overload + def move(self, v: Vector) -> Edges: + r""" + @brief Moves the edge collection + + Moves the polygon by the given offset and returns the + moved edge collection. The edge collection is overwritten. + + @param v The distance to move the edge collection. + + @return The moved edge collection (self). + + Starting with version 0.25 the displacement type is a vector. + """ + @overload + def move(self, x: int, y: int) -> Edges: + r""" + @brief Moves the edge collection + + Moves the edge collection by the given offset and returns the + moved edge collection. The edge collection is overwritten. + + @param x The x distance to move the edge collection. + @param y The y distance to move the edge collection. + + @return The moved edge collection (self). + """ + @overload + def moved(self, v: Vector) -> Edges: + r""" + @brief Returns the moved edge collection (does not modify self) + + Moves the edge collection by the given offset and returns the + moved edge collection. The edge collection is not modified. + + @param v The distance to move the edge collection. + + @return The moved edge collection. + + Starting with version 0.25 the displacement type is a vector. + """ + @overload + def moved(self, x: int, v: int) -> Edges: + r""" + @brief Returns the moved edge collection (does not modify self) + + Moves the edge collection by the given offset and returns the + moved edge collection. The edge collection is not modified. + + @param x The x distance to move the edge collection. + @param y The y distance to move the edge collection. + + @return The moved edge collection. + """ + def not_in(self, other: Edges) -> Edges: + r""" + @brief Returns all edges which are not members of the other edge collection + This method returns all edges in self which can not be found in the other edge collection with exactly the same geometry. + """ + @overload + def not_inside(self, other: Edges) -> Edges: + r""" + @brief Returns the edges of this edge collection which are not inside (completely covered by) edges from the other edge collection + + @return A new edge collection containing the edges not overlapping or touching edges from the other edge collection + + This method has been introduced in version 0.28. + """ + @overload + def not_inside(self, other: Region) -> Edges: + r""" + @brief Returns the edges from this edge collection which are not inside (completely covered by) polygons from the region + + @return A new edge collection containing the edges not overlapping or touching polygons from the region + + This method has been introduced in version 0.28. + """ + @overload + def not_interacting(self, other: Edges) -> Edges: + r""" + @brief Returns the edges of this edge collection which do not overlap or touch edges from the other edge collection + + @return A new edge collection containing the edges not overlapping or touching edges from the other edge collection + """ + @overload + def not_interacting(self, other: Region) -> Edges: + r""" + @brief Returns the edges from this edge collection which do not overlap or touch polygons from the region + + @return A new edge collection containing the edges not overlapping or touching polygons from the region + """ + def not_members_of(self, other: Edges) -> Edges: + r""" + @brief Returns all edges which are not members of the other edge collection + This method returns all edges in self which can not be found in the other edge collection with exactly the same geometry. + """ + @overload + def not_outside(self, other: Edges) -> Edges: + r""" + @brief Returns the edges of this edge collection which are not outside (completely covered by) edges from the other edge collection + + @return A new edge collection containing the edges not overlapping or touching edges from the other edge collection + + This method has been introduced in version 0.28. + """ + @overload + def not_outside(self, other: Region) -> Edges: + r""" + @brief Returns the edges from this edge collection which are not outside (completely covered by) polygons from the region + + @return A new edge collection containing the edges not overlapping or touching polygons from the region + + This method has been introduced in version 0.28. + """ + @overload + def outside(self, other: Edges) -> Edges: + r""" + @brief Returns the edges of this edge collection which are outside (completely covered by) edges from the other edge collection + + @return A new edge collection containing the edges overlapping or touching edges from the other edge collection + + This method has been introduced in version 0.28. + """ + @overload + def outside(self, other: Region) -> Edges: + r""" + @brief Returns the edges from this edge collection which are outside (completely covered by) polygons from the region + + @return A new edge collection containing the edges overlapping or touching polygons from the region + + This method has been introduced in version 0.28. + """ + def outside_part(self, other: Region) -> Edges: + r""" + @brief Returns the parts of the edges of this edge collection which are outside the polygons of the region + + @return A new edge collection containing the edge parts outside the region + + This operation returns the parts of the edges which are not inside the given region. + This functionality is similar to the '-' operator, but edges on the borders of the polygons are included in the edge set. + As a side effect, the edges are made non-intersecting by introducing cut points where + edges intersect. + + This method has been introduced in version 0.24. + """ + def overlap_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: + r""" + @brief Performs an overlap check with options + @param d The minimum distance for which the edges are checked + @param other The other edge collection against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The threshold angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper threshold of the projected length of one edge onto another + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. + """ + @overload + def pull_interacting(self, other: Edges) -> Edges: + r""" + @brief Returns all edges of "other" which are interacting with polygons of this edge set + See the other \pull_interacting version for more details. + + @return The edge collection after the edges have been selected (from other) + + Merged semantics applies for this method (see \merged_semantics= of merged semantics) + + This method has been introduced in version 0.26.1 + """ + @overload + def pull_interacting(self, other: Region) -> Region: + r""" + @brief Returns all polygons of "other" which are interacting with (overlapping, touching) edges of this edge set + The "pull_..." methods are similar to "select_..." but work the opposite way: they select shapes from the argument region rather than self. In a deep (hierarchical) context the output region will be hierarchically aligned with self, so the "pull_..." methods provide a way for re-hierarchization. + + @return The region after the polygons have been selected (from other) + + Merged semantics applies for this method (see \merged_semantics= of merged semantics) + + This method has been introduced in version 0.26.1 + """ + def remove_properties(self) -> None: + r""" + @brief Removes properties for the given container. + This will remove all properties on the given container. + + This method has been introduced in version 0.28.4. + """ + @overload + def select_inside(self, other: Edges) -> Edges: + r""" + @brief Selects the edges from this edge collection which are inside (completely covered by) edges from the other edge collection + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_inside(self, other: Region) -> Edges: + r""" + @brief Selects the edges from this edge collection which are inside (completely covered by) polygons from the region + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + def select_inside_part(self, other: Region) -> Edges: + r""" + @brief Selects the parts of the edges from this edge collection which are inside the polygons of the given region + + @return The edge collection after the edges have been selected (self) + + This operation selects the parts of the edges which are inside the given region. + This functionality is similar to the '&=' operator, but edges on the borders of the polygons are not included in the edge set. + As a side effect, the edges are made non-intersecting by introducing cut points where + edges intersect. + + This method has been introduced in version 0.24. + """ + @overload + def select_interacting(self, other: Edges) -> Edges: + r""" + @brief Selects the edges from this edge collection which overlap or touch edges from the other edge collection + + @return The edge collection after the edges have been selected (self) + """ + @overload + def select_interacting(self, other: Region) -> Edges: + r""" + @brief Selects the edges from this edge collection which overlap or touch polygons from the region + + @return The edge collection after the edges have been selected (self) + """ + @overload + def select_not_inside(self, other: Edges) -> Edges: + r""" + @brief Selects the edges from this edge collection which are not inside (completely covered by) edges from the other edge collection + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_not_inside(self, other: Region) -> Edges: + r""" + @brief Selects the edges from this edge collection which are not inside (completely covered by) polygons from the region + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_not_interacting(self, other: Edges) -> Edges: + r""" + @brief Selects the edges from this edge collection which do not overlap or touch edges from the other edge collection + + @return The edge collection after the edges have been selected (self) + """ + @overload + def select_not_interacting(self, other: Region) -> Edges: + r""" + @brief Selects the edges from this edge collection which do not overlap or touch polygons from the region + + @return The edge collection after the edges have been selected (self) + """ + @overload + def select_not_outside(self, other: Edges) -> Edges: + r""" + @brief Selects the edges from this edge collection which are not outside (completely covered by) edges from the other edge collection + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_not_outside(self, other: Region) -> Edges: + r""" + @brief Selects the edges from this edge collection which are not outside (completely covered by) polygons from the region + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_outside(self, other: Edges) -> Edges: + r""" + @brief Selects the edges from this edge collection which are outside (completely covered by) edges from the other edge collection + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + @overload + def select_outside(self, other: Region) -> Edges: + r""" + @brief Selects the edges from this edge collection which are outside (completely covered by) polygons from the region + + @return The edge collection after the edges have been selected (self) + + This method has been introduced in version 0.28. + """ + def select_outside_part(self, other: Region) -> Edges: + r""" + @brief Selects the parts of the edges from this edge collection which are outside the polygons of the given region + + @return The edge collection after the edges have been selected (self) + + This operation selects the parts of the edges which are not inside the given region. + This functionality is similar to the '-=' operator, but edges on the borders of the polygons are included in the edge set. + As a side effect, the edges are made non-intersecting by introducing cut points where + edges intersect. + + This method has been introduced in version 0.24. + """ + def separation_check(self, other: Edges, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: + r""" + @brief Performs an overlap check with options + @param d The minimum distance for which the edges are checked + @param other The other edge collection against which to check + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The threshold angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper threshold of the projected length of one edge onto another + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. + """ + def size(self) -> int: + r""" + @brief Returns the (flat) number of edges in the edge collection + + This returns the number of raw edges (not merged edges if merged semantics is enabled). + The count is computed 'as if flat', i.e. edges inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ + def space_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: + r""" + @brief Performs a space check with options + @param d The minimum distance for which the edges are checked + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The threshold angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper threshold of the projected length of one edge onto another + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the space check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. + """ + @overload + def split_inside(self, other: Edges) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which are and are not inside (completely covered by) edges from the other collection + + @return A two-element list of edge collections (first: inside, second: non-inside) + + This method provides a faster way to compute both inside and non-inside edges compared to using separate methods. It has been introduced in version 0.28. + """ + @overload + def split_inside(self, other: Region) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which are and are not inside (completely covered by) polygons from the other region + + @return A two-element list of edge collections (first: inside, second: non-inside) + + This method provides a faster way to compute both inside and non-inside edges compared to using separate methods. It has been introduced in version 0.28. + """ + @overload + def split_interacting(self, other: Edges) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which do and do not interact with edges from the other collection + + @return A two-element list of edge collections (first: interacting, second: non-interacting) + + This method provides a faster way to compute both interacting and non-interacting edges compared to using separate methods. It has been introduced in version 0.28. + """ + @overload + def split_interacting(self, other: Region) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which do and do not interact with polygons from the other region + + @return A two-element list of edge collections (first: interacting, second: non-interacting) + + This method provides a faster way to compute both interacting and non-interacting edges compared to using separate methods. It has been introduced in version 0.28. + """ + @overload + def split_outside(self, other: Edges) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which are and are not outside (completely covered by) edges from the other collection + + @return A two-element list of edge collections (first: outside, second: non-outside) + + This method provides a faster way to compute both outside and non-outside edges compared to using separate methods. It has been introduced in version 0.28. + """ + @overload + def split_outside(self, other: Region) -> List[Edges]: + r""" + @brief Selects the edges from this edge collection which are and are not outside (completely covered by) polygons from the other region + + @return A two-element list of edge collections (first: outside, second: non-outside) + + This method provides a faster way to compute both outside and non-outside edges compared to using separate methods. It has been introduced in version 0.28. + """ + def start_segments(self, length: int, fraction: float) -> Edges: + r""" + @brief Returns edges representing a part of the edge after the start point + @return A new collection of edges representing the start part + This method allows one to specify the length of these segments in a twofold way: either as a fixed length or by specifying a fraction of the original length: + + @code + edges = ... # An edge collection + edges.start_segments(100, 0.0) # All segments have a length of 100 DBU + edges.start_segments(0, 50.0) # All segments have a length of half the original length + edges.start_segments(100, 50.0) # All segments have a length of half the original length + # or 100 DBU, whichever is larger + @/code + + It is possible to specify 0 for both values. In this case, degenerated edges (points) are delivered which specify the start positions of the edges but can't participate in some functions. + """ + def swap(self, other: Edges) -> None: + r""" + @brief Swap the contents of this edge collection with the contents of another one + This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare. + """ + @overload + def to_s(self) -> str: + r""" + @brief Converts the edge collection to a string + The length of the output is limited to 20 edges to avoid giant strings on large regions. For full output use "to_s" with a maximum count parameter. + """ + @overload + def to_s(self, max_count: int) -> str: + r""" + @brief Converts the edge collection to a string + This version allows specification of the maximum number of edges contained in the string. + """ + @overload + def transform(self, t: ICplxTrans) -> Edges: + r""" + @brief Transform the edge collection with a complex transformation (modifies self) + + Transforms the edge collection with the given transformation. + This version modifies the edge collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed edge collection. + """ + @overload + def transform(self, t: IMatrix2d) -> Edges: + r""" + @brief Transform the edge collection (modifies self) + + Transforms the edge collection with the given 2d matrix transformation. + This version modifies the edge collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed edge collection. + + This variant has been introduced in version 0.27. + """ + @overload + def transform(self, t: IMatrix3d) -> Edges: + r""" + @brief Transform the edge collection (modifies self) + + Transforms the edge collection with the given 3d matrix transformation. + This version modifies the edge collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed edge collection. + + This variant has been introduced in version 0.27. + """ + @overload + def transform(self, t: Trans) -> Edges: + r""" + @brief Transform the edge collection (modifies self) + + Transforms the edge collection with the given transformation. + This version modifies the edge collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed edge collection. + """ + def transform_icplx(self, t: ICplxTrans) -> Edges: + r""" + @brief Transform the edge collection with a complex transformation (modifies self) + + Transforms the edge collection with the given transformation. + This version modifies the edge collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed edge collection. + """ + @overload + def transformed(self, t: ICplxTrans) -> Edges: + r""" + @brief Transform the edge collection with a complex transformation + + Transforms the edge collection with the given complex transformation. + Does not modify the edge collection but returns the transformed edge collection. + + @param t The transformation to apply. + + @return The transformed edge collection. + """ + @overload + def transformed(self, t: IMatrix2d) -> Edges: + r""" + @brief Transform the edge collection + + Transforms the edge collection with the given 2d matrix transformation. + Does not modify the edge collection but returns the transformed edge collection. + + @param t The transformation to apply. + + @return The transformed edge collection. + + This variant has been introduced in version 0.27. + """ + @overload + def transformed(self, t: IMatrix3d) -> Edges: + r""" + @brief Transform the edge collection + + Transforms the edge collection with the given 3d matrix transformation. + Does not modify the edge collection but returns the transformed edge collection. + + @param t The transformation to apply. + + @return The transformed edge collection. + + This variant has been introduced in version 0.27. + """ + @overload + def transformed(self, t: Trans) -> Edges: + r""" + @brief Transform the edge collection + + Transforms the edge collection with the given transformation. + Does not modify the edge collection but returns the transformed edge collection. + + @param t The transformation to apply. + + @return The transformed edge collection. + """ + def transformed_icplx(self, t: ICplxTrans) -> Edges: + r""" + @brief Transform the edge collection with a complex transformation + + Transforms the edge collection with the given complex transformation. + Does not modify the edge collection but returns the transformed edge collection. + + @param t The transformation to apply. + + @return The transformed edge collection. + """ + def width_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ...) -> EdgePairs: + r""" + @brief Performs a width check with options + @param d The minimum width for which the edges are checked + @param whole_edges If true, deliver the whole edges + @param metrics Specify the metrics type + @param ignore_angle The threshold angle above which no check is performed + @param min_projection The lower threshold of the projected length of one edge onto another + @param max_projection The upper threshold of the projected length of one edge onto another + + If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. + + "metrics" can be one of the constants \Euclidian, \Square or \Projection. See there for a description of these constants. + Use nil for this value to select the default (Euclidian metrics). + + "ignore_angle" specifies the angle threshold of two edges. If two edges form an angle equal or above the given value, they will not contribute in the check. Setting this value to 90 (the default) will exclude edges with an angle of 90 degree or more from the check. + Use nil for this value to select the default. + + "min_projection" and "max_projection" allow selecting edges by their projected value upon each other. It is sufficient if the projection of one edge on the other matches the specified condition. The projected length must be larger or equal to "min_projection" and less than "max_projection". If you don't want to specify one threshold, pass nil to the respective value. + """ + @overload + def with_angle(self, angle: float, inverse: bool) -> Edges: + r""" + @brief Filters the edges by orientation + Filters the edges in the edge collection by orientation. If "inverse" is false, only edges which have the given angle to the x-axis are returned. If "inverse" is true, edges not having the given angle are returned. + + This will select horizontal edges: + + @code + horizontal = edges.with_angle(0, false) + @/code + """ + @overload + def with_angle(self, min_angle: float, max_angle: float, inverse: bool, include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Edges: + r""" + @brief Filters the edges by orientation + Filters the edges in the edge collection by orientation. If "inverse" is false, only edges which have an angle to the x-axis larger or equal to "min_angle" (depending on "include_min_angle") and equal or less than "max_angle" (depending on "include_max_angle") are returned. If "inverse" is true, edges which do not conform to this criterion are returned. + + With "include_min_angle" set to true (the default), the minimum angle is included in the criterion while with false, the minimum angle itself is not included. Same for "include_max_angle" where the default is false, meaning the maximum angle is not included in the range. + + The two "include.." arguments have been added in version 0.27. + """ + @overload + def with_angle(self, type: Edges.EdgeType, inverse: bool) -> Edges: + r""" + @brief Filters the edges by orientation type + Filters the edges in the edge collection by orientation. If "inverse" is false, only edges which have an angle of the given type are returned. If "inverse" is true, edges which do not conform to this criterion are returned. + + This version allows specifying an edge type instead of an angle. Edge types include multiple distinct orientations and are specified using one of the \OrthoEdges, \DiagonalEdges or \OrthoDiagonalEdges types. + + This method has been added in version 0.28. + """ + @overload + def with_length(self, length: int, inverse: bool) -> Edges: + r""" + @brief Filters the edges by length + Filters the edges in the edge collection by length. If "inverse" is false, only edges which have the given length are returned. If "inverse" is true, edges not having the given length are returned. + """ + @overload + def with_length(self, min_length: Any, max_length: Any, inverse: bool) -> Edges: + r""" + @brief Filters the edges by length + Filters the edges in the edge collection by length. If "inverse" is false, only edges which have a length larger or equal to "min_length" and less than "max_length" are returned. If "inverse" is true, edges not having a length less than "min_length" or larger or equal than "max_length" are returned. + + If you don't want to specify a lower or upper limit, pass nil to that parameter. + """ + +class EqualDeviceParameters: + r""" + @brief A device parameter equality comparer. + Attach this object to a device class with \DeviceClass#equal_parameters= to make the device class use this comparer: + + @code + # 20nm tolerance for length: + equal_device_parameters = RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_L, 0.02, 0.0) + # one percent tolerance for width: + equal_device_parameters += RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_W, 0.0, 0.01) + # applies the compare delegate: + netlist.device_class_by_name("NMOS").equal_parameters = equal_device_parameters + @/code + + You can use this class to specify fuzzy equality criteria for the comparison of device parameters in netlist verification or to confine the equality of devices to certain parameters only. + + This class has been added in version 0.26. + """ + @classmethod + def ignore(cls, param_id: int) -> EqualDeviceParameters: + r""" + @brief Creates a device parameter comparer which ignores the parameter. + + This specification can be used to make a parameter ignored. Starting with version 0.27.4, all primary parameters are compared. Before 0.27.4, giving a tolerance meant only those parameters are compared. To exclude a primary parameter from the compare, use the 'ignore' specification for that parameter. + + This constructor has been introduced in version 0.27.4. + """ + @classmethod + def new(cls, param_id: int, absolute: Optional[float] = ..., relative: Optional[float] = ...) -> EqualDeviceParameters: + r""" + @brief Creates a device parameter comparer for a single parameter. + 'absolute' is the absolute deviation allowed for the parameter values. 'relative' is the relative deviation allowed for the parameter values (a value between 0 and 1). + + A value of 0 for both absolute and relative deviation means the parameters have to match exactly. + + If 'absolute' and 'relative' are both given, their deviations will add to the allowed difference between two parameter values. The relative deviation will be applied to the mean value of both parameter values. For example, when comparing parameter values of 40 and 60, a relative deviation of 0.35 means an absolute deviation of 17.5 (= 0.35 * average of 40 and 60) which does not make both values match. + """ + def __add__(self, other: EqualDeviceParameters) -> EqualDeviceParameters: + r""" + @brief Combines two parameters for comparison. + The '+' operator will join the parameter comparers and produce one that checks the combined parameters. + """ + def __copy__(self) -> EqualDeviceParameters: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> EqualDeviceParameters: + r""" + @brief Creates a copy of self + """ + def __iadd__(self, other: EqualDeviceParameters) -> EqualDeviceParameters: + r""" + @brief Combines two parameters for comparison (in-place). + The '+=' operator will join the parameter comparers and produce one that checks the combined parameters. + """ + def __init__(self, param_id: int, absolute: Optional[float] = ..., relative: Optional[float] = ...) -> None: + r""" + @brief Creates a device parameter comparer for a single parameter. + 'absolute' is the absolute deviation allowed for the parameter values. 'relative' is the relative deviation allowed for the parameter values (a value between 0 and 1). + + A value of 0 for both absolute and relative deviation means the parameters have to match exactly. + + If 'absolute' and 'relative' are both given, their deviations will add to the allowed difference between two parameter values. The relative deviation will be applied to the mean value of both parameter values. For example, when comparing parameter values of 40 and 60, a relative deviation of 0.35 means an absolute deviation of 17.5 (= 0.35 * average of 40 and 60) which does not make both values match. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: EqualDeviceParameters) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> EqualDeviceParameters: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def to_string(self) -> str: + r""" + @hide + """ + +class GenericDeviceCombiner: + r""" + @brief A class implementing the combination of two devices (parallel or serial mode). + Reimplement this class to provide a custom device combiner. + Device combination requires 'supports_paralell_combination' or 'supports_serial_combination' to be set to true for the device class. In the netlist device combination step, the algorithm will try to identify devices which can be combined into single devices and use the combiner object to implement the actual joining of such devices. + + Attach this object to a device class with \DeviceClass#combiner= to make the device class use this combiner. + + This class has been added in version 0.27.3. + """ + @classmethod + def new(cls) -> GenericDeviceCombiner: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> GenericDeviceCombiner: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> GenericDeviceCombiner: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: GenericDeviceCombiner) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> GenericDeviceCombiner: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class GenericDeviceExtractor(DeviceExtractorBase): + r""" + @brief The basic class for implementing custom device extractors. + + This class serves as a base class for implementing customized device extractors. This class does not provide any extraction functionality, so you have to implement every detail. + + Device extraction requires a few definitions. The definitions are made in the reimplementation of the \setup + method. Required definitions to be made are: + + @ul + @li The name of the extractor. This will also be the name of the device class produced by the extractor. The name is set using \name=. @/li + @li The device class of the devices to produce. The device class is registered using \register_device_class. @/li + @li The layers used for the device extraction. These are input layers for the extraction as well as output layers for defining the terminals. Terminals are the points at which the nets connect to the devices. + Layers are defined using \define_layer. Initially, layers are abstract definitions with a name and a description. + Concrete layers will be given when defining the connectivity. @/li + @/ul + + When the device extraction is started, the device extraction algorithm will first ask the device extractor for the 'connectivity'. This is not a connectivity in a sense of electrical connections. The connectivity defines are logical compound that makes up the device. 'Connected' shapes are collected and presented to the device extractor. + The connectivity is obtained by calling \get_connectivity. This method must be implemented to produce the connectivity. + + Finally, the individual devices need to be extracted. Each cluster of connected shapes is presented to the device extractor. A cluster may include more than one device. It's the device extractor's responsibility to extract the devices from this cluster and deliver the devices through \create_device. In addition, terminals have to be defined, so the net extractor can connect to the devices. Terminal definitions are made through \define_terminal. The device extraction is implemented in the \extract_devices method. + + If errors occur during device extraction, the \error method may be used to issue such errors. Errors reported this way are kept in the error log. + + This class has been introduced in version 0.26. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create_device(self) -> Device: + r""" + @brief Creates a device. + The device object returned can be configured by the caller, e.g. set parameters. + It will be owned by the netlist and must not be deleted by the caller. + """ + def dbu(self) -> float: + r""" + @brief Gets the database unit + """ + def define_layer(self, name: str, description: str) -> NetlistDeviceExtractorLayerDefinition: + r""" + @brief Defines a layer. + @return The layer descriptor object created for this layer (use 'index' to get the layer's index) + Each call will define one more layer for the device extraction. + This method shall be used inside the implementation of \setup to define + the device layers. The actual geometries are later available to \extract_devices + in the order the layers are defined. + """ + def define_opt_layer(self, name: str, fallback: int, description: str) -> NetlistDeviceExtractorLayerDefinition: + r""" + @brief Defines a layer with a fallback layer. + @return The layer descriptor object created for this layer (use 'index' to get the layer's index) + As \define_layer, this method allows specification of device extraction layer. In addition to \define_layout, it features a fallback layer. If in the device extraction statement, the primary layer is not given, the fallback layer will be used. Hence, this layer is optional. The fallback layer is given by it's index and must be defined before the layer using the fallback layer is defined. For the index, 0 is the first layer defined, 1 the second and so forth. + """ + @overload + def define_terminal(self, device: Device, terminal_id: int, layer_index: int, point: Point) -> None: + r""" + @brief Defines a device terminal. + This method will define a terminal to the given device and the given terminal ID. + The terminal will be placed on the layer given by "layer_index". The layer index + is the index of the layer during layer definition. The first layer is 0, the second layer 1 etc. + + This version produces a point-like terminal. Note that the point is + specified in database units. + """ + @overload + def define_terminal(self, device: Device, terminal_id: int, layer_index: int, shape: Box) -> None: + r""" + @brief Defines a device terminal. + This method will define a terminal to the given device and the given terminal ID. + The terminal will be placed on the layer given by "layer_index". The layer index + is the index of the layer during layer definition. The first layer is 0, the second layer 1 etc. + + This version produces a terminal with a shape given by the box. Note that the box is + specified in database units. + """ + @overload + def define_terminal(self, device: Device, terminal_id: int, layer_index: int, shape: Polygon) -> None: + r""" + @brief Defines a device terminal. + This method will define a terminal to the given device and the given terminal ID. + The terminal will be placed on the layer given by "layer_index". The layer index + is the index of the layer during layer definition. The first layer is 0, the second layer 1 etc. + + This version produces a terminal with a shape given by the polygon. Note that the polygon is + specified in database units. + """ + @overload + def define_terminal(self, device: Device, terminal_name: str, layer_name: str, point: Point) -> None: + r""" + @brief Defines a device terminal using names for terminal and layer. + + This convenience version of the ID-based \define_terminal methods allows using names for terminal and layer. + It has been introduced in version 0.28. + """ + @overload + def define_terminal(self, device: Device, terminal_name: str, layer_name: str, shape: Box) -> None: + r""" + @brief Defines a device terminal using names for terminal and layer. + + This convenience version of the ID-based \define_terminal methods allows using names for terminal and layer. + It has been introduced in version 0.28. + """ + @overload + def define_terminal(self, device: Device, terminal_name: str, layer_name: str, shape: Polygon) -> None: + r""" + @brief Defines a device terminal using names for terminal and layer. + + This convenience version of the ID-based \define_terminal methods allows using names for terminal and layer. + It has been introduced in version 0.28. + """ + @overload + def error(self, category_name: str, category_description: str, message: str) -> None: + r""" + @brief Issues an error with the given category name and description, message + """ + @overload + def error(self, category_name: str, category_description: str, message: str, geometry: DPolygon) -> None: + r""" + @brief Issues an error with the given category name and description, message and micrometer-units polygon geometry + """ + @overload + def error(self, category_name: str, category_description: str, message: str, geometry: Polygon) -> None: + r""" + @brief Issues an error with the given category name and description, message and database-unit polygon geometry + """ + @overload + def error(self, message: str) -> None: + r""" + @brief Issues an error with the given message + """ + @overload + def error(self, message: str, geometry: DPolygon) -> None: + r""" + @brief Issues an error with the given message and micrometer-units polygon geometry + """ + @overload + def error(self, message: str, geometry: Polygon) -> None: + r""" + @brief Issues an error with the given message and database-unit polygon geometry + """ + def register_device_class(self, device_class: DeviceClass) -> None: + r""" + @brief Registers a device class. + The device class object will become owned by the netlist and must not be deleted by + the caller. The name of the device class will be changed to the name given to + the device extractor. + This method shall be used inside the implementation of \setup to register + the device classes. + """ + def sdbu(self) -> float: + r""" + @brief Gets the scaled database unit + Use this unit to compute device properties. It is the database unit multiplied with the + device scaling factor. + """ + +class GenericDeviceParameterCompare(EqualDeviceParameters): + r""" + @brief A class implementing the comparison of device parameters. + Reimplement this class to provide a custom device parameter compare scheme. + Attach this object to a device class with \DeviceClass#equal_parameters= to make the device class use this comparer. + + This class is intended for special cases. In most scenarios it is easier to use \EqualDeviceParameters instead of implementing a custom comparer class. + + This class has been added in version 0.26. The 'equal' method has been dropped in 0.27.1 as it can be expressed as !less(a,b) && !less(b,a). + """ + def _assign(self, other: EqualDeviceParameters) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> GenericDeviceParameterCompare: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class GenericNetlistCompareLogger(NetlistCompareLogger): + r""" + @brief An event receiver for the netlist compare feature. + The \NetlistComparer class will send compare events to a logger derived from this class. Use this class to implement your own logger class. You can override on of it's methods to receive certain kind of events. + This class has been introduced in version 0.26. + """ + class Severity: + r""" + @brief This class represents the log severity level for \GenericNetlistCompareLogger#log_entry. + This enum has been introduced in version 0.28. + """ + Error: ClassVar[GenericNetlistCompareLogger.Severity] + r""" + @brief An error + """ + Info: ClassVar[GenericNetlistCompareLogger.Severity] + r""" + @brief Information only + """ + NoSeverity: ClassVar[GenericNetlistCompareLogger.Severity] + r""" + @brief Unspecific severity + """ + Warning: ClassVar[GenericNetlistCompareLogger.Severity] + r""" + @brief A warning + """ + @overload + @classmethod + def new(cls, i: int) -> GenericNetlistCompareLogger.Severity: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> GenericNetlistCompareLogger.Severity: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: GenericNetlistCompareLogger.Severity) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class HAlign: + r""" + @brief This class represents the horizontal alignment modes. + This enum has been introduced in version 0.28. + """ + HAlignCenter: ClassVar[HAlign] + r""" + @brief Centered horizontal alignment + """ + HAlignLeft: ClassVar[HAlign] + r""" + @brief Left horizontal alignment + """ + HAlignRight: ClassVar[HAlign] + r""" + @brief Right horizontal alignment + """ + NoHAlign: ClassVar[HAlign] + r""" + @brief Undefined horizontal alignment + """ + @overload + @classmethod + def new(cls, i: int) -> HAlign: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> HAlign: + r""" + @brief Creates an enum from a string value + """ + def __copy__(self) -> HAlign: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> HAlign: + r""" + @brief Creates a copy of self + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: HAlign) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: HAlign) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> HAlign: + r""" + @brief Creates a copy of self + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + +class ICplxTrans: + r""" + @brief A complex transformation + + A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary + angle and a displacement. This is also the order, the operations are applied. + This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact. + + Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar. + + Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: + + @code + # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree + # and displacement of 10 in x and 20 units in y direction: + t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) + t.to_s # r90 *1.5 10,20 + # compute the inverse: + t.inverted.to_s # r270 *0.666666667 -13,7 + # Combine with another displacement (applied after that): + (RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 + # Transform a point: + t.trans(RBA::Point::new(100, 200)).to_s # -290,170 + @/code + + This class has been introduced in version 0.18. + + See @The Database API@ for more details about the database objects. + """ + M0: ClassVar[ICplxTrans] + r""" + @brief A constant giving "mirrored at the x-axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M135: ClassVar[ICplxTrans] + r""" + @brief A constant giving "mirrored at the 135 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M45: ClassVar[ICplxTrans] + r""" + @brief A constant giving "mirrored at the 45 degree axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + M90: ClassVar[ICplxTrans] + r""" + @brief A constant giving "mirrored at the y (90 degree) axis" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R0: ClassVar[ICplxTrans] + r""" + @brief A constant giving "unrotated" (unit) transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R180: ClassVar[ICplxTrans] + r""" + @brief A constant giving "rotated by 180 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R270: ClassVar[ICplxTrans] + r""" + @brief A constant giving "rotated by 270 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + R90: ClassVar[ICplxTrans] + r""" + @brief A constant giving "rotated by 90 degree counterclockwise" transformation + The previous integer constant has been turned into a transformation in version 0.25. + """ + angle: float + r""" + Getter: + @brief Gets the angle + + Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. + + @return The rotation angle this transformation provides in degree units (0..360 deg). + + Setter: + @brief Sets the angle + @param a The new angle + See \angle for a description of that attribute. + """ + disp: Vector + r""" + Getter: + @brief Gets the displacement + + Setter: + @brief Sets the displacement + @param u The new displacement + """ + mag: float + r""" + Getter: + @brief Gets the magnification + + Setter: + @brief Sets the magnification + @param m The new magnification + """ + mirror: bool + r""" + Getter: + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + Setter: + @brief Sets the mirror flag + "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + """ + @classmethod + def from_dtrans(cls, trans: DCplxTrans) -> ICplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @classmethod + def from_s(cls, s: str) -> ICplxTrans: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @classmethod + def from_trans(cls, trans: CplxTrans) -> ICplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_trans'. + """ + @overload + @classmethod + def new(cls) -> ICplxTrans: + r""" + @brief Creates a unit transformation + """ + @overload + @classmethod + def new(cls, c: ICplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> ICplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + @classmethod + def new(cls, c: ICplxTrans, m: float, x: int, y: int) -> ICplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + @classmethod + def new(cls, m: float) -> ICplxTrans: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, u: Vector) -> ICplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, x: int, y: int) -> ICplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + @overload + @classmethod + def new(cls, t: Trans) -> ICplxTrans: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + @classmethod + def new(cls, t: Trans, m: float) -> ICplxTrans: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + @classmethod + def new(cls, trans: CplxTrans) -> ICplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_trans'. + """ + @overload + @classmethod + def new(cls, trans: DCplxTrans) -> ICplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + @classmethod + def new(cls, trans: VCplxTrans) -> ICplxTrans: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, u: Vector) -> ICplxTrans: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + @classmethod + def new(cls, x: int, y: int) -> ICplxTrans: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + def __copy__(self) -> ICplxTrans: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> ICplxTrans: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Tests for equality + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a unit transformation + """ + @overload + def __init__(self, c: ICplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + def __init__(self, c: ICplxTrans, m: float, x: int, y: int) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + def __init__(self, m: float) -> None: + r""" + @brief Creates a transformation from a magnification + + Creates a magnifying transformation without displacement and rotation given the magnification m. + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, u: Vector) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, x: int, y: int) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + @overload + def __init__(self, t: Trans) -> None: + r""" + @brief Creates a transformation from a simple transformation alone + + Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + """ + @overload + def __init__(self, t: Trans, m: float) -> None: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + def __init__(self, trans: CplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_trans'. + """ + @overload + def __init__(self, trans: DCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + def __init__(self, trans: VCplxTrans) -> None: + r""" + @brief Creates a floating-point coordinate transformation from another coordinate flavour + + This constructor has been introduced in version 0.25. + """ + @overload + def __init__(self, u: Vector) -> None: + r""" + @brief Creates a transformation from a displacement + + Creates a transformation with a displacement only. + + This method has been added in version 0.25. + """ + @overload + def __init__(self, x: int, y: int) -> None: + r""" + @brief Creates a transformation from a x and y displacement + + This constructor will create a transformation with the specified displacement + but no rotation. + + @param x The x displacement + @param y The y displacement + """ + def __lt__(self, other: ICplxTrans) -> bool: + r""" + @brief Provides a 'less' criterion for sorting + This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. + """ + @overload + def __mul__(self, box: Box) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, d: int) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __mul__(self, edge: Edge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, p: Point) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __mul__(self, p: Vector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __mul__(self, path: Path) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, polygon: Polygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __mul__(self, t: ICplxTrans) -> ICplxTrans: + r""" + @brief Returns the concatenated transformation + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, t: VCplxTrans) -> VCplxTrans: + r""" + @brief Multiplication (concatenation) of transformations + + The * operator returns self*t ("t is applied before this transformation"). + + @param t The transformation to apply before + @return The modified transformation + """ + @overload + def __mul__(self, text: Text) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Tests for inequality + """ + @overload + def __rmul__(self, box: Box) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, d: int) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + @overload + def __rmul__(self, edge: Edge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, p: Point) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def __rmul__(self, p: Vector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def __rmul__(self, path: Path) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, polygon: Polygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def __rmul__(self, text: Text) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + def __str__(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: ICplxTrans) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def ctrans(self, d: int) -> int: + r""" + @brief Transforms a distance + + The "ctrans" method transforms the given distance. + e = t(d). For the simple transformations, there + is no magnification and no modification of the distance + therefore. + + @param d The distance to transform + @return The transformed distance + + The product '*' has been added as a synonym in version 0.28. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> ICplxTrans: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given transformation. This method enables transformations as hash keys. + + This method has been introduced in version 0.25. + """ + def invert(self) -> ICplxTrans: + r""" + @brief Inverts the transformation (in place) + + Inverts the transformation and replaces this transformation by it's + inverted one. + + @return The inverted transformation + """ + def inverted(self) -> ICplxTrans: + r""" + @brief Returns the inverted transformation + + Returns the inverted transformation. This method does not modify the transformation. + + @return The inverted transformation + """ + def is_complex(self) -> bool: + r""" + @brief Returns true if the transformation is a complex one + + If this predicate is false, the transformation can safely be converted to a simple transformation. + Otherwise, this conversion will be lossy. + The predicate value is equivalent to 'is_mag || !is_ortho'. + + This method has been introduced in version 0.27.5. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_mag(self) -> bool: + r""" + @brief Tests, if the transformation is a magnifying one + + This is the recommended test for checking if the transformation represents + a magnification. + """ + def is_mirror(self) -> bool: + r""" + @brief Gets the mirror flag + + If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + """ + def is_ortho(self) -> bool: + r""" + @brief Tests, if the transformation is an orthogonal transformation + + If the rotation is by a multiple of 90 degree, this method will return true. + """ + def is_unity(self) -> bool: + r""" + @brief Tests, whether this is a unit transformation + """ + def rot(self) -> int: + r""" + @brief Returns the respective simple transformation equivalent rotation code if possible + + If this transformation is orthogonal (is_ortho () == true), then this method + will return the corresponding fixpoint transformation, not taking into account + magnification and displacement. If the transformation is not orthogonal, the result + reflects the quadrant the rotation goes into. + """ + def s_trans(self) -> Trans: + r""" + @brief Extracts the simple transformation part + + The simple transformation part does not reflect magnification or arbitrary angles. + Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. + """ + def to_itrans(self, dbu: Optional[float] = ...) -> DCplxTrans: + r""" + @brief Converts the transformation to another transformation with floating-point input and output coordinates + + The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. + + This method has been introduced in version 0.25. + """ + def to_s(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion + If 'lazy' is true, some parts are omitted when not required. + If a DBU is given, the output units will be micrometers. + + The lazy and DBU arguments have been added in version 0.27.6. + """ + def to_trans(self) -> VCplxTrans: + r""" + @brief Converts the transformation to another transformation with floating-point input coordinates + + This method has been introduced in version 0.25. + """ + def to_vtrans(self, dbu: Optional[float] = ...) -> CplxTrans: + r""" + @brief Converts the transformation to another transformation with floating-point output coordinates + + The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. + + This method has been introduced in version 0.25. + """ + @overload + def trans(self, box: Box) -> Box: + r""" + @brief Transforms a box + + 't*box' or 't.trans(box)' is equivalent to box.transformed(t). + + @param box The box to transform + @return The transformed box + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, edge: Edge) -> Edge: + r""" + @brief Transforms an edge + + 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). + + @param edge The edge to transform + @return The transformed edge + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, p: Point) -> Point: + r""" + @brief Transforms a point + + The "trans" method or the * operator transforms the given point. + q = t(p) + + The * operator has been introduced in version 0.25. + + @param p The point to transform + @return The transformed point + """ + @overload + def trans(self, p: Vector) -> Vector: + r""" + @brief Transforms a vector + + The "trans" method or the * operator transforms the given vector. + w = t(v) + + Vector transformation has been introduced in version 0.25. + + @param v The vector to transform + @return The transformed vector + """ + @overload + def trans(self, path: Path) -> Path: + r""" + @brief Transforms a path + + 't*path' or 't.trans(path)' is equivalent to path.transformed(t). + + @param path The path to transform + @return The transformed path + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, polygon: Polygon) -> Polygon: + r""" + @brief Transforms a polygon + + 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). + + @param polygon The polygon to transform + @return The transformed polygon + + This convenience method has been introduced in version 0.25. + """ + @overload + def trans(self, text: Text) -> Text: + r""" + @brief Transforms a text + + 't*text' or 't.trans(text)' is equivalent to text.transformed(t). + + @param text The text to transform + @return The transformed text + + This convenience method has been introduced in version 0.25. + """ + +class IMatrix2d: + r""" + @brief A 2d matrix object used mainly for representing rotation and shear transformations (integer coordinate version). + + This object represents a 2x2 matrix. This matrix is used to implement affine transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation and shear. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification and shear. + + The integer variant was introduced in version 0.27. + """ + @overload + @classmethod + def new(cls) -> IMatrix2d: + r""" + @brief Create a new Matrix2d representing a unit transformation + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float) -> IMatrix2d: + r""" + @brief Create a new Matrix2d from the four coefficients + """ + @overload + @classmethod + def new(cls, m: float) -> IMatrix2d: + r""" + @brief Create a new Matrix2d representing an isotropic magnification + @param m The magnification + """ + @overload + @classmethod + def new(cls, mx: float, my: float) -> IMatrix2d: + r""" + @brief Create a new Matrix2d representing an anisotropic magnification + @param mx The magnification in x direction + @param my The magnification in y direction + """ + @overload + @classmethod + def new(cls, t: DCplxTrans) -> IMatrix2d: + r""" + @brief Create a new Matrix2d from the given complex transformation@param t The transformation from which to create the matrix (not taking into account the displacement) + """ + @overload + @classmethod + def newc(cls, mag: float, rotation: float, mirror: bool) -> IMatrix2d: + r""" + @brief Create a new Matrix2d representing an isotropic magnification, rotation and mirroring + @param mag The magnification in x direction + @param rotation The rotation angle (in degree) + @param mirror The mirror flag (at x axis) + + This constructor is provided to construct a matrix similar to the complex transformation. + This constructor is called 'newc' to distinguish it from the constructors taking matrix coefficients ('c' is for composite). + The order of execution of the operations is mirror, magnification, rotation (as for complex transformations). + """ + @overload + @classmethod + def newc(cls, shear: float, mx: float, my: float, rotation: float, mirror: bool) -> IMatrix2d: + r""" + @brief Create a new Matrix2d representing a shear, anisotropic magnification, rotation and mirroring + @param shear The shear angle + @param mx The magnification in x direction + @param my The magnification in y direction + @param rotation The rotation angle (in degree) + @param mirror The mirror flag (at x axis) + + The order of execution of the operations is mirror, magnification, shear and rotation. + This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). + """ + def __add__(self, m: IMatrix2d) -> IMatrix2d: + r""" + @brief Sum of two matrices. + @param m The other matrix. + @return The (element-wise) sum of self+m + """ + def __copy__(self) -> IMatrix2d: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> IMatrix2d: + r""" + @brief Creates a copy of self + """ + @overload + def __init__(self) -> None: + r""" + @brief Create a new Matrix2d representing a unit transformation + """ + @overload + def __init__(self, m11: float, m12: float, m21: float, m22: float) -> None: + r""" + @brief Create a new Matrix2d from the four coefficients + """ + @overload + def __init__(self, m: float) -> None: + r""" + @brief Create a new Matrix2d representing an isotropic magnification + @param m The magnification + """ + @overload + def __init__(self, mx: float, my: float) -> None: + r""" + @brief Create a new Matrix2d representing an anisotropic magnification + @param mx The magnification in x direction + @param my The magnification in y direction + """ + @overload + def __init__(self, t: DCplxTrans) -> None: + r""" + @brief Create a new Matrix2d from the given complex transformation@param t The transformation from which to create the matrix (not taking into account the displacement) + """ + @overload + def __mul__(self, box: Box) -> Box: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __mul__(self, e: Edge) -> Edge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __mul__(self, m: IMatrix2d) -> IMatrix2d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __mul__(self, p: Point) -> Point: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __mul__(self, p: Polygon) -> Polygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __mul__(self, p: SimplePolygon) -> SimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __mul__(self, v: Vector) -> Vector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ + @overload + def __rmul__(self, box: Box) -> Box: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __rmul__(self, e: Edge) -> Edge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __rmul__(self, m: IMatrix2d) -> IMatrix2d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __rmul__(self, p: Point) -> Point: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __rmul__(self, p: Polygon) -> Polygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __rmul__(self, p: SimplePolygon) -> SimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __rmul__(self, v: Vector) -> Vector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ + def __str__(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def angle(self) -> float: + r""" + @brief Returns the rotation angle of the rotation component of this matrix. + @return The angle in degree. + The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. + """ + def assign(self, other: IMatrix2d) -> None: + r""" + @brief Assigns another object to self + """ + def cplx_trans(self) -> ICplxTrans: + r""" + @brief Converts this matrix to a complex transformation (if possible). + @return The complex transformation. + This method is successful only if the matrix does not contain shear components and the magnification must be isotropic. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> IMatrix2d: + r""" + @brief Creates a copy of self + """ + def inverted(self) -> IMatrix2d: + r""" + @brief The inverse of this matrix. + @return The inverse of this matrix + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_mirror(self) -> bool: + r""" + @brief Returns the mirror flag of this matrix. + @return True if this matrix has a mirror component. + The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. + """ + def m(self, i: int, j: int) -> float: + r""" + @brief Gets the m coefficient with the given index. + @return The coefficient [i,j] + """ + def m11(self) -> float: + r""" + @brief Gets the m11 coefficient. + @return The value of the m11 coefficient + """ + def m12(self) -> float: + r""" + @brief Gets the m12 coefficient. + @return The value of the m12 coefficient + """ + def m21(self) -> float: + r""" + @brief Gets the m21 coefficient. + @return The value of the m21 coefficient + """ + def m22(self) -> float: + r""" + @brief Gets the m22 coefficient. + @return The value of the m22 coefficient + """ + def mag_x(self) -> float: + r""" + @brief Returns the x magnification of the magnification component of this matrix. + @return The magnification factor. + The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation. + """ + def mag_y(self) -> float: + r""" + @brief Returns the y magnification of the magnification component of this matrix. + @return The magnification factor. + The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation. + """ + def shear_angle(self) -> float: + r""" + @brief Returns the magnitude of the shear component of this matrix. + @return The shear angle in degree. + The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. + The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree. + """ + def to_s(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + def trans(self, p: Point) -> Point: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + +class IMatrix3d: + r""" + @brief A 3d matrix object used mainly for representing rotation, shear, displacement and perspective transformations (integer coordinate version). + + This object represents a 3x3 matrix. This matrix is used to implement generic geometrical transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation, shear, displacement and perspective distortion. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification, shear, displacement and perspective distortion. + + The integer variant was introduced in version 0.27. + """ + @overload + @classmethod + def new(cls) -> IMatrix3d: + r""" + @brief Create a new Matrix3d representing a unit transformation + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> IMatrix3d: + r""" + @brief Create a new Matrix3d from the nine matrix coefficients + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float) -> IMatrix3d: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> IMatrix3d: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d plus a displacement + """ + @overload + @classmethod + def new(cls, m: float) -> IMatrix3d: + r""" + @brief Create a new Matrix3d representing a magnification + @param m The magnification + """ + @overload + @classmethod + def new(cls, t: ICplxTrans) -> IMatrix3d: + r""" + @brief Create a new Matrix3d from the given complex transformation@param t The transformation from which to create the matrix + """ + @overload + @classmethod + def newc(cls, mag: float, rotation: float, mirrx: bool) -> IMatrix3d: + r""" + @brief Create a new Matrix3d representing a isotropic magnification, rotation and mirroring + @param mag The magnification + @param rotation The rotation angle (in degree) + @param mirrx The mirror flag (at x axis) + + The order of execution of the operations is mirror, magnification and rotation. + This constructor is called 'newc' to distinguish it from the constructors taking coefficients ('c' is for composite). + """ + @overload + @classmethod + def newc(cls, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> IMatrix3d: + r""" + @brief Create a new Matrix3d representing a shear, anisotropic magnification, rotation and mirroring + @param shear The shear angle + @param mx The magnification in x direction + @param mx The magnification in y direction + @param rotation The rotation angle (in degree) + @param mirrx The mirror flag (at x axis) + + The order of execution of the operations is mirror, magnification, rotation and shear. + This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). + """ + @overload + @classmethod + def newc(cls, tx: float, ty: float, z: float, u: Vector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> IMatrix3d: + r""" + @brief Create a new Matrix3d representing a perspective distortion, displacement, shear, anisotropic magnification, rotation and mirroring + @param tx The perspective tilt angle x (around the y axis) + @param ty The perspective tilt angle y (around the x axis) + @param z The observer distance at which the tilt angles are given + @param u The displacement + @param shear The shear angle + @param mx The magnification in x direction + @param mx The magnification in y direction + @param rotation The rotation angle (in degree) + @param mirrx The mirror flag (at x axis) + + The order of execution of the operations is mirror, magnification, rotation, shear, perspective distortion and displacement. + This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). + + The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles for different observer distances. Hence, the observer distance must be given at which the tilt angles are given. If the magnitude of the tilt angle is not important, z can be set to 1. + + Starting with version 0.25 the displacement is of vector type. + """ + @overload + @classmethod + def newc(cls, u: Vector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> IMatrix3d: + r""" + @brief Create a new Matrix3d representing a displacement, shear, anisotropic magnification, rotation and mirroring + @param u The displacement + @param shear The shear angle + @param mx The magnification in x direction + @param mx The magnification in y direction + @param rotation The rotation angle (in degree) + @param mirrx The mirror flag (at x axis) + + The order of execution of the operations is mirror, magnification, rotation, shear and displacement. + This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). + + Starting with version 0.25 the displacement is of vector type. + """ + def __add__(self, m: IMatrix3d) -> IMatrix3d: + r""" + @brief Sum of two matrices. + @param m The other matrix. + @return The (element-wise) sum of self+m + """ + def __copy__(self) -> IMatrix3d: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> IMatrix3d: + r""" + @brief Creates a copy of self + """ + @overload + def __init__(self) -> None: + r""" + @brief Create a new Matrix3d representing a unit transformation + """ + @overload + def __init__(self, m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> None: + r""" + @brief Create a new Matrix3d from the nine matrix coefficients + """ + @overload + def __init__(self, m11: float, m12: float, m21: float, m22: float) -> None: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d + """ + @overload + def __init__(self, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> None: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d plus a displacement + """ + @overload + def __init__(self, m: float) -> None: + r""" + @brief Create a new Matrix3d representing a magnification + @param m The magnification + """ + @overload + def __init__(self, t: ICplxTrans) -> None: + r""" + @brief Create a new Matrix3d from the given complex transformation@param t The transformation from which to create the matrix + """ + @overload + def __mul__(self, box: Box) -> Box: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __mul__(self, e: Edge) -> Edge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __mul__(self, m: IMatrix3d) -> IMatrix3d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __mul__(self, p: Point) -> Point: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __mul__(self, p: Polygon) -> Polygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __mul__(self, p: SimplePolygon) -> SimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __mul__(self, v: Vector) -> Vector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ + @overload + def __rmul__(self, box: Box) -> Box: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __rmul__(self, e: Edge) -> Edge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __rmul__(self, m: IMatrix3d) -> IMatrix3d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __rmul__(self, p: Point) -> Point: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __rmul__(self, p: Polygon) -> Polygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __rmul__(self, p: SimplePolygon) -> SimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __rmul__(self, v: Vector) -> Vector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ + def __str__(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def angle(self) -> float: + r""" + @brief Returns the rotation angle of the rotation component of this matrix. + @return The angle in degree. + See the description of this class for details about the basic transformations. + """ + def assign(self, other: IMatrix3d) -> None: + r""" + @brief Assigns another object to self + """ + def cplx_trans(self) -> DCplxTrans: + r""" + @brief Converts this matrix to a complex transformation (if possible). + @return The complex transformation. + This method is successful only if the matrix does not contain shear or perspective distortion components and the magnification must be isotropic. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def disp(self) -> Vector: + r""" + @brief Returns the displacement vector of this transformation. + + Starting with version 0.25 this method returns a vector type instead of a point. + @return The displacement vector. + """ + def dup(self) -> IMatrix3d: + r""" + @brief Creates a copy of self + """ + def inverted(self) -> IMatrix3d: + r""" + @brief The inverse of this matrix. + @return The inverse of this matrix + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_mirror(self) -> bool: + r""" + @brief Returns the mirror flag of this matrix. + @return True if this matrix has a mirror component. + See the description of this class for details about the basic transformations. + """ + def m(self, i: int, j: int) -> float: + r""" + @brief Gets the m coefficient with the given index. + @return The coefficient [i,j] + """ + def mag_x(self) -> float: + r""" + @brief Returns the x magnification of the magnification component of this matrix. + @return The magnification factor. + """ + def mag_y(self) -> float: + r""" + @brief Returns the y magnification of the magnification component of this matrix. + @return The magnification factor. + """ + def shear_angle(self) -> float: + r""" + @brief Returns the magnitude of the shear component of this matrix. + @return The shear angle in degree. + The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree.See the description of this class for details about the basic transformations. + """ + def to_s(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + def trans(self, p: Point) -> Point: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + def tx(self, z: float) -> float: + r""" + @brief Returns the perspective tilt angle tx. + @param z The observer distance at which the tilt angle is computed. + @return The tilt angle tx. + The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1. + """ + def ty(self, z: float) -> float: + r""" + @brief Returns the perspective tilt angle ty. + @param z The observer distance at which the tilt angle is computed. + @return The tilt angle ty. + The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1. + """ + +class InstElement: + r""" + @brief An element in an instantiation path + + This objects are used to reference a single instance in a instantiation path. The object is composed of a \CellInstArray object (accessible through the \cell_inst accessor) that describes the basic instance, which may be an array. The particular instance within the array can be further retrieved using the \array_member_trans, \specific_trans or \specific_cplx_trans methods. + """ + @overload + @classmethod + def new(cls) -> InstElement: + r""" + @brief Default constructor + """ + @overload + @classmethod + def new(cls, inst: Instance) -> InstElement: + r""" + @brief Create an instance element from a single instance alone + Starting with version 0.15, this method takes an \Instance object (an instance reference) as the argument. + """ + @overload + @classmethod + def new(cls, inst: Instance, a_index: int, b_index: int) -> InstElement: + r""" + @brief Create an instance element from an array instance pointing into a certain array member + Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument. + """ + @classmethod + def new_i(cls, inst: Instance) -> InstElement: + r""" + @brief Create an instance element from a single instance alone + Starting with version 0.15, this method takes an \Instance object (an instance reference) as the argument. + """ + @classmethod + def new_iab(cls, inst: Instance, a_index: int, b_index: int) -> InstElement: + r""" + @brief Create an instance element from an array instance pointing into a certain array member + Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument. + """ + def __copy__(self) -> InstElement: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> InstElement: + r""" + @brief Creates a copy of self + """ + def __eq__(self, b: object) -> bool: + r""" + @brief Equality of two InstElement objects + Note: this operator returns true if both instance elements refer to the same instance, not just identical ones. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor + """ + @overload + def __init__(self, inst: Instance) -> None: + r""" + @brief Create an instance element from a single instance alone + Starting with version 0.15, this method takes an \Instance object (an instance reference) as the argument. + """ + @overload + def __init__(self, inst: Instance, a_index: int, b_index: int) -> None: + r""" + @brief Create an instance element from an array instance pointing into a certain array member + Starting with version 0.15, this method takes an \Instance object (an instance reference) as the first argument. + """ + def __lt__(self, b: InstElement) -> bool: + r""" + @brief Provides an order criterion for two InstElement objects + Note: this operator is just provided to establish any order, not a particular one. + """ + def __ne__(self, b: object) -> bool: + r""" + @brief Inequality of two InstElement objects + See the comments on the == operator. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def array_member_trans(self) -> Trans: + r""" + @brief Returns the transformation for this array member + + The array member transformation is the one applicable in addition to the global transformation for the member selected from an array. + If this instance is not an array instance, the specific transformation is a unit transformation without displacement. + """ + def assign(self, other: InstElement) -> None: + r""" + @brief Assigns another object to self + """ + def cell_inst(self) -> CellInstArray: + r""" + @brief Accessor to the cell instance (array). + + This method is equivalent to "self.inst.cell_inst" and provided for convenience. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> InstElement: + r""" + @brief Creates a copy of self + """ + def ia(self) -> int: + r""" + @brief Returns the 'a' axis index for array instances + For instance elements describing one member of an array, this attribute will deliver the a axis index addressed by this element. See \ib and \array_member_trans for further attributes applicable to array members. + If the element is a plain instance and not an array member, this attribute is a negative value. + + This method has been introduced in version 0.25. + """ + def ib(self) -> int: + r""" + @brief Returns the 'b' axis index for array instances + For instance elements describing one member of an array, this attribute will deliver the a axis index addressed by this element. See \ia and \array_member_trans for further attributes applicable to array members. + If the element is a plain instance and not an array member, this attribute is a negative value. + + This method has been introduced in version 0.25. + """ + def inst(self) -> Instance: + r""" + @brief Gets the \Instance object held in this instance path element. + + This method has been added in version 0.24. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def prop_id(self) -> int: + r""" + @brief Accessor to the property attached to this instance. + + This method is equivalent to "self.inst.prop_id" and provided for convenience. + """ + def specific_cplx_trans(self) -> ICplxTrans: + r""" + @brief Returns the specific complex transformation for this instance + + The specific transformation is the one applicable for the member selected from an array. + This is the effective transformation applied for this array member. \array_member_trans gives the transformation applied additionally to the instances' global transformation (in other words, specific_cplx_trans = array_member_trans * cell_inst.cplx_trans). + """ + def specific_trans(self) -> Trans: + r""" + @brief Returns the specific transformation for this instance + + The specific transformation is the one applicable for the member selected from an array. + This is the effective transformation applied for this array member. \array_member_trans gives the transformation applied additionally to the instances' global transformation (in other words, specific_trans = array_member_trans * cell_inst.trans). + This method delivers a simple transformation that does not include magnification components. To get these as well, use \specific_cplx_trans. + """ + +class Instance: + r""" + @brief An instance proxy + + An instance proxy is basically a pointer to an instance of different kinds, + similar to \Shape, the shape proxy. \Instance objects can be duplicated without + creating copies of the instances itself: the copy will still point to the same instance + than the original. + + When the \Instance object is modified, the actual instance behind it is modified. The \Instance object acts as a simplified interface for single and array instances with or without properties. + + See @The Database API@ for more details about the database objects. + """ + a: Vector + r""" + Getter: + @brief Returns the displacement vector for the 'a' axis + + Starting with version 0.25 the displacement is of vector type. + Setter: + @brief Sets the displacement vector for the 'a' axis + + If the instance was not an array instance before it is made one. + + This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type. + """ + b: Vector + r""" + Getter: + @brief Returns the displacement vector for the 'b' axis + + Starting with version 0.25 the displacement is of vector type. + Setter: + @brief Sets the displacement vector for the 'b' axis + + If the instance was not an array instance before it is made one. + + This method has been introduced in version 0.23. Starting with version 0.25 the displacement is of vector type. + """ + cell: Cell + r""" + Getter: + @brief Gets the \Cell object of the cell this instance refers to + + Please note that before version 0.23 this method returned the cell the instance is contained in. For consistency, this method has been renamed \parent_cell. + + This method has been introduced in version 0.23. + Setter: + @brief Sets the \Cell object this instance refers to + + Setting the cell object to nil is equivalent to deleting the instance. + + This method has been introduced in version 0.23. + """ + cell_index: int + r""" + Getter: + @brief Get the index of the cell this instance refers to + + Setter: + @brief Sets the index of the cell this instance refers to + + This method has been introduced in version 0.23. + """ + cell_inst: CellInstArray + r""" + Getter: + @brief Gets the basic \CellInstArray object associated with this instance reference. + Setter: + @brief Returns the basic cell instance array object by giving a micrometer unit object. + This method replaces the instance by the given CellInstArray object and it internally transformed into database units. + + This method has been introduced in version 0.25 + """ + cplx_trans: ICplxTrans + r""" + Getter: + @brief Gets the complex transformation of the instance or the first instance in the array + This method is always valid compared to \trans, since simple transformations can be expressed as complex transformations as well. + Setter: + @brief Sets the complex transformation of the instance or the first instance in the array (in micrometer units) + This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. + + This method has been introduced in version 0.25. + """ + da: DVector + r""" + Getter: + @brief Returns the displacement vector for the 'a' axis in micrometer units + + Like \a, this method returns the displacement, but it will be translated to database units internally. + + This method has been introduced in version 0.25. + Setter: + @brief Sets the displacement vector for the 'a' axis in micrometer units + + Like \a= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. + + This method has been introduced in version 0.25. + """ + db: DVector + r""" + Getter: + @brief Returns the displacement vector for the 'b' axis in micrometer units + + Like \b, this method returns the displacement, but it will be translated to database units internally. + + This method has been introduced in version 0.25. + Setter: + @brief Sets the displacement vector for the 'b' axis in micrometer units + + Like \b= with an integer displacement, this method will set the displacement vector but it accepts a vector in micrometer units that is of \DVector type. The vector will be translated to database units internally. + + This method has been introduced in version 0.25. + """ + dcell_inst: DCellInstArray + r""" + Getter: + @brief Returns the micrometer unit version of the basic cell instance array object. + + This method has been introduced in version 0.25 + Setter: + @brief Returns the basic cell instance array object by giving a micrometer unit object. + This method replaces the instance by the given CellInstArray object and it internally transformed into database units. + + This method has been introduced in version 0.25 + """ + dcplx_trans: DCplxTrans + r""" + Getter: + @brief Gets the complex transformation of the instance or the first instance in the array (in micrometer units) + This method returns the same transformation as \cplx_trans, but the displacement of this transformation is given in micrometer units. It is internally translated from database units into micrometers. + + This method has been introduced in version 0.25. + + Setter: + @brief Sets the complex transformation of the instance or the first instance in the array (in micrometer units) + This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. + + This method has been introduced in version 0.25. + """ + dtrans: DTrans + r""" + Getter: + @brief Gets the transformation of the instance or the first instance in the array (in micrometer units) + This method returns the same transformation as \cplx_trans, but the displacement of this transformation is given in micrometer units. It is internally translated from database units into micrometers. + + This method has been introduced in version 0.25. + + Setter: + @brief Sets the transformation of the instance or the first instance in the array (in micrometer units) + This method sets the transformation the same way as \cplx_trans=, but the displacement of this transformation is given in micrometer units. It is internally translated into database units. + + This method has been introduced in version 0.25. + """ + na: int + r""" + Getter: + @brief Returns the number of instances in the 'a' axis + + Setter: + @brief Sets the number of instances in the 'a' axis + + If the instance was not an array instance before it is made one. + + This method has been introduced in version 0.23. + """ + nb: int + r""" + Getter: + @brief Returns the number of instances in the 'b' axis + + Setter: + @brief Sets the number of instances in the 'b' axis + + If the instance was not an array instance before it is made one. + + This method has been introduced in version 0.23. + """ + parent_cell: Cell + r""" + Getter: + @brief Gets the cell this instance is contained in + + Returns nil if the instance does not live inside a cell. + This method was named "cell" previously which lead to confusion with \cell_index. + It was renamed to "parent_cell" in version 0.23. + + Setter: + @brief Moves the instance to a different cell + + Both the current and the target cell must live in the same layout. + + This method has been introduced in version 0.23. + """ + prop_id: int + r""" + Getter: + @brief Gets the properties ID associated with the instance + + Setter: + @brief Sets the properties ID associated with the instance + This method is provided, if a properties ID has been derived already. Usually it's more convenient to use \delete_property, \set_property or \property. + + This method has been introduced in version 0.22. + """ + trans: Trans + r""" + Getter: + @brief Gets the transformation of the instance or the first instance in the array + The transformation returned is only valid if the array does not represent a complex transformation array + Setter: + @brief Sets the transformation of the instance or the first instance in the array + + This method has been introduced in version 0.23. + """ + @classmethod + def new(cls) -> Instance: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> Instance: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Instance: + r""" + @brief Creates a copy of self + """ + def __eq__(self, b: object) -> bool: + r""" + @brief Tests for equality of two Instance objects + See the hint on the < operator. + """ + def __getitem__(self, key: Any) -> Any: + r""" + @brief Gets the user property with the given key or, if available, the PCell parameter with the name given by the key + Getting the PCell parameter has priority over the user property. + This method has been introduced in version 0.25. + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def __len__(self) -> int: + r""" + @brief Gets the number of single instances in the instance array + If the instance represents a single instance, the count is 1. Otherwise it is na*nb. + """ + def __lt__(self, b: Instance) -> bool: + r""" + @brief Provides an order criterion for two Instance objects + Warning: this operator is just provided to establish any order, not a particular one. + """ + def __ne__(self, b: object) -> bool: + r""" + @brief Tests for inequality of two Instance objects + Warning: this operator returns true if both objects refer to the same instance, not just identical ones. + """ + def __setitem__(self, key: Any, value: Any) -> None: + r""" + @brief Sets the user property with the given key or, if available, the PCell parameter with the name given by the key + Setting the PCell parameter has priority over the user property. + This method has been introduced in version 0.25. + """ + def __str__(self) -> str: + r""" + @brief Creates a string showing the contents of the reference + + This method has been introduced with version 0.16. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Instance) -> None: + r""" + @brief Assigns another object to self + """ + @overload + def bbox(self) -> Box: + r""" + @brief Gets the bounding box of the instance + The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array). + This method has been introduced in version 0.23. + """ + @overload + def bbox(self, layer_index: int) -> Box: + r""" + @brief Gets the bounding box of the instance for a given layer + @param layer_index The index of the layer the bounding box will be computed for. + The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all it's children', an empty bounding box will be returned. + This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28. + """ + def bbox_per_layer(self, layer_index: int) -> Box: + r""" + @brief Gets the bounding box of the instance for a given layer + @param layer_index The index of the layer the bounding box will be computed for. + The bounding box incorporates all instances that the array represents. It gives the overall extension of the child cell as seen in the calling cell (or all array members if the instance forms an array) for the given layer. If the layer is empty in this cell and all it's children', an empty bounding box will be returned. + This method has been introduced in version 0.25. 'bbox' is the preferred synonym for it since version 0.28. + """ + def change_pcell_parameter(self, name: str, value: Any) -> None: + r""" + @brief Changes a single parameter of a PCell instance to the given value + + This method changes a parameter of a PCell instance to the given value. The name identifies the PCell parameter and must correspond to one parameter listed in the PCell declaration. + + This method has been introduced in version 0.24. + """ + @overload + def change_pcell_parameters(self, dict: Dict[str, Any]) -> None: + r""" + @brief Changes the parameters of a PCell instance to the dictionary of parameters + + This method changes the parameters of a PCell instance to the given values. The values are specifies as a dictionary of names (keys) vs. values. + Unknown names are ignored and only the parameters listed in the dictionary are changed. + + This method has been introduced in version 0.24. + """ + @overload + def change_pcell_parameters(self, params: Sequence[Any]) -> None: + r""" + @brief Changes the parameters of a PCell instance to the list of parameters + + This method changes the parameters of a PCell instance to the given list of parameters. The list must correspond to the parameters listed in the pcell declaration. + A more convenient method is provided with the same name which accepts a dictionary of names and values + . + This method has been introduced in version 0.24. + """ + def convert_to_static(self) -> None: + r""" + @brief Converts a PCell instance to a static cell + + If the instance is a PCell instance, this method will convert the cell into a static cell and remove the PCell variant if required. A new cell will be created containing the PCell content but being a static cell. If the instance is not a PCell instance, this method won't do anything. + + This method has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + @overload + def dbbox(self) -> DBox: + r""" + @brief Gets the bounding box of the instance in micron units + Gets the bounding box (see \bbox) of the instance, but will compute the micrometer unit box by multiplying \bbox with the database unit. + + This method has been introduced in version 0.25. + """ + @overload + def dbbox(self, layer_index: int) -> DBox: + r""" + @brief Gets the bounding box of the instance in micron units + @param layer_index The index of the layer the bounding box will be computed for. + Gets the bounding box (see \bbox) of the instance, but will compute the micrometer unit box by multiplying \bbox with the database unit. + + This method has been introduced in version 0.25. 'dbbox' is the preferred synonym for it since version 0.28. + """ + def dbbox_per_layer(self, layer_index: int) -> DBox: + r""" + @brief Gets the bounding box of the instance in micron units + @param layer_index The index of the layer the bounding box will be computed for. + Gets the bounding box (see \bbox) of the instance, but will compute the micrometer unit box by multiplying \bbox with the database unit. + + This method has been introduced in version 0.25. 'dbbox' is the preferred synonym for it since version 0.28. + """ + def delete(self) -> None: + r""" + @brief Deletes this instance + + After this method was called, the instance object is pointing to nothing. + + This method has been introduced in version 0.23. + """ + def delete_property(self, key: Any) -> None: + r""" + @brief Deletes the user property with the given key + This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. + This method may change the properties ID. Calling this method may invalidate any iterators. It should not be called inside a loop iterating over instances. + + This method has been introduced in version 0.22. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> Instance: + r""" + @brief Creates a copy of self + """ + def explode(self) -> None: + r""" + @brief Explodes the instance array + + This method does nothing if the instance was not an array before. + The instance object will point to the first instance of the array afterwards. + + This method has been introduced in version 0.23. + """ + @overload + def flatten(self) -> None: + r""" + @brief Flattens the instance + + This method will convert the instance to a number of shapes which are equivalent to the content of the cell. The instance itself will be removed. + There is another variant of this method which allows specification of the number of hierarchy levels to flatten. + + This method has been introduced in version 0.24. + """ + @overload + def flatten(self, levels: int) -> None: + r""" + @brief Flattens the instance + + This method will convert the instance to a number of shapes which are equivalent to the content of the cell. The instance itself will be removed. + This version of the method allows specification of the number of hierarchy levels to remove. Specifying 1 for 'levels' will remove the instance and replace it by the contents of the cell. Specifying a negative value or zero for the number of levels will flatten the instance completely. + + This method has been introduced in version 0.24. + """ + def has_prop_id(self) -> bool: + r""" + @brief Returns true, if the instance has properties + """ + def is_complex(self) -> bool: + r""" + @brief Tests, if the array is a complex array + + Returns true if the array represents complex instances (that is, with magnification and + arbitrary rotation angles). + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_null(self) -> bool: + r""" + @brief Checks, if the instance is a valid one + """ + def is_pcell(self) -> bool: + r""" + @brief Returns a value indicating whether the instance is a PCell instance + + This method has been introduced in version 0.24. + """ + def is_regular_array(self) -> bool: + r""" + @brief Tests, if this instance is a regular array + """ + def is_valid(self) -> bool: + r""" + @brief Tests if the \Instance object is still pointing to a valid instance + If the instance represented by the given reference has been deleted, this method returns false. If however, another instance has been inserted already that occupies the original instances position, this method will return true again. + + This method has been introduced in version 0.23 and is a shortcut for "inst.cell.is_valid?(inst)". + """ + @overload + def layout(self) -> Layout: + r""" + @brief Gets the layout this instance is contained in + + This method has been introduced in version 0.22. + """ + @overload + def layout(self) -> Layout: + r""" + @brief Gets the layout this instance is contained in + + This const version of the method has been introduced in version 0.25. + """ + def pcell_declaration(self) -> PCellDeclaration_Native: + r""" + @brief Returns the PCell declaration object + + If the instance is a PCell instance, this method returns the PCell declaration object for that PCell. If not, this method will return nil. + This method has been introduced in version 0.24. + """ + def pcell_parameter(self, name: str) -> Any: + r""" + @brief Gets a PCell parameter by the name of the parameter + @return The parameter value or nil if the instance is not a PCell or does not have a parameter with given name + + This method has been introduced in version 0.25. + """ + def pcell_parameters(self) -> List[Any]: + r""" + @brief Gets the parameters of a PCell instance as a list of values + @return A list of values + + If the instance is a PCell instance, this method will return an array of values where each value corresponds to one parameter. The order of the values is the order the parameters are declared in the PCell declaration. + If the instance is not a PCell instance, this list returned will be empty. + + This method has been introduced in version 0.24. + """ + def pcell_parameters_by_name(self) -> Dict[str, Any]: + r""" + @brief Gets the parameters of a PCell instance as a dictionary of values vs. names + @return A dictionary of values by parameter name + + If the instance is a PCell instance, this method will return a map of values vs. parameter names. The names are the ones defined in the PCell declaration.If the instance is not a PCell instance, the dictionary returned will be empty. + + This method has been introduced in version 0.24. + """ + def property(self, key: Any) -> Any: + r""" + @brief Gets the user property with the given key + This method is a convenience method that gets the property with the given key. If no property with that key exists, it will return nil. Using that method is more convenient than using the layout object and the properties ID to retrieve the property value. + This method has been introduced in version 0.22. + """ + def set_property(self, key: Any, value: Any) -> None: + r""" + @brief Sets the user property with the given key to the given value + This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. + This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. Calling this method may invalidate any iterators. It should not be called inside a loop iterating over instances. + + This method has been introduced in version 0.22. + """ + def size(self) -> int: + r""" + @brief Gets the number of single instances in the instance array + If the instance represents a single instance, the count is 1. Otherwise it is na*nb. + """ + @overload + def to_s(self) -> str: + r""" + @brief Creates a string showing the contents of the reference + + This method has been introduced with version 0.16. + """ + @overload + def to_s(self, with_cellname: bool) -> str: + r""" + @brief Creates a string showing the contents of the reference + + Passing true to with_cellname makes the string contain the cellname instead of the cell index + + This method has been introduced with version 0.23. + """ + @overload + def transform(self, t: DCplxTrans) -> None: + r""" + @brief Transforms the instance array with the given complex transformation (given in micrometer units) + Transforms the instance like \transform does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units. + + This method has been introduced in version 0.25. + """ + @overload + def transform(self, t: DTrans) -> None: + r""" + @brief Transforms the instance array with the given transformation (given in micrometer units) + Transforms the instance like \transform does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units. + + This method has been introduced in version 0.25. + """ + @overload + def transform(self, t: ICplxTrans) -> None: + r""" + @brief Transforms the instance array with the given complex transformation + See \Cell#transform for a description of this method. + + This method has been introduced in version 0.23. + """ + @overload + def transform(self, t: Trans) -> None: + r""" + @brief Transforms the instance array with the given transformation + See \Cell#transform for a description of this method. + + This method has been introduced in version 0.23. + """ + @overload + def transform_into(self, t: DCplxTrans) -> None: + r""" + @brief Transforms the instance array with the given complex transformation (given in micrometer units) + Transforms the instance like \transform_into does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units. + + This method has been introduced in version 0.25. + """ + @overload + def transform_into(self, t: DTrans) -> None: + r""" + @brief Transforms the instance array with the given transformation (given in micrometer units) + Transforms the instance like \transform_into does, but with a transformation given in micrometer units. The displacement of this transformation is given in micrometers and is internally translated to database units. + + This method has been introduced in version 0.25. + """ + @overload + def transform_into(self, t: ICplxTrans) -> None: + r""" + @brief Transforms the instance array with the given transformation + See \Cell#transform_into for a description of this method. + + This method has been introduced in version 0.23. + """ + @overload + def transform_into(self, t: Trans) -> None: + r""" + @brief Transforms the instance array with the given transformation + See \Cell#transform_into for a description of this method. + + This method has been introduced in version 0.23. + """ + +class LEFDEFReaderConfiguration: + r""" + @brief Detailed LEF/DEF reader options + This class is a aggregate belonging to the \LoadLayoutOptions class. It provides options for the LEF/DEF reader. These options have been placed into a separate class to account for their complexity. + This class specifically handles layer mapping. This is the process of generating layer names or GDS layer/datatypes from LEF/DEF layers and purpose combinations. There are basically two ways: to use a map file or to use pattern-based production rules. + + To use a layer map file, set the \map_file attribute to the name of the layer map file. The layer map file lists the GDS layer and datatype numbers to generate for the geometry. + + The pattern-based approach will use the layer name and attach a purpose-dependent suffix to it. Use the ..._suffix attributes to specify this suffix. For routing, the corresponding attribute is \routing_suffix for example. A purpose can also be mapped to a specific GDS datatype using the corresponding ..._datatype attributes. + The decorated or undecorated names are looked up in a layer mapping table in the next step. The layer mapping table is specified using the \layer_map attribute. This table can be used to map layer names to specific GDS layers by using entries of the form 'NAME: layer-number'. + + If a layer map file is present, the pattern-based attributes are ignored. + """ + blockages_datatype: int + r""" + Getter: + @brief Gets the blockage marker layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the blockage marker layer datatype value. + See \produce_via_geometry for details about the layer production rules. + """ + blockages_suffix: str + r""" + Getter: + @brief Gets the blockage marker layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the blockage marker layer name suffix. + See \produce_via_geometry for details about the layer production rules. + """ + cell_outline_layer: str + r""" + Getter: + @brief Gets the layer on which to produce the cell outline (diearea). + This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details. + The setter for this attribute is \cell_outline_layer=. See also \produce_cell_outlines. + Setter: + @brief Sets the layer on which to produce the cell outline (diearea). + See \cell_outline_layer for details. + """ + create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether layers not mapped in the layer map shall be created too + See \layer_map for details. + Setter: + @brief Sets a value indicating whether layers not mapped in the layer map shall be created too + See \layer_map for details. + """ + dbu: float + r""" + Getter: + @brief Gets the database unit to use for producing the layout. + This value specifies the database to be used for the layout that is read. When a DEF file is specified with a different database unit, the layout is translated into this database unit. + + Setter: + @brief Sets the database unit to use for producing the layout. + See \dbu for details. + """ + @property + def paths_relative_to_cwd(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets a value indicating whether to use paths relative to cwd (true) or DEF file (false) for map or LEF files + This write-only attribute has been introduced in version 0.27.9. + """ + fills_datatype: int + r""" + Getter: + @brief Gets the fill geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules. + + Fill support has been introduced in version 0.27. + Setter: + @brief Sets the fill geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules. + + Fill support has been introduced in version 0.27. + """ + fills_datatype_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + fills_suffix: str + r""" + Getter: + @brief Gets the fill geometry layer name suffix. + See \produce_via_geometry for details about the layer production rules. + + Fill support has been introduced in version 0.27. + Setter: + @brief Sets the fill geometry layer name suffix. + See \produce_via_geometry for details about the layer production rules. + + Fill support has been introduced in version 0.27. + """ + fills_suffix_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + instance_property_name: Any + r""" + Getter: + @brief Gets a value indicating whether and how to produce instance names as properties. + If set to a value not nil, instance names will be attached to the instances generated as user properties. + This attribute then specifies the user property name to be used for attaching the instance names. + If set to nil, no instance names will be produced. + + The corresponding setter is \instance_property_name=. + + This method has been introduced in version 0.26.4. + Setter: + @brief Sets a value indicating whether and how to produce instance names as properties. + See \instance_property_name for details. + + This method has been introduced in version 0.26.4. + """ + labels_datatype: int + r""" + Getter: + @brief Gets the labels layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the labels layer datatype value. + See \produce_via_geometry for details about the layer production rules. + """ + labels_suffix: str + r""" + Getter: + @brief Gets the label layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the label layer name suffix. + See \produce_via_geometry for details about the layer production rules. + """ + layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map to be used for the LEF/DEF reader + @return A reference to the layer map + Because LEF/DEF layer mapping is substantially different than for normal layout files, the LEF/DEF reader employs a separate layer mapping table. The LEF/DEF specific layer mapping is stored within the LEF/DEF reader's configuration and can be accessed with this attribute. The layer mapping table of \LoadLayoutOptions will be ignored for the LEF/DEF reader. + + The setter is \layer_map=. \create_other_layers= is available to control whether layers not specified in the layer mapping table shall be created automatically. + Setter: + @brief Sets the layer map to be used for the LEF/DEF reader + See \layer_map for details. + """ + lef_files: List[str] + r""" + Getter: + @brief Gets the list technology LEF files to additionally import + Returns a list of path names for technology LEF files to read in addition to the primary file. Relative paths are resolved relative to the file to read or relative to the technology base path. + + The setter for this property is \lef_files=. + Setter: + @brief Sets the list technology LEF files to additionally import + See \lef_files for details. + """ + lef_labels_datatype: int + r""" + Getter: + @brief Gets the lef_labels layer datatype value. + See \produce_via_geometry for details about the layer production rules. + + This method has been introduced in version 0.27.2 + + Setter: + @brief Sets the lef_labels layer datatype value. + See \produce_via_geometry for details about the layer production rules. + + This method has been introduced in version 0.27.2 + """ + lef_labels_suffix: str + r""" + Getter: + @brief Gets the label layer name suffix. + See \produce_via_geometry for details about the layer production rules. + + This method has been introduced in version 0.27.2 + + Setter: + @brief Sets the label layer name suffix. + See \produce_via_geometry for details about the layer production rules. + + This method has been introduced in version 0.27.2 + """ + lef_pins_datatype: int + r""" + Getter: + @brief Gets the LEF pin geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the LEF pin geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules. + """ + lef_pins_datatype_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + lef_pins_suffix: str + r""" + Getter: + @brief Gets the LEF pin geometry layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the LEF pin geometry layer name suffix. + See \produce_via_geometry for details about the layer production rules. + """ + lef_pins_suffix_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + macro_layout_files: List[str] + r""" + Getter: + @brief Gets the list of layout files to read for substituting macros in DEF + These files play the same role than the macro layouts (see \macro_layouts), except that this property specifies a list of file names. The given files are loaded automatically to resolve macro layouts instead of LEF geometry. See \macro_resolution_mode for details when this happens. Relative paths are resolved relative to the DEF file to read or relative to the technology base path. + Macros in need for substitution are looked up in the layout files by searching for cells with the same name. The files are scanned in the order they are given in the file list. + The files from \macro_layout_files are scanned after the layout objects specified with \macro_layouts. + + The setter for this property is \macro_layout_files=. + + This property has been added in version 0.27.1. + + Setter: + @brief Sets the list of layout files to read for substituting macros in DEF + See \macro_layout_files for details. + + This property has been added in version 0.27.1. + """ + macro_layouts: List[Layout] + r""" + Getter: + @brief Gets the layout objects used for resolving LEF macros in the DEF reader. + The DEF reader can either use LEF geometry or use a separate source of layouts for the LEF macros. The \macro_resolution_mode controls whether to use LEF geometry. If LEF geometry is not used, the DEF reader will look up macro cells from the \macro_layouts and pull cell layouts from there. + + The LEF cells are looked up as cells by name from the macro layouts in the order these are given in this array. + + \macro_layout_files is another way of specifying such substitution layouts. This method accepts file names instead of layout objects. + + This property has been added in version 0.27. + + Setter: + @brief Sets the layout objects used for resolving LEF macros in the DEF reader. + See \macro_layouts for more details about this property. + + Layout objects specified in the array for this property are not owned by the \LEFDEFReaderConfiguration object. Be sure to keep some other reference to these Layout objects if you are storing away the LEF/DEF reader configuration object. + + This property has been added in version 0.27. + """ + macro_resolution_mode: int + r""" + Getter: + @brief Gets the macro resolution mode (LEF macros into DEF). + This property describes the way LEF macros are turned into layout cells when reading DEF. There are three modes available: + + @ul + @li 0: produce LEF geometry unless a FOREIGN cell is specified @/li + @li 1: produce LEF geometry always and ignore FOREIGN @/li + @li 2: Never produce LEF geometry and assume FOREIGN always @/li + @/ul + + If substitution layouts are specified with \macro_layouts, these are used to provide macro layouts in case no LEF geometry is taken. + + This property has been added in version 0.27. + + Setter: + @brief Sets the macro resolution mode (LEF macros into DEF). + See \macro_resolution_mode for details about this property. + + This property has been added in version 0.27. + """ + map_file: str + r""" + Getter: + @brief Gets the layer map file to use. + If a layer map file is given, the reader will pull the layer mapping from this file. The layer mapping rules specified in the reader options are ignored in this case. These are the name suffix rules for vias, blockages, routing, special routing, pins etc. and the corresponding datatype rules. The \layer_map attribute will also be ignored. + The layer map file path will be resolved relative to the technology base path if the LEF/DEF reader options are used in the context of a technology. + + This property has been added in version 0.27. + + Setter: + @brief Sets the layer map file to use. + See \map_file for details about this property. + + This property has been added in version 0.27. + """ + net_property_name: Any + r""" + Getter: + @brief Gets a value indicating whether and how to produce net names as properties. + If set to a value not nil, net names will be attached to the net shapes generated as user properties. + This attribute then specifies the user property name to be used for attaching the net names. + If set to nil, no net names will be produced. + + The corresponding setter is \net_property_name=. + Setter: + @brief Sets a value indicating whether and how to produce net names as properties. + See \net_property_name for details. + """ + obstructions_datatype: int + r""" + Getter: + @brief Gets the obstruction marker layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the obstruction marker layer datatype value. + See \produce_via_geometry for details about the layer production rules. + """ + obstructions_suffix: str + r""" + Getter: + @brief Gets the obstruction marker layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the obstruction marker layer name suffix. + See \produce_via_geometry for details about the layer production rules. + """ + pin_property_name: Any + r""" + Getter: + @brief Gets a value indicating whether and how to produce pin names as properties. + If set to a value not nil, pin names will be attached to the pin shapes generated as user properties. + This attribute then specifies the user property name to be used for attaching the pin names. + If set to nil, no pin names will be produced. + + The corresponding setter is \pin_property_name=. + + This method has been introduced in version 0.26.4. + Setter: + @brief Sets a value indicating whether and how to produce pin names as properties. + See \pin_property_name for details. + + This method has been introduced in version 0.26.4. + """ + pins_datatype: int + r""" + Getter: + @brief Gets the pin geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the pin geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules. + """ + pins_datatype_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + pins_suffix: str + r""" + Getter: + @brief Gets the pin geometry layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the pin geometry layer name suffix. + See \produce_via_geometry for details about the layer production rules. + """ + pins_suffix_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + placement_blockage_layer: str + r""" + Getter: + @brief Gets the layer on which to produce the placement blockage. + This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details.The setter for this attribute is \placement_blockage_layer=. See also \produce_placement_blockages. + Setter: + @brief Sets the layer on which to produce the placement blockage. + See \placement_blockage_layer for details. + """ + produce_blockages: bool + r""" + Getter: + @brief Gets a value indicating whether routing blockage markers shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether routing blockage markers shall be produced. + See \produce_via_geometry for details about the layer production rules. + """ + produce_cell_outlines: bool + r""" + Getter: + @brief Gets a value indicating whether to produce cell outlines (diearea). + If set to true, cell outlines will be produced on the layer given by \cell_outline_layer. + Setter: + @brief Sets a value indicating whether to produce cell outlines (diearea). + See \produce_cell_outlines for details. + """ + produce_fills: bool + r""" + Getter: + @brief Gets a value indicating whether fill geometries shall be produced. + See \produce_via_geometry for details about the layer production rules. + + Fill support has been introduced in version 0.27. + Setter: + @brief Sets a value indicating whether fill geometries shall be produced. + See \produce_via_geometry for details about the layer production rules. + + Fill support has been introduced in version 0.27. + """ + produce_labels: bool + r""" + Getter: + @brief Gets a value indicating whether labels shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether labels shall be produced. + See \produce_via_geometry for details about the layer production rules. + """ + produce_lef_labels: bool + r""" + Getter: + @brief Gets a value indicating whether lef_labels shall be produced. + See \produce_via_geometry for details about the layer production rules. + + This method has been introduced in version 0.27.2 + + Setter: + @brief Sets a value indicating whether lef_labels shall be produced. + See \produce_via_geometry for details about the layer production rules. + + This method has been introduced in version 0.27.2 + """ + produce_lef_pins: bool + r""" + Getter: + @brief Gets a value indicating whether LEF pin geometries shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether LEF pin geometries shall be produced. + See \produce_via_geometry for details about the layer production rules. + """ + produce_obstructions: bool + r""" + Getter: + @brief Gets a value indicating whether obstruction markers shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether obstruction markers shall be produced. + See \produce_via_geometry for details about the layer production rules. + """ + produce_pins: bool + r""" + Getter: + @brief Gets a value indicating whether pin geometries shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether pin geometries shall be produced. + See \produce_via_geometry for details about the layer production rules. + """ + produce_placement_blockages: bool + r""" + Getter: + @brief Gets a value indicating whether to produce placement blockage regions. + If set to true, polygons will be produced representing the placement blockage region on the layer given by \placement_blockage_layer. + Setter: + @brief Sets a value indicating whether to produce placement blockage regions. + See \produce_placement_blockages for details. + """ + produce_regions: bool + r""" + Getter: + @brief Gets a value indicating whether to produce regions. + If set to true, polygons will be produced representing the regions on the layer given by \region_layer. + + The attribute has been introduced in version 0.27. + Setter: + @brief Sets a value indicating whether to produce regions. + See \produce_regions for details. + + The attribute has been introduced in version 0.27. + """ + produce_routing: bool + r""" + Getter: + @brief Gets a value indicating whether routing geometry shall be produced. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets a value indicating whether routing geometry shall be produced. + See \produce_via_geometry for details about the layer production rules. + """ + produce_special_routing: bool + r""" + Getter: + @brief Gets a value indicating whether special routing geometry shall be produced. + See \produce_via_geometry for details about the layer production rules. + + The differentiation between special and normal routing has been introduced in version 0.27. + Setter: + @brief Sets a value indicating whether special routing geometry shall be produced. + See \produce_via_geometry for details about the layer production rules. + The differentiation between special and normal routing has been introduced in version 0.27. + """ + produce_via_geometry: bool + r""" + Getter: + @brief Sets a value indicating whether via geometries shall be produced. + + If set to true, shapes will be produced for each via. The layer to be produced will be determined from the via layer's name using the suffix provided by \via_geometry_suffix. If there is a specific mapping in the layer mapping table for the via layer including the suffix, the layer/datatype will be taken from the layer mapping table. If there is a mapping to the undecorated via layer, the datatype will be substituted with the \via_geometry_datatype value. If no mapping is defined, a unique number will be assigned to the layer number and the datatype will be taken from the \via_geometry_datatype value. + + For example: the via layer is 'V1', \via_geometry_suffix is 'GEO' and \via_geometry_datatype is 1. Then: + + @ul + @li If there is a mapping for 'V1.GEO', the layer and datatype will be taken from there. @/li + @li If there is a mapping for 'V1', the layer will be taken from there and the datatype will be taken from \via_geometry_datatype. The name of the produced layer will be 'V1.GEO'. @/li + @li If there is no mapping for both, the layer number will be a unique value, the datatype will be taken from \via_geometry_datatype and the layer name will be 'V1.GEO'. @/li@/ul + + Setter: + @brief Sets a value indicating whether via geometries shall be produced. + See \produce_via_geometry for details. + """ + read_lef_with_def: bool + r""" + Getter: + @brief Gets a value indicating whether to read all LEF files in the same directory than the DEF file. + If this property is set to true (the default), the DEF reader will automatically consume all LEF files next to the DEF file in addition to the LEF files specified with \lef_files. If set to false, only the LEF files specified with \lef_files will be read. + + This property has been added in version 0.27. + + Setter: + @brief Sets a value indicating whether to read all LEF files in the same directory than the DEF file. + See \read_lef_with_def for details about this property. + + This property has been added in version 0.27. + """ + region_layer: str + r""" + Getter: + @brief Gets the layer on which to produce the regions. + This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details.The setter for this attribute is \region_layer=. See also \produce_regions. + + The attribute has been introduced in version 0.27. + Setter: + @brief Sets the layer on which to produce the regions. + See \region_layer for details. + + The attribute has been introduced in version 0.27. + """ + routing_datatype: int + r""" + Getter: + @brief Gets the routing layer datatype value. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the routing layer datatype value. + See \produce_via_geometry for details about the layer production rules. + """ + routing_datatype_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + routing_suffix: str + r""" + Getter: + @brief Gets the routing layer name suffix. + See \produce_via_geometry for details about the layer production rules. + Setter: + @brief Sets the routing layer name suffix. + See \produce_via_geometry for details about the layer production rules. + """ + routing_suffix_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + separate_groups: bool + r""" + Getter: + @brief Gets a value indicating whether to create separate parent cells for individual groups. + If this property is set to true, instances belonging to different groups are separated by putting them into individual parent cells. These parent cells are named after the groups and are put into the master top cell. + If this property is set to false (the default), no such group parents will be formed. + This property has been added in version 0.27. + + Setter: + @brief Sets a value indicating whether to create separate parent cells for individual groups. + See \separate_groups for details about this property. + + This property has been added in version 0.27. + """ + special_routing_datatype: int + r""" + Getter: + @brief Gets the special routing layer datatype value. + See \produce_via_geometry for details about the layer production rules. + The differentiation between special and normal routing has been introduced in version 0.27. + Setter: + @brief Sets the special routing layer datatype value. + See \produce_via_geometry for details about the layer production rules. + The differentiation between special and normal routing has been introduced in version 0.27. + """ + special_routing_datatype_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + special_routing_suffix: str + r""" + Getter: + @brief Gets the special routing layer name suffix. + See \produce_via_geometry for details about the layer production rules. + The differentiation between special and normal routing has been introduced in version 0.27. + Setter: + @brief Sets the special routing layer name suffix. + See \produce_via_geometry for details about the layer production rules. + The differentiation between special and normal routing has been introduced in version 0.27. + """ + special_routing_suffix_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + via_cellname_prefix: str + r""" + Getter: + @brief Gets the via cellname prefix. + Vias are represented by cells. The cell name is formed by combining the via cell name prefix and the via name. + + This property has been added in version 0.27. + + Setter: + @brief Sets the via cellname prefix. + See \via_cellname_prefix for details about this property. + + This property has been added in version 0.27. + """ + via_geometry_datatype: int + r""" + Getter: + @brief Gets the via geometry layer datatype value. + See \produce_via_geometry for details about this property. + + Setter: + @brief Sets the via geometry layer datatype value. + See \produce_via_geometry for details about this property. + """ + via_geometry_datatype_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + via_geometry_suffix: str + r""" + Getter: + @brief Gets the via geometry layer name suffix. + See \produce_via_geometry for details about this property. + + Setter: + @brief Sets the via geometry layer name suffix. + See \produce_via_geometry for details about this property. + """ + via_geometry_suffix_str: str + r""" + Getter: + @hide + Setter: + @hide + """ + @classmethod + def new(cls) -> LEFDEFReaderConfiguration: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LEFDEFReaderConfiguration: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> LEFDEFReaderConfiguration: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: LEFDEFReaderConfiguration) -> None: + r""" + @brief Assigns another object to self + """ + def clear_fill_datatypes_per_mask(self) -> None: + r""" + @brief Clears the fill layer datatypes per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_fills_suffixes_per_mask(self) -> None: + r""" + @brief Clears the fill layer name suffix per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_lef_pins_datatypes_per_mask(self) -> None: + r""" + @brief Clears the LEF pin layer datatypes per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_lef_pins_suffixes_per_mask(self) -> None: + r""" + @brief Clears the LEF pin layer name suffix per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_pin_datatypes_per_mask(self) -> None: + r""" + @brief Clears the pin layer datatypes per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_pins_suffixes_per_mask(self) -> None: + r""" + @brief Clears the pin layer name suffix per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_routing_datatypes_per_mask(self) -> None: + r""" + @brief Clears the routing layer datatypes per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_routing_suffixes_per_mask(self) -> None: + r""" + @brief Clears the routing layer name suffix per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_special_routing_datatypes_per_mask(self) -> None: + r""" + @brief Clears the special routing layer datatypes per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_special_routing_suffixes_per_mask(self) -> None: + r""" + @brief Clears the special routing layer name suffix per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_via_geometry_datatypes_per_mask(self) -> None: + r""" + @brief Clears the via geometry layer datatypes per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def clear_via_geometry_suffixes_per_mask(self) -> None: + r""" + @brief Clears the via geometry layer name suffix per mask. + See \produce_via_geometry for details about this property. + + + Mask specific rules have been introduced in version 0.27. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> LEFDEFReaderConfiguration: + r""" + @brief Creates a copy of self + """ + def fills_suffix_per_mask(self, mask: int) -> str: + r""" + @brief Gets the fill geometry layer name suffix per mask. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def lef_pins_suffix_per_mask(self, mask: int) -> str: + r""" + @brief Gets the LEF pin geometry layer name suffix per mask. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def pins_suffix_per_mask(self, mask: int) -> str: + r""" + @brief Gets the pin geometry layer name suffix per mask. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def routing_suffix_per_mask(self, mask: int) -> str: + r""" + @brief Gets the routing geometry layer name suffix per mask. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_fills_datatype_per_mask(self, mask: int, datatype: int) -> None: + r""" + @brief Sets the fill geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_fills_suffix_per_mask(self, mask: int, suffix: str) -> None: + r""" + @brief Sets the fill geometry layer name suffix per mask. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_lef_pins_datatype_per_mask(self, mask: int, datatype: int) -> None: + r""" + @brief Sets the LEF pin geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_lef_pins_suffix_per_mask(self, mask: int, suffix: str) -> None: + r""" + @brief Sets the LEF pin geometry layer name suffix per mask. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_pins_datatype_per_mask(self, mask: int, datatype: int) -> None: + r""" + @brief Sets the pin geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_pins_suffix_per_mask(self, mask: int, suffix: str) -> None: + r""" + @brief Sets the pin geometry layer name suffix per mask. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_routing_datatype_per_mask(self, mask: int, datatype: int) -> None: + r""" + @brief Sets the routing geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_routing_suffix_per_mask(self, mask: int, suffix: str) -> None: + r""" + @brief Sets the routing geometry layer name suffix per mask. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_special_routing_datatype_per_mask(self, mask: int, datatype: int) -> None: + r""" + @brief Sets the special routing geometry layer datatype value. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_special_routing_suffix_per_mask(self, mask: int, suffix: str) -> None: + r""" + @brief Sets the special routing geometry layer name suffix per mask. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_via_geometry_datatype_per_mask(self, mask: int, datatype: int) -> None: + r""" + @brief Sets the via geometry layer datatype value. + See \produce_via_geometry for details about this property. + The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def set_via_geometry_suffix_per_mask(self, mask: int, suffix: str) -> None: + r""" + @brief Sets the via geometry layer name suffix per mask. + See \produce_via_geometry for details about this property. + The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def special_routing_suffix_per_mask(self, mask: int) -> str: + r""" + @brief Gets the special routing geometry layer name suffix per mask. + See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + def via_geometry_suffix_per_mask(self, mask: int) -> str: + r""" + @brief Gets the via geometry layer name suffix per mask. + See \produce_via_geometry for details about this property. + The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). + + Mask specific rules have been introduced in version 0.27. + """ + +class LayerInfo: + r""" + @brief A structure encapsulating the layer properties + + The layer properties describe how a layer is stored in a GDS2 or OASIS file for example. The \LayerInfo object represents the storage properties that are attached to a layer in the database. + + In general, a layer has either a layer and a datatype number (in GDS2), a name (for example in DXF or CIF) or both (in OASIS). In the latter case, the primary identification is through layer and datatype number and the name is some annotation attached to it. A \LayerInfo object which specifies just a name returns true on \is_named?. + The \LayerInfo object can also specify an anonymous layer (use \LayerInfo#new without arguments). Such a layer will not be stored when saving the layout. They can be employed for temporary layers for example. Use \LayerInfo#anonymous? to test whether a layer does not have a specification. + + The \LayerInfo is used for example in \Layout#insert_layer to specify the properties of the new layer that will be created. The \is_equivalent? method compares two \LayerInfo objects using the layer and datatype numbers with a higher priority over the name. + """ + datatype: int + r""" + Getter: + @brief Gets the datatype + + Setter: + @brief Set the datatype + """ + layer: int + r""" + Getter: + @brief Gets the layer number + + Setter: + @brief Sets the layer number + """ + name: str + r""" + Getter: + @brief Gets the layer name + + Setter: + @brief Set the layer name + The name is set on OASIS input for example, if the layer has a name. + """ + @classmethod + def from_string(cls, s: str, as_target: Optional[bool] = ...) -> LayerInfo: + r""" + @brief Create a layer info object from a string + @param The string + @return The LayerInfo object + + If 'as_target' is true, relative specifications such as '*+1' for layer or datatype are permitted. + + This method will take strings as produced by \to_s and create a \LayerInfo object from them. The format is either "layer", "layer/datatype", "name" or "name (layer/datatype)". + + This method was added in version 0.23. + The 'as_target' argument has been added in version 0.26.5. + """ + @overload + @classmethod + def new(cls) -> LayerInfo: + r""" + @brief The default constructor. + Creates a default \LayerInfo object. + + This method was added in version 0.18. + """ + @overload + @classmethod + def new(cls, layer: int, datatype: int) -> LayerInfo: + r""" + @brief The constructor for a layer/datatype pair. + Creates a \LayerInfo object representing a layer and datatype. + @param layer The layer number + @param datatype The datatype number + + This method was added in version 0.18. + """ + @overload + @classmethod + def new(cls, layer: int, datatype: int, name: str) -> LayerInfo: + r""" + @brief The constructor for a named layer with layer and datatype. + Creates a \LayerInfo object representing a named layer with layer and datatype. + @param layer The layer number + @param datatype The datatype number + @param name The name + + This method was added in version 0.18. + """ + @overload + @classmethod + def new(cls, name: str) -> LayerInfo: + r""" + @brief The constructor for a named layer. + Creates a \LayerInfo object representing a named layer. + @param name The name + + This method was added in version 0.18. + """ + def __copy__(self) -> LayerInfo: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> LayerInfo: + r""" + @brief Creates a copy of self + """ + def __eq__(self, b: object) -> bool: + r""" + @brief Compares two layer info objects + @return True, if both are equal + + This method was added in version 0.18. + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given layer info object. This method enables layer info objects as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief The default constructor. + Creates a default \LayerInfo object. + + This method was added in version 0.18. + """ + @overload + def __init__(self, layer: int, datatype: int) -> None: + r""" + @brief The constructor for a layer/datatype pair. + Creates a \LayerInfo object representing a layer and datatype. + @param layer The layer number + @param datatype The datatype number + + This method was added in version 0.18. + """ + @overload + def __init__(self, layer: int, datatype: int, name: str) -> None: + r""" + @brief The constructor for a named layer with layer and datatype. + Creates a \LayerInfo object representing a named layer with layer and datatype. + @param layer The layer number + @param datatype The datatype number + @param name The name + + This method was added in version 0.18. + """ + @overload + def __init__(self, name: str) -> None: + r""" + @brief The constructor for a named layer. + Creates a \LayerInfo object representing a named layer. + @param name The name + + This method was added in version 0.18. + """ + def __ne__(self, b: object) -> bool: + r""" + @brief Compares two layer info objects + @return True, if both are not equal + + This method was added in version 0.18. + """ + def __str__(self, as_target: Optional[bool] = ...) -> str: + r""" + @brief Convert the layer info object to a string + @return The string + + If 'as_target' is true, wildcard and relative specifications are formatted such such. + + This method was added in version 0.18. + The 'as_target' argument has been added in version 0.26.5. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def anonymous(self) -> bool: + r""" + @brief Returns true, if the layer has no specification (i.e. is created by the default constructor). + @return True, if the layer does not have any specification. + + This method was added in version 0.23. + """ + def assign(self, other: LayerInfo) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> LayerInfo: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given layer info object. This method enables layer info objects as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_equivalent(self, b: LayerInfo) -> bool: + r""" + @brief Equivalence of two layer info objects + @return True, if both are equivalent + + First, layer and datatype are compared. The name is of second order and used only if no layer or datatype is given. + This is basically a weak comparison that reflects the search preferences. + + This method was added in version 0.18. + """ + def is_named(self) -> bool: + r""" + @brief Returns true, if the layer is purely specified by name. + @return True, if no layer or datatype is given. + + This method was added in version 0.18. + """ + def to_s(self, as_target: Optional[bool] = ...) -> str: + r""" + @brief Convert the layer info object to a string + @return The string + + If 'as_target' is true, wildcard and relative specifications are formatted such such. + + This method was added in version 0.18. + The 'as_target' argument has been added in version 0.26.5. + """ + +class LayerMap: + r""" + @brief An object representing an arbitrary mapping of physical layers to logical layers + + "Physical" layers are stream layers or other separated layers in a CAD file. "Logical" layers are the layers present in a \Layout object. Logical layers are represented by an integer index while physical layers are given by a layer and datatype number or name. A logical layer is created automatically in the layout on reading if it does not exist yet. + + The mapping describes an association of a set of physical layers to a set of logical ones, where multiple + physical layers can be mapped to a single logical one, which effectively merges the layers. + + For each logical layer, a target layer can be specified. A target layer is the layer/datatype/name combination + as which the logical layer appears in the layout. By using a target layer different from the source layer + renaming a layer can be achieved while loading a layout. Another use case for that feature is to assign + layer names to GDS layer/datatype combinations which are numerical only. + + LayerMap objects are used in two ways: as input for the reader (inside a \LoadLayoutOptions class) and + as output from the reader (i.e. Layout::read method). For layer map objects used as input, the layer indexes + (logical layers) can be consecutive numbers. They do not need to correspond with real layer indexes from + a layout object. When used as output, the layer map's logical layers correspond to the layer indexes inside + the layout that the layer map was used upon. + + This is a sample how to use the LayerMap object. It maps all datatypes of layers 1, 2 and 3 to datatype 0 and + assigns the names 'ONE', 'TWO' and 'THREE' to these layout layers: + + @codelm = RBA::LayerMap::new + lm.map("1/0-255 : ONE (1/0)") + lm.map("2/0-255 : TWO (2/0)") + lm.map("3/0-255 : THREE (3/0)") + + # read the layout using the layer map + lo = RBA::LoadLayoutOptions::new + lo.layer_map.assign(lm) + ly = RBA::Layout::new + ly.read("input.gds", lo) + @/code + + 1:n mapping is supported: a physical layer can be mapped to multiple logical layers using 'mmap' instead of 'map'. When using this variant, mapping acts additive. + The following example will map layer 1, datatypes 0 to 255 to logical layer 0, and layer 1, datatype 17 to logical layers 0 plus 1: + @codelm = RBA::LayerMap::new + lm.map("1/0-255", 0) # (can be 'mmap' too) + lm.mmap("1/17", 1) + @/code + + 'unmapping' allows removing a mapping. This allows creating 'holes' in mapping ranges. The following example maps layer 1, datatypes 0 to 16 and 18 to 255 to logical layer 0: + @codelm = RBA::LayerMap::new + lm.map("1/0-255", 0) + lm.unmap("1/17") + @/code + + The LayerMap class has been introduced in version 0.18. Target layer have been introduced in version 0.20. 1:n mapping and unmapping has been introduced in version 0.27. + """ + @classmethod + def from_string(cls, arg0: str) -> LayerMap: + r""" + @brief Creates a layer map from the given string + The format of the string is that used in layer mapping files: one mapping entry per line, comments are allowed using '#' or '//'. The format of each line is that used in the 'map(string, index)' method. + + This method has been introduced in version 0.23. + """ + @classmethod + def new(cls) -> LayerMap: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LayerMap: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> LayerMap: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: LayerMap) -> None: + r""" + @brief Assigns another object to self + """ + def clear(self) -> None: + r""" + @brief Clears the map + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> LayerMap: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_mapped(self, layer: LayerInfo) -> bool: + r""" + @brief Check, if a given physical layer is mapped + @param layer The physical layer specified with an \LayerInfo object. + @return True, if the layer is mapped. + """ + def logical(self, layer: LayerInfo) -> int: + r""" + @brief Returns the logical layer (the layer index in the layout object) for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. + @return The logical layer index or -1 if the layer is not mapped. + This method is deprecated with version 0.27 as in this version, layers can be mapped to multiple targets which this method can't capture. Use \logicals instead. + """ + def logicals(self, layer: LayerInfo) -> List[int]: + r""" + @brief Returns the logical layers for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. + @return This list of logical layers this physical layer as mapped to or empty if there is no mapping. + This method has been introduced in version 0.27. + """ + @overload + def map(self, map_expr: str, log_layer: Optional[int] = ...) -> None: + r""" + @brief Maps a physical layer given by a string to a logical one + @param map_expr The string describing the physical layer to map. + @param log_layer The logical layer to which the physical layers are mapped. + + The string expression is constructed using the syntax: + "list[/list][;..]" for layer/datatype pairs. "list" is a + sequence of numbers, separated by comma values or a range + separated by a hyphen. Examples are: "1/2", "1-5/0", "1,2,5/0", + "1/5;5/6". + + layer/datatype wildcards can be specified with "*". When "*" is used + for the upper limit, it is equivalent to "all layer above". When used + alone, it is equivalent to "all layers". Examples: "1 / *", "* / 10-*" + + Named layers are specified simply by specifying the name, if + necessary in single or double quotes (if the name begins with a digit or + contains non-word characters). layer/datatype and name descriptions can + be mixed, i.e. "AA;1/5" (meaning: name "AA" or layer 1/datatype 5). + + A target layer can be specified with the ":" notation, where + target is a valid string for a LayerProperties() object. + + A target can include relative layer/datatype specifications and wildcards. + For example, "1-10/0: *+1/0" will add 1 to the original layer number. + "1-10/0-50: * / *" will use the original layers. + + If the logical layer is negative or omitted, the method will select the next available one. + + Target mapping has been added in version 0.20. The logical layer is optional since version 0.28. + """ + @overload + def map(self, phys_layer: LayerInfo, log_layer: int) -> None: + r""" + @brief Maps a physical layer to a logical one + @param phys_layer The physical layer (a \LayerInfo object). + @param log_layer The logical layer to which the physical layer is mapped. + + In general, there may be more than one physical layer mapped + to one logical layer. This method will add the given physical layer to the mapping for the logical layer. + """ + @overload + def map(self, phys_layer: LayerInfo, log_layer: int, target_layer: LayerInfo) -> None: + r""" + @brief Maps a physical layer to a logical one with a target layer + @param phys_layer The physical layer (a \LayerInfo object). + @param log_layer The logical layer to which the physical layer is mapped. + @param target_layer The properties of the layer that will be created unless it already exists. + + In general, there may be more than one physical layer mapped + to one logical layer. This method will add the given physical layer to the mapping for the logical layer. + + This method has been added in version 0.20. + """ + @overload + def map(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int) -> None: + r""" + @brief Maps a physical layer interval to a logical one + @param pl_start The first physical layer (a \LayerInfo object). + @param pl_stop The last physical layer (a \LayerInfo object). + @param log_layer The logical layer to which the physical layers are mapped. + + This method maps an interval of layers l1..l2 and datatypes d1..d2 to the mapping for the given logical layer. l1 and d1 are given by the pl_start argument, while l2 and d2 are given by the pl_stop argument. + """ + @overload + def map(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int, layer_properties: LayerInfo) -> None: + r""" + @brief Maps a physical layer interval to a logical one with a target layer + @param pl_start The first physical layer (a \LayerInfo object). + @param pl_stop The last physical layer (a \LayerInfo object). + @param log_layer The logical layer to which the physical layers are mapped. + @param target_layer The properties of the layer that will be created unless it already exists. + + This method maps an interval of layers l1..l2 and datatypes d1..d2 to the mapping for the given logical layer. l1 and d1 are given by the pl_start argument, while l2 and d2 are given by the pl_stop argument. + This method has been added in version 0.20. + """ + def mapping(self, log_layer: int) -> LayerInfo: + r""" + @brief Returns the mapped physical (or target if one is specified) layer for a given logical layer + @param log_layer The logical layer for which the mapping is requested. + @return A \LayerInfo object which is the physical layer mapped to the logical layer. + In general, there may be more than one physical layer mapped + to one logical layer. This method will return a single one of + them. It will return the one with the lowest layer and datatype. + """ + def mapping_str(self, log_layer: int) -> str: + r""" + @brief Returns the mapping string for a given logical layer + @param log_layer The logical layer for which the mapping is requested. + @return A string describing the mapping. + The mapping string is compatible with the string that the "map" method accepts. + """ + @overload + def mmap(self, map_expr: str, log_layer: Optional[int] = ...) -> None: + r""" + @brief Maps a physical layer given by an expression to a logical one and adds to existing mappings + + This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. + For backward compatibility, 'map' still substitutes mapping. + + If the logical layer is negative or omitted, the method will select the next available one. + + Multi-mapping has been added in version 0.27. The logical layer is optional since version 0.28. + """ + @overload + def mmap(self, phys_layer: LayerInfo, log_layer: int) -> None: + r""" + @brief Maps a physical layer to a logical one and adds to existing mappings + + This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. + For backward compatibility, 'map' still substitutes mapping. + + Multi-mapping has been added in version 0.27. + """ + @overload + def mmap(self, phys_layer: LayerInfo, log_layer: int, target_layer: LayerInfo) -> None: + r""" + @brief Maps a physical layer to a logical one, adds to existing mappings and specifies a target layer + + This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. + For backward compatibility, 'map' still substitutes mapping. + + Multi-mapping has been added in version 0.27. + """ + @overload + def mmap(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int) -> None: + r""" + @brief Maps a physical layer from the given interval to a logical one and adds to existing mappings + + This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. + For backward compatibility, 'map' still substitutes mapping. + + Multi-mapping has been added in version 0.27. + """ + @overload + def mmap(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int, layer_properties: LayerInfo) -> None: + r""" + @brief Maps a physical layer from the given interval to a logical one, adds to existing mappings and specifies a target layer + + This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. + For backward compatibility, 'map' still substitutes mapping. + + Multi-mapping has been added in version 0.27. + """ + def to_string(self) -> str: + r""" + @brief Converts a layer mapping object to a string + This method is the inverse of the \from_string method. + + This method has been introduced in version 0.23. + """ + @overload + def unmap(self, expr: str) -> None: + r""" + @brief Unmaps the layers from the given expression + This method has been introduced in version 0.27. + """ + @overload + def unmap(self, phys_layer: LayerInfo) -> None: + r""" + @brief Unmaps the given layer + Unmapping will remove the specific layer from the mapping. This method allows generating 'mapping holes' by first mapping a range and then unmapping parts of it. + + This method has been introduced in version 0.27. + """ + @overload + def unmap(self, pl_start: LayerInfo, pl_stop: LayerInfo) -> None: + r""" + @brief Unmaps the layers from the given interval + This method has been introduced in version 0.27. + """ + +class LayerMapping: + r""" + @brief A layer mapping (source to target layout) + + A layer mapping is an association of layers in two layouts forming pairs of layers, i.e. one layer corresponds to another layer in the other layout. The LayerMapping object describes the mapping of layers of a source layout A to a target layout B. + + A layer mapping can be set up manually or using the methods \create or \create_full. + + @code + lm = RBA::LayerMapping::new + # explicit: + lm.map(2, 1) # map layer index 2 of source to 1 of target + lm.map(7, 3) # map layer index 7 of source to 3 of target + ... + # or employing the specification identity: + lm.create(target_layout, source_layout) + # plus creating layers which don't exist in the target layout yet: + new_layers = lm.create_full(target_layout, source_layout) + @/code + + A layer might not be mapped to another layer which basically means that there is no corresponding layer. + Such layers will be ignored in operations using the layer mapping. Use \create_full to ensure all layers + of the source layout are mapped. + + LayerMapping objects play a role mainly in the hierarchical copy or move operations of \Layout. However, use is not restricted to these applications. + + This class has been introduced in version 0.23. + """ + @classmethod + def new(cls) -> LayerMapping: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LayerMapping: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> LayerMapping: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: LayerMapping) -> None: + r""" + @brief Assigns another object to self + """ + def clear(self) -> None: + r""" + @brief Clears the mapping. + """ + def create(self, layout_a: Layout, layout_b: Layout) -> None: + r""" + @brief Initialize the layer mapping from two layouts + + @param layout_a The target layout + @param layout_b The source layout + + The layer mapping is created by looking up each layer of layout_b in layout_a. All layers with matching specifications (\LayerInfo) are mapped. Layouts without a layer/datatype/name specification will not be mapped. + \create_full is a version of this method which creates new layers in layout_a if no corresponding layer is found. + """ + def create_full(self, layout_a: Layout, layout_b: Layout) -> List[int]: + r""" + @brief Initialize the layer mapping from two layouts + + @param layout_a The target layout + @param layout_b The source layout + @return A list of layers created + + The layer mapping is created by looking up each layer of layout_b in layout_a. All layers with matching specifications (\LayerInfo) are mapped. Layouts without a layer/datatype/name specification will not be mapped. + Layers with a valid specification which are not found in layout_a are created there. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> LayerMapping: + r""" + @brief Creates a copy of self + """ + def has_mapping(self, layer_index_b: int) -> bool: + r""" + @brief Determine if a layer in layout_b has a mapping to a layout_a layer. + + + @param layer_index_b The index of the layer in layout_b whose mapping is requested. + @return true, if the layer has a mapping + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def layer_mapping(self, layer_index_b: int) -> int: + r""" + @brief Determine layer mapping of a layout_b layer to the corresponding layout_a layer. + + + @param layer_index_b The index of the layer in layout_b whose mapping is requested. + @return The corresponding layer in layout_a. + """ + def map(self, layer_index_b: int, layer_index_a: int) -> None: + r""" + @brief Explicitly specify a mapping. + + + @param layer_index_b The index of the layer in layout B (the "source") + @param layer_index_a The index of the layer in layout A (the "target") + + Beside using the mapping generator algorithms provided through \create and \create_full, it is possible to explicitly specify layer mappings using this method. + """ + def table(self) -> Dict[int, int]: + r""" + @brief Returns the mapping table. + + The mapping table is a dictionary where the keys are source layout layer indexes and the values are the target layout layer indexes. + + This method has been introduced in version 0.25. + """ + +class Layout: + r""" + @brief The layout object + + This object represents a layout. + The layout object contains the cell hierarchy and + adds functionality for managing cell names and layer names. + The cell hierarchy can be changed by adding cells and cell instances. + Cell instances will virtually put the content of a cell into another cell. Many cell instances can be put into a cell thus forming repetitions of the cell content. This process can be repeated over multiple levels. In effect a cell graphs is created with parent cells and child cells. The graph must not be recursive, so there is at least one top cell, which does not have a parent cell. Multiple top cells can be present. + + \Layout is the very basic class of the layout database. It has a rich set of methods to manipulate and query the layout hierarchy, the geometrical objects, the meta information and other features of the layout database. For a discussion of the basic API and the related classes see @The Database API@. + + Usually layout objects have already been created by KLayout's application core. You can address such a layout via the \CellView object inside the \LayoutView class. For example: + + @code + active_layout = RBA::CellView::active.layout + puts "Top cell of current layout is #{active_layout.top_cell.name}" + @/code + + However, a layout can also be used standalone: + + @code + layout = RBA::Layout::new + cell = layout.create_cell("TOP") + layer = layout.layer(RBA::LayerInfo::new(1, 0)) + cell.shapes(layer).insert(RBA::Box::new(0, 0, 1000, 1000)) + layout.write("single_rect.gds") + @/code + """ + dbu: float + r""" + Getter: + @brief Gets the database unit + + The database unit is the value of one units distance in micrometers. + For numerical reasons and to be compliant with the GDS2 format, the database objects use integer coordinates. The basic unit of these coordinates is the database unit. + You can convert coordinates to micrometers by multiplying the integer value with the database unit. + Typical values for the database unit are 0.001 micrometer (one nanometer). + + Setter: + @brief Sets the database unit + + See \dbu for a description of the database unit. + """ + prop_id: int + r""" + Getter: + @brief Gets the properties ID associated with the layout + + This method has been introduced in version 0.24. + Setter: + @brief Sets the properties ID associated with the layout + This method is provided, if a properties ID has been derived already. Usually it's more convenient to use \delete_property, \set_property or \property. + + This method has been introduced in version 0.24. + """ + technology_name: str + r""" + Getter: + @brief Gets the name of the technology this layout is associated with + This method has been introduced in version 0.27. Before that, the technology has been kept in the 'technology' meta data element. + Setter: + @brief Sets the name of the technology this layout is associated with + Changing the technology name will re-assess all library references because libraries can be technology specified. Cell layouts may be substituted during this re-assessment. + + This method has been introduced in version 0.27. + """ + @overload + @classmethod + def new(cls) -> Layout: + r""" + @brief Creates a layout object + + Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application. + """ + @overload + @classmethod + def new(cls, editable: bool) -> Layout: + r""" + @brief Creates a layout object + + This constructor specifies whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods. + + This method was introduced in version 0.22. + """ + @overload + @classmethod + def new(cls, editable: bool, manager: Manager) -> Layout: + r""" + @brief Creates a layout object attached to a manager + + This constructor specifies a manager object which is used to store undo information for example. It also allows one to specify whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods. + + This method was introduced in version 0.22. + """ + @overload + @classmethod + def new(cls, manager: Manager) -> Layout: + r""" + @brief Creates a layout object attached to a manager + + This constructor specifies a manager object which is used to store undo information for example. + + Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application. + """ + def __copy__(self) -> Layout: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Layout: + r""" + @brief Creates a copy of self + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a layout object + + Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application. + """ + @overload + def __init__(self, editable: bool) -> None: + r""" + @brief Creates a layout object + + This constructor specifies whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods. + + This method was introduced in version 0.22. + """ + @overload + def __init__(self, editable: bool, manager: Manager) -> None: + r""" + @brief Creates a layout object attached to a manager + + This constructor specifies a manager object which is used to store undo information for example. It also allows one to specify whether the layout is editable. In editable mode, some optimizations are disabled and the layout can be manipulated through a variety of methods. + + This method was introduced in version 0.22. + """ + @overload + def __init__(self, manager: Manager) -> None: + r""" + @brief Creates a layout object attached to a manager + + This constructor specifies a manager object which is used to store undo information for example. + + Starting with version 0.25, layouts created with the default constructor are always editable. Before that version, they inherited the editable flag from the application. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_cell(self, name: str) -> int: + r""" + @brief Adds a cell with the given name + @return The index of the newly created cell. + + From version 0.23 on this method is deprecated because another method exists which is more convenient because is returns a \Cell object (\create_cell). + """ + def add_lib_cell(self, library: Library, lib_cell_index: int) -> int: + r""" + @brief Imports a cell from the library + @param library The reference to the library from which to import the cell + @param lib_cell_index The index of the imported cell in the library + @return The cell index of the new proxy cell in this layout + This method imports the given cell from the library and creates a new proxy cell. + The proxy cell acts as a pointer to the actual cell which still resides in the + library (precisely: in library.layout). The name of the new cell will be the name of + library cell. + + This method has been introduced in version 0.22. + """ + def add_meta_info(self, info: LayoutMetaInfo) -> None: + r""" + @brief Adds meta information to the layout + See \LayoutMetaInfo for details about layouts and meta information. + This method has been introduced in version 0.25. + """ + @overload + def add_pcell_variant(self, library: Library, pcell_id: int, parameters: Dict[str, Any]) -> int: + r""" + @brief Creates a PCell variant for a PCell located in an external library with the parameters given as a name/value dictionary + @return The cell index of the new proxy cell in this layout + This method will import a PCell from a library and create a variant for the + given parameter set. + Technically, this method creates a proxy to the library and creates the variant + inside that library. + Unlike the variant using a list of parameters, this version allows specification + of the parameters with a key/value dictionary. The keys are the parameter names + as given by the PCell declaration. + + The parameters are a sequence of variants which correspond to the parameters declared by the \PCellDeclaration object. + + The name of the new cell will be the name of the PCell. + If a cell with that name already exists, a new unique name is generated. + + This method has been introduced in version 0.22. + """ + @overload + def add_pcell_variant(self, library: Library, pcell_id: int, parameters: Sequence[Any]) -> int: + r""" + @brief Creates a PCell variant for a PCell located in an external library + @return The cell index of the new proxy cell in this layout + This method will import a PCell from a library and create a variant for the + given parameter set. + Technically, this method creates a proxy to the library and creates the variant + inside that library. + + The parameters are a sequence of variants which correspond to the parameters declared by the \PCellDeclaration object. + + The name of the new cell will be the name of the PCell. + If a cell with that name already exists, a new unique name is generated. + + This method has been introduced in version 0.22. + """ + @overload + def add_pcell_variant(self, pcell_id: int, parameters: Dict[str, Any]) -> int: + r""" + @brief Creates a PCell variant for the given PCell ID with the parameters given as a name/value dictionary + @return The cell index of the pcell variant proxy cell + This method will create a PCell variant proxy for a local PCell definition. + It will create the PCell variant for the given parameters. Note that this method + does not allow one to create PCell instances for PCells located in a library. Use + \add_pcell_variant with the library parameter for that purpose. + Unlike the variant using a list of parameters, this version allows specification + of the parameters with a key/value dictionary. The keys are the parameter names + as given by the PCell declaration. + + The parameters are a sequence of variants which correspond to the parameters declared by the \PCellDeclaration object. + + The name of the new cell will be the name of the PCell. + If a cell with that name already exists, a new unique name is generated. + + This method has been introduced in version 0.22. + """ + @overload + def add_pcell_variant(self, pcell_id: int, parameters: Sequence[Any]) -> int: + r""" + @brief Creates a PCell variant for the given PCell ID with the given parameters + @return The cell index of the pcell variant proxy cell + This method will create a PCell variant proxy for a local PCell definition. + It will create the PCell variant for the given parameters. Note that this method + does not allow one to create PCell instances for PCells located in a library. Use + \add_pcell_variant with the library parameter for that purpose. + + The parameters are a sequence of variants which correspond to the parameters declared by the \PCellDeclaration object. + + The name of the new cell will be the name of the PCell. + If a cell with that name already exists, a new unique name is generated. + + This method has been introduced in version 0.22. + """ + def assign(self, other: Layout) -> None: + r""" + @brief Assigns another object to self + """ + @overload + def begin_shapes(self, cell: Cell, layer: int) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer + @param cell The cell object of the initial (top) cell + @param layer The layer from which to get the shapes + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version is convenience overload which takes a cell object instead of a cell index. + + This method is deprecated. Use \Cell#begin_shapes_rec instead. + + This method has been added in version 0.24. + """ + @overload + def begin_shapes(self, cell_index: int, layer: int) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer + @param cell_index The index of the initial (top) cell + @param layer The layer from which to get the shapes + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + + This method is deprecated. Use \Cell#begin_shapes_rec instead. + + This method has been added in version 0.18. + """ + @overload + def begin_shapes_overlapping(self, cell: Cell, layer: int, region: DBox) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units + @param cell The cell object for the starting cell + @param layer The layer from which to get the shapes + @param region The search region as a \DBox object in micrometer units + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box overlaps the given region. + It is convenience overload which takes a cell object instead of a cell index. + + This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. + + This variant has been added in version 0.25. + """ + @overload + def begin_shapes_overlapping(self, cell_index: Cell, layer: int, region: Box) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search + @param cell The cell object for the starting cell + @param layer The layer from which to get the shapes + @param region The search region + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box overlaps the given region. + It is convenience overload which takes a cell object instead of a cell index. + + This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. + + This method has been added in version 0.24. + """ + @overload + def begin_shapes_overlapping(self, cell_index: int, layer: int, region: Box) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search + @param cell_index The index of the starting cell + @param layer The layer from which to get the shapes + @param region The search region + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box overlaps the given region. + + This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. + + This method has been added in version 0.18. + """ + @overload + def begin_shapes_overlapping(self, cell_index: int, layer: int, region: DBox) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units + @param cell_index The index of the starting cell + @param layer The layer from which to get the shapes + @param region The search region as a \DBox object in micrometer units + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box overlaps the given region. + + This method is deprecated. Use \Cell#begin_shapes_rec_overlapping instead. + + This variant has been added in version 0.25. + """ + @overload + def begin_shapes_touching(self, cell: Cell, layer: int, region: Box) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search + @param cell The cell object for the starting cell + @param layer The layer from which to get the shapes + @param region The search region + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box touches the given region. + It is convenience overload which takes a cell object instead of a cell index. + + This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. + + This method has been added in version 0.24. + """ + @overload + def begin_shapes_touching(self, cell: Cell, layer: int, region: DBox) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units + @param cell The cell object for the starting cell + @param layer The layer from which to get the shapes + @param region The search region as a \DBox object in micrometer units + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box touches the given region. + It is convenience overload which takes a cell object instead of a cell index. + + This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. + + This variant has been added in version 0.25. + """ + @overload + def begin_shapes_touching(self, cell_index: int, layer: int, region: Box) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search + @param cell_index The index of the starting cell + @param layer The layer from which to get the shapes + @param region The search region + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box touches the given region. + + This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. + + This method has been added in version 0.18. + """ + @overload + def begin_shapes_touching(self, cell_index: int, layer: int, region: DBox) -> RecursiveShapeIterator: + r""" + @brief Delivers a recursive shape iterator for the shapes below the given cell on the given layer using a region search, the region given in micrometer units + @param cell_index The index of the starting cell + @param layer The layer from which to get the shapes + @param region The search region as a \DBox object in micrometer units + @return A suitable iterator + + For details see the description of the \RecursiveShapeIterator class. + This version gives an iterator delivering shapes whose bounding box touches the given region. + + This method is deprecated. Use \Cell#begin_shapes_rec_touching instead. + + This variant has been added in version 0.25. + """ + @overload + def cell(self, i: int) -> Cell: + r""" + @brief Gets a cell object from the cell index + + @param i The cell index + @return A reference to the cell (a \Cell object) + + If the cell index is not a valid cell index, this method will raise an error. Use \is_valid_cell_index? to test whether a given cell index is valid. + """ + @overload + def cell(self, name: str) -> Cell: + r""" + @brief Gets a cell object from the cell name + + @param name The cell name + @return A reference to the cell (a \Cell object) + + If name is not a valid cell name, this method will return "nil". + This method has been introduced in version 0.23 and replaces \cell_by_name. + """ + def cell_by_name(self, name: str) -> int: + r""" + @brief Gets the cell index for a given name + Returns the cell index for the cell with the given name. If no cell with this name exists, an exception is thrown. + From version 0.23 on, a version of the \cell method is provided which returns a \Cell object for the cell with the given name or "nil" if the name is not valid. This method replaces \cell_by_name and \has_cell? + """ + def cell_name(self, index: int) -> str: + r""" + @brief Gets the name for a cell with the given index + """ + @overload + def cells(self) -> int: + r""" + @brief Returns the number of cells + + @return The number of cells (the maximum cell index) + """ + @overload + def cells(self, name_filter: str) -> List[Cell]: + r""" + @brief Gets the cell objects for a given name filter + + @param name_filter The cell name filter (glob pattern) + @return A list of \Cell object of the cells matching the pattern + + This method has been introduced in version 0.27.3. + """ + def cleanup(self, cell_indexes_to_keep: Optional[Sequence[int]] = ...) -> None: + r""" + @brief Cleans up the layout + This method will remove proxy objects that are no longer in use. After changing PCell parameters such proxy objects may still be present in the layout and are cached for later reuse. Usually they are cleaned up automatically, but in a scripting context it may be useful to clean up these cells explicitly. + + Use 'cell_indexes_to_keep' for specifying a list of cell indexes of PCell variants or library proxies you don't want to be cleaned up. + + This method has been introduced in version 0.25. + """ + def clear(self) -> None: + r""" + @brief Clears the layout + + Clears the layout completely. + """ + def clear_layer(self, layer_index: int) -> None: + r""" + @brief Clears a layer + + Clears the layer: removes all shapes. + + This method was introduced in version 0.19. + + @param layer_index The index of the layer to delete. + """ + @overload + def clip(self, cell: Cell, box: Box) -> Cell: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The cell reference of the cell to clip + @param box The clip box in database units + @return The reference to the new cell + + This variant which takes cell references instead of cell indexes has been added in version 0.28. + """ + @overload + def clip(self, cell: Cell, box: DBox) -> Cell: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The cell reference of the cell to clip + @param box The clip box in micrometer units + @return The reference to the new cell + + This variant which takes a micrometer-unit box and cell references has been added in version 0.28. + """ + @overload + def clip(self, cell: int, box: Box) -> int: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The cell index of the cell to clip + @param box The clip box in database units + @return The index of the new cell + + This method will cut a rectangular region given by the box from the given cell. The clip will be stored in a new cell whose index is returned. The clip will be performed hierarchically. The resulting cell will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. + This method has been added in version 0.21. + """ + @overload + def clip(self, cell: int, box: DBox) -> int: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The cell index of the cell to clip + @param box The clip box in micrometer units + @return The index of the new cell + + This variant which takes a micrometer-unit box has been added in version 0.28. + """ + @overload + def clip_into(self, cell: Cell, target: Layout, box: Box) -> Cell: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The reference to the cell to clip + @param box The clip box in database units + @param target The target layout + @return The reference to the new cell in the target layout + + This variant which takes cell references instead of cell indexes has been added in version 0.28. + """ + @overload + def clip_into(self, cell: Cell, target: Layout, box: DBox) -> Cell: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The reference to the cell to clip + @param box The clip box in micrometer units + @param target The target layout + @return The reference to the new cell in the target layout + + This variant which takes a micrometer-unit box and cell references has been added in version 0.28. + """ + @overload + def clip_into(self, cell: int, target: Layout, box: Box) -> int: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The cell index of the cell to clip + @param box The clip box in database units + @param target The target layout + @return The index of the new cell in the target layout + + This method will cut a rectangular region given by the box from the given cell. The clip will be stored in a new cell in the target layout. The clip will be performed hierarchically. The resulting cell will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. + + Please note that it is important that the database unit of the target layout is identical to the database unit of the source layout to achieve the desired results.This method also assumes that the target layout holds the same layers than the source layout. It will copy shapes to the same layers than they have been on the original layout. + This method has been added in version 0.21. + """ + @overload + def clip_into(self, cell: int, target: Layout, box: DBox) -> int: + r""" + @brief Clips the given cell by the given rectangle and produce a new cell with the clip + @param cell The cell index of the cell to clip + @param box The clip box in micrometer units + @param target The target layout + @return The index of the new cell in the target layout + + This variant which takes a micrometer-unit box has been added in version 0.28. + """ + def convert_cell_to_static(self, cell_index: int) -> int: + r""" + @brief Converts a PCell or library cell to a usual (static) cell + @return The index of the new cell + This method will create a new cell which contains the static representation of the PCell or library proxy given by "cell_index". If that cell is not a PCell or library proxy, it won't be touched and the input cell index is returned. + + This method has been added in version 0.23. + """ + def copy_layer(self, src: int, dest: int) -> None: + r""" + @brief Copies a layer + + This method was introduced in version 0.19. + + Copy a layer from the source to the target. The target is not cleared before, so that this method + merges shapes from the source with the target layer. + + @param src The layer index of the source layer. + @param dest The layer index of the destination layer. + """ + @overload + def copy_tree_shapes(self, source_layout: Layout, cell_mapping: CellMapping) -> None: + r""" + @brief Copies the shapes for all given mappings in the \CellMapping object + @param source_layout The layout where to take the shapes from + @param cell_mapping The cell mapping object that determines how cells are identified between source and target layout + + Provide a \CellMapping object to specify pairs of cells which are mapped from the source layout to this layout. When constructing such a cell mapping object for example with \CellMapping#for_multi_cells_full, use self as the target layout. During the cell mapping construction, the cell mapper will usually create a suitable target hierarchy already. After having completed the cell mapping, use \copy_tree_shapes to copy over the shapes from the source to the target layout. + + This method has been added in version 0.26.8. + """ + @overload + def copy_tree_shapes(self, source_layout: Layout, cell_mapping: CellMapping, layer_mapping: LayerMapping) -> None: + r""" + @brief Copies the shapes for all given mappings in the \CellMapping object using the given layer mapping + @param source_layout The layout where to take the shapes from + @param cell_mapping The cell mapping object that determines how cells are identified between source and target layout + @param layer_mapping Specifies which layers are copied from the source layout to the target layout + + Provide a \CellMapping object to specify pairs of cells which are mapped from the source layout to this layout. When constructing such a cell mapping object for example with \CellMapping#for_multi_cells_full, use self as the target layout. During the cell mapping construction, the cell mapper will usually create a suitable target hierarchy already. After having completed the cell mapping, use \copy_tree_shapes to copy over the shapes from the source to the target layout. + + This method has been added in version 0.26.8. + """ + def create(self) -> None: + r""" + @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. + """ + @overload + def create_cell(self, name: str) -> Cell: + r""" + @brief Creates a cell with the given name + @param name The name of the cell to create + @return The \Cell object of the newly created cell. + + If a cell with that name already exists, the unique name will be chosen for the new cell consisting of the given name plus a suitable suffix. + + This method has been introduce in version 0.23 and replaces \add_cell. + """ + @overload + def create_cell(self, name: str, lib_name: str) -> Cell: + r""" + @brief Creates a cell with the given name + @param name The name of the library cell and the name of the cell to create + @param lib_name The name of the library where to take the cell from + @return The \Cell object of the newly created cell or an existing cell if the library cell has already been used in this layout. + + Library cells are imported by creating a 'library proxy'. This is a cell which represents the library cell in the framework of the current layout. The library proxy is linked to the library and will be updated if the library cell is changed. + + This method will look up the cell by the given name in the specified library and create a new library proxy for this cell. + If the same library cell has already been used, the original library proxy is returned. Hence, strictly speaking this method does not always create a new cell but may return a reference to an existing cell. + + If the library name is not valid, nil is returned. + + This method has been introduce in version 0.24. + """ + @overload + def create_cell(self, pcell_name: str, lib_name: str, params: Dict[str, Any]) -> Cell: + r""" + @brief Creates a cell for a PCell with the given PCell name from the given library + @param pcell_name The name of the PCell and also the name of the cell to create + @param lib_name The name of the library where to take the PCell from + @param params The PCell parameters (key/value dictionary) + @return The \Cell object of the newly created cell or an existing cell if this PCell has already been used with the given parameters + + This method will look up the PCell by the PCell name in the specified library and create a new PCell variant for the given parameters plus the library proxy. The parameters must be specified as a key/value dictionary with the names being the ones from the PCell declaration. + + If no PCell with the given name exists or the library name is not valid, nil is returned. Note that this function - despite the name - may not always create a new cell, but return an existing cell if the PCell from the library has already been used with the given parameters. + + This method has been introduce in version 0.24. + """ + @overload + def create_cell(self, pcell_name: str, params: Dict[str, Any]) -> Cell: + r""" + @brief Creates a cell as a PCell variant for the PCell with the given name + @param pcell_name The name of the PCell and also the name of the cell to create + @param params The PCell parameters (key/value dictionary) + @return The \Cell object of the newly created cell or an existing cell if the PCell has already been used with these parameters. + + PCells are instantiated by creating a PCell variant. A PCell variant is linked to the PCell and represents this PCell with a particular parameter set. + + This method will look up the PCell by the PCell name and create a new PCell variant for the given parameters. If the PCell has already been instantiated with the same parameters, the original variant will be returned. Hence this method is not strictly creating a cell - only if the required variant has not been created yet. + + The parameters are specified as a key/value dictionary with the names being the ones from the PCell declaration. + + If no PCell with the given name exists, nil is returned. + + This method has been introduce in version 0.24. + """ + def delete_cell(self, cell_index: int) -> None: + r""" + @brief Deletes a cell + + This deletes a cell but not the sub cells of the cell. + These subcells will likely become new top cells unless they are used + otherwise. + All instances of this cell are deleted as well. + Hint: to delete multiple cells, use "delete_cells" which is + far more efficient in this case. + + @param cell_index The index of the cell to delete + + This method has been introduced in version 0.20. + """ + def delete_cell_rec(self, cell_index: int) -> None: + r""" + @brief Deletes a cell plus all subcells + + This deletes a cell and also all sub cells of the cell. + In contrast to \prune_cell, all cells are deleted together with their instances even if they are used otherwise. + + @param cell_index The index of the cell to delete + + This method has been introduced in version 0.20. + """ + def delete_cells(self, cell_index_list: Sequence[int]) -> None: + r""" + @brief Deletes multiple cells + + This deletes the cells but not the sub cells of these cells. + These subcells will likely become new top cells unless they are used + otherwise. + All instances of these cells are deleted as well. + + @param cell_index_list An array of cell indices of the cells to delete + + This method has been introduced in version 0.20. + """ + def delete_layer(self, layer_index: int) -> None: + r""" + @brief Deletes a layer + + This method frees the memory allocated for the shapes of this layer and remembers the + layer's index for reuse when the next layer is allocated. + + @param layer_index The index of the layer to delete. + """ + def delete_property(self, key: Any) -> None: + r""" + @brief Deletes the user property with the given key + This method is a convenience method that deletes the property with the given key. It does nothing if no property with that key exists. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. + This method may change the properties ID. + + This method has been introduced in version 0.24. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dump_mem_statistics(self, detailed: Optional[bool] = ...) -> None: + r""" + @hide + """ + def dup(self) -> Layout: + r""" + @brief Creates a copy of self + """ + def each_cell(self) -> Iterator[Cell]: + r""" + @brief Iterates the unsorted cell list + """ + def each_cell_bottom_up(self) -> Iterator[int]: + r""" + @brief Iterates the bottom-up sorted cell list + + In bottom-up traversal a cell is not delivered before + the last child cell of this cell has been delivered. + The bottom-up iterator does not deliver cells but cell + indices actually. + """ + def each_cell_top_down(self) -> Iterator[int]: + r""" + @brief Iterates the top-down sorted cell list + + The top-down cell list has the property of delivering all + cells before they are instantiated. In addition the first + cells are all top cells. There is at least one top cell. + The top-down iterator does not deliver cells but cell + indices actually. + @brief begin iterator of the top-down sorted cell list + """ + def each_meta_info(self) -> Iterator[LayoutMetaInfo]: + r""" + @brief Iterates over the meta information of the layout + See \LayoutMetaInfo for details about layouts and meta information. + + This method has been introduced in version 0.25. + """ + def each_top_cell(self) -> Iterator[int]: + r""" + @brief Iterates the top cells + A layout may have an arbitrary number of top cells. The usual case however is that there is one top cell. + """ + def end_changes(self) -> None: + r""" + @brief Cancels the "in changes" state (see "start_changes") + """ + @overload + def find_layer(self, info: LayerInfo) -> Any: + r""" + @brief Finds a layer with the given properties + + If a layer with the given properties already exists, this method will return the index of that layer.If no such layer exists, it will return nil. + + This method has been introduced in version 0.23. + """ + @overload + def find_layer(self, layer: int, datatype: int) -> Any: + r""" + @brief Finds a layer with the given layer and datatype number + + If a layer with the given layer/datatype already exists, this method will return the index of that layer.If no such layer exists, it will return nil. + + This method has been introduced in version 0.23. + """ + @overload + def find_layer(self, layer: int, datatype: int, name: str) -> Any: + r""" + @brief Finds a layer with the given layer and datatype number and name + + If a layer with the given layer/datatype/name already exists, this method will return the index of that layer.If no such layer exists, it will return nil. + + This method has been introduced in version 0.23. + """ + @overload + def find_layer(self, name: str) -> Any: + r""" + @brief Finds a layer with the given name + + If a layer with the given name already exists, this method will return the index of that layer.If no such layer exists, it will return nil. + + This method has been introduced in version 0.23. + """ + def flatten(self, cell_index: int, levels: int, prune: bool) -> None: + r""" + @brief Flattens the given cell + + This method propagates all shapes and instances from the specified number of hierarchy levels below into the given cell. + It also removes the instances of the cells from which the shapes came from, but does not remove the cells themselves if prune is set to false. + If prune is set to true, these cells are removed if not used otherwise. + + @param cell_index The cell which should be flattened + @param levels The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.) + @param prune Set to true to remove orphan cells. + + This method has been introduced in version 0.20. + """ + def flatten_into(self, source_cell_index: int, target_cell_index: int, trans: ICplxTrans, levels: int) -> None: + r""" + @brief Flattens the given cell into another cell + + This method works like 'flatten', but allows specification of a target cell which can be different from the source cell plus a transformation which is applied for all shapes and instances in the target cell. + + In contrast to the 'flatten' method, the source cell is not modified. + + @param source_cell_index The source cell which should be flattened + @param target_cell_index The target cell into which the resulting objects are written + @param trans The transformation to apply on the output shapes and instances + @param levels The number of hierarchy levels to flatten (-1: all, 0: none, 1: one level etc.) + + This method has been introduced in version 0.24. + """ + def get_info(self, index: int) -> LayerInfo: + r""" + @brief Gets the info structure for a specified layer + """ + def guiding_shape_layer(self) -> int: + r""" + @brief Returns the index of the guiding shape layer + The guiding shape layer is used to store guiding shapes for PCells. + + This method has been added in version 0.22. + """ + def has_cell(self, name: str) -> bool: + r""" + @brief Returns true if a cell with a given name exists + Returns true, if the layout has a cell with the given name + """ + def has_prop_id(self) -> bool: + r""" + @brief Returns true, if the layout has user properties + + This method has been introduced in version 0.24. + """ + @overload + def insert(self, cell_index: int, layer: int, edge_pairs: EdgePairs) -> None: + r""" + @brief Inserts an edge pair collection into the given cell and layer + If the edge pair collection is (conceptionally) flat, it will be inserted into the cell's shapes list as a flat sequence of edge pairs. + If the edge pair collection is deep (hierarchical), it will create a subhierarchy below the given cell and it's edge pairs will be put into the respective cells. Suitable subcells will be picked for inserting the edge pairs. If a hierarchy already exists below the given cell, the algorithm will try to reuse this hierarchy. + + This method has been introduced in version 0.27. + """ + @overload + def insert(self, cell_index: int, layer: int, edges: Edges) -> None: + r""" + @brief Inserts an edge collection into the given cell and layer + If the edge collection is (conceptionally) flat, it will be inserted into the cell's shapes list as a flat sequence of edges. + If the edge collection is deep (hierarchical), it will create a subhierarchy below the given cell and it's edges will be put into the respective cells. Suitable subcells will be picked for inserting the edges. If a hierarchy already exists below the given cell, the algorithm will try to reuse this hierarchy. + + This method has been introduced in version 0.26. + """ + @overload + def insert(self, cell_index: int, layer: int, region: Region) -> None: + r""" + @brief Inserts a region into the given cell and layer + If the region is (conceptionally) a flat region, it will be inserted into the cell's shapes list as a flat sequence of polygons. + If the region is a deep (hierarchical) region, it will create a subhierarchy below the given cell and it's shapes will be put into the respective cells. Suitable subcells will be picked for inserting the shapes. If a hierarchy already exists below the given cell, the algorithm will try to reuse this hierarchy. + + This method has been introduced in version 0.26. + """ + @overload + def insert(self, cell_index: int, layer: int, texts: Texts) -> None: + r""" + @brief Inserts an text collection into the given cell and layer + If the text collection is (conceptionally) flat, it will be inserted into the cell's shapes list as a flat sequence of texts. + If the text collection is deep (hierarchical), it will create a subhierarchy below the given cell and it's texts will be put into the respective cells. Suitable subcells will be picked for inserting the texts. If a hierarchy already exists below the given cell, the algorithm will try to reuse this hierarchy. + + This method has been introduced in version 0.27. + """ + def insert_layer(self, props: LayerInfo) -> int: + r""" + @brief Inserts a new layer with the given properties + @return The index of the newly created layer + """ + def insert_layer_at(self, index: int, props: LayerInfo) -> None: + r""" + @brief Inserts a new layer with the given properties at the given index + This method will associate the given layer info with the given layer index. If a layer with that index already exists, this method will change the properties of the layer with that index. Otherwise a new layer is created. + """ + def insert_special_layer(self, props: LayerInfo) -> int: + r""" + @brief Inserts a new special layer with the given properties + + Special layers can be used to represent objects that should not participate in normal viewing or other related operations. Special layers are not reported as valid layers. + + @return The index of the newly created layer + """ + def insert_special_layer_at(self, index: int, props: LayerInfo) -> None: + r""" + @brief Inserts a new special layer with the given properties at the given index + + See \insert_special_layer for a description of special layers. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_editable(self) -> bool: + r""" + @brief Returns a value indicating whether the layout is editable. + @return True, if the layout is editable. + If a layout is editable, in general manipulation methods are enabled and some optimizations are disabled (i.e. shape arrays are expanded). + + This method has been introduced in version 0.22. + """ + def is_free_layer(self, layer_index: int) -> bool: + r""" + @brief Returns true, if a layer index is a free (unused) layer index + + @return true, if this is the case + + This method has been introduced in version 0.26. + """ + def is_special_layer(self, layer_index: int) -> bool: + r""" + @brief Returns true, if a layer index is a special layer index + + @return true, if this is the case + """ + def is_valid_cell_index(self, cell_index: int) -> bool: + r""" + @brief Returns true, if a cell index is a valid index + + @return true, if this is the case + This method has been added in version 0.20. + """ + def is_valid_layer(self, layer_index: int) -> bool: + r""" + @brief Returns true, if a layer index is a valid normal layout layer index + + @return true, if this is the case + """ + @overload + def layer(self) -> int: + r""" + @brief Creates a new internal layer + + This method will create a new internal layer and return the layer index for this layer. + The layer does not have any properties attached to it. That means, it is not going to be saved to a layout file unless it is given database properties with \set_info. + + This method is equivalent to "layer(RBA::LayerInfo::new())". + + This method has been introduced in version 0.25. + """ + @overload + def layer(self, info: LayerInfo) -> int: + r""" + @brief Finds or creates a layer with the given properties + + If a layer with the given properties already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned. If "info" is anonymous (info.anonymous? is true), a new layer will always be created. + + This method has been introduced in version 0.23. + """ + @overload + def layer(self, layer: int, datatype: int) -> int: + r""" + @brief Finds or creates a layer with the given layer and datatype number + + If a layer with the given layer/datatype already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned. + + This method has been introduced in version 0.23. + """ + @overload + def layer(self, layer: int, datatype: int, name: str) -> int: + r""" + @brief Finds or creates a layer with the given layer and datatype number and name + + If a layer with the given layer/datatype/name already exists, this method will return the index of that layer.If no such layer exists, a new one with these properties will be created and its index will be returned. + + This method has been introduced in version 0.23. + """ + @overload + def layer(self, name: str) -> int: + r""" + @brief Finds or creates a layer with the given name + + If a layer with the given name already exists, this method will return the index of that layer.If no such layer exists, a new one with this name will be created and its index will be returned. + + This method has been introduced in version 0.23. + """ + def layer_indexes(self) -> List[int]: + r""" + @brief Gets a list of valid layer's indices + This method returns an array with layer indices representing valid layers. + + This method has been introduced in version 0.19. + """ + def layer_indices(self) -> List[int]: + r""" + @brief Gets a list of valid layer's indices + This method returns an array with layer indices representing valid layers. + + This method has been introduced in version 0.19. + """ + def layer_infos(self) -> List[LayerInfo]: + r""" + @brief Gets a list of valid layer's properties + The method returns an array with layer properties representing valid layers. + The sequence and length of this list corresponds to that of \layer_indexes. + + This method has been introduced in version 0.25. + """ + def layers(self) -> int: + r""" + @brief Returns the number of layers + The number of layers reports the maximum (plus 1) layer index used so far. Not all of the layers with an index in the range of 0 to layers-1 needs to be a valid layer. These layers can be either valid, special or unused. Use \is_valid_layer? and \is_special_layer? to test for the first two states. + """ + def library(self) -> Library: + r""" + @brief Gets the library this layout lives in or nil if the layout is not part of a library + This attribute has been introduced in version 0.27.5. + """ + def meta_info_value(self, name: str) -> str: + r""" + @brief Gets the meta information value for a given name + See \LayoutMetaInfo for details about layouts and meta information. + + If no meta information with the given name exists, an empty string will be returned. + + This method has been introduced in version 0.25. + """ + def move_layer(self, src: int, dest: int) -> None: + r""" + @brief Moves a layer + + This method was introduced in version 0.19. + + Move a layer from the source to the target. The target is not cleared before, so that this method + merges shapes from the source with the target layer. The source layer is empty after that operation. + + @param src The layer index of the source layer. + @param dest The layer index of the destination layer. + """ + @overload + def move_tree_shapes(self, source_layout: Layout, cell_mapping: CellMapping) -> None: + r""" + @brief Moves the shapes for all given mappings in the \CellMapping object + + This method acts like the corresponding \copy_tree_shapes method, but removes the shapes from the source layout after they have been copied. + + This method has been added in version 0.26.8. + """ + @overload + def move_tree_shapes(self, source_layout: Layout, cell_mapping: CellMapping, layer_mapping: LayerMapping) -> None: + r""" + @brief Moves the shapes for all given mappings in the \CellMapping object using the given layer mapping + + This method acts like the corresponding \copy_tree_shapes method, but removes the shapes from the source layout after they have been copied. + + This method has been added in version 0.26.8. + """ + @overload + def multi_clip(self, cell: Cell, boxes: Sequence[Box]) -> List[Cell]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The reference to the cell to clip + @param boxes The clip boxes in database units + @return The references to the new cells + + This variant which takes cell references has been added in version 0.28. + """ + @overload + def multi_clip(self, cell: Cell, boxes: Sequence[DBox]) -> List[Cell]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The reference to the cell to clip + @param boxes The clip boxes in micrometer units + @return The references to the new cells + + This variant which takes cell references and micrometer-unit boxes has been added in version 0.28. + """ + @overload + def multi_clip(self, cell: int, boxes: Sequence[Box]) -> List[int]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The cell index of the cell to clip + @param boxes The clip boxes in database units + @return The indexes of the new cells + + This method will cut rectangular regions given by the boxes from the given cell. The clips will be stored in a new cells whose indexed are returned. The clips will be performed hierarchically. The resulting cells will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This version is somewhat more efficient than doing individual clips because the clip cells may share clipped versions of child cells. + + This method has been added in version 0.21. + """ + @overload + def multi_clip(self, cell: int, boxes: Sequence[DBox]) -> List[int]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The cell index of the cell to clip + @param boxes The clip boxes in micrometer units + @return The indexes of the new cells + + This variant which takes micrometer-unit boxes has been added in version 0.28. + """ + @overload + def multi_clip_into(self, cell: Cell, target: Layout, boxes: Sequence[Box]) -> List[Cell]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The reference the cell to clip + @param boxes The clip boxes in database units + @param target The target layout + @return The references to the new cells + + This variant which takes cell references boxes has been added in version 0.28. + """ + @overload + def multi_clip_into(self, cell: Cell, target: Layout, boxes: Sequence[DBox]) -> List[Cell]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The reference the cell to clip + @param boxes The clip boxes in micrometer units + @param target The target layout + @return The references to the new cells + + This variant which takes cell references and micrometer-unit boxes has been added in version 0.28. + """ + @overload + def multi_clip_into(self, cell: int, target: Layout, boxes: Sequence[Box]) -> List[int]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The cell index of the cell to clip + @param boxes The clip boxes in database units + @param target The target layout + @return The indexes of the new cells + + This method will cut rectangular regions given by the boxes from the given cell. The clips will be stored in a new cells in the given target layout. The clips will be performed hierarchically. The resulting cells will hold a hierarchy of child cells, which are potentially clipped versions of child cells of the original cell. This version is somewhat more efficient than doing individual clips because the clip cells may share clipped versions of child cells. + + Please note that it is important that the database unit of the target layout is identical to the database unit of the source layout to achieve the desired results. This method also assumes that the target layout holds the same layers than the source layout. It will copy shapes to the same layers than they have been on the original layout. + + This method has been added in version 0.21. + """ + @overload + def multi_clip_into(self, cell: int, target: Layout, boxes: Sequence[DBox]) -> List[int]: + r""" + @brief Clips the given cell by the given rectangles and produces new cells with the clips, one for each rectangle. + @param cell The cell index of the cell to clip + @param boxes The clip boxes in database units + @param target The target layout + @return The indexes of the new cells + + This variant which takes micrometer-unit boxes has been added in version 0.28. + """ + @overload + def pcell_declaration(self, name: str) -> PCellDeclaration_Native: + r""" + @brief Gets a reference to the PCell declaration for the PCell with the given name + Returns a reference to the local PCell declaration with the given name. If the name + is not a valid PCell name, this method returns nil. + + Usually this method is used on library layouts that define + PCells. Note that this method cannot be used on the layouts using the PCell from + a library. + + This method has been introduced in version 0.22. + """ + @overload + def pcell_declaration(self, pcell_id: int) -> PCellDeclaration_Native: + r""" + @brief Gets a reference to the PCell declaration for the PCell with the given PCell ID. + Returns a reference to the local PCell declaration with the given PCell id. If the parameter + is not a valid PCell ID, this method returns nil. The PCell ID is the number returned + by \register_pcell for example. + + Usually this method is used on library layouts that define + PCells. Note that this method cannot be used on the layouts using the PCell from + a library. + + This method has been introduced in version 0.22. + """ + def pcell_id(self, name: str) -> int: + r""" + @brief Gets the ID of the PCell with the given name + This method is equivalent to 'pcell_declaration(name).id'. + + This method has been introduced in version 0.22. + """ + def pcell_ids(self) -> List[int]: + r""" + @brief Gets the IDs of the PCells registered in the layout + Returns an array of PCell IDs. + + This method has been introduced in version 0.24. + """ + def pcell_names(self) -> List[str]: + r""" + @brief Gets the names of the PCells registered in the layout + Returns an array of PCell names. + + This method has been introduced in version 0.24. + """ + def properties(self, properties_id: int) -> List[Any]: + r""" + @brief Gets the properties set for a given properties ID + + Basically performs the backward conversion of the 'properties_id' method. Given a properties ID, returns the properties set as an array of pairs of variants. In this array, each key and the value are stored as pairs (arrays with two elements). + If the properties ID is not valid, an empty array is returned. + + @param properties_id The properties ID to get the properties for + @return The array of variants (see \properties_id) + """ + def properties_id(self, properties: Sequence[Any]) -> int: + r""" + @brief Gets the properties ID for a given properties set + + Before a set of properties can be attached to a shape, it must be converted into an ID that is unique for that set. The properties set must be given as a list of pairs of variants, each pair describing a name and a value. The name acts as the key for the property and does not need to be a string (it can be an integer or double value as well). + The backward conversion can be performed with the 'properties' method. + + @param properties The array of pairs of variants (both elements can be integer, double or string) + @return The unique properties ID for that set + """ + def property(self, key: Any) -> Any: + r""" + @brief Gets the user property with the given key + This method is a convenience method that gets the property with the given key. If no property with that key exists, it will return nil. Using that method is more convenient than using the properties ID to retrieve the property value. + This method has been introduced in version 0.24. + """ + def prune_cell(self, cell_index: int, levels: int) -> None: + r""" + @brief Deletes a cell plus subcells not used otherwise + + This deletes a cell and also all sub cells of the cell which are not used otherwise. + The number of hierarchy levels to consider can be specified as well. One level of hierarchy means that only the direct children of the cell are deleted with the cell itself. + All instances of this cell are deleted as well. + + @param cell_index The index of the cell to delete + @param levels The number of hierarchy levels to consider (-1: all, 0: none, 1: one level etc.) + + This method has been introduced in version 0.20. + """ + def prune_subcells(self, cell_index: int, levels: int) -> None: + r""" + @brief Deletes all sub cells of the cell which are not used otherwise down to the specified level of hierarchy + + This deletes all sub cells of the cell which are not used otherwise. + All instances of the deleted cells are deleted as well. + It is possible to specify how many levels of hierarchy below the given root cell are considered. + + @param cell_index The root cell from which to delete a sub cells + @param levels The number of hierarchy levels to consider (-1: all, 0: none, 1: one level etc.) + + This method has been introduced in version 0.20. + """ + @overload + def read(self, filename: str) -> LayerMap: + r""" + @brief Load the layout from the given file + The format of the file is determined automatically and automatic unzipping is provided. No particular options can be specified. + @param filename The name of the file to load. + @return A layer map that contains the mapping used by the reader including the layers that have been created. + This method has been added in version 0.18. + """ + @overload + def read(self, filename: str, options: LoadLayoutOptions) -> LayerMap: + r""" + @brief Load the layout from the given file with options + The format of the file is determined automatically and automatic unzipping is provided. In this version, some reader options can be specified. @param filename The name of the file to load. + @param options The options object specifying further options for the reader. + @return A layer map that contains the mapping used by the reader including the layers that have been created. + This method has been added in version 0.18. + """ + def refresh(self) -> None: + r""" + @brief Calls \Cell#refresh on all cells inside this layout + This method is useful to recompute all PCells from a layout. Note that this does not update PCells which are linked from a library. To recompute PCells from a library, you need to use \Library#refresh on the library object from which the PCells are imported. + + This method has been introduced in version 0.27.9. + """ + def register_pcell(self, name: str, declaration: PCellDeclaration_Native) -> int: + r""" + @brief Registers a PCell declaration under the given name + Registers a local PCell in the current layout. If a declaration with that name + already exists, it is replaced with the new declaration. + + This method has been introduced in version 0.22. + """ + def remove_meta_info(self, name: str) -> None: + r""" + @brief Removes meta information from the layout + See \LayoutMetaInfo for details about layouts and meta information. + This method has been introduced in version 0.25. + """ + def rename_cell(self, index: int, name: str) -> None: + r""" + @brief Renames the cell with given index + The cell with the given index is renamed to the given name. NOTE: it is not ensured that the name is unique. This method allows assigning identical names to different cells which usually breaks things. + Consider using \unique_cell_name to generate truely unique names. + """ + @overload + def scale_and_snap(self, cell: Cell, grid: int, mult: int, div: int) -> None: + r""" + @brief Scales and snaps the layout below a given cell by the given rational factor and snaps to the given grid + + This method is useful to scale a layout by a non-integer factor. The scale factor is given by the rational number mult / div. After scaling, the layout will be snapped to the given grid. + + Snapping happens 'as-if-flat' - that is, touching edges will stay touching, regardless of their hierarchy path. To achieve this, this method usually needs to produce cell variants. + + This method has been introduced in version 0.26.1. + """ + @overload + def scale_and_snap(self, cell_index: int, grid: int, mult: int, div: int) -> None: + r""" + @brief Scales and snaps the layout below a given cell by the given rational factor and snaps to the given grid + + Like the other version of \scale_and_snap, but taking a cell index for the argument. + + This method has been introduced in version 0.26.1. + """ + def set_info(self, index: int, props: LayerInfo) -> None: + r""" + @brief Sets the info structure for a specified layer + """ + def set_property(self, key: Any, value: Any) -> None: + r""" + @brief Sets the user property with the given key to the given value + This method is a convenience method that sets the property with the given key to the given value. If no property with that key exists, it will create one. Using that method is more convenient than creating a new property set with a new ID and assigning that properties ID. + This method may change the properties ID. Note: GDS only supports integer keys. OASIS supports numeric and string keys. + This method has been introduced in version 0.24. + """ + def start_changes(self) -> None: + r""" + @brief Signals the start of an operation bringing the layout into invalid state + + This method should be called whenever the layout is + about to be brought into an invalid state. After calling + this method, \under_construction? returns true which + tells foreign code (i.e. the asynchronous painter or the cell tree view) + not to use this layout object. + + This state is cancelled by the \end_changes method. + The start_changes method can be called multiple times + and must be cancelled the same number of times. + + This method can be used to speed up certain operations. For example iterating over the layout with a \RecursiveShapeIterator while modifying other layers of the layout can be very inefficient, because inside the loop the layout's state is invalidate and updated frequently. + Putting a update and start_changes sequence before the loop (use both methods in that order!) and a end_changes call after the loop can improve the performance dramatically. + + In addition, it can be necessary to prevent redraw operations in certain cases by using start_changes .. end_changes, in particular when it is possible to put a layout object into an invalid state temporarily. + + While the layout is under construction \update can be called to update the internal state explicitly if required. + This for example might be necessary to update the cell bounding boxes or to redo the sorting for region queries. + """ + def swap_layers(self, a: int, b: int) -> None: + r""" + @brief Swap two layers + + Swaps the shapes of both layers. + + This method was introduced in version 0.19. + + @param a The first of the layers to swap. + @param b The second of the layers to swap. + """ + def technology(self) -> Technology: + r""" + @brief Gets the \Technology object of the technology this layout is associated with or nil if the layout is not associated with a technology + This method has been introduced in version 0.27. Before that, the technology has been kept in the 'technology' meta data element. + """ + def top_cell(self) -> Cell: + r""" + @brief Returns the top cell object + @return The \Cell object of the top cell + If the layout has a single top cell, this method returns the top cell's \Cell object. + If the layout does not have a top cell, this method returns "nil". If the layout has multiple + top cells, this method raises an error. + + This method has been introduced in version 0.23. + """ + def top_cells(self) -> List[Cell]: + r""" + @brief Returns the top cell objects + @return The \Cell objects of the top cells + This method returns and array of \Cell objects representing the top cells of the layout. + This array can be empty, if the layout does not have a top cell (i.e. no cell at all). + + This method has been introduced in version 0.23. + """ + @overload + def transform(self, trans: DCplxTrans) -> None: + r""" + @brief Transforms the layout with the given complex integer transformation, which is in micrometer units + This variant will internally translate the transformation's displacement into database units. Apart from that, it behaves identical to the version with a \ICplxTrans argument. + + This method has been introduced in version 0.23. + """ + @overload + def transform(self, trans: DTrans) -> None: + r""" + @brief Transforms the layout with the given transformation, which is in micrometer units + This variant will internally translate the transformation's displacement into database units. Apart from that, it behaves identical to the version with a \Trans argument. + + This variant has been introduced in version 0.25. + """ + @overload + def transform(self, trans: ICplxTrans) -> None: + r""" + @brief Transforms the layout with the given complex integer transformation + + This method has been introduced in version 0.23. + """ + @overload + def transform(self, trans: Trans) -> None: + r""" + @brief Transforms the layout with the given transformation + + This method has been introduced in version 0.23. + """ + def under_construction(self) -> bool: + r""" + @brief Returns true if the layout object is under construction + + A layout object is either under construction if a transaction + is ongoing or the layout is brought into invalid state by + "start_changes". + """ + def unique_cell_name(self, name: str) -> str: + r""" + @brief Creates a new unique cell name from the given name + @return A unique name derived from the argument + + If a cell with the given name exists, a suffix will be added to make the name unique. Otherwise, the argument will be returned unchanged. + + The returned name can be used to rename cells without risk of creating name clashes. + + This method has been introduced in version 0.28. + """ + def update(self) -> None: + r""" + @brief Updates the internals of the layout + This method updates the internal state of the layout. Usually this is done automatically + This method is provided to ensure this explicitly. This can be useful while using \start_changes and \end_changes to wrap a performance-critical operation. See \start_changes for more details. + """ + @overload + def write(self, filename: str) -> None: + r""" + @brief Writes the layout to a stream file + @param filename The file to which to write the layout + """ + @overload + def write(self, filename: str, gzip: bool, options: SaveLayoutOptions) -> None: + r""" + @brief Writes the layout to a stream file + @param filename The file to which to write the layout + @param gzip Ignored + @param options The option set to use for writing. See \SaveLayoutOptions for details + + Starting with version 0.23, this variant is deprecated since the more convenient variant with two parameters automatically determines the compression mode from the file name. The gzip parameter is ignored staring with version 0.23. + """ + @overload + def write(self, filename: str, options: SaveLayoutOptions) -> None: + r""" + @brief Writes the layout to a stream file + @param filename The file to which to write the layout + @param options The option set to use for writing. See \SaveLayoutOptions for details + + This version automatically determines the compression mode from the file name. The file is written with zlib compression if the suffix is ".gz" or ".gzip". + + This variant has been introduced in version 0.23. + """ + +class LayoutDiff: + r""" + @brief The layout compare tool + + The layout compare tool is a facility to quickly compare layouts and derive events that give details about the differences. The events are basically emitted following a certain order: + + @ul + @li General configuration events (database units, layers ...) @/li + @li \on_begin_cell @/li + @li \on_begin_inst_differences (if the instances differ) @/li + @li details about instance differences (if \Verbose flag is given) @/li + @li \on_end_inst_differences (if the instances differ) @/li + @li \on_begin_layer @/li + @li \on_begin_polygon_differences (if the polygons differ) @/li + @li details about polygon differences (if \Verbose flag is given) @/li + @li \on_end_polygon_differences (if the polygons differ) @/li + @li other shape difference events (paths, boxes, ...) @/li + @li \on_end_layer @/li + @li repeated layer event groups @/li + @li \on_end_cell @/li + @li repeated cell event groups @/li + @/ul + + To use the diff facility, create a \LayoutDiff object and call the \compare_layout or \compare_cell method: + + @code + lya = ... # layout A + lyb = ... # layout B + + diff = RBA::LayoutDiff::new + diff.on_polygon_in_a_only do |poly| + puts "Polygon in A: #{diff.cell_a.name}@#{diff.layer_info_a.to_s}: #{poly.to_s}" + end + diff.on_polygon_in_b_only do |poly| + puts "Polygon in A: #{diff.cell_b.name}@#{diff.layer_info_b.to_s}: #{poly.to_s}" + end + diff.compare(lya, lyb, RBA::LayoutDiff::Verbose + RBA::LayoutDiff::NoLayerNames) + @/code + """ + BoxesAsPolygons: ClassVar[int] + r""" + @brief Compare boxes to polygons + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + DontSummarizeMissingLayers: ClassVar[int] + r""" + @brief Don't summarize missing layers + If this mode is present, missing layers are treated as empty ones and every shape on the other layer will be reported as difference. + + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + FlattenArrayInsts: ClassVar[int] + r""" + @brief Compare array instances instance by instance + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + NoLayerNames: ClassVar[int] + r""" + @brief Do not compare layer names + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + NoProperties: ClassVar[int] + r""" + @brief Ignore properties + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + NoTextDetails: ClassVar[int] + r""" + @brief Ignore text details (font, size, presentation) + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + NoTextOrientation: ClassVar[int] + r""" + @brief Ignore text orientation + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + PathsAsPolygons: ClassVar[int] + r""" + @brief Compare paths to polygons + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + Silent: ClassVar[int] + r""" + @brief Silent compare - just report whether the layouts are identical + Silent mode will not issue any signals, but instead the return value of the \LayoutDiff#compare method will indicate whether the layouts are identical. In silent mode, the compare method will return immediately once a difference has been encountered so that mode may be much faster than the full compare. + + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + SmartCellMapping: ClassVar[int] + r""" + @brief Derive smart cell mapping instead of name mapping (available only if top cells are specified) + Smart cell mapping is only effective currently when cells are compared (with \LayoutDiff#compare with cells instead of layout objects). + + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + Verbose: ClassVar[int] + r""" + @brief Enables verbose mode (gives details about the differences) + + See the event descriptions for details about the differences in verbose and non-verbose mode. + + This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. + """ + on_bbox_differs: None + r""" + Getter: + @brief This signal indicates a difference in the bounding boxes of two cells + This signal is only emitted in non-verbose mode (without \Verbose flag) as a summarizing cell property. In verbose mode detailed events will be issued indicating the differences. + + Setter: + @brief This signal indicates a difference in the bounding boxes of two cells + This signal is only emitted in non-verbose mode (without \Verbose flag) as a summarizing cell property. In verbose mode detailed events will be issued indicating the differences. + """ + on_begin_box_differences: None + r""" + Getter: + @brief This signal indicates differences in the boxes on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for boxes that are different between the two layouts. + Setter: + @brief This signal indicates differences in the boxes on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for boxes that are different between the two layouts. + """ + on_begin_cell: None + r""" + Getter: + @brief This signal initiates the sequence of events for a cell pair + All cell specific events happen between \begin_cell_event and \end_cell_event signals. + Setter: + @brief This signal initiates the sequence of events for a cell pair + All cell specific events happen between \begin_cell_event and \end_cell_event signals. + """ + on_begin_edge_differences: None + r""" + Getter: + @brief This signal indicates differences in the edges on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edges that are different between the two layouts. + Setter: + @brief This signal indicates differences in the edges on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edges that are different between the two layouts. + """ + on_begin_edge_pair_differences: None + r""" + Getter: + @brief This signal indicates differences in the edge pairs on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edge pairs that are different between the two layouts. + This event has been introduced in version 0.28. + Setter: + @brief This signal indicates differences in the edge pairs on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edge pairs that are different between the two layouts. + This event has been introduced in version 0.28. + """ + on_begin_inst_differences: None + r""" + Getter: + @brief This signal indicates differences in the cell instances + In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\instance_in_a_only_event and \instance_in_b_only_event). + Setter: + @brief This signal indicates differences in the cell instances + In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\instance_in_a_only_event and \instance_in_b_only_event). + """ + on_begin_layer: None + r""" + Getter: + @brief This signal indicates differences on the given layer + In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\polygon_in_a_only_event, \polygon_in_b_only_event and similar). + Setter: + @brief This signal indicates differences on the given layer + In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\polygon_in_a_only_event, \polygon_in_b_only_event and similar). + """ + on_begin_path_differences: None + r""" + Getter: + @brief This signal indicates differences in the paths on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for paths that are different between the two layouts. + Setter: + @brief This signal indicates differences in the paths on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for paths that are different between the two layouts. + """ + on_begin_polygon_differences: None + r""" + Getter: + @brief This signal indicates differences in the polygons on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for polygons that are different between the two layouts. + Setter: + @brief This signal indicates differences in the polygons on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for polygons that are different between the two layouts. + """ + on_begin_text_differences: None + r""" + Getter: + @brief This signal indicates differences in the texts on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for texts that are different between the two layouts. + Setter: + @brief This signal indicates differences in the texts on the current layer + The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for texts that are different between the two layouts. + """ + on_box_in_a_only: None + r""" + Getter: + @brief This signal indicates a box that is present in the first layout only + Setter: + @brief This signal indicates a box that is present in the first layout only + """ + on_box_in_b_only: None + r""" + Getter: + @brief This signal indicates a box that is present in the second layout only + Setter: + @brief This signal indicates a box that is present in the second layout only + """ + on_cell_in_a_only: None + r""" + Getter: + @brief This signal indicates that the given cell is only present in the first layout + + Setter: + @brief This signal indicates that the given cell is only present in the first layout + """ + on_cell_in_b_only: None + r""" + Getter: + @brief This signal indicates that the given cell is only present in the second layout + + Setter: + @brief This signal indicates that the given cell is only present in the second layout + """ + on_cell_name_differs: None + r""" + Getter: + @brief This signal indicates a difference in the cell names + This signal is emitted in 'smart cell mapping' mode (see \SmartCellMapping) if two cells are considered identical, but have different names. + Setter: + @brief This signal indicates a difference in the cell names + This signal is emitted in 'smart cell mapping' mode (see \SmartCellMapping) if two cells are considered identical, but have different names. + """ + on_dbu_differs: None + r""" + Getter: + @brief This signal indicates a difference in the database units of the layouts + + Setter: + @brief This signal indicates a difference in the database units of the layouts + """ + on_edge_in_a_only: None + r""" + Getter: + @brief This signal indicates an edge that is present in the first layout only + Setter: + @brief This signal indicates an edge that is present in the first layout only + """ + on_edge_in_b_only: None + r""" + Getter: + @brief This signal indicates an edge that is present in the second layout only + Setter: + @brief This signal indicates an edge that is present in the second layout only + """ + on_edge_pair_in_a_only: None + r""" + Getter: + @brief This signal indicates an edge pair that is present in the first layout only + This event has been introduced in version 0.28. + Setter: + @brief This signal indicates an edge pair that is present in the first layout only + This event has been introduced in version 0.28. + """ + on_edge_pair_in_b_only: None + r""" + Getter: + @brief This signal indicates an edge pair that is present in the second layout only + This event has been introduced in version 0.28. + Setter: + @brief This signal indicates an edge pair that is present in the second layout only + This event has been introduced in version 0.28. + """ + on_end_box_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of box differences + + Setter: + @brief This signal indicates the end of sequence of box differences + """ + on_end_cell: None + r""" + Getter: + @brief This signal indicates the end of a sequence of signals for a specific cell + + Setter: + @brief This signal indicates the end of a sequence of signals for a specific cell + """ + on_end_edge_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of edge differences + + Setter: + @brief This signal indicates the end of sequence of edge differences + """ + on_end_edge_pair_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of edge pair differences + + This event has been introduced in version 0.28. + Setter: + @brief This signal indicates the end of sequence of edge pair differences + + This event has been introduced in version 0.28. + """ + on_end_inst_differences: None + r""" + Getter: + @brief This signal finishes a sequence of detailed instance difference events + + Setter: + @brief This signal finishes a sequence of detailed instance difference events + """ + on_end_layer: None + r""" + Getter: + @brief This signal indicates the end of a sequence of signals for a specific layer + + Setter: + @brief This signal indicates the end of a sequence of signals for a specific layer + """ + on_end_path_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of path differences + + Setter: + @brief This signal indicates the end of sequence of path differences + """ + on_end_polygon_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of polygon differences + + Setter: + @brief This signal indicates the end of sequence of polygon differences + """ + on_end_text_differences: None + r""" + Getter: + @brief This signal indicates the end of sequence of text differences + + Setter: + @brief This signal indicates the end of sequence of text differences + """ + on_instance_in_a_only: None + r""" + Getter: + @brief This signal indicates an instance that is present only in the first layout + This event is only emitted in verbose mode (\Verbose flag). + Setter: + @brief This signal indicates an instance that is present only in the first layout + This event is only emitted in verbose mode (\Verbose flag). + """ + on_instance_in_b_only: None + r""" + Getter: + @brief This signal indicates an instance that is present only in the second layout + This event is only emitted in verbose mode (\Verbose flag). + Setter: + @brief This signal indicates an instance that is present only in the second layout + This event is only emitted in verbose mode (\Verbose flag). + """ + on_layer_in_a_only: None + r""" + Getter: + @brief This signal indicates a layer that is present only in the first layout + + Setter: + @brief This signal indicates a layer that is present only in the first layout + """ + on_layer_in_b_only: None + r""" + Getter: + @brief This signal indicates a layer that is present only in the second layout + + Setter: + @brief This signal indicates a layer that is present only in the second layout + """ + on_layer_name_differs: None + r""" + Getter: + @brief This signal indicates a difference in the layer names + + Setter: + @brief This signal indicates a difference in the layer names + """ + on_path_in_a_only: None + r""" + Getter: + @brief This signal indicates a path that is present in the first layout only + Setter: + @brief This signal indicates a path that is present in the first layout only + """ + on_path_in_b_only: None + r""" + Getter: + @brief This signal indicates a path that is present in the second layout only + Setter: + @brief This signal indicates a path that is present in the second layout only + """ + on_per_layer_bbox_differs: None + r""" + Getter: + @brief This signal indicates differences in the per-layer bounding boxes of the current cell + + Setter: + @brief This signal indicates differences in the per-layer bounding boxes of the current cell + """ + on_polygon_in_a_only: None + r""" + Getter: + @brief This signal indicates a polygon that is present in the first layout only + + Setter: + @brief This signal indicates a polygon that is present in the first layout only + """ + on_polygon_in_b_only: None + r""" + Getter: + @brief This signal indicates a polygon that is present in the second layout only + + Setter: + @brief This signal indicates a polygon that is present in the second layout only + """ + on_text_in_a_only: None + r""" + Getter: + @brief This signal indicates a text that is present in the first layout only + Setter: + @brief This signal indicates a text that is present in the first layout only + """ + on_text_in_b_only: None + r""" + Getter: + @brief This signal indicates a text that is present in the second layout only + Setter: + @brief This signal indicates a text that is present in the second layout only + """ + @classmethod + def new(cls) -> LayoutDiff: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LayoutDiff: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> LayoutDiff: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: LayoutDiff) -> None: + r""" + @brief Assigns another object to self + """ + def cell_a(self) -> Cell: + r""" + @brief Gets the current cell for the first layout + This attribute is the current cell and is set after \on_begin_cell and reset after \on_end_cell. + """ + def cell_b(self) -> Cell: + r""" + @brief Gets the current cell for the second layout + This attribute is the current cell and is set after \on_begin_cell and reset after \on_end_cell. + """ + @overload + def compare(self, a: Cell, b: Cell, flags: Optional[int] = ..., tolerance: Optional[int] = ...) -> bool: + r""" + @brief Compares two cells + + Compares layer definitions, cells, instances and shapes and properties of two layout hierarchies starting from the given cells. + Cells are identified by name. Only layers with valid layer and datatype are compared. + Several flags can be specified as a bitwise or combination of the constants. + + @param a The first top cell + @param b The second top cell + @param flags Flags to use for the comparison + @param tolerance A coordinate tolerance to apply (0: exact match, 1: one DBU tolerance is allowed ...) + + @return True, if the cells are identical + """ + @overload + def compare(self, a: Layout, b: Layout, flags: Optional[int] = ..., tolerance: Optional[int] = ...) -> bool: + r""" + @brief Compares two layouts + + Compares layer definitions, cells, instances and shapes and properties. + Cells are identified by name. Only layers with valid layer and datatype are compared. + Several flags can be specified as a bitwise or combination of the constants. + + @param a The first input layout + @param b The second input layout + @param flags Flags to use for the comparison + @param tolerance A coordinate tolerance to apply (0: exact match, 1: one DBU tolerance is allowed ...) + + @return True, if the layouts are identical + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> LayoutDiff: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def layer_index_a(self) -> int: + r""" + @brief Gets the current layer for the first layout + This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. + """ + def layer_index_b(self) -> int: + r""" + @brief Gets the current layer for the second layout + This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. + """ + def layer_info_a(self) -> LayerInfo: + r""" + @brief Gets the current layer properties for the first layout + This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. + """ + def layer_info_b(self) -> LayerInfo: + r""" + @brief Gets the current layer properties for the second layout + This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. + """ + def layout_a(self) -> Layout: + r""" + @brief Gets the first layout the difference detector runs on + """ + def layout_b(self) -> Layout: + r""" + @brief Gets the second layout the difference detector runs on + """ + +class LayoutMetaInfo: + r""" + @brief A piece of layout meta information + Layout meta information is basically additional data that can be attached to a layout. Layout readers may generate meta information and some writers will add layout information to the layout object. Some writers will also read meta information to determine certain attributes. + + Multiple layout meta information objects can be attached to one layout using \Layout#add_meta_info. Meta information is identified by a unique name and carries a string value plus an optional description string. The description string is for information only and is not evaluated by code. + + See also \Layout#each_meta_info and \Layout#meta_info_value and \Layout#remove_meta_info + This class has been introduced in version 0.25. + """ + description: str + r""" + Getter: + @brief Gets the description of the layout meta info object + + Setter: + @brief Sets the description of the layout meta info object + """ + name: str + r""" + Getter: + @brief Gets the name of the layout meta info object + + Setter: + @brief Sets the name of the layout meta info object + """ + value: str + r""" + Getter: + @brief Gets the value of the layout meta info object + + Setter: + @brief Sets the value of the layout meta info object + """ + @classmethod + def new(cls, name: str, value: str, description: Optional[str] = ...) -> LayoutMetaInfo: + r""" + @brief Creates a layout meta info object + @param name The name + @param value The value + @param description An optional description text + """ + def __copy__(self) -> LayoutMetaInfo: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> LayoutMetaInfo: + r""" + @brief Creates a copy of self + """ + def __init__(self, name: str, value: str, description: Optional[str] = ...) -> None: + r""" + @brief Creates a layout meta info object + @param name The name + @param value The value + @param description An optional description text + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: LayoutMetaInfo) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> LayoutMetaInfo: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class LayoutQuery: + r""" + @brief A layout query + Layout queries are the backbone of the "Search & replace" feature. Layout queries allow retrieval of data from layouts and manipulation of layouts. This object provides script binding for this feature. + Layout queries are used by first creating a query object. Depending on the nature of the query, either \execute or \each can be used to execute the query. \execute will run the query and return once the query is finished. \execute is useful for running queries that don't return results such as "delete" or "with ... do" queries. + \each can be used when the results of the query need to be retrieved. + + The \each method will call a block a of code for every result available. It will provide a \LayoutQueryIterator object that allows accessing the results of the query. Depending on the query, different attributes of the iterator object will be available. For example, "select" queries will fill the "data" attribute with an array of values corresponding to the columns of the selection. + + Here is some sample code: + @code + ly = RBA::CellView::active.layout + q = RBA::LayoutQuery::new("select cell.name, cell.bbox from *") + q.each(ly) do |iter| + puts "cell name: #{iter.data[0]}, bounding box: #{iter.data[1]}" + end + @/code + + The LayoutQuery class has been introduced in version 0.25. + """ + @classmethod + def new(cls, query: str) -> LayoutQuery: + r""" + @brief Creates a new query object from the given query string + """ + def __init__(self, query: str) -> None: + r""" + @brief Creates a new query object from the given query string + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def each(self, layout: Layout, context: Optional[tl.ExpressionContext] = ...) -> Iterator[LayoutQueryIterator]: + r""" + @brief Executes the query and delivered the results iteratively. + The argument to the block is a \LayoutQueryIterator object which can be asked for specific results. + + The context argument allows supplying an expression execution context. This context can be used for example to supply variables for the execution. It has been added in version 0.26. + """ + def execute(self, layout: Layout, context: Optional[tl.ExpressionContext] = ...) -> None: + r""" + @brief Executes the query + + This method can be used to execute "active" queries such + as "delete" or "with ... do". + It is basically equivalent to iterating over the query until it is + done. + + The context argument allows supplying an expression execution context. This context can be used for example to supply variables for the execution. It has been added in version 0.26. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def property_names(self) -> List[str]: + r""" + @brief Gets a list of property names available. + The list of properties available from the query depends on the nature of the query. This method allows detection of the properties available. Within the query, all of these properties can be obtained from the query iterator using \LayoutQueryIterator#get. + """ + +class LayoutQueryIterator: + r""" + @brief Provides the results of the query + + This object is used by \LayoutQuery#each to deliver the results of a query in an iterative fashion. See \LayoutQuery for a detailed description of the query interface. + + The LayoutQueryIterator class has been introduced in version 0.25. + """ + @classmethod + def new(cls) -> LayoutQueryIterator: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def cell(self) -> Any: + r""" + @brief A shortcut for 'get("cell")' + """ + def cell_index(self) -> Any: + r""" + @brief A shortcut for 'get("cell_index")' + """ + def create(self) -> None: + r""" + @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. + """ + def data(self) -> Any: + r""" + @brief A shortcut for 'get("data")' + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dtrans(self) -> Any: + r""" + @brief A shortcut for 'get("dtrans")' + """ + def get(self, name: str) -> Any: + r""" + @brief Gets the query property with the given name + The query properties available can be obtained from the query object using \LayoutQuery#property_names. + Some shortcut methods are available. For example, the \data method provides a shortcut for 'get("data")'. + + If a property with the given name is not available, nil will be returned. + """ + def initial_cell(self) -> Any: + r""" + @brief A shortcut for 'get("initial_cell")' + """ + def initial_cell_index(self) -> Any: + r""" + @brief A shortcut for 'get("initial_cell_index")' + """ + def inst(self) -> Any: + r""" + @brief A shortcut for 'get("inst")' + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def layer_index(self) -> Any: + r""" + @brief A shortcut for 'get("layer_index")' + """ + def layout(self) -> Layout: + r""" + @brief Gets the layout the query acts on + """ + def parent_cell(self) -> Any: + r""" + @brief A shortcut for 'get("parent_cell")' + """ + def parent_cell_index(self) -> Any: + r""" + @brief A shortcut for 'get("parent_cell_index")' + """ + def path_dtrans(self) -> Any: + r""" + @brief A shortcut for 'get("path_dtrans")' + """ + def path_trans(self) -> Any: + r""" + @brief A shortcut for 'get("path_trans")' + """ + def query(self) -> LayoutQuery: + r""" + @brief Gets the query the iterator follows on + """ + def shape(self) -> Any: + r""" + @brief A shortcut for 'get("shape")' + """ + def trans(self) -> Any: + r""" + @brief A shortcut for 'get("trans")' + """ + +class LayoutToNetlist: + r""" + @brief A generic framework for extracting netlists from layouts + + This class wraps various concepts from db::NetlistExtractor and db::NetlistDeviceExtractor + and more. It is supposed to provide a framework for extracting a netlist from a layout. + + The use model of this class consists of five steps which need to be executed in this order. + + @ul + @li Configuration: in this step, the LayoutToNetlist object is created and + if required, configured. Methods to be used in this step are \threads=, + \area_ratio= or \max_vertex_count=. The constructor for the LayoutToNetlist + object receives a \RecursiveShapeIterator object which basically supplies the + hierarchy and the layout taken as input. + @/li + @li Preparation + In this step, the device recognition and extraction layers are drawn from + the framework. Derived can now be computed using boolean operations. + Methods to use in this step are \make_layer and it's variants. + Layer preparation is not necessarily required to happen before all + other steps. Layers can be computed shortly before they are required. + @/li + @li Following the preparation, the devices can be extracted using \extract_devices. + This method needs to be called for each device extractor required. Each time, + a device extractor needs to be given plus a map of device layers. The device + layers are device extractor specific. Either original or derived layers + may be specified here. Layer preparation may happen between calls to \extract_devices. + @/li + @li Once the devices are derived, the netlist connectivity can be defined and the + netlist extracted. The connectivity is defined with \connect and it's + flavours. The actual netlist extraction happens with \extract_netlist. + @/li + @li After netlist extraction, the information is ready to be retrieved. + The produced netlist is available with \netlist. The Shapes of a + specific net are available with \shapes_of_net. \probe_net allows + finding a net by probing a specific location. + @/li + @/ul + + You can also use the extractor with an existing \DeepShapeStore object or even flat data. In this case, preparation means importing existing regions with the \register method. + If you want to use the \LayoutToNetlist object with flat data, use the 'LayoutToNetlist(topcell, dbu)' constructor. If you want to use it with hierarchical data and an existing DeepShapeStore object, use the 'LayoutToNetlist(dss)' constructor. + + This class has been introduced in version 0.26. + """ + class BuildNetHierarchyMode: + r""" + @brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum + This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net. + """ + BNH_Disconnected: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] + r""" + @brief This constant tells \build_net and \build_all_nets to produce local nets without connections to subcircuits (used for the "hier_mode" parameter). + """ + BNH_Flatten: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] + r""" + @brief This constant tells \build_net and \build_all_nets to flatten the nets (used for the "hier_mode" parameter). + """ + BNH_SubcircuitCells: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] + r""" + @brief This constant tells \build_net and \build_all_nets to produce a hierarchy of subcircuit cells per net (used for the "hier_mode" parameter). + """ + @overload + @classmethod + def new(cls, i: int) -> LayoutToNetlist.BuildNetHierarchyMode: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> LayoutToNetlist.BuildNetHierarchyMode: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: LayoutToNetlist.BuildNetHierarchyMode) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + BNH_Disconnected: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] + r""" + @brief This constant tells \build_net and \build_all_nets to produce local nets without connections to subcircuits (used for the "hier_mode" parameter). + """ + BNH_Flatten: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] + r""" + @brief This constant tells \build_net and \build_all_nets to flatten the nets (used for the "hier_mode" parameter). + """ + BNH_SubcircuitCells: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] + r""" + @brief This constant tells \build_net and \build_all_nets to produce a hierarchy of subcircuit cells per net (used for the "hier_mode" parameter). + """ + area_ratio: float + r""" + Getter: + @brief Gets the area_ratio parameter for the hierarchical network processor + See \area_ratio= for details about this attribute. + Setter: + @brief Sets the area_ratio parameter for the hierarchical network processor + This parameter controls splitting of large polygons in order to reduce the + error made by the bounding box approximation. + """ + description: str + r""" + Getter: + @brief Gets the description of the database + + Setter: + @brief Sets the description of the database + """ + device_scaling: float + r""" + Getter: + @brief Gets the device scaling factor + See \device_scaling= for details about this attribute. + Setter: + @brief Sets the device scaling factor + This factor will scale the physical properties of the extracted devices + accordingly. The scale factor applies an isotropic shrink (<1) or expansion (>1). + """ + generator: str + r""" + Getter: + @brief Gets the generator string. + The generator is the script that created this database. + + Setter: + @brief Sets the generator string. + """ + include_floating_subcircuits: bool + r""" + Getter: + @brief Gets a flag indicating whether to include floating subcircuits in the netlist. + See \include_floating_subcircuits= for details. + + This attribute has been introduced in version 0.27. + + Setter: + @brief Sets a flag indicating whether to include floating subcircuits in the netlist. + + With 'include_floating_subcircuits' set to true, subcircuits with no connection to their parent circuit are still included in the circuit as floating subcircuits. Specifically on flattening this means that these subcircuits are properly propagated to their parent instead of appearing as additional top circuits. + + This attribute has been introduced in version 0.27 and replaces the arguments of \extract_netlist. + """ + max_vertex_count: int + r""" + Getter: + See \max_vertex_count= for details about this attribute. + Setter: + @brief Sets the max_vertex_count parameter for the hierarchical network processor + This parameter controls splitting of large polygons in order to enhance performance + for very big polygons. + """ + name: str + r""" + Getter: + @brief Gets the name of the database + + Setter: + @brief Sets the name of the database + """ + original_file: str + r""" + Getter: + @brief Gets the original file name of the database + The original filename is the layout file from which the netlist DB was created. + Setter: + @brief Sets the original file name of the database + """ + threads: int + r""" + Getter: + @brief Gets the number of threads to use for operations which support multiple threads + + Setter: + @brief Sets the number of threads to use for operations which support multiple threads + """ + @overload + @classmethod + def new(cls) -> LayoutToNetlist: + r""" + @brief Creates a new and empty extractor object + The main objective for this constructor is to create an object suitable for reading an annotated netlist. + """ + @overload + @classmethod + def new(cls, dss: DeepShapeStore) -> LayoutToNetlist: + r""" + @brief Creates a new extractor object reusing an existing \DeepShapeStore object + This constructor can be used if there is a DSS object already from which the shapes can be taken. This version can only be used with \register to add layers (regions) inside the 'dss' object. + + The make_... methods will not create new layers as there is no particular place defined where to create the layers. + + The extractor will not take ownership of the dss object unless you call \keep_dss. + """ + @overload + @classmethod + def new(cls, dss: DeepShapeStore, layout_index: int) -> LayoutToNetlist: + r""" + @brief Creates a new extractor object reusing an existing \DeepShapeStore object + This constructor can be used if there is a DSS object already from which the shapes can be taken. NOTE: in this case, the make_... functions will create new layers inside this DSS. To register existing layers (regions) use \register. + """ + @overload + @classmethod + def new(cls, iter: RecursiveShapeIterator) -> LayoutToNetlist: + r""" + @brief Creates a new extractor connected to an original layout + This constructor will attach the extractor to an original layout through the shape iterator. + """ + @overload + @classmethod + def new(cls, topcell_name: str, dbu: float) -> LayoutToNetlist: + r""" + @brief Creates a new extractor object with a flat DSS + @param topcell_name The name of the top cell of the internal flat layout + @param dbu The database unit to use for the internal flat layout + + This constructor will create an extractor for flat extraction. Layers registered with \register will be flattened. New layers created with make_... will be flat layers. + + The database unit is mandatory because the physical parameter extraction for devices requires this unit for translation of layout to physical dimensions. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a new and empty extractor object + The main objective for this constructor is to create an object suitable for reading an annotated netlist. + """ + @overload + def __init__(self, dss: DeepShapeStore) -> None: + r""" + @brief Creates a new extractor object reusing an existing \DeepShapeStore object + This constructor can be used if there is a DSS object already from which the shapes can be taken. This version can only be used with \register to add layers (regions) inside the 'dss' object. + + The make_... methods will not create new layers as there is no particular place defined where to create the layers. + + The extractor will not take ownership of the dss object unless you call \keep_dss. + """ + @overload + def __init__(self, dss: DeepShapeStore, layout_index: int) -> None: + r""" + @brief Creates a new extractor object reusing an existing \DeepShapeStore object + This constructor can be used if there is a DSS object already from which the shapes can be taken. NOTE: in this case, the make_... functions will create new layers inside this DSS. To register existing layers (regions) use \register. + """ + @overload + def __init__(self, iter: RecursiveShapeIterator) -> None: + r""" + @brief Creates a new extractor connected to an original layout + This constructor will attach the extractor to an original layout through the shape iterator. + """ + @overload + def __init__(self, topcell_name: str, dbu: float) -> None: + r""" + @brief Creates a new extractor object with a flat DSS + @param topcell_name The name of the top cell of the internal flat layout + @param dbu The database unit to use for the internal flat layout + + This constructor will create an extractor for flat extraction. Layers registered with \register will be flattened. New layers created with make_... will be flat layers. + + The database unit is mandatory because the physical parameter extraction for devices requires this unit for translation of layout to physical dimensions. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def antenna_check(self, gate: Region, gate_area_factor: float, gate_perimeter_factor: float, metal: Region, metal_area_factor: float, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: + r""" + @brief Runs an antenna check on the extracted clusters taking the perimeter into account and providing an area factor + + This (most generic) version of the \antenna_check method allows taking the perimeter of gate or metal into account and also provides a scaling factor for the area part. + The effective area is computed using: + + @code + Aeff = A * f + P * t + @/code + + Here f is the area factor and t the perimeter factor. A is the polygon area and P the polygon perimeter. A use case for this variant is to set the area factor to zero. This way, only perimeter contributions are considered. + + This variant has been introduced in version 0.26.6. + """ + @overload + def antenna_check(self, gate: Region, gate_perimeter_factor: float, metal: Region, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: + r""" + @brief Runs an antenna check on the extracted clusters taking the perimeter into account + + This version of the \antenna_check method allows taking the perimeter of gate or metal into account. The effective area is computed using: + + @code + Aeff = A + P * t + @/code + + Here Aeff is the area used in the check, A is the polygon area, P the perimeter and t the perimeter factor. This formula applies to gate polygon area/perimeter with 'gate_perimeter_factor' for t and metal polygon area/perimeter with 'metal_perimeter_factor'. The perimeter_factor has the dimension of micrometers and can be thought of as the width of the material. Essentially the side walls of the material are taking into account for the surface area as well. + + This variant has been introduced in version 0.26.6. + """ + @overload + def antenna_check(self, gate: Region, metal: Region, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: + r""" + @brief Runs an antenna check on the extracted clusters + + The antenna check will traverse all clusters and run an antenna check + for all root clusters. The antenna ratio is defined by the total + area of all "metal" shapes divided by the total area of all "gate" shapes + on the cluster. Of all clusters where the antenna ratio is larger than + the limit ratio all metal shapes are copied to the output region as + error markers. + + The simple call is: + + @code + l2n = ... # a LayoutToNetlist object + l2n.extract_netlist + # check for antenna ratio 10.0 of metal vs. poly: + errors = l2n.antenna(poly, metal, 10.0) + @/code + + You can include diodes which rectify the antenna effect. Provide recognition layers for theses diodes and include them in the connections. Then specify the diode layers in the antenna call: + + @code + ... + # include diode_layer1: + errors = l2n.antenna(poly, metal, 10.0, [ diode_layer1 ]) + # include diode_layer1 and diode_layer2:errors = l2n.antenna(poly, metal, 10.0, [ diode_layer1, diode_layer2 ]) + @/code + + Diodes can be configured to partially reduce the antenna effect depending on their area. This will make the diode_layer1 increase the ratio by 50.0 per square micrometer area of the diode: + + @code + ... + # diode_layer1 increases the ratio by 50 per square micrometer area: + errors = l2n.antenna(poly, metal, 10.0 [ [ diode_layer, 50.0 ] ]) + @/code + + If 'texts' is non-nil, this text collection will receive labels explaining the error in terms of area values and relevant ratio. + + The 'texts' parameter has been added in version 0.27.11. + """ + def build_all_nets(self, cmap: CellMapping, target: Layout, lmap: Dict[int, Region], net_cell_name_prefix: Optional[Any] = ..., netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: + r""" + @brief Builds a full hierarchical representation of the nets + + This method copies all nets into cells corresponding to the circuits. It uses the 'cmap' + object to determine the target cell (create it with "cell_mapping_into" or "const_cell_mapping_into"). + If no mapping is provided for a specific circuit cell, the nets are copied into the next mapped parent as many times as the circuit cell appears there (circuit flattening). + + The method has three net annotation modes: + @ul + @li No annotation (net_cell_name_prefix == nil and netname_prop == nil): the shapes will be put + into the target cell simply. @/li + @li Net name property (net_cell_name_prefix == nil and netname_prop != nil): the shapes will be + annotated with a property named with netname_prop and containing the net name string. @/li + @li Individual subcells per net (net_cell_name_prefix != 0): for each net, a subcell is created + and the net shapes will be put there (name of the subcell = net_cell_name_prefix + net name). + (this mode can be combined with netname_prop too). @/li + @/ul + + In addition, net hierarchy is covered in three ways: + @ul + @li No connection indicated (hier_mode == \BNH_Disconnected: the net shapes are simply put into their + respective circuits. The connections are not indicated. @/li + @li Subnet hierarchy (hier_mode == \BNH_SubcircuitCells): for each root net, a full hierarchy is built + to accommodate the subnets (see build_net in recursive mode). @/li + @li Flat (hier_mode == \BNH_Flatten): each net is flattened and put into the circuit it + belongs to. @/li + @/ul + + If a device cell name prefix is given, cells will be produced for each device abstract + using a name like device_cell_name_prefix + device name. Otherwise the device shapes are + treated as part of the net. + + @param cmap The mapping of internal layout to target layout for the circuit mapping + @param target The target layout + @param lmap Target layer indexes (keys) and net regions (values) + @param hier_mode See description of this method + @param netname_prop An (optional) property name to which to attach the net name + @param circuit_cell_name_prefix See method description + @param net_cell_name_prefix See method description + @param device_cell_name_prefix See above + """ + def build_net(self, net: Net, target: Layout, target_cell: Cell, lmap: Dict[int, Region], netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: + r""" + @brief Builds a net representation in the given layout and cell + + This method puts the shapes of a net into the given target cell using a variety of options + to represent the net name and the hierarchy of the net. + + If the netname_prop name is not nil, a property with the given name is created and assigned + the net name. + + Net hierarchy is covered in three ways: + @ul + @li No connection indicated (hier_mode == \BNH_Disconnected: the net shapes are simply put into their + respective circuits. The connections are not indicated. @/li + @li Subnet hierarchy (hier_mode == \BNH_SubcircuitCells): for each root net, a full hierarchy is built + to accommodate the subnets (see build_net in recursive mode). @/li + @li Flat (hier_mode == \BNH_Flatten): each net is flattened and put into the circuit it + belongs to. @/li + @/ul + If a device cell name prefix is given, cells will be produced for each device abstract + using a name like device_cell_name_prefix + device name. Otherwise the device shapes are + treated as part of the net. + + @param target The target layout + @param target_cell The target cell + @param lmap Target layer indexes (keys) and net regions (values) + @param hier_mode See description of this method + @param netname_prop An (optional) property name to which to attach the net name + @param cell_name_prefix Chooses recursive mode if non-null + @param device_cell_name_prefix See above + """ + def build_nets(self, nets: Sequence[Net], cmap: CellMapping, target: Layout, lmap: Dict[int, Region], net_cell_name_prefix: Optional[Any] = ..., netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: + r""" + @brief Like \build_all_nets, but with the ability to select some nets. + """ + @overload + def cell_mapping_into(self, layout: Layout, cell: Cell, nets: Sequence[Net], with_device_cells: Optional[bool] = ...) -> CellMapping: + r""" + @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. + This version will only create cells which are required to represent the nets from the 'nets' argument. + + If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. + Use this option, if you want to access device terminal shapes per device. + + CAUTION: this function may create new cells in 'layout'. Use \const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it. + """ + @overload + def cell_mapping_into(self, layout: Layout, cell: Cell, with_device_cells: Optional[bool] = ...) -> CellMapping: + r""" + @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. + If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. + Use this option, if you want to access device terminal shapes per device. + + CAUTION: this function may create new cells in 'layout'. Use \const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it. + """ + def clear_join_net_names(self) -> None: + r""" + @brief Clears all implicit net joining expressions. + See \extract_netlist for more details about this feature. + + This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. + """ + def clear_join_nets(self) -> None: + r""" + @brief Clears all explicit net joining expressions. + See \extract_netlist for more details about this feature. + + Explicit net joining has been introduced in version 0.27. + """ + @overload + def connect(self, a: Region, b: Region) -> None: + r""" + @brief Defines an inter-layer connection for the given layers. + The conditions mentioned with intra-layer \connect apply for this method too. + """ + @overload + def connect(self, a: Region, b: Texts) -> None: + r""" + @brief Defines an inter-layer connection for the given layers. + The conditions mentioned with intra-layer \connect apply for this method too. + As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons. + + This variant has been introduced in version 0.27. + """ + @overload + def connect(self, a: Texts, b: Region) -> None: + r""" + @brief Defines an inter-layer connection for the given layers. + The conditions mentioned with intra-layer \connect apply for this method too. + As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons. + + This variant has been introduced in version 0.27. + """ + @overload + def connect(self, l: Region) -> None: + r""" + @brief Defines an intra-layer connection for the given layer. + The layer is either an original layer created with \make_includelayer and it's variants or + a derived layer. Certain limitations apply. It's safe to use + boolean operations for deriving layers. Other operations are applicable as long as they are + capable of delivering hierarchical layers. + """ + @overload + def connect_global(self, l: Region, global_net_name: str) -> int: + r""" + @brief Defines a connection of the given layer with a global net. + This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. + """ + @overload + def connect_global(self, l: Texts, global_net_name: str) -> int: + r""" + @brief Defines a connection of the given text layer with a global net. + This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. + This variant has been introduced in version 0.27. + """ + def const_cell_mapping_into(self, layout: Layout, cell: Cell) -> CellMapping: + r""" + @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. + This version will not create new cells in the target layout. + If the required cells do not exist there yet, flatting will happen. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dss(self) -> DeepShapeStore: + r""" + @brief Gets a reference to the internal DSS object. + """ + def dump_joined_net_names(self) -> str: + r""" + @hide + """ + def dump_joined_net_names_per_cell(self) -> str: + r""" + @hide + """ + def dump_joined_nets(self) -> str: + r""" + @hide + """ + def dump_joined_nets_per_cell(self) -> str: + r""" + @hide + """ + def extract_devices(self, extractor: DeviceExtractorBase, layers: Dict[str, ShapeCollection]) -> None: + r""" + @brief Extracts devices + See the class description for more details. + This method will run device extraction for the given extractor. The layer map is specific + for the extractor and uses the region objects derived with \make_layer and it's variants. + + In addition, derived regions can be passed too. Certain limitations apply. It's safe to use + boolean operations for deriving layers. Other operations are applicable as long as they are + capable of delivering hierarchical layers. + + If errors occur, the device extractor will contain theses errors. + """ + def extract_netlist(self) -> None: + r""" + @brief Runs the netlist extraction + + See the class description for more details. + + This method has been made parameter-less in version 0.27. Use \include_floating_subcircuits= and \join_net_names as substitutes for the arguments of previous versions. + """ + def filename(self) -> str: + r""" + @brief Gets the file name of the database + The filename is the name under which the database is stored or empty if it is not associated with a file. + """ + def global_net_name(self, global_net_id: int) -> str: + r""" + @brief Gets the global net name for the given global net ID. + """ + def internal_layout(self) -> Layout: + r""" + @brief Gets the internal layout + Usually it should not be required to obtain the internal layout. If you need to do so, make sure not to modify the layout as + the functionality of the netlist extractor depends on it. + """ + def internal_top_cell(self) -> Cell: + r""" + @brief Gets the internal top cell + Usually it should not be required to obtain the internal cell. If you need to do so, make sure not to modify the cell as + the functionality of the netlist extractor depends on it. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_extracted(self) -> bool: + r""" + @brief Gets a value indicating whether the netlist has been extracted + + This method has been introduced in version 0.27.1. + """ + @overload + def is_persisted(self, layer: Region) -> bool: + r""" + @brief Returns true, if the given layer is a persisted region. + Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Named layers are persisted, unnamed layers are not. Only persisted, named layers can be put into \connect. + """ + @overload + def is_persisted(self, layer: Texts) -> bool: + r""" + @brief Returns true, if the given layer is a persisted texts collection. + Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Named layers are persisted, unnamed layers are not. Only persisted, named layers can be put into \connect. + + The variant for Texts collections has been added in version 0.27. + """ + @overload + def join_net_names(self, cell_pattern: str, pattern: str) -> None: + r""" + @brief Specifies another pattern for implicit joining of nets for the cells from the given cell pattern. + This method allows applying implicit net joining for specific cells, not only for the top cell. + + This method adds a new pattern. Use \clear_join_net_names to clear the registered pattern. + + This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. + """ + @overload + def join_net_names(self, pattern: str) -> None: + r""" + @brief Specifies another pattern for implicit joining of nets for the top level cell. + Use this method to register a pattern for net labels considered in implicit net joining. Implicit net joining allows connecting multiple parts of the same nets (e.g. supply rails) without need for a physical connection. The pattern specifies labels to look for. When parts are labelled with a name matching the expression, the parts carrying the same name are joined. + + This method adds a new pattern. Use \clear_join_net_names to clear the registered pattern. + + Each pattern is a glob expression. Valid glob expressions are: + @ul + @li "" no implicit connections.@/li + @li "*" to make all labels candidates for implicit connections.@/li + @li "VDD" to make all 'VDD'' nets candidates for implicit connections.@/li + @li "VDD" to make all 'VDD'+suffix nets candidates for implicit connections.@/li + @li "{VDD,VSS}" to all VDD and VSS nets candidates for implicit connections.@/li + @/ul + + Label matching is case sensitive. + + This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. + """ + @overload + def join_nets(self, cell_pattern: str, net_names: Sequence[str]) -> None: + r""" + @brief Specifies another name list for explicit joining of nets for the cells from the given cell pattern. + This method allows applying explicit net joining for specific cells, not only for the top cell. + + This method adds a new name list. Use \clear_join_nets to clear the registered pattern. + + Explicit net joining has been introduced in version 0.27. + """ + @overload + def join_nets(self, net_names: Sequence[str]) -> None: + r""" + @brief Specifies another name list for explicit joining of nets for the top level cell. + Use this method to join nets from the set of net names. All these nets will be connected together forming a single net. + Explicit joining will imply implicit joining for the involved nets - partial nets involved will be connected too (intra-net joining). + + This method adds a new name list. Use \clear_join_nets to clear the registered pattern. + + Explicit net joining has been introduced in version 0.27. + """ + def keep_dss(self) -> None: + r""" + @brief Resumes ownership over the DSS object if created with an external one. + """ + def layer_by_index(self, index: int) -> Region: + r""" + @brief Gets a layer object for the given index. + Only named layers can be retrieved with this method. The returned object is a copy which represents the named layer. + """ + def layer_by_name(self, name: str) -> Region: + r""" + @brief Gets a layer object for the given name. + The returned object is a copy which represents the named layer. + """ + @overload + def layer_name(self, l: ShapeCollection) -> str: + r""" + @brief Gets the name of the given layer + """ + @overload + def layer_name(self, l: int) -> str: + r""" + @brief Gets the name of the given layer (by index) + """ + def layer_names(self) -> List[str]: + r""" + @brief Returns a list of names of the layer kept inside the LayoutToNetlist object. + """ + @overload + def layer_of(self, l: Region) -> int: + r""" + @brief Gets the internal layer for a given extraction layer + This method is required to derive the internal layer index - for example for + investigating the cluster tree. + """ + @overload + def layer_of(self, l: Texts) -> int: + r""" + @brief Gets the internal layer for a given text collection + This method is required to derive the internal layer index - for example for + investigating the cluster tree. + + The variant for Texts collections has been added in version 0.27. + """ + @overload + def make_layer(self, layer_index: int, name: Optional[str] = ...) -> Region: + r""" + @brief Creates a new hierarchical region representing an original layer + 'layer_index' is the layer index of the desired layer in the original layout. + This variant produces polygons and takes texts for net name annotation. + A variant not taking texts is \make_polygon_layer. A Variant only taking + texts is \make_text_layer. + + The name is optional. If given, the layer will already be named accordingly (see \register). + """ + @overload + def make_layer(self, name: Optional[str] = ...) -> Region: + r""" + @brief Creates a new, empty hierarchical region + + The name is optional. If given, the layer will already be named accordingly (see \register). + """ + def make_polygon_layer(self, layer_index: int, name: Optional[str] = ...) -> Region: + r""" + @brief Creates a new region representing an original layer taking polygons and texts + See \make_layer for details. + + The name is optional. If given, the layer will already be named accordingly (see \register). + """ + def make_text_layer(self, layer_index: int, name: Optional[str] = ...) -> Texts: + r""" + @brief Creates a new region representing an original layer taking texts only + See \make_layer for details. + + The name is optional. If given, the layer will already be named accordingly (see \register). + + Starting with version 0.27, this method returns a \Texts object. + """ + def netlist(self) -> Netlist: + r""" + @brief gets the netlist extracted (0 if no extraction happened yet) + """ + @overload + def probe_net(self, of_layer: Region, point: DPoint, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: + r""" + @brief Finds the net by probing a specific location on the given layer + + This method will find a net looking at the given layer at the specific position. + It will traverse the hierarchy below if no shape in the requested layer is found + in the specified location. The function will report the topmost net from far above the + hierarchy of circuits as possible. + + If \initial_circuit is given, the probing will start from this circuit and from the cell this circuit represents. By default, the probing will start from the top circuit. + + If no net is found at all, 0 is returned. + + It is recommended to use \probe_net on the netlist right after extraction. + Optimization functions such as \Netlist#purge will remove parts of the net which means + shape to net probing may no longer work for these nets. + + If non-null and an array, 'sc_path_out' will receive a list of \SubCircuits objects which lead to the net from the top circuit of the database. + + This variant accepts a micrometer-unit location. The location is given in the + coordinate space of the initial cell. + + The \sc_path_out and \initial_circuit parameters have been added in version 0.27. + """ + @overload + def probe_net(self, of_layer: Region, point: Point, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: + r""" + @brief Finds the net by probing a specific location on the given layer + See the description of the other \probe_net variant. + This variant accepts a database-unit location. The location is given in the + coordinate space of the initial cell. + + The \sc_path_out and \initial_circuit parameters have been added in version 0.27. + """ + def read(self, path: str) -> None: + r""" + @brief Reads the extracted netlist from the file. + This method employs the native format of KLayout. + """ + def read_l2n(self, path: str) -> None: + r""" + @brief Reads the extracted netlist from the file. + This method employs the native format of KLayout. + """ + def register(self, l: ShapeCollection, n: Optional[str] = ...) -> None: + r""" + @brief Names the given layer + 'l' must be a \Region or \Texts object. + Flat regions or text collections must be registered with this function, before they can be used in \connect. Registering will copy the shapes into the LayoutToNetlist object in this step to enable netlist extraction. + + Naming a layer allows the system to indicate the layer in various contexts, i.e. when writing the data to a file. Named layers are also persisted inside the LayoutToNetlist object. They are not discarded when the Region object is destroyed. + + If required, the system will assign a name automatically. + This method has been generalized in version 0.27. + """ + def reset_extracted(self) -> None: + r""" + @brief Resets the extracted netlist and enables re-extraction + This method is implicitly called when using \connect or \connect_global after a netlist has been extracted. + This enables incremental connect with re-extraction. + + This method has been introduced in version 0.27.1. + """ + @overload + def shapes_of_net(self, net: Net, of_layer: Region, recursive: Optional[bool] = ..., trans: Optional[ICplxTrans] = ...) -> Region: + r""" + @brief Returns all shapes of a specific net and layer. + If 'recursive'' is true, the returned region will contain the shapes of + all subcircuits too. + + The optional 'trans' parameter allows applying a transformation to all shapes. It has been introduced in version 0.28.4. + """ + @overload + def shapes_of_net(self, net: Net, of_layer: Region, recursive: bool, to: Shapes, propid: Optional[int] = ..., trans: Optional[ICplxTrans] = ...) -> None: + r""" + @brief Sends all shapes of a specific net and layer to the given Shapes container. + If 'recursive'' is true, the returned region will contain the shapes of + all subcircuits too. + "prop_id" is an optional properties ID. If given, this property set will be attached to the shapes. + The optional 'trans' parameter allows applying a transformation to all shapes. It has been introduced in version 0.28.4. + """ + def write(self, path: str, short_format: Optional[bool] = ...) -> None: + r""" + @brief Writes the extracted netlist to a file. + This method employs the native format of KLayout. + """ + def write_l2n(self, path: str, short_format: Optional[bool] = ...) -> None: + r""" + @brief Writes the extracted netlist to a file. + This method employs the native format of KLayout. + """ + +class LayoutVsSchematic(LayoutToNetlist): + r""" + @brief A generic framework for doing LVS (layout vs. schematic) + + This class extends the concept of the netlist extraction from a layout to LVS verification. It does so by adding these concepts to the \LayoutToNetlist class: + + @ul + @li A reference netlist. This will be the netlist against which the layout-derived netlist is compared against. See \reference and \reference=. + @/li + @li A compare step. During the compare the layout-derived netlist and the reference netlists are compared. The compare results are captured in the cross-reference object. See \compare and \NetlistComparer for the comparer object. + @/li + @li A cross-reference. This object (of class \NetlistCrossReference) will keep the relations between the objects of the two netlists. It also lists the differences between the netlists. See \xref about how to access this object.@/li + @/ul + + The LVS object can be persisted to and from a file in a specific format, so it is sometimes referred to as the "LVS database". + + LVS objects can be attached to layout views with \LayoutView#add_lvsdb so they become available in the netlist database browser. + + This class has been introduced in version 0.26. + """ + reference: Netlist + r""" + Getter: + @brief Gets the reference netlist. + + Setter: + @brief Sets the reference netlist. + This will set the reference netlist used inside \compare as the second netlist to compare against the layout-extracted netlist. + + The LVS object will take ownership over the netlist - i.e. if it goes out of scope, the reference netlist is deleted. + """ + @overload + @classmethod + def new(cls) -> LayoutVsSchematic: + r""" + @brief Creates a new LVS object + The main objective for this constructor is to create an object suitable for reading and writing LVS database files. + """ + @overload + @classmethod + def new(cls, dss: DeepShapeStore) -> LayoutVsSchematic: + r""" + @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + @overload + @classmethod + def new(cls, dss: DeepShapeStore, layout_index: int) -> LayoutVsSchematic: + r""" + @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + @overload + @classmethod + def new(cls, iter: RecursiveShapeIterator) -> LayoutVsSchematic: + r""" + @brief Creates a new LVS object with the extractor connected to an original layout + This constructor will attach the extractor of the LVS object to an original layout through the shape iterator. + """ + @overload + @classmethod + def new(cls, topcell_name: str, dbu: float) -> LayoutVsSchematic: + r""" + @brief Creates a new LVS object with the extractor object taking a flat DSS + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a new LVS object + The main objective for this constructor is to create an object suitable for reading and writing LVS database files. + """ + @overload + def __init__(self, dss: DeepShapeStore) -> None: + r""" + @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + @overload + def __init__(self, dss: DeepShapeStore, layout_index: int) -> None: + r""" + @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + @overload + def __init__(self, iter: RecursiveShapeIterator) -> None: + r""" + @brief Creates a new LVS object with the extractor connected to an original layout + This constructor will attach the extractor of the LVS object to an original layout through the shape iterator. + """ + @overload + def __init__(self, topcell_name: str, dbu: float) -> None: + r""" + @brief Creates a new LVS object with the extractor object taking a flat DSS + See the corresponding constructor of the \LayoutToNetlist object for more details. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def compare(self, comparer: NetlistComparer) -> bool: + r""" + @brief Compare the layout-extracted netlist against the reference netlist using the given netlist comparer. + """ + def read(self, path: str) -> None: + r""" + @brief Reads the LVS object from the file. + This method employs the native format of KLayout. + """ + def read_l2n(self, path: str) -> None: + r""" + @brief Reads the \LayoutToNetlist part of the object from a file. + This method employs the native format of KLayout. + """ + def write(self, path: str, short_format: Optional[bool] = ...) -> None: + r""" + @brief Writes the LVS object to a file. + This method employs the native format of KLayout. + """ + def write_l2n(self, path: str, short_format: Optional[bool] = ...) -> None: + r""" + @brief Writes the \LayoutToNetlist part of the object to a file. + This method employs the native format of KLayout. + """ + def xref(self) -> NetlistCrossReference: + r""" + @brief Gets the cross-reference object + The cross-reference object is created while comparing the layout-extracted netlist against the reference netlist - i.e. during \compare. Before \compare is called, this object is nil. + It holds the results of the comparison - a cross-reference between the nets and other objects in the match case and a listing of non-matching nets and other objects for the non-matching cases. + See \NetlistCrossReference for more details. + """ + +class Library: + r""" + @brief A Library + + A library is basically a wrapper around a layout object. The layout object + provides cells and potentially PCells that can be imported into other layouts. + + The library provides a name which is used to identify the library and a description + which is used for identifying the library in a user interface. + + After a library is created and the layout is filled, it must be registered using the register method. + + This class has been introduced in version 0.22. + """ + description: str + r""" + Getter: + @brief Returns the libraries' description text + + Setter: + @brief Sets the libraries' description text + """ + technology: str + r""" + Getter: + @brief Returns name of the technology the library is associated with + If this attribute is a non-empty string, this library is only offered for selection if the current layout uses this technology. + + This attribute has been introduced in version 0.25. In version 0.27 this attribute is deprecated as a library can now be associated with multiple technologies. + Setter: + @brief sets the name of the technology the library is associated with + + See \technology for details. This attribute has been introduced in version 0.25. In version 0.27, a library can be associated with multiple technologies and this method will revert the selection to a single one. Passing an empty string is equivalent to \clear_technologies. + """ + @classmethod + def library_by_id(cls, id: int) -> Library: + r""" + @brief Gets the library object for the given ID + If the ID is not valid, nil is returned. + + This method has been introduced in version 0.27. + """ + @classmethod + def library_by_name(cls, name: str, for_technology: Optional[str] = ...) -> Library: + r""" + @brief Gets a library by name + Returns the library object for the given name. If the name is not a valid + library name, nil is returned. + + Different libraries can be registered under the same names for different technologies. When a technology name is given in 'for_technologies', the first library matching this technology is returned. If no technology is given, the first library is returned. + + The technology selector has been introduced in version 0.27. + """ + @classmethod + def library_ids(cls) -> List[int]: + r""" + @brief Returns a list of valid library IDs. + See \library_names for the reasoning behind this method. + This method has been introduced in version 0.27. + """ + @classmethod + def library_names(cls) -> List[str]: + r""" + @brief Returns a list of the names of all libraries registered in the system. + + NOTE: starting with version 0.27, the name of a library does not need to be unique if libraries are associated with specific technologies. This method will only return the names and it's not possible not unambiguously derive the library object. It is recommended to use \library_ids and \library_by_id to obtain the library unambiguously. + """ + @classmethod + def new(cls) -> Library: + r""" + @brief Creates a new, empty library + """ + def __copy__(self) -> Library: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Library: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new, empty library + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_technology(self, tech: str) -> None: + r""" + @brief Additionally associates the library with the given technology. + See also \clear_technologies. + + This method has been introduced in version 0.27 + """ + def assign(self, other: Library) -> None: + r""" + @brief Assigns another object to self + """ + def clear_technologies(self) -> None: + r""" + @brief Clears the list of technologies the library is associated with. + See also \add_technology. + + This method has been introduced in version 0.27 + """ + def create(self) -> None: + r""" + @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. + """ + def delete(self) -> None: + r""" + @brief Deletes the library + + This method will delete the library object. Library proxies pointing to this library will become invalid and the library object cannot be used any more after calling this method. + + This method has been introduced in version 0.25. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> Library: + r""" + @brief Creates a copy of self + """ + def for_technologies(self) -> bool: + r""" + @brief Returns a value indicating whether the library is associated with any technology. + The method is equivalent to checking whether the \technologies list is empty. + + This method has been introduced in version 0.27 + """ + def id(self) -> int: + r""" + @brief Returns the library's ID + The ID is set when the library is registered and cannot be changed + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_for_technology(self, tech: str) -> bool: + r""" + @brief Returns a value indicating whether the library is associated with the given technology. + This method has been introduced in version 0.27 + """ + def layout(self) -> Layout: + r""" + @brief The layout object where the cells reside that this library defines + """ + def layout_const(self) -> Layout: + r""" + @brief The layout object where the cells reside that this library defines (const version) + """ + def name(self) -> str: + r""" + @brief Returns the libraries' name + The name is set when the library is registered and cannot be changed + """ + def refresh(self) -> None: + r""" + @brief Updates all layouts using this library. + This method will retire cells or update layouts in the attached clients. + It will also recompute the PCells inside the library. + This method has been introduced in version 0.27.8. + """ + def register(self, name: str) -> None: + r""" + @brief Registers the library with the given name + + This method can be called in the constructor to register the library after + the layout object has been filled with content. If a library with that name + already exists for the same technologies, it will be replaced with this library. + + This method will set the libraries' name. + + The technology specific behaviour has been introduced in version 0.27. + """ + def technologies(self) -> List[str]: + r""" + @brief Gets the list of technologies this library is associated with. + This method has been introduced in version 0.27 + """ + +class LoadLayoutOptions: + r""" + @brief Layout reader options + + This object describes various layer reader options used for loading layouts. + + This class has been introduced in version 0.18. + """ + class CellConflictResolution: + r""" + @brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. + Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts. + + Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed. + + If the new or existing cell is a ghost cell, both cells are merged always. + + This enum was introduced in version 0.27. + """ + AddToCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief Add content to existing cell + This is the mode use in before version 0.27. Content of new cells is simply added to existing cells with the same name. + """ + OverwriteCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The old cell is overwritten entirely (including child cells which are not used otherwise) + """ + RenameCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The new cell will be renamed to become unique + """ + SkipNewCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The new cell is skipped entirely (including child cells which are not used otherwise) + """ + @overload + @classmethod + def new(cls, i: int) -> LoadLayoutOptions.CellConflictResolution: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> LoadLayoutOptions.CellConflictResolution: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: LoadLayoutOptions.CellConflictResolution) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + AddToCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief Add content to existing cell + This is the mode use in before version 0.27. Content of new cells is simply added to existing cells with the same name. + """ + OverwriteCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The old cell is overwritten entirely (including child cells which are not used otherwise) + """ + RenameCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The new cell will be renamed to become unique + """ + SkipNewCell: ClassVar[LoadLayoutOptions.CellConflictResolution] + r""" + @brief The new cell is skipped entirely (including child cells which are not used otherwise) + """ + cell_conflict_resolution: LoadLayoutOptions.CellConflictResolution + r""" + Getter: + @brief Gets the cell conflict resolution mode + + Multiple layout files can be collected into a single Layout object by reading file after file into the Layout object. Cells with same names are considered a conflict. This mode indicates how such conflicts are resolved. See \LoadLayoutOptions::CellConflictResolution for the values allowed. The default mode is \LoadLayoutOptions::CellConflictResolution#AddToCell. + + This option has been introduced in version 0.27. + Setter: + @brief Sets the cell conflict resolution mode + + See \cell_conflict_resolution for details about this option. + + This option has been introduced in version 0.27. + """ + cif_create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether other layers shall be created + @return True, if other layers will be created. + This attribute acts together with a layer map (see \cif_layer_map=). Layers not listed in this map are created as well when \cif_create_other_layers? is true. Otherwise they are ignored. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + Setter: + @brief Specifies whether other layers shall be created + @param create True, if other layers will be created. + See \cif_create_other_layers? for a description of this attribute. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + cif_dbu: float + r""" + Getter: + @brief Specifies the database unit which the reader uses and produces + See \cif_dbu= method for a description of this property. + This property has been added in version 0.21. + + Setter: + @brief Specifies the database unit which the reader uses and produces + + This property has been added in version 0.21. + """ + cif_keep_layer_names: bool + r""" + Getter: + @brief Gets a value indicating whether layer names are kept + @return True, if layer names are kept. + + When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. + + This method has been added in version 0.25.3. + Setter: + @brief Gets a value indicating whether layer names are kept + @param keep True, if layer names are to be kept. + + See \cif_keep_layer_names? for a description of this property. + + This method has been added in version 0.25.3. + """ + cif_layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map + @return A reference to the layer map + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + + Python note: this method has been turned into a property in version 0.26. + Setter: + @brief Sets the layer map + This sets a layer mapping for the reader. Unlike \cif_set_layer_map, the 'create_other_layers' flag is not changed. + @param map The layer map to set. + + This convenience method has been added in version 0.26. + """ + cif_wire_mode: int + r""" + Getter: + @brief Specifies how to read 'W' objects + See \cif_wire_mode= method for a description of this mode. + This property has been added in version 0.21 and was renamed to cif_wire_mode in 0.25. + + Setter: + @brief How to read 'W' objects + + This property specifies how to read 'W' (wire) objects. + Allowed values are 0 (as square ended paths), 1 (as flush ended paths), 2 (as round paths) + + This property has been added in version 0.21. + """ + create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether other layers shall be created + @return True, if other layers should be created. + This attribute acts together with a layer map (see \layer_map=). Layers not listed in this map are created as well when \create_other_layers? is true. Otherwise they are ignored. + + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + Setter: + @brief Specifies whether other layers shall be created + @param create True, if other layers should be created. + See \create_other_layers? for a description of this attribute. + + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + dxf_circle_accuracy: float + r""" + Getter: + @brief Gets the accuracy of the circle approximation + + This property has been added in version 0.24.9. + + Setter: + @brief Specifies the accuracy of the circle approximation + + In addition to the number of points per circle, the circle accuracy can be specified. If set to a value larger than the database unit, the number of points per circle will be chosen such that the deviation from the ideal circle becomes less than this value. + + The actual number of points will not become bigger than the points specified through \dxf_circle_points=. The accuracy value is given in the DXF file units (see \dxf_unit) which is usually micrometers. + + \dxf_circle_points and \dxf_circle_accuracy also apply to other "round" structures such as arcs, ellipses and splines in the same sense than for circles. + + + This property has been added in version 0.24.9. + """ + dxf_circle_points: int + r""" + Getter: + @brief Gets the number of points used per full circle for arc interpolation + + This property has been added in version 0.21.6. + + Setter: + @brief Specifies the number of points used per full circle for arc interpolation + See also \dxf_circle_accuracy for how to specify the number of points based on an approximation accuracy. + + \dxf_circle_points and \dxf_circle_accuracy also apply to other "round" structures such as arcs, ellipses and splines in the same sense than for circles. + + + This property has been added in version 0.21.6. + """ + dxf_contour_accuracy: float + r""" + Getter: + @brief Gets the accuracy for contour closing + + + This property has been added in version 0.25.3. + + Setter: + @brief Specifies the accuracy for contour closing + + When polylines need to be connected or closed, this + value is used to indicate the accuracy. This is the value (in DXF units) + by which points may be separated and still be considered + connected. The default is 0.0 which implies exact + (within one DBU) closing. + + This value is effective in polyline mode 3 and 4. + + + This property has been added in version 0.25.3. + """ + dxf_create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether other layers shall be created + @return True, if other layers will be created. + This attribute acts together with a layer map (see \dxf_layer_map=). Layers not listed in this map are created as well when \dxf_create_other_layers? is true. Otherwise they are ignored. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + Setter: + @brief Specifies whether other layers shall be created + @param create True, if other layers will be created. + See \dxf_create_other_layers? for a description of this attribute. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + dxf_dbu: float + r""" + Getter: + @brief Specifies the database unit which the reader uses and produces + + This property has been added in version 0.21. + + Setter: + @brief Specifies the database unit which the reader uses and produces + + This property has been added in version 0.21. + """ + dxf_keep_layer_names: bool + r""" + Getter: + @brief Gets a value indicating whether layer names are kept + @return True, if layer names are kept. + + When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. + + This method has been added in version 0.25.3. + Setter: + @brief Gets a value indicating whether layer names are kept + @param keep True, if layer names are to be kept. + + See \cif_keep_layer_names? for a description of this property. + + This method has been added in version 0.25.3. + """ + dxf_keep_other_cells: bool + r""" + Getter: + @brief If this option is true, all cells are kept, not only the top cell and it's children + + This property has been added in version 0.21.15. + + Setter: + @brief If this option is set to true, all cells are kept, not only the top cell and it's children + + This property has been added in version 0.21.15. + """ + dxf_layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map + @return A reference to the layer map + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + Python note: this method has been turned into a property in version 0.26. + Setter: + @brief Sets the layer map + This sets a layer mapping for the reader. Unlike \dxf_set_layer_map, the 'create_other_layers' flag is not changed. + @param map The layer map to set. + + This convenience method has been added in version 0.26. + """ + dxf_polyline_mode: int + r""" + Getter: + @brief Specifies whether closed POLYLINE and LWPOLYLINE entities with width 0 are converted to polygons. + See \dxf_polyline_mode= for a description of this property. + + This property has been added in version 0.21.3. + + Setter: + @brief Specifies how to treat POLYLINE/LWPOLYLINE entities. + The mode is 0 (automatic), 1 (keep lines), 2 (create polygons from closed polylines with width = 0), 3 (merge all lines with width = 0 into polygons), 4 (as 3 plus auto-close open contours). + + This property has been added in version 0.21.3. + """ + dxf_render_texts_as_polygons: bool + r""" + Getter: + @brief If this option is true, text objects are rendered as polygons + + This property has been added in version 0.21.15. + + Setter: + @brief If this option is set to true, text objects are rendered as polygons + + This property has been added in version 0.21.15. + """ + dxf_text_scaling: float + r""" + Getter: + @brief Gets the text scaling factor (see \dxf_text_scaling=) + + This property has been added in version 0.21.20. + + Setter: + @brief Specifies the text scaling in percent of the default scaling + + The default value 100, meaning that the letter pitch is roughly 92 percent of the specified text height. Decrease this value to get smaller fonts and increase it to get larger fonts. + + This property has been added in version 0.21.20. + """ + dxf_unit: float + r""" + Getter: + @brief Specifies the unit in which the DXF file is drawn + + This property has been added in version 0.21.3. + + Setter: + @brief Specifies the unit in which the DXF file is drawn. + + This property has been added in version 0.21.3. + """ + gds2_allow_big_records: bool + r""" + Getter: + @brief Gets a value specifying whether to allow big records with a length of 32768 to 65535 bytes. + See \gds2_allow_big_records= method for a description of this property. + This property has been added in version 0.18. + + Setter: + @brief Allows big records with more than 32767 bytes + + Setting this property to true allows larger records by treating the record length as unsigned short, which for example allows larger polygons (~8000 points rather than ~4000 points) without using multiple XY records. + For strict compatibility with the standard, this property should be set to false. The default is true. + + This property has been added in version 0.18. + """ + gds2_allow_multi_xy_records: bool + r""" + Getter: + @brief Gets a value specifying whether to allow big polygons with multiple XY records. + See \gds2_allow_multi_xy_records= method for a description of this property. + This property has been added in version 0.18. + + Setter: + @brief Allows the use of multiple XY records in BOUNDARY elements for unlimited large polygons + + Setting this property to true allows big polygons that span over multiple XY records. + For strict compatibility with the standard, this property should be set to false. The default is true. + + This property has been added in version 0.18. + """ + gds2_box_mode: int + r""" + Getter: + @brief Gets a value specifying how to treat BOX records + See \gds2_box_mode= method for a description of this mode. + This property has been added in version 0.18. + + Setter: + @brief Sets a value specifying how to treat BOX records + This property specifies how BOX records are treated. + Allowed values are 0 (ignore), 1 (treat as rectangles), 2 (treat as boundaries) or 3 (treat as errors). The default is 1. + + This property has been added in version 0.18. + """ + layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map + @return A reference to the layer map + + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + Python note: this method has been turned into a property in version 0.26. + Setter: + @brief Sets the layer map, but does not affect the "create_other_layers" flag. + Use \create_other_layers? to enable or disable other layers not listed in the layer map. + @param map The layer map to set. + This convenience method has been introduced with version 0.26. + """ + lefdef_config: LEFDEFReaderConfiguration + r""" + Getter: + @brief Gets a copy of the LEF/DEF reader configuration + The LEF/DEF reader configuration is wrapped in a separate object of class \LEFDEFReaderConfiguration. See there for details. + This method will return a copy of the reader configuration. To modify the configuration, modify the copy and set the modified configuration with \lefdef_config=. + + + This method has been added in version 0.25. + + Setter: + @brief Sets the LEF/DEF reader configuration + + + This method has been added in version 0.25. + """ + mag_create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether other layers shall be created + @return True, if other layers will be created. + This attribute acts together with a layer map (see \mag_layer_map=). Layers not listed in this map are created as well when \mag_create_other_layers? is true. Otherwise they are ignored. + + This method has been added in version 0.26.2. + Setter: + @brief Specifies whether other layers shall be created + @param create True, if other layers will be created. + See \mag_create_other_layers? for a description of this attribute. + + This method has been added in version 0.26.2. + """ + mag_dbu: float + r""" + Getter: + @brief Specifies the database unit which the reader uses and produces + See \mag_dbu= method for a description of this property. + + This property has been added in version 0.26.2. + + Setter: + @brief Specifies the database unit which the reader uses and produces + The database unit is the final resolution of the produced layout. This physical resolution is usually defined by the layout system - GDS for example typically uses 1nm (mag_dbu=0.001). + All geometry in the MAG file will first be scaled to \mag_lambda and is then brought to the database unit. + + This property has been added in version 0.26.2. + """ + mag_keep_layer_names: bool + r""" + Getter: + @brief Gets a value indicating whether layer names are kept + @return True, if layer names are kept. + + When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. + + This method has been added in version 0.26.2. + Setter: + @brief Gets a value indicating whether layer names are kept + @param keep True, if layer names are to be kept. + + See \mag_keep_layer_names? for a description of this property. + + This method has been added in version 0.26.2. + """ + mag_lambda: float + r""" + Getter: + @brief Gets the lambda value + See \mag_lambda= method for a description of this attribute. + + This property has been added in version 0.26.2. + + Setter: + @brief Specifies the lambda value to used for reading + + The lambda value is the basic unit of the layout. Magic draws layout as multiples of this basic unit. The layout read by the MAG reader will use the database unit specified by \mag_dbu, but the physical layout coordinates will be multiples of \mag_lambda. + + This property has been added in version 0.26.2. + """ + mag_layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map + @return A reference to the layer map + + This method has been added in version 0.26.2. + Setter: + @brief Sets the layer map + This sets a layer mapping for the reader. Unlike \mag_set_layer_map, the 'create_other_layers' flag is not changed. + @param map The layer map to set. + + This method has been added in version 0.26.2. + """ + mag_library_paths: List[str] + r""" + Getter: + @brief Gets the locations where to look up libraries (in this order) + See \mag_library_paths= method for a description of this attribute. + + This property has been added in version 0.26.2. + + Setter: + @brief Specifies the locations where to look up libraries (in this order) + + The reader will look up library reference in these paths when it can't find them locally. + Relative paths in this collection are resolved relative to the initial file's path. + Expression interpolation is supported in the path strings. + + This property has been added in version 0.26.2. + """ + mag_merge: bool + r""" + Getter: + @brief Gets a value indicating whether boxes are merged into polygons + @return True, if boxes are merged. + + When set to true, the boxes and triangles of the Magic layout files are merged into polygons where possible. + + This method has been added in version 0.26.2. + Setter: + @brief Sets a value indicating whether boxes are merged into polygons + @param merge True, if boxes and triangles will be merged into polygons. + + See \mag_merge? for a description of this property. + + This method has been added in version 0.26.2. + """ + mebes_boundary_datatype: int + r""" + Getter: + @brief Gets the datatype number of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the datatype number of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + """ + mebes_boundary_layer: int + r""" + Getter: + @brief Gets the layer number of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the layer number of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + """ + mebes_boundary_name: str + r""" + Getter: + @brief Gets the name of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the name of the boundary layer to produce + See \mebes_produce_boundary= for a description of this attribute. + + This property has been added in version 0.23.10. + """ + mebes_create_other_layers: bool + r""" + Getter: + @brief Gets a value indicating whether other layers shall be created + @return True, if other layers will be created. + This attribute acts together with a layer map (see \mebes_layer_map=). Layers not listed in this map are created as well when \mebes_create_other_layers? is true. Otherwise they are ignored. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + Setter: + @brief Specifies whether other layers shall be created + @param create True, if other layers will be created. + See \mebes_create_other_layers? for a description of this attribute. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + mebes_data_datatype: int + r""" + Getter: + @brief Gets the datatype number of the data layer to produce + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the datatype number of the data layer to produce + + This property has been added in version 0.23.10. + """ + mebes_data_layer: int + r""" + Getter: + @brief Gets the layer number of the data layer to produce + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the layer number of the data layer to produce + + This property has been added in version 0.23.10. + """ + mebes_data_name: str + r""" + Getter: + @brief Gets the name of the data layer to produce + + This property has been added in version 0.23.10. + + Setter: + @brief Sets the name of the data layer to produce + + This property has been added in version 0.23.10. + """ + mebes_invert: bool + r""" + Getter: + @brief Gets a value indicating whether to invert the MEBES pattern + If this property is set to true, the pattern will be inverted. + + This property has been added in version 0.22. + + Setter: + @brief Specify whether to invert the MEBES pattern + If this property is set to true, the pattern will be inverted. + + This property has been added in version 0.22. + """ + mebes_layer_map: LayerMap + r""" + Getter: + @brief Gets the layer map + @return The layer map. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + Setter: + @brief Sets the layer map + This sets a layer mapping for the reader. Unlike \mebes_set_layer_map, the 'create_other_layers' flag is not changed. + @param map The layer map to set. + + This convenience method has been added in version 0.26.2. + """ + mebes_num_shapes_per_cell: int + r""" + Getter: + @brief Gets the number of stripes collected per cell + See \mebes_num_stripes_per_cell= for details about this property. + + This property has been added in version 0.24.5. + + Setter: + @brief Specify the number of stripes collected per cell + See \mebes_num_stripes_per_cell= for details about this property. + + This property has been added in version 0.24.5. + """ + mebes_num_stripes_per_cell: int + r""" + Getter: + @brief Gets the number of stripes collected per cell + See \mebes_num_stripes_per_cell= for details about this property. + + This property has been added in version 0.23.10. + + Setter: + @brief Specify the number of stripes collected per cell + This property specifies how many stripes will be collected into one cell. + A smaller value means less but bigger cells. The default value is 64. + New cells will be formed whenever more than this number of stripes has been read + or a new segment is started and the number of shapes given by \mebes_num_shapes_per_cell + is exceeded. + + This property has been added in version 0.23.10. + """ + mebes_produce_boundary: bool + r""" + Getter: + @brief Gets a value indicating whether a boundary layer will be produced + See \mebes_produce_boundary= for details about this property. + + This property has been added in version 0.23.10. + + Setter: + @brief Specify whether to produce a boundary layer + If this property is set to true, the pattern boundary will be written to the layer and datatype specified with \mebes_boundary_name, \mebes_boundary_layer and \mebes_boundary_datatype. + By default, the boundary layer is produced. + + This property has been added in version 0.23.10. + """ + mebes_subresolution: bool + r""" + Getter: + @brief Gets a value indicating whether to invert the MEBES pattern + See \subresolution= for details about this property. + + This property has been added in version 0.23.10. + + Setter: + @brief Specify whether subresolution trapezoids are supported + If this property is set to true, subresolution trapezoid vertices are supported. + In order to implement support, the reader will create magnified instances with a magnification of 1/16. + By default this property is enabled. + + This property has been added in version 0.23.10. + """ + mebes_top_cell_index: int + r""" + Getter: + @brief Gets the cell index for the top cell to use + See \mebes_top_cell_index= for a description of this property. + + This property has been added in version 0.23.10. + + Setter: + @brief Specify the cell index for the top cell to use + If this property is set to a valid cell index, the MEBES reader will put the subcells and shapes into this cell. + + This property has been added in version 0.23.10. + """ + oasis_expect_strict_mode: int + r""" + Getter: + @hide + Setter: + @hide + """ + oasis_read_all_properties: int + r""" + Getter: + @hide + Setter: + @hide + """ + properties_enabled: bool + r""" + Getter: + @brief Gets a value indicating whether properties shall be read + @return True, if properties should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + Setter: + @brief Specifies whether properties should be read + @param enabled True, if properties should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + text_enabled: bool + r""" + Getter: + @brief Gets a value indicating whether text objects shall be read + @return True, if text objects should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + Setter: + @brief Specifies whether text objects shall be read + @param enabled True, if text objects should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + warn_level: int + r""" + Getter: + @brief Sets the warning level. + See \warn_level= for details about this attribute. + + This attribute has been added in version 0.28. + Setter: + @brief Sets the warning level. + The warning level is a reader-specific setting which enables or disables warnings + on specific levels. Level 0 is always "warnings off". The default level is 1 + which means "reasonable warnings emitted". + + This attribute has been added in version 0.28. + """ + @classmethod + def from_technology(cls, technology: str) -> LoadLayoutOptions: + r""" + @brief Gets the reader options of a given technology + @param technology The name of the technology to apply + Returns the reader options of a specific technology. If the technology name is not valid or an empty string, the reader options of the default technology are returned. + + This method has been introduced in version 0.25 + """ + @classmethod + def new(cls) -> LoadLayoutOptions: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> LoadLayoutOptions: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> LoadLayoutOptions: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: LoadLayoutOptions) -> None: + r""" + @brief Assigns another object to self + """ + def cif_select_all_layers(self) -> None: + r""" + @brief Selects all layers and disables the layer map + + This disables any layer map and enables reading of all layers. + New layers will be created when required. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def cif_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: + r""" + @brief Sets the layer map + This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. + @param map The layer map to set. + @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> LoadLayoutOptions: + r""" + @brief Creates a copy of self + """ + def dxf_select_all_layers(self) -> None: + r""" + @brief Selects all layers and disables the layer map + + This disables any layer map and enables reading of all layers. + New layers will be created when required. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def dxf_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: + r""" + @brief Sets the layer map + This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. + @param map The layer map to set. + @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_properties_enabled(self) -> bool: + r""" + @brief Gets a value indicating whether properties shall be read + @return True, if properties should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + def is_text_enabled(self) -> bool: + r""" + @brief Gets a value indicating whether text objects shall be read + @return True, if text objects should be read. + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + def mag_select_all_layers(self) -> None: + r""" + @brief Selects all layers and disables the layer map + + This disables any layer map and enables reading of all layers. + New layers will be created when required. + + This method has been added in version 0.26.2. + """ + def mag_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: + r""" + @brief Sets the layer map + This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. + @param map The layer map to set. + @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. + + This method has been added in version 0.26.2. + """ + def mebes_select_all_layers(self) -> None: + r""" + @brief Selects all layers and disables the layer map + + This disables any layer map and enables reading of all layers. + New layers will be created when required. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def mebes_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: + r""" + @brief Sets the layer map + This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers. + @param map The layer map to set. + @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. + + This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. + """ + def select_all_layers(self) -> None: + r""" + @brief Selects all layers and disables the layer map + + This disables any layer map and enables reading of all layers. + New layers will be created when required. + + Starting with version 0.25 this method only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + def set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: + r""" + @brief Sets the layer map + This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to add a layer name. + @param map The layer map to set.@param create_other_layers The flag telling whether other layer should be created as well. Set to false if just the layers in the mapping table should be read. + + Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + """ + +class Manager: + r""" + @brief A transaction manager class + + Manager objects control layout and potentially other objects in the layout database and queue operations to form transactions. A transaction is a sequence of operations that can be undone or redone. + + In order to equip a layout object with undo/redo support, instantiate the layout object with a manager attached and embrace the operations to undo/redo with transaction/commit calls. + + The use of transactions is subject to certain constraints, i.e. transacted sequences may not be mixed with non-transacted ones. + + This class has been introduced in version 0.19. + """ + @classmethod + def new(cls) -> Manager: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> Manager: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Manager: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Manager) -> None: + r""" + @brief Assigns another object to self + """ + def commit(self) -> None: + r""" + @brief Close a transaction. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> Manager: + r""" + @brief Creates a copy of self + """ + def has_redo(self) -> bool: + r""" + @brief Determine if a transaction is available for 'redo' + + @return True, if a transaction is available. + """ + def has_undo(self) -> bool: + r""" + @brief Determine if a transaction is available for 'undo' + + @return True, if a transaction is available. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def redo(self) -> None: + r""" + @brief Redo the next available transaction + + The next transaction is redone with this method. + The 'has_redo' method can be used to determine whether + there are transactions to undo. + """ + @overload + def transaction(self, description: str) -> int: + r""" + @brief Begin a transaction + + + This call will open a new transaction. A transaction consists + of a set of operations issued with the 'queue' method. + A transaction is closed with the 'commit' method. + + @param description The description for this transaction. + + @return The ID of the transaction (can be used to join other transactions with this one) + """ + @overload + def transaction(self, description: str, join_with: int) -> int: + r""" + @brief Begin a joined transaction + + + This call will open a new transaction and join if with the previous transaction. + The ID of the previous transaction must be equal to the ID given with 'join_with'. + + This overload was introduced in version 0.22. + + @param description The description for this transaction (ignored if joined). + @param description The ID of the previous transaction. + + @return The ID of the new transaction (can be used to join more) + """ + def transaction_for_redo(self) -> str: + r""" + @brief Return the description of the next transaction for 'redo' + """ + def transaction_for_undo(self) -> str: + r""" + @brief Return the description of the next transaction for 'undo' + """ + def undo(self) -> None: + r""" + @brief Undo the current transaction + + The current transaction is undone with this method. + The 'has_undo' method can be used to determine whether + there are transactions to undo. + """ + +class Matrix2d: + r""" + @brief A 2d matrix object used mainly for representing rotation and shear transformations. + + This object represents a 2x2 matrix. This matrix is used to implement affine transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation and shear. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification and shear. + + The matrix is a generalization of the transformations and is of limited use in a layout database context. It is useful however to implement shear transformations on polygons, edges and polygon or edge collections. + + This class was introduced in version 0.22. + """ + @overload + @classmethod + def new(cls) -> Matrix2d: + r""" + @brief Create a new Matrix2d representing a unit transformation + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float) -> Matrix2d: + r""" + @brief Create a new Matrix2d from the four coefficients + """ + @overload + @classmethod + def new(cls, m: float) -> Matrix2d: + r""" + @brief Create a new Matrix2d representing an isotropic magnification + @param m The magnification + """ + @overload + @classmethod + def new(cls, mx: float, my: float) -> Matrix2d: + r""" + @brief Create a new Matrix2d representing an anisotropic magnification + @param mx The magnification in x direction + @param my The magnification in y direction + """ + @overload + @classmethod + def new(cls, t: DCplxTrans) -> Matrix2d: + r""" + @brief Create a new Matrix2d from the given complex transformation@param t The transformation from which to create the matrix (not taking into account the displacement) + """ + @overload + @classmethod + def newc(cls, mag: float, rotation: float, mirror: bool) -> Matrix2d: + r""" + @brief Create a new Matrix2d representing an isotropic magnification, rotation and mirroring + @param mag The magnification in x direction + @param rotation The rotation angle (in degree) + @param mirror The mirror flag (at x axis) + + This constructor is provided to construct a matrix similar to the complex transformation. + This constructor is called 'newc' to distinguish it from the constructors taking matrix coefficients ('c' is for composite). + The order of execution of the operations is mirror, magnification, rotation (as for complex transformations). + """ + @overload + @classmethod + def newc(cls, shear: float, mx: float, my: float, rotation: float, mirror: bool) -> Matrix2d: + r""" + @brief Create a new Matrix2d representing a shear, anisotropic magnification, rotation and mirroring + @param shear The shear angle + @param mx The magnification in x direction + @param my The magnification in y direction + @param rotation The rotation angle (in degree) + @param mirror The mirror flag (at x axis) + + The order of execution of the operations is mirror, magnification, shear and rotation. + This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). + """ + def __add__(self, m: Matrix2d) -> Matrix2d: + r""" + @brief Sum of two matrices. + @param m The other matrix. + @return The (element-wise) sum of self+m + """ + def __copy__(self) -> Matrix2d: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Matrix2d: + r""" + @brief Creates a copy of self + """ + @overload + def __init__(self) -> None: + r""" + @brief Create a new Matrix2d representing a unit transformation + """ + @overload + def __init__(self, m11: float, m12: float, m21: float, m22: float) -> None: + r""" + @brief Create a new Matrix2d from the four coefficients + """ + @overload + def __init__(self, m: float) -> None: + r""" + @brief Create a new Matrix2d representing an isotropic magnification + @param m The magnification + """ + @overload + def __init__(self, mx: float, my: float) -> None: + r""" + @brief Create a new Matrix2d representing an anisotropic magnification + @param mx The magnification in x direction + @param my The magnification in y direction + """ + @overload + def __init__(self, t: DCplxTrans) -> None: + r""" + @brief Create a new Matrix2d from the given complex transformation@param t The transformation from which to create the matrix (not taking into account the displacement) + """ + @overload + def __mul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __mul__(self, e: DEdge) -> DEdge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __mul__(self, m: Matrix2d) -> Matrix2d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __mul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __mul__(self, p: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __mul__(self, p: DSimplePolygon) -> DSimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __mul__(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __rmul__(self, e: DEdge) -> DEdge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __rmul__(self, m: Matrix2d) -> Matrix2d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __rmul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __rmul__(self, p: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __rmul__(self, p: DSimplePolygon) -> DSimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __rmul__(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ + def __str__(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def angle(self) -> float: + r""" + @brief Returns the rotation angle of the rotation component of this matrix. + @return The angle in degree. + The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. + """ + def assign(self, other: Matrix2d) -> None: + r""" + @brief Assigns another object to self + """ + def cplx_trans(self) -> DCplxTrans: + r""" + @brief Converts this matrix to a complex transformation (if possible). + @return The complex transformation. + This method is successful only if the matrix does not contain shear components and the magnification must be isotropic. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> Matrix2d: + r""" + @brief Creates a copy of self + """ + def inverted(self) -> Matrix2d: + r""" + @brief The inverse of this matrix. + @return The inverse of this matrix + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_mirror(self) -> bool: + r""" + @brief Returns the mirror flag of this matrix. + @return True if this matrix has a mirror component. + The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. + """ + def m(self, i: int, j: int) -> float: + r""" + @brief Gets the m coefficient with the given index. + @return The coefficient [i,j] + """ + def m11(self) -> float: + r""" + @brief Gets the m11 coefficient. + @return The value of the m11 coefficient + """ + def m12(self) -> float: + r""" + @brief Gets the m12 coefficient. + @return The value of the m12 coefficient + """ + def m21(self) -> float: + r""" + @brief Gets the m21 coefficient. + @return The value of the m21 coefficient + """ + def m22(self) -> float: + r""" + @brief Gets the m22 coefficient. + @return The value of the m22 coefficient + """ + def mag_x(self) -> float: + r""" + @brief Returns the x magnification of the magnification component of this matrix. + @return The magnification factor. + The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation. + """ + def mag_y(self) -> float: + r""" + @brief Returns the y magnification of the magnification component of this matrix. + @return The magnification factor. + The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, magnification, shear and rotation. + """ + def shear_angle(self) -> float: + r""" + @brief Returns the magnitude of the shear component of this matrix. + @return The shear angle in degree. + The matrix is decomposed into basic transformations assuming an execution order of mirroring at the x axis, rotation, magnification and shear. + The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree. + """ + def to_s(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + def trans(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + +class Matrix3d: + r""" + @brief A 3d matrix object used mainly for representing rotation, shear, displacement and perspective transformations. + + This object represents a 3x3 matrix. This matrix is used to implement generic geometrical transformations in the 2d space mainly. It can be decomposed into basic transformations: mirroring, rotation, shear, displacement and perspective distortion. In that case, the assumed execution order of the basic transformations is mirroring at the x axis, rotation, magnification, shear, displacement and perspective distortion. + + This class was introduced in version 0.22. + """ + AdjustAll: ClassVar[int] + r""" + @brief Mode for \adjust: currently equivalent to \adjust_perspective + """ + AdjustDisplacement: ClassVar[int] + r""" + @brief Mode for \adjust: adjust displacement only + """ + AdjustMagnification: ClassVar[int] + r""" + @brief Mode for \adjust: adjust rotation, mirror option and magnification + """ + AdjustNone: ClassVar[int] + r""" + @brief Mode for \adjust: adjust nothing + """ + AdjustPerspective: ClassVar[int] + r""" + @brief Mode for \adjust: adjust whole matrix including perspective transformation + """ + AdjustRotation: ClassVar[int] + r""" + @brief Mode for \adjust: adjust rotation only + """ + AdjustRotationMirror: ClassVar[int] + r""" + @brief Mode for \adjust: adjust rotation and mirror option + """ + AdjustShear: ClassVar[int] + r""" + @brief Mode for \adjust: adjust rotation, mirror option, magnification and shear + """ + @overload + @classmethod + def new(cls) -> Matrix3d: + r""" + @brief Create a new Matrix3d representing a unit transformation + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> Matrix3d: + r""" + @brief Create a new Matrix3d from the nine matrix coefficients + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float) -> Matrix3d: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d + """ + @overload + @classmethod + def new(cls, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> Matrix3d: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d plus a displacement + """ + @overload + @classmethod + def new(cls, m: float) -> Matrix3d: + r""" + @brief Create a new Matrix3d representing a magnification + @param m The magnification + """ + @overload + @classmethod + def new(cls, t: DCplxTrans) -> Matrix3d: + r""" + @brief Create a new Matrix3d from the given complex transformation@param t The transformation from which to create the matrix + """ + @overload + @classmethod + def newc(cls, mag: float, rotation: float, mirrx: bool) -> Matrix3d: + r""" + @brief Create a new Matrix3d representing a isotropic magnification, rotation and mirroring + @param mag The magnification + @param rotation The rotation angle (in degree) + @param mirrx The mirror flag (at x axis) + + The order of execution of the operations is mirror, magnification and rotation. + This constructor is called 'newc' to distinguish it from the constructors taking coefficients ('c' is for composite). + """ + @overload + @classmethod + def newc(cls, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> Matrix3d: + r""" + @brief Create a new Matrix3d representing a shear, anisotropic magnification, rotation and mirroring + @param shear The shear angle + @param mx The magnification in x direction + @param mx The magnification in y direction + @param rotation The rotation angle (in degree) + @param mirrx The mirror flag (at x axis) + + The order of execution of the operations is mirror, magnification, rotation and shear. + This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). + """ + @overload + @classmethod + def newc(cls, tx: float, ty: float, z: float, u: DVector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> Matrix3d: + r""" + @brief Create a new Matrix3d representing a perspective distortion, displacement, shear, anisotropic magnification, rotation and mirroring + @param tx The perspective tilt angle x (around the y axis) + @param ty The perspective tilt angle y (around the x axis) + @param z The observer distance at which the tilt angles are given + @param u The displacement + @param shear The shear angle + @param mx The magnification in x direction + @param mx The magnification in y direction + @param rotation The rotation angle (in degree) + @param mirrx The mirror flag (at x axis) + + The order of execution of the operations is mirror, magnification, rotation, shear, perspective distortion and displacement. + This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). + + The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles for different observer distances. Hence, the observer distance must be given at which the tilt angles are given. If the magnitude of the tilt angle is not important, z can be set to 1. + + Starting with version 0.25 the displacement is of vector type. + """ + @overload + @classmethod + def newc(cls, u: DVector, shear: float, mx: float, my: float, rotation: float, mirrx: bool) -> Matrix3d: + r""" + @brief Create a new Matrix3d representing a displacement, shear, anisotropic magnification, rotation and mirroring + @param u The displacement + @param shear The shear angle + @param mx The magnification in x direction + @param mx The magnification in y direction + @param rotation The rotation angle (in degree) + @param mirrx The mirror flag (at x axis) + + The order of execution of the operations is mirror, magnification, rotation, shear and displacement. + This constructor is called 'newc' to distinguish it from the constructor taking the four matrix coefficients ('c' is for composite). + + Starting with version 0.25 the displacement is of vector type. + """ + def __add__(self, m: Matrix3d) -> Matrix3d: + r""" + @brief Sum of two matrices. + @param m The other matrix. + @return The (element-wise) sum of self+m + """ + def __copy__(self) -> Matrix3d: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Matrix3d: + r""" + @brief Creates a copy of self + """ + @overload + def __init__(self) -> None: + r""" + @brief Create a new Matrix3d representing a unit transformation + """ + @overload + def __init__(self, m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float) -> None: + r""" + @brief Create a new Matrix3d from the nine matrix coefficients + """ + @overload + def __init__(self, m11: float, m12: float, m21: float, m22: float) -> None: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d + """ + @overload + def __init__(self, m11: float, m12: float, m21: float, m22: float, dx: float, dy: float) -> None: + r""" + @brief Create a new Matrix3d from the four coefficients of a Matrix2d plus a displacement + """ + @overload + def __init__(self, m: float) -> None: + r""" + @brief Create a new Matrix3d representing a magnification + @param m The magnification + """ + @overload + def __init__(self, t: DCplxTrans) -> None: + r""" + @brief Create a new Matrix3d from the given complex transformation@param t The transformation from which to create the matrix + """ + @overload + def __mul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __mul__(self, e: DEdge) -> DEdge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __mul__(self, m: Matrix3d) -> Matrix3d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __mul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __mul__(self, p: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __mul__(self, p: DSimplePolygon) -> DSimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __mul__(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ + @overload + def __rmul__(self, box: DBox) -> DBox: + r""" + @brief Transforms a box with this matrix. + @param box The box to transform. + @return The transformed box + + Please note that the box remains a box, even though the matrix supports shear and rotation. The returned box will be the bounding box of the sheared and rotated rectangle. + """ + @overload + def __rmul__(self, e: DEdge) -> DEdge: + r""" + @brief Transforms an edge with this matrix. + @param e The edge to transform. + @return The transformed edge + """ + @overload + def __rmul__(self, m: Matrix3d) -> Matrix3d: + r""" + @brief Product of two matrices. + @param m The other matrix. + @return The matrix product self*m + """ + @overload + def __rmul__(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + @overload + def __rmul__(self, p: DPolygon) -> DPolygon: + r""" + @brief Transforms a polygon with this matrix. + @param p The polygon to transform. + @return The transformed polygon + """ + @overload + def __rmul__(self, p: DSimplePolygon) -> DSimplePolygon: + r""" + @brief Transforms a simple polygon with this matrix. + @param p The simple polygon to transform. + @return The transformed simple polygon + """ + @overload + def __rmul__(self, v: DVector) -> DVector: + r""" + @brief Transforms a vector with this matrix. + @param v The vector to transform. + @return The transformed vector + """ + def __str__(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def adjust(self, landmarks_before: Sequence[DPoint], landmarks_after: Sequence[DPoint], flags: int, fixed_point: int) -> None: + r""" + @brief Adjust a 3d matrix to match the given set of landmarks + + This function tries to adjust the matrix + such, that either the matrix is changed as little as possible (if few landmarks are given) + or that the "after" landmarks will match as close as possible to the "before" landmarks + (if the problem is overdetermined). + + @param landmarks_before The points before the transformation. + @param landmarks_after The points after the transformation. + @param mode Selects the adjustment mode. Must be one of the Adjust... constants. + @param fixed_point The index of the fixed point (one that is definitely mapped to the target) or -1 if there is none + """ + def angle(self) -> float: + r""" + @brief Returns the rotation angle of the rotation component of this matrix. + @return The angle in degree. + See the description of this class for details about the basic transformations. + """ + def assign(self, other: Matrix3d) -> None: + r""" + @brief Assigns another object to self + """ + def cplx_trans(self) -> DCplxTrans: + r""" + @brief Converts this matrix to a complex transformation (if possible). + @return The complex transformation. + This method is successful only if the matrix does not contain shear or perspective distortion components and the magnification must be isotropic. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def disp(self) -> DVector: + r""" + @brief Returns the displacement vector of this transformation. + + Starting with version 0.25 this method returns a vector type instead of a point. + @return The displacement vector. + """ + def dup(self) -> Matrix3d: + r""" + @brief Creates a copy of self + """ + def inverted(self) -> Matrix3d: + r""" + @brief The inverse of this matrix. + @return The inverse of this matrix + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_mirror(self) -> bool: + r""" + @brief Returns the mirror flag of this matrix. + @return True if this matrix has a mirror component. + See the description of this class for details about the basic transformations. + """ + def m(self, i: int, j: int) -> float: + r""" + @brief Gets the m coefficient with the given index. + @return The coefficient [i,j] + """ + def mag_x(self) -> float: + r""" + @brief Returns the x magnification of the magnification component of this matrix. + @return The magnification factor. + """ + def mag_y(self) -> float: + r""" + @brief Returns the y magnification of the magnification component of this matrix. + @return The magnification factor. + """ + def shear_angle(self) -> float: + r""" + @brief Returns the magnitude of the shear component of this matrix. + @return The shear angle in degree. + The shear basic transformation will tilt the x axis towards the y axis and vice versa. The shear angle gives the tilt angle of the axes towards the other one. The possible range for this angle is -45 to 45 degree.See the description of this class for details about the basic transformations. + """ + def to_s(self) -> str: + r""" + @brief Convert the matrix to a string. + @return The string representing this matrix + """ + def trans(self, p: DPoint) -> DPoint: + r""" + @brief Transforms a point with this matrix. + @param p The point to transform. + @return The transformed point + """ + def tx(self, z: float) -> float: + r""" + @brief Returns the perspective tilt angle tx. + @param z The observer distance at which the tilt angle is computed. + @return The tilt angle tx. + The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1. + """ + def ty(self, z: float) -> float: + r""" + @brief Returns the perspective tilt angle ty. + @param z The observer distance at which the tilt angle is computed. + @return The tilt angle ty. + The tx and ty parameters represent the perspective distortion. They denote a tilt of the xy plane around the y axis (tx) or the x axis (ty) in degree. The same effect is achieved for different tilt angles at different observer distances. Hence, the observer distance must be specified at which the tilt angle is computed. If the magnitude of the tilt angle is not important, z can be set to 1. + """ + +class Metrics: + r""" + @brief This class represents the metrics type for \Region#width and related checks. + + This enum has been introduced in version 0.27. + """ + Euclidian: ClassVar[Metrics] + r""" + @brief Specifies Euclidian metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by: + + @code + d = sqrt(dx^2 + dy^2) + @/code + + All points within a circle with radius d around one point are considered to have a smaller distance than d. + """ + Projection: ClassVar[Metrics] + r""" + @brief Specifies projected distance metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other. + """ + Square: ClassVar[Metrics] + r""" + @brief Specifies square metrics for the check functions + This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies square metrics, i.e. the distance between two points is measured by: + + @code + d = max(abs(dx), abs(dy)) + @/code + + All points within a square with length 2*d around one point are considered to have a smaller distance than d in this metrics. + """ + @overload + @classmethod + def new(cls, i: int) -> Metrics: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> Metrics: + r""" + @brief Creates an enum from a string value + """ + def __copy__(self) -> Metrics: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Metrics: + r""" + @brief Creates a copy of self + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: Metrics) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Metrics) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> Metrics: + r""" + @brief Creates a copy of self + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + +class Net(NetlistObject): + r""" + @brief A single net. + A net connects multiple pins or terminals together. Pins are either pin or subcircuits of outgoing pins of the circuit the net lives in. Terminals are connections made to specific terminals of devices. + + Net objects are created inside a circuit with \Circuit#create_net. + + To connect a net to an outgoing pin of a circuit, use \Circuit#connect_pin, to disconnect a net from an outgoing pin use \Circuit#disconnect_pin. To connect a net to a pin of a subcircuit, use \SubCircuit#connect_pin, to disconnect a net from a pin of a subcircuit, use \SubCircuit#disconnect_pin. To connect a net to a terminal of a device, use \Device#connect_terminal, to disconnect a net from a terminal of a device, use \Device#disconnect_terminal. + + This class has been added in version 0.26. + """ + cluster_id: int + r""" + Getter: + @brief Gets the cluster ID of the net. + See \cluster_id= for details about the cluster ID. + Setter: + @brief Sets the cluster ID of the net. + The cluster ID connects the net with a layout cluster. It is set when the net is extracted from a layout. + """ + name: str + r""" + Getter: + @brief Gets the name of the net. + See \name= for details about the name. + Setter: + @brief Sets the name of the net. + The name of the net is used for naming the net in schematic files for example. The name of the net has to be unique. + """ + def __str__(self) -> str: + r""" + @brief Gets the qualified name. + The qualified name is like the expanded name, but the circuit's name is preceded + (i.e. 'CIRCUIT:NET') if available. + """ + def _assign(self, other: NetlistObject) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> Net: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def circuit(self) -> Circuit: + r""" + @brief Gets the circuit the net lives in. + """ + def clear(self) -> None: + r""" + @brief Clears the net. + """ + @overload + def each_pin(self) -> Iterator[NetPinRef]: + r""" + @brief Iterates over all outgoing pins the net connects. + Pin connections are described by \NetPinRef objects. Pin connections are connections to outgoing pins of the circuit the net lives in. + """ + @overload + def each_pin(self) -> Iterator[NetPinRef]: + r""" + @brief Iterates over all outgoing pins the net connects (non-const version). + Pin connections are described by \NetPinRef objects. Pin connections are connections to outgoing pins of the circuit the net lives in. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def each_subcircuit_pin(self) -> Iterator[NetSubcircuitPinRef]: + r""" + @brief Iterates over all subcircuit pins the net connects. + Subcircuit pin connections are described by \NetSubcircuitPinRef objects. These are connections to specific pins of subcircuits. + """ + @overload + def each_subcircuit_pin(self) -> Iterator[NetSubcircuitPinRef]: + r""" + @brief Iterates over all subcircuit pins the net connects (non-const version). + Subcircuit pin connections are described by \NetSubcircuitPinRef objects. These are connections to specific pins of subcircuits. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def each_terminal(self) -> Iterator[NetTerminalRef]: + r""" + @brief Iterates over all terminals the net connects. + Terminals connect devices. Terminal connections are described by \NetTerminalRef objects. + """ + @overload + def each_terminal(self) -> Iterator[NetTerminalRef]: + r""" + @brief Iterates over all terminals the net connects (non-const version). + Terminals connect devices. Terminal connections are described by \NetTerminalRef objects. + + This constness variant has been introduced in version 0.26.8 + """ + def expanded_name(self) -> str: + r""" + @brief Gets the expanded name of the net. + The expanded name takes the name of the net. If the name is empty, the cluster ID will be used to build a name. + """ + def is_floating(self) -> bool: + r""" + @brief Returns true, if the net is floating. + Floating nets are those which don't have any device or subcircuit on it and are not connected through a pin. + """ + def is_internal(self) -> bool: + r""" + @brief Returns true, if the net is an internal net. + Internal nets are those which connect exactly two terminals and nothing else (pin_count = 0 and terminal_count == 2). + """ + def is_passive(self) -> bool: + r""" + @brief Returns true, if the net is passive. + Passive nets don't have devices or subcircuits on it. They can be exposed through a pin. + \is_floating? implies \is_passive?. + + This method has been introduced in version 0.26.1. + """ + def pin_count(self) -> int: + r""" + @brief Returns the number of outgoing pins connected by this net. + """ + def qname(self) -> str: + r""" + @brief Gets the qualified name. + The qualified name is like the expanded name, but the circuit's name is preceded + (i.e. 'CIRCUIT:NET') if available. + """ + def subcircuit_pin_count(self) -> int: + r""" + @brief Returns the number of subcircuit pins connected by this net. + """ + def terminal_count(self) -> int: + r""" + @brief Returns the number of terminals connected by this net. + """ + def to_s(self) -> str: + r""" + @brief Gets the qualified name. + The qualified name is like the expanded name, but the circuit's name is preceded + (i.e. 'CIRCUIT:NET') if available. + """ + +class NetElement: + r""" + @brief A net element for the NetTracer net tracing facility + + This object represents a piece of a net extracted by the net tracer. See the description of \NetTracer for more details about the net tracer feature. + + The NetTracer object represents one shape of the net. The shape can be an original shape or a shape derived in a boolean operation. In the first case, the shape refers to a shape within a cell or a subcell of the original top cell. In the latter case, the shape is a synthesized one and outside the original layout hierarchy. + + In any case, the \shape method will deliver the shape and \trans the transformation of the shape into the original top cell. To obtain a flat representation of the net, the shapes need to be transformed by this transformation. + + \layer will give the layer the shape is located at, \cell_index will denote the cell that contains the shape. + + This class has been introduced in version 0.25. + """ + @classmethod + def new(cls) -> NetElement: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetElement: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetElement: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetElement) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Delivers the bounding box of the shape as seen from the original top cell + """ + def cell_index(self) -> int: + r""" + @brief Gets the index of the cell the shape is inside + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetElement: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def layer(self) -> int: + r""" + @brief Gets the index of the layer the shape is on + """ + def shape(self) -> Shape: + r""" + @brief Gets the shape that makes up this net element + See the class description for more details about this attribute. + """ + def trans(self) -> ICplxTrans: + r""" + @brief Gets the transformation to apply for rendering the shape in the original top cell + See the class description for more details about this attribute. + """ + +class NetPinRef: + r""" + @brief A connection to an outgoing pin of the circuit. + This object is used inside a net (see \Net) to describe the connections a net makes. + + This class has been added in version 0.26. + """ + @classmethod + def new(cls) -> NetPinRef: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetPinRef: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetPinRef: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetPinRef) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetPinRef: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + @overload + def net(self) -> Net: + r""" + @brief Gets the net this pin reference is attached to (non-const version). + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def net(self) -> Net: + r""" + @brief Gets the net this pin reference is attached to. + """ + def pin(self) -> Pin: + r""" + @brief Gets the \Pin object of the pin the connection is made to. + """ + def pin_id(self) -> int: + r""" + @brief Gets the ID of the pin the connection is made to. + """ + +class NetSubcircuitPinRef: + r""" + @brief A connection to a pin of a subcircuit. + This object is used inside a net (see \Net) to describe the connections a net makes. + + This class has been added in version 0.26. + """ + @classmethod + def new(cls) -> NetSubcircuitPinRef: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetSubcircuitPinRef: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetSubcircuitPinRef: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetSubcircuitPinRef) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetSubcircuitPinRef: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + @overload + def net(self) -> Net: + r""" + @brief Gets the net this pin reference is attached to. + """ + @overload + def net(self) -> Net: + r""" + @brief Gets the net this pin reference is attached to (non-const version). + + This constness variant has been introduced in version 0.26.8 + """ + def pin(self) -> Pin: + r""" + @brief Gets the \Pin object of the pin the connection is made to. + """ + def pin_id(self) -> int: + r""" + @brief Gets the ID of the pin the connection is made to. + """ + @overload + def subcircuit(self) -> SubCircuit: + r""" + @brief Gets the subcircuit reference. + This attribute indicates the subcircuit the net attaches to. The subcircuit lives in the same circuit than the net. + """ + @overload + def subcircuit(self) -> SubCircuit: + r""" + @brief Gets the subcircuit reference (non-const version). + This attribute indicates the subcircuit the net attaches to. The subcircuit lives in the same circuit than the net. + + This constness variant has been introduced in version 0.26.8 + """ + +class NetTerminalRef: + r""" + @brief A connection to a terminal of a device. + This object is used inside a net (see \Net) to describe the connections a net makes. + + This class has been added in version 0.26. + """ + @classmethod + def new(cls) -> NetTerminalRef: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetTerminalRef: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetTerminalRef: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetTerminalRef) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + @overload + def device(self) -> Device: + r""" + @brief Gets the device reference (non-const version). + Gets the device object that this connection is made to. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def device(self) -> Device: + r""" + @brief Gets the device reference. + Gets the device object that this connection is made to. + """ + def device_class(self) -> DeviceClass: + r""" + @brief Gets the class of the device which is addressed. + """ + def dup(self) -> NetTerminalRef: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + @overload + def net(self) -> Net: + r""" + @brief Gets the net this terminal reference is attached to. + """ + @overload + def net(self) -> Net: + r""" + @brief Gets the net this terminal reference is attached to (non-const version). + + This constness variant has been introduced in version 0.26.8 + """ + def terminal_def(self) -> DeviceTerminalDefinition: + r""" + @brief Gets the terminal definition of the terminal that is connected + """ + def terminal_id(self) -> int: + r""" + @brief Gets the ID of the terminal of the device the connection is made to. + """ + +class NetTracer: + r""" + @brief The net tracer feature + + The net tracer class provides an interface to the net tracer feature. It is accompanied by the \NetElement and \NetTracerTechnology classes. The latter will provide the technology definition for the net tracer while the \NetElement objects represent a piece of the net after it has been extracted. + + The technology definition is optional. The net tracer can be used with a predefined technology as well. The basic scheme of using the net tracer is to instantiate a net tracer object and run the extraction through the \NetTracer#trace method. After this method was executed successfully, the resulting net can be obtained from the net tracer object by iterating over the \NetElement objects of the net tracer. + + Here is some sample code: + + @code + ly = RBA::CellView::active.layout + + tracer = RBA::NetTracer::new + + tech = RBA::NetTracerConnectivity::new + tech.connection("1/0", "2/0", "3/0") + + tracer.trace(tech, ly, ly.top_cell, RBA::Point::new(7000, 1500), ly.find_layer(1, 0)) + + tracer.each_element do |e| + puts e.shape.polygon.transformed(e.trans) + end + @/code + + This class has been introduced in version 0.25. With version 0.28, the \NetTracerConnectivity class replaces the 'NetTracerTechnology' class. + """ + trace_depth: int + r""" + Getter: + @brief gets the trace depth + See \trace_depth= for a description of this property. + + This method has been introduced in version 0.26.4. + + Setter: + @brief Sets the trace depth (shape limit) + Set this value to limit the maximum number of shapes delivered. Upon reaching this count, the tracer will stop and report the net as 'incomplete' (see \incomplete?). + Setting a trace depth if 0 is equivalent to 'unlimited'. + The actual number of shapes delivered may be a little less than the depth because of internal marker shapes which are taken into account, but are not delivered. + + This method has been introduced in version 0.26.4. + """ + @classmethod + def new(cls) -> NetTracer: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetTracer: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetTracer: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetTracer) -> None: + r""" + @brief Assigns another object to self + """ + def clear(self) -> None: + r""" + @brief Clears the data from the last extraction + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetTracer: + r""" + @brief Creates a copy of self + """ + def each_element(self) -> Iterator[NetElement]: + r""" + @brief Iterates over the elements found during extraction + The elements are available only after the extraction has been performed. + """ + def incomplete(self) -> bool: + r""" + @brief Returns a value indicating whether the net is incomplete + A net may be incomplete if the extraction has been stopped by the user for example. This attribute is useful only after the extraction has been performed. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def name(self) -> str: + r""" + @brief Returns the name of the net found during extraction + The net name is extracted from labels found during the extraction. This attribute is useful only after the extraction has been performed. + """ + def num_elements(self) -> int: + r""" + @brief Returns the number of elements found during extraction + This attribute is useful only after the extraction has been performed. + """ + @overload + def trace(self, tech: NetTracerConnectivity, layout: Layout, cell: Cell, start_point: Point, start_layer: int) -> None: + r""" + @brief Runs a net extraction + + This method runs an extraction with the given parameters. + To make the extraction successful, a shape must be present at the given start point on the start layer. The start layer must be a valid layer mentioned within the technology specification. + + This version runs a single extraction - i.e. it will extract all elements connected to the given seed point. A path extraction version is provided as well which will extract one (the presumably shortest) path between two points. + + @param tech The connectivity definition + @param layout The layout on which to run the extraction + @param cell The cell on which to run the extraction (child cells will be included) + @param start_point The start point from which to start extraction of the net + @param start_layer The layer from which to start extraction + """ + @overload + def trace(self, tech: NetTracerConnectivity, layout: Layout, cell: Cell, start_point: Point, start_layer: int, stop_point: Point, stop_layer: int) -> None: + r""" + @brief Runs a path extraction + + This method runs an path extraction with the given parameters. + To make the extraction successful, a shape must be present at the given start point on the start layer and at the given stop point at the given stop layer. The start and stop layers must be a valid layers mentioned within the technology specification. + + This version runs a path extraction and will deliver elements forming one path leading from the start to the end point. + + @param tech The connectivity definition + @param layout The layout on which to run the extraction + @param cell The cell on which to run the extraction (child cells will be included) + @param start_point The start point from which to start extraction of the net + @param start_layer The layer from which to start extraction + @param stop_point The stop point at which to stop extraction of the net + @param stop_layer The layer at which to stop extraction + """ + @overload + def trace(self, tech: str, connectivity_name: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int) -> None: + r""" + @brief Runs a net extraction taking a predefined technology + This method behaves identical as the version with a technology object, except that it will look for a technology with the given name to obtain the extraction setup. This version allows specifying the name of the connecvitiy setup. + + This method variant has been introduced in version 0.28. + """ + @overload + def trace(self, tech: str, connectivity_name: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int, stop_point: Point, stop_layer: int) -> None: + r""" + @brief Runs a path extraction taking a predefined technology + This method behaves identical as the version with a technology object, except that it will look for a technology with the given name to obtain the extraction setup.This version allows specifying the name of the connecvitiy setup. + + This method variant has been introduced in version 0.28. + """ + @overload + def trace(self, tech: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int) -> None: + r""" + @brief Runs a net extraction taking a predefined technology + This method behaves identical as the version with a technology object, except that it will look for a technology with the given name to obtain the extraction setup. + The technology is looked up by technology name. A version of this method exists where it is possible to specify the name of the particular connectivity to use in case there are multiple definitions available. + """ + @overload + def trace(self, tech: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int, stop_point: Point, stop_layer: int) -> None: + r""" + @brief Runs a path extraction taking a predefined technology + This method behaves identical as the version with a technology object, except that it will look for a technology with the given name to obtain the extraction setup. + """ + +class NetTracerConnectionInfo: + r""" + @brief Represents a single connection info line for the net tracer technology definition + This class has been introduced in version 0.28.3. + """ + @classmethod + def new(cls) -> NetTracerConnectionInfo: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetTracerConnectionInfo: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetTracerConnectionInfo: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetTracerConnectionInfo) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetTracerConnectionInfo: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def layer_a(self) -> str: + r""" + @brief Gets the expression for the A layer + """ + def layer_b(self) -> str: + r""" + @brief Gets the expression for the B layer + """ + def via_layer(self) -> str: + r""" + @brief Gets the expression for the Via layer + """ + +class NetTracerConnectivity: + r""" + @brief A connectivity description for the net tracer + + This object represents the technology description for the net tracer (represented by the \NetTracer class). + A technology description basically consists of connection declarations. + A connection is given by either two or three expressions describing two conductive materials. + With two expressions, the connection describes a transition from one material to another one. + With three expressions, the connection describes a transition from one material to another through a connection (a "via"). + + The conductive material is derived from original layers either directly or through boolean expressions. These expressions can include symbols which are defined through the \symbol method. + + For details about the expressions see the description of the net tracer feature. + + This class has been introduced in version 0.28 and replaces the 'NetTracerTechnology' class which has been generalized. + """ + description: str + r""" + Getter: + @brief Gets the description text of the connectivty definition + The description is an optional string giving a human-readable description for this definition. + Setter: + @brief Sets the description of the connectivty definition + """ + name: str + r""" + Getter: + @brief Gets the name of the connectivty definition + The name is an optional string defining the formal name for this definition. + + Setter: + @brief Sets the name of the connectivty definition + """ + @classmethod + def new(cls) -> NetTracerConnectivity: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetTracerConnectivity: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetTracerConnectivity: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetTracerConnectivity) -> None: + r""" + @brief Assigns another object to self + """ + @overload + def connection(self, a: str, b: str) -> None: + r""" + @brief Defines a connection between two materials + See the class description for details about this method. + """ + @overload + def connection(self, a: str, via: str, b: str) -> None: + r""" + @brief Defines a connection between materials through a via + See the class description for details about this method. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetTracerConnectivity: + r""" + @brief Creates a copy of self + """ + def each_connection(self) -> Iterator[NetTracerConnectionInfo]: + r""" + @brief Gets the connection information. + This iterator method has been introduced in version 0.28.3. + """ + def each_symbol(self) -> Iterator[NetTracerSymbolInfo]: + r""" + @brief Gets the symbol information. + This iterator method has been introduced in version 0.28.3. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def symbol(self, name: str, expr: str) -> None: + r""" + @brief Defines a symbol for use in the material expressions. + Defines a sub-expression to be used in further symbols or material expressions. For the detailed notation of the expression see the description of the net tracer feature. + """ + +class NetTracerSymbolInfo: + r""" + @brief Represents a single symbol info line for the net tracer technology definition + This class has been introduced in version 0.28.3. + """ + @classmethod + def new(cls) -> NetTracerSymbolInfo: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetTracerSymbolInfo: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetTracerSymbolInfo: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetTracerSymbolInfo) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetTracerSymbolInfo: + r""" + @brief Creates a copy of self + """ + def expression(self) -> str: + r""" + @brief Gets the expression + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def symbol(self) -> str: + r""" + @brief Gets the symbol + """ + +class NetTracerTechnologyComponent(TechnologyComponent): + r""" + @brief Represents the technology information for the net tracer. + This class has been redefined in version 0.28 and re-introduced in version 0.28.3. Since version 0.28, multiple stacks are supported and the individual stack definition is provided through a list of stacks. Use \each to iterate the stacks. + """ + def __copy__(self) -> NetTracerTechnologyComponent: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetTracerTechnologyComponent: + r""" + @brief Creates a copy of self + """ + def __iter__(self) -> Iterator[NetTracerConnectivity]: + r""" + @brief Gets the connectivity definitions from the net tracer technology component. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: TechnologyComponent) -> None: + r""" + @brief Assigns another object to self + """ + def dup(self) -> NetTracerTechnologyComponent: + r""" + @brief Creates a copy of self + """ + def each(self) -> Iterator[NetTracerConnectivity]: + r""" + @brief Gets the connectivity definitions from the net tracer technology component. + """ + +class Netlist: + r""" + @brief The netlist top-level class + A netlist is a hierarchical structure of circuits. At least one circuit is the top-level circuit, other circuits may be referenced as subcircuits. + Circuits are created with \create_circuit and are represented by objects of the \Circuit class. + + Beside circuits, the netlist manages device classes. Device classes describe specific types of devices. Device classes are represented by objects of the \DeviceClass class and are created using \create_device_class. + + The netlist class has been introduced with version 0.26. + """ + case_sensitive: bool + r""" + Getter: + @brief Returns a value indicating whether the netlist names are case sensitive + This method has been added in version 0.27.3. + + Setter: + @brief Sets a value indicating whether the netlist names are case sensitive + This method has been added in version 0.27.3. + """ + @classmethod + def new(cls) -> Netlist: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> Netlist: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Netlist: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def __str__(self) -> str: + r""" + @brief Converts the netlist to a string representation. + This method is intended for test purposes mainly. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def add(self, circuit: Circuit) -> None: + r""" + @brief Adds the circuit to the netlist + This method will add the given circuit object to the netlist. After the circuit has been added, it will be owned by the netlist. + """ + @overload + def add(self, device_class: DeviceClass) -> None: + r""" + @brief Adds the device class to the netlist + This method will add the given device class object to the netlist. After the device class has been added, it will be owned by the netlist. + """ + def assign(self, other: Netlist) -> None: + r""" + @brief Assigns another object to self + """ + def blank_circuit(self, pattern: str) -> None: + r""" + @brief Blanks circuits matching a certain pattern + This method will erase everything from inside the circuits matching the given pattern. It will only leave pins which are not connected to any net. Hence, this method forms 'abstract' or black-box circuits which can be instantiated through subcircuits like the former ones, but are empty shells. + The name pattern is a glob expression. For example, 'blank_circuit("np*")' will blank out all circuits with names starting with 'np'. + + For more details see \Circuit#blank which is the corresponding method on the actual object. + """ + @overload + def circuit_by_cell_index(self, cell_index: int) -> Circuit: + r""" + @brief Gets the circuit object for a given cell index. + If the cell index is not valid or no circuit is registered with this index, nil is returned. + """ + @overload + def circuit_by_cell_index(self, cell_index: int) -> Circuit: + r""" + @brief Gets the circuit object for a given cell index (const version). + If the cell index is not valid or no circuit is registered with this index, nil is returned. + + This constness variant has been introduced in version 0.26.8. + """ + @overload + def circuit_by_name(self, name: str) -> Circuit: + r""" + @brief Gets the circuit object for a given name. + If the name is not a valid circuit name, nil is returned. + """ + @overload + def circuit_by_name(self, name: str) -> Circuit: + r""" + @brief Gets the circuit object for a given name (const version). + If the name is not a valid circuit name, nil is returned. + + This constness variant has been introduced in version 0.26.8. + """ + @overload + def circuits_by_name(self, name_pattern: str) -> List[Circuit]: + r""" + @brief Gets the circuit objects for a given name filter. + The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. + + This method has been introduced in version 0.26.4. + """ + @overload + def circuits_by_name(self, name_pattern: str) -> List[Circuit]: + r""" + @brief Gets the circuit objects for a given name filter (const version). + The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. + + + This constness variant has been introduced in version 0.26.8. + """ + def combine_devices(self) -> None: + r""" + @brief Combines devices where possible + This method will combine devices that can be combined according to their device classes 'combine_devices' method. + For example, serial or parallel resistors can be combined into a single resistor. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + @overload + def device_class_by_name(self, name: str) -> DeviceClass: + r""" + @brief Gets the device class for a given name. + If the name is not a valid device class name, nil is returned. + """ + @overload + def device_class_by_name(self, name: str) -> DeviceClass: + r""" + @brief Gets the device class for a given name (const version). + If the name is not a valid device class name, nil is returned. + + This constness variant has been introduced in version 0.26.8. + """ + def dup(self) -> Netlist: + r""" + @brief Creates a copy of self + """ + @overload + def each_circuit(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the circuits of the netlist + """ + @overload + def each_circuit(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the circuits of the netlist (const version) + + This constness variant has been introduced in version 0.26.8. + """ + @overload + def each_circuit_bottom_up(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the circuits bottom-up (const version) + Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. + + This constness variant has been introduced in version 0.26.8. + """ + @overload + def each_circuit_bottom_up(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the circuits bottom-up + Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. + """ + @overload + def each_circuit_top_down(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the circuits top-down + Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. + """ + @overload + def each_circuit_top_down(self) -> Iterator[Circuit]: + r""" + @brief Iterates over the circuits top-down (const version) + Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. + + This constness variant has been introduced in version 0.26.8. + """ + @overload + def each_device_class(self) -> Iterator[DeviceClass]: + r""" + @brief Iterates over the device classes of the netlist + """ + @overload + def each_device_class(self) -> Iterator[DeviceClass]: + r""" + @brief Iterates over the device classes of the netlist (const version) + + This constness variant has been introduced in version 0.26.8. + """ + def flatten(self) -> None: + r""" + @brief Flattens all circuits of the netlist + After calling this method, only the top circuits will remain. + """ + @overload + def flatten_circuit(self, circuit: Circuit) -> None: + r""" + @brief Flattens a subcircuit + This method will substitute all instances (subcircuits) of the given circuit by it's contents. After this, the circuit is removed. + """ + @overload + def flatten_circuit(self, pattern: str) -> None: + r""" + @brief Flattens circuits matching a certain pattern + This method will substitute all instances (subcircuits) of all circuits with names matching the given name pattern. The name pattern is a glob expression. For example, 'flatten_circuit("np*")' will flatten all circuits with names starting with 'np'. + """ + def flatten_circuits(self, arg0: Sequence[Circuit]) -> None: + r""" + @brief Flattens all given circuits of the netlist + This method is equivalent to calling \flatten_circuit for all given circuits, but more efficient. + + This method has been introduced in version 0.26.1 + """ + def from_s(self, str: str) -> None: + r""" + @brief Reads the netlist from a string representation. + This method is intended for test purposes mainly. It turns a string returned by \to_s back into a netlist. Note that the device classes must be created before as they are not persisted inside the string. + """ + def is_case_sensitive(self) -> bool: + r""" + @brief Returns a value indicating whether the netlist names are case sensitive + This method has been added in version 0.27.3. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def make_top_level_pins(self) -> None: + r""" + @brief Creates pins for top-level circuits. + This method will turn all named nets of top-level circuits (such that are not referenced by subcircuits) into pins. This method can be used before purge to avoid that purge will remove nets which are directly connecting to subcircuits. + """ + @overload + def nets_by_name(self, name_pattern: str) -> List[Net]: + r""" + @brief Gets the net objects for a given name filter. + The name filter is a glob pattern. This method will return all \Net objects matching the glob pattern. + + This method has been introduced in version 0.28.4. + """ + @overload + def nets_by_name(self, name_pattern: str) -> List[Net]: + r""" + @brief Gets the net objects for a given name filter (const version). + The name filter is a glob pattern. This method will return all \Net objects matching the glob pattern. + + + This constness variant has been introduced in version 0.28.4. + """ + def purge(self) -> None: + r""" + @brief Purge unused nets, circuits and subcircuits. + This method will purge all nets which return \floating == true. Circuits which don't have any nets (or only floating ones) and removed. Their subcircuits are disconnected. + This method respects the \Circuit#dont_purge attribute and will never delete circuits with this flag set. + """ + def purge_circuit(self, circuit: Circuit) -> None: + r""" + @brief Removes the given circuit object and all child circuits which are not used otherwise from the netlist + After the circuit has been removed, the object becomes invalid and cannot be used further. A circuit with references (see \has_refs?) should not be removed as the subcircuits calling it would afterwards point to nothing. + """ + def purge_nets(self) -> None: + r""" + @brief Purges floating nets. + Floating nets can be created as effect of reconnections of devices or pins. This method will eliminate all nets that make less than two connections. + """ + def read(self, file: str, reader: NetlistReader) -> None: + r""" + @brief Writes the netlist to the given file using the given reader object to parse the file + See \NetlistSpiceReader for an example for a parser. + """ + @overload + def remove(self, circuit: Circuit) -> None: + r""" + @brief Removes the given circuit object from the netlist + After the circuit has been removed, the object becomes invalid and cannot be used further. A circuit with references (see \has_refs?) should not be removed as the subcircuits calling it would afterwards point to nothing. + """ + @overload + def remove(self, device_class: DeviceClass) -> None: + r""" + @brief Removes the given device class object from the netlist + After the object has been removed, it becomes invalid and cannot be used further. Use this method with care as it may corrupt the internal structure of the netlist. Only use this method when device refers to this device class. + """ + def simplify(self) -> None: + r""" + @brief Convenience method that combines the simplification. + This method is a convenience method that runs \make_top_level_pins, \purge, \combine_devices and \purge_nets. + """ + def to_s(self) -> str: + r""" + @brief Converts the netlist to a string representation. + This method is intended for test purposes mainly. + """ + def top_circuit_count(self) -> int: + r""" + @brief Gets the number of top circuits. + Top circuits are those which are not referenced by other circuits via subcircuits. A well-formed netlist has a single top circuit. + """ + def write(self, file: str, writer: NetlistWriter, description: Optional[str] = ...) -> None: + r""" + @brief Writes the netlist to the given file using the given writer object to format the file + See \NetlistSpiceWriter for an example for a formatter. The description is an arbitrary text which will be put into the file somewhere at the beginning. + """ + +class NetlistCompareLogger: + r""" + @brief A base class for netlist comparer event receivers + See \GenericNetlistCompareLogger for custom implementations of such receivers. + """ + @classmethod + def new(cls) -> NetlistCompareLogger: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class NetlistComparer: + r""" + @brief Compares two netlists + This class performs a comparison of two netlists. + It can be used with an event receiver (logger) to track the errors and net mismatches. Event receivers are derived from class \GenericNetlistCompareLogger. + The netlist comparer can be configured in different ways. Specific hints can be given for nets, device classes or circuits to improve efficiency and reliability of the graph equivalence deduction algorithm. For example, objects can be marked as equivalent using \same_nets, \same_circuits etc. The compare algorithm will then use these hints to derive further equivalences. This way, ambiguities can be resolved. + + Another configuration option relates to swappable pins of subcircuits. If pins are marked this way, the compare algorithm may swap them to achieve net matching. Swappable pins belong to an 'equivalence group' and can be defined with \equivalent_pins. + + This class has been introduced in version 0.26. + """ + @property + def max_resistance(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Excludes all resistor devices with a resistance values higher than the given threshold. + To reset this constraint, set this attribute to zero. + """ + @property + def min_capacitance(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Excludes all capacitor devices with a capacitance values less than the given threshold. + To reset this constraint, set this attribute to zero. + """ + dont_consider_net_names: bool + r""" + Getter: + @brief Gets a value indicating whether net names shall not be considered + See \dont_consider_net_names= for details. + Setter: + @brief Sets a value indicating whether net names shall not be considered + If this value is set to true, net names will not be considered when resolving ambiguities. + Not considering net names usually is more expensive. The default is 'false' indicating that + net names will be considered for ambiguity resolution. + + This property has been introduced in version 0.26.7. + """ + max_branch_complexity: int + r""" + Getter: + @brief Gets the maximum branch complexity + See \max_branch_complexity= for details. + Setter: + @brief Sets the maximum branch complexity + This value limits the maximum branch complexity of the backtracking algorithm. + The complexity is the accumulated number of branch options with ambiguous + net matches. Backtracking will stop when the maximum number of options + has been exceeded. + + By default, from version 0.27 on the complexity is unlimited and can be reduced in cases where runtimes need to be limited at the cost less elaborate matching evaluation. + + As the computational complexity is the square of the branch count, + this value should be adjusted carefully. + """ + max_depth: int + r""" + Getter: + @brief Gets the maximum search depth + See \max_depth= for details. + Setter: + @brief Sets the maximum search depth + This value limits the search depth of the backtracking algorithm to the + given number of jumps. + + By default, from version 0.27 on the depth is unlimited and can be reduced in cases where runtimes need to be limited at the cost less elaborate matching evaluation. + """ + with_log: bool + r""" + Getter: + @brief Gets a value indicating that log messages are generated. + See \with_log= for details about this flag. + + This attribute have been introduced in version 0.28. + + Setter: + @brief Sets a value indicating that log messages are generated. + Log messages may be expensive to compute, hence they can be turned off. + By default, log messages are generated. + + This attribute have been introduced in version 0.28. + """ + @overload + @classmethod + def new(cls) -> NetlistComparer: + r""" + @brief Creates a new comparer object. + See the class description for more details. + """ + @overload + @classmethod + def new(cls, logger: GenericNetlistCompareLogger) -> NetlistComparer: + r""" + @brief Creates a new comparer object. + The logger is a delegate or event receiver which the comparer will send compare events to. See the class description for more details. + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a new comparer object. + See the class description for more details. + """ + @overload + def __init__(self, logger: GenericNetlistCompareLogger) -> None: + r""" + @brief Creates a new comparer object. + The logger is a delegate or event receiver which the comparer will send compare events to. See the class description for more details. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def compare(self, netlist_a: Netlist, netlist_b: Netlist) -> bool: + r""" + @brief Compares two netlists. + This method will perform the actual netlist compare. It will return true if both netlists are identical. If the comparer has been configured with \same_nets or similar methods, the objects given there must be located inside 'circuit_a' and 'circuit_b' respectively. + """ + @overload + def compare(self, netlist_a: Netlist, netlist_b: Netlist, logger: NetlistCompareLogger) -> bool: + r""" + @brief Compares two netlists. + This method will perform the actual netlist compare using the given logger. It will return true if both netlists are identical. If the comparer has been configured with \same_nets or similar methods, the objects given there must be located inside 'circuit_a' and 'circuit_b' respectively. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + @overload + def equivalent_pins(self, circuit_b: Circuit, pin_id1: int, pin_id2: int) -> None: + r""" + @brief Marks two pins of the given circuit as equivalent (i.e. they can be swapped). + Only circuits from the second input can be given swappable pins. This will imply the same swappable pins on the equivalent circuit of the first input. To mark multiple pins as swappable, use the version that takes a list of pins. + """ + @overload + def equivalent_pins(self, circuit_b: Circuit, pin_ids: Sequence[int]) -> None: + r""" + @brief Marks several pins of the given circuit as equivalent (i.e. they can be swapped). + Only circuits from the second input can be given swappable pins. This will imply the same swappable pins on the equivalent circuit of the first input. This version is a generic variant of the two-pin version of this method. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def join_symmetric_nets(self, circuit: Circuit) -> None: + r""" + @brief Joins symmetric nodes in the given circuit. + + Nodes are symmetrical if swapping them would not modify the circuit. + Hence they will carry the same potential and can be connected (joined). + This will simplify the circuit and can be applied before device combination + to render a schematic-equivalent netlist in some cases (split gate option). + + This algorithm will apply the comparer's settings to the symmetry + condition (device filtering, device compare tolerances, device class + equivalence etc.). + + This method has been introduced in version 0.26.4. + """ + def same_circuits(self, circuit_a: Circuit, circuit_b: Circuit) -> None: + r""" + @brief Marks two circuits as identical. + This method makes a circuit circuit_a in netlist a identical to the corresponding + circuit circuit_b in netlist b (see \compare). By default circuits with the same name are identical. + """ + def same_device_classes(self, dev_cls_a: DeviceClass, dev_cls_b: DeviceClass) -> None: + r""" + @brief Marks two device classes as identical. + This makes a device class dev_cls_a in netlist a identical to the corresponding + device class dev_cls_b in netlist b (see \compare). + By default device classes with the same name are identical. + """ + @overload + def same_nets(self, circuit_a: Circuit, circuit_b: Circuit, net_a: Net, net_b: Net, must_match: Optional[bool] = ...) -> None: + r""" + @brief Marks two nets as identical. + This makes a net net_a in netlist a identical to the corresponding + net net_b in netlist b (see \compare). + Otherwise, the algorithm will try to identify nets according to their topology. This method can be used to supply hints to the compare algorithm. It will use these hints to derive further identities. + + If 'must_match' is true, the nets are required to match. If they don't, an error is reported. + + This variant allows specifying nil for the nets indicating the nets are mismatched by definition. with 'must_match' this will render a net mismatch error. + + This variant has been added in version 0.27.3. + """ + @overload + def same_nets(self, net_a: Net, net_b: Net, must_match: Optional[bool] = ...) -> None: + r""" + @brief Marks two nets as identical. + This makes a net net_a in netlist a identical to the corresponding + net net_b in netlist b (see \compare). + Otherwise, the algorithm will try to identify nets according to their topology. This method can be used to supply hints to the compare algorithm. It will use these hints to derive further identities. + + If 'must_match' is true, the nets are required to match. If they don't, an error is reported. + + The 'must_match' optional argument has been added in version 0.27.3. + """ + def unmatched_circuits_a(self, a: Netlist, b: Netlist) -> List[Circuit]: + r""" + @brief Returns a list of circuits in A for which there is not corresponding circuit in B + This list can be used to flatten these circuits so they do not participate in the compare process. + """ + def unmatched_circuits_b(self, a: Netlist, b: Netlist) -> List[Circuit]: + r""" + @brief Returns a list of circuits in B for which there is not corresponding circuit in A + This list can be used to flatten these circuits so they do not participate in the compare process. + """ + +class NetlistCrossReference(NetlistCompareLogger): + r""" + @brief Represents the identity mapping between the objects of two netlists. + + The NetlistCrossReference object is a container for the results of a netlist comparison. It implemented the \NetlistCompareLogger interface, hence can be used as output for a netlist compare operation (\NetlistComparer#compare). It's purpose is to store the results of the compare. It is used in this sense inside the \LayoutVsSchematic framework. + + The basic idea of the cross reference object is pairing: the netlist comparer will try to identify matching items and store them as pairs inside the cross reference object. If no match is found, a single-sided pair is generated: one item is nil in this case. + Beside the items, a status is kept which gives more details about success or failure of the match operation. + + Item pairing happens on different levels, reflecting the hierarchy of the netlists. On the top level there are circuits. Inside circuits nets, devices, subcircuits and pins are paired. Nets further contribute their connected items through terminals (for devices), pins (outgoing) and subcircuit pins. + + This class has been introduced in version 0.26. + """ + class CircuitPairData: + r""" + @brief A circuit match entry. + This object is used to describe the relationship of two circuits in a netlist match. + + Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. + This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. + """ + def first(self) -> Circuit: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> Circuit: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + def status(self) -> NetlistCrossReference.Status: + r""" + @brief Gets the status of the relation. + This enum described the match status of the relation pair. + """ + class DevicePairData: + r""" + @brief A device match entry. + This object is used to describe the relationship of two devices in a netlist match. + + Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. + This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. + """ + def first(self) -> Device: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> Device: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + def status(self) -> NetlistCrossReference.Status: + r""" + @brief Gets the status of the relation. + This enum described the match status of the relation pair. + """ + class NetPairData: + r""" + @brief A net match entry. + This object is used to describe the relationship of two nets in a netlist match. + + Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. + This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. + """ + def first(self) -> Net: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> Net: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + def status(self) -> NetlistCrossReference.Status: + r""" + @brief Gets the status of the relation. + This enum described the match status of the relation pair. + """ + class NetPinRefPair: + r""" + @brief A match entry for a net pin pair. + This object is used to describe the matching pin pairs or non-matching pins on a net. + + Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. + """ + def first(self) -> NetPinRef: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> NetPinRef: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + class NetSubcircuitPinRefPair: + r""" + @brief A match entry for a net subcircuit pin pair. + This object is used to describe the matching subcircuit pin pairs or non-matching subcircuit pins on a net. + + Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. + """ + def first(self) -> NetSubcircuitPinRef: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> NetSubcircuitPinRef: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + class NetTerminalRefPair: + r""" + @brief A match entry for a net terminal pair. + This object is used to describe the matching terminal pairs or non-matching terminals on a net. + + Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. + """ + def first(self) -> NetTerminalRef: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> NetTerminalRef: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + class PinPairData: + r""" + @brief A pin match entry. + This object is used to describe the relationship of two circuit pins in a netlist match. + + Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. + This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. + """ + def first(self) -> Pin: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> Pin: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + def status(self) -> NetlistCrossReference.Status: + r""" + @brief Gets the status of the relation. + This enum described the match status of the relation pair. + """ + class Status: + r""" + @brief This class represents the NetlistCrossReference::Status enum + """ + Match: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Match + An exact match exists if this code is present. + """ + MatchWithWarning: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::MatchWithWarning + If this code is present, a match was found but a warning is issued. For nets, this means that the choice is ambiguous and one, unspecific candidate has been chosen. For devices, this means a device match was established, but parameters or the device class are not matching exactly. + """ + Mismatch: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Mismatch + This code means there is a match candidate, but exact identity could not be confirmed. + """ + NoMatch: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::NoMatch + If this code is present, no match could be found. + There is also 'Mismatch' which means there is a candidate, but exact identity could not be confirmed. + """ + None_: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::None + No specific status is implied if this code is present. + """ + Skipped: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Skipped + On circuits this code means that a match has not been attempted because subcircuits of this circuits were not matched. As circuit matching happens bottom-up, all subcircuits must match at least with respect to their pins to allow any parent circuit to be matched. + """ + @overload + @classmethod + def new(cls, i: int) -> NetlistCrossReference.Status: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> NetlistCrossReference.Status: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: NetlistCrossReference.Status) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + class SubCircuitPairData: + r""" + @brief A subcircuit match entry. + This object is used to describe the relationship of two subcircuits in a netlist match. + + Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. + This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. + """ + def first(self) -> SubCircuit: + r""" + @brief Gets the first object of the relation pair. + The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. + """ + def second(self) -> SubCircuit: + r""" + @brief Gets the second object of the relation pair. + The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. + """ + def status(self) -> NetlistCrossReference.Status: + r""" + @brief Gets the status of the relation. + This enum described the match status of the relation pair. + """ + Match: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Match + An exact match exists if this code is present. + """ + MatchWithWarning: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::MatchWithWarning + If this code is present, a match was found but a warning is issued. For nets, this means that the choice is ambiguous and one, unspecific candidate has been chosen. For devices, this means a device match was established, but parameters or the device class are not matching exactly. + """ + Mismatch: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Mismatch + This code means there is a match candidate, but exact identity could not be confirmed. + """ + NoMatch: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::NoMatch + If this code is present, no match could be found. + There is also 'Mismatch' which means there is a candidate, but exact identity could not be confirmed. + """ + None_: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::None + No specific status is implied if this code is present. + """ + Skipped: ClassVar[NetlistCrossReference.Status] + r""" + @brief Enum constant NetlistCrossReference::Skipped + On circuits this code means that a match has not been attempted because subcircuits of this circuits were not matched. As circuit matching happens bottom-up, all subcircuits must match at least with respect to their pins to allow any parent circuit to be matched. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def circuit_count(self) -> int: + r""" + @brief Gets the number of circuit pairs in the cross-reference object. + """ + def clear(self) -> None: + r""" + @hide + """ + def each_circuit_pair(self) -> Iterator[NetlistCrossReference.CircuitPairData]: + r""" + @brief Delivers the circuit pairs and their status. + See the class description for details. + """ + def each_device_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.DevicePairData]: + r""" + @brief Delivers the device pairs and their status for the given circuit pair. + See the class description for details. + """ + def each_net_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.NetPairData]: + r""" + @brief Delivers the net pairs and their status for the given circuit pair. + See the class description for details. + """ + def each_net_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetPinRefPair]: + r""" + @brief Delivers the pin pairs for the given net pair. + For the net pair, lists the pin pairs identified on this net. + """ + def each_net_subcircuit_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetSubcircuitPinRefPair]: + r""" + @brief Delivers the subcircuit pin pairs for the given net pair. + For the net pair, lists the subcircuit pin pairs identified on this net. + """ + def each_net_terminal_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetTerminalRefPair]: + r""" + @brief Delivers the device terminal pairs for the given net pair. + For the net pair, lists the device terminal pairs identified on this net. + """ + def each_pin_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.PinPairData]: + r""" + @brief Delivers the pin pairs and their status for the given circuit pair. + See the class description for details. + """ + def each_subcircuit_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.SubCircuitPairData]: + r""" + @brief Delivers the subcircuit pairs and their status for the given circuit pair. + See the class description for details. + """ + def netlist_a(self) -> Netlist: + r""" + @brief Gets the first netlist which participated in the compare. + This member may be nil, if the respective netlist is no longer valid. In this case, the netlist cross-reference object cannot be used. + """ + def netlist_b(self) -> Netlist: + r""" + @brief Gets the second netlist which participated in the compare. + This member may be nil, if the respective netlist is no longer valid.In this case, the netlist cross-reference object cannot be used. + """ + def other_circuit_for(self, circuit: Circuit) -> Circuit: + r""" + @brief Gets the matching other circuit for a given primary circuit. + The return value will be nil if no match is found. Otherwise it is the 'b' circuit for circuits from the 'a' netlist and vice versa. + + This method has been introduced in version 0.27. + """ + def other_device_for(self, device: Device) -> Device: + r""" + @brief Gets the matching other device for a given primary device. + The return value will be nil if no match is found. Otherwise it is the 'b' device for devices from the 'a' netlist and vice versa. + + This method has been introduced in version 0.27. + """ + def other_net_for(self, net: Net) -> Net: + r""" + @brief Gets the matching other net for a given primary net. + The return value will be nil if no match is found. Otherwise it is the 'b' net for nets from the 'a' netlist and vice versa. + """ + def other_pin_for(self, pin: Pin) -> Pin: + r""" + @brief Gets the matching other pin for a given primary pin. + The return value will be nil if no match is found. Otherwise it is the 'b' pin for pins from the 'a' netlist and vice versa. + + This method has been introduced in version 0.27. + """ + def other_subcircuit_for(self, subcircuit: SubCircuit) -> SubCircuit: + r""" + @brief Gets the matching other subcircuit for a given primary subcircuit. + The return value will be nil if no match is found. Otherwise it is the 'b' subcircuit for subcircuits from the 'a' netlist and vice versa. + + This method has been introduced in version 0.27. + """ + +class NetlistDeviceExtractorError: + r""" + @brief An error that occurred during device extraction + The device extractor will keep errors that occurred during extraction of the devices. It does not by using this error class. + + An error is basically described by the cell/circuit it occurs in and the message. In addition, a geometry may be attached forming a marker that can be shown when the error is selected. The geometry is given as a \DPolygon object. If no geometry is specified, this polygon is empty. + + For categorization of the errors, a category name and description may be specified. If given, the errors will be shown in the specified category. The category description is optional. + + This class has been introduced in version 0.26. + """ + category_description: str + r""" + Getter: + @brief Gets the category description. + See \category_name= for details about categories. + Setter: + @brief Sets the category description. + See \category_name= for details about categories. + """ + category_name: str + r""" + Getter: + @brief Gets the category name. + See \category_name= for more details. + Setter: + @brief Sets the category name. + The category name is optional. If given, it specifies a formal category name. Errors with the same category name are shown in that category. If in addition a category description is specified (see \category_description), this description will be displayed as the title of. + """ + cell_name: str + r""" + Getter: + @brief Gets the cell name. + See \cell_name= for details about this attribute. + Setter: + @brief Sets the cell name. + The cell name is the name of the layout cell which was treated. This is also the name of the circuit the device should have appeared in (it may be dropped because of this error). If netlist hierarchy manipulation happens however, the circuit may not exist any longer or may be renamed. + """ + geometry: DPolygon + r""" + Getter: + @brief Gets the geometry. + See \geometry= for more details. + Setter: + @brief Sets the geometry. + The geometry is optional. If given, a marker will be shown when selecting this error. + """ + message: str + r""" + Getter: + @brief Gets the message text. + + Setter: + @brief Sets the message text. + """ + @classmethod + def new(cls) -> NetlistDeviceExtractorError: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetlistDeviceExtractorError: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetlistDeviceExtractorError: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistDeviceExtractorError) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetlistDeviceExtractorError: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class NetlistDeviceExtractorLayerDefinition: + r""" + @brief Describes a layer used in the device extraction + This read-only structure is used to describe a layer in the device extraction. + Every device has specific layers used in the device extraction process. + Layer definitions can be retrieved using \NetlistDeviceExtractor#each_layer. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls) -> NetlistDeviceExtractorLayerDefinition: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetlistDeviceExtractorLayerDefinition: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetlistDeviceExtractorLayerDefinition: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistDeviceExtractorLayerDefinition) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def description(self) -> str: + r""" + @brief Gets the description of the layer. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetlistDeviceExtractorLayerDefinition: + r""" + @brief Creates a copy of self + """ + def fallback_index(self) -> int: + r""" + @brief Gets the index of the fallback layer. + This is the index of the layer to be used when this layer isn't specified for input or (more important) output. + """ + def index(self) -> int: + r""" + @brief Gets the index of the layer. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def name(self) -> str: + r""" + @brief Gets the name of the layer. + """ + +class NetlistObject: + r""" + @brief The base class for some netlist objects. + The main purpose of this class is to supply user properties for netlist objects. + + This class has been introduced in version 0.26.2 + """ + @classmethod + def new(cls) -> NetlistObject: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetlistObject: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetlistObject: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistObject) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetlistObject: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def property(self, key: Any) -> Any: + r""" + @brief Gets the property value for the given key or nil if there is no value with this key. + """ + def property_keys(self) -> List[Any]: + r""" + @brief Gets the keys for the properties stored in this object. + """ + def set_property(self, key: Any, value: Any) -> None: + r""" + @brief Sets the property value for the given key. + Use a nil value to erase the property with this key. + """ + +class NetlistReader: + r""" + @brief Base class for netlist readers + This class is provided as a base class for netlist readers. It is not intended for reimplementation on script level, but used internally as an interface. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls) -> NetlistReader: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class NetlistSpiceReader(NetlistReader): + r""" + @brief Implements a netlist Reader for the SPICE format. + Use the SPICE reader like this: + + @code + reader = RBA::NetlistSpiceReader::new + netlist = RBA::Netlist::new + netlist.read(path, reader) + @/code + + The translation of SPICE elements can be tailored by providing a \NetlistSpiceReaderDelegate class. This allows translating of device parameters and mapping of some subcircuits to devices. + + The following example is a delegate that turns subcircuits called HVNMOS and HVPMOS into MOS4 devices with the parameters scaled by 1.5: + + @code + class MyDelegate < RBA::NetlistSpiceReaderDelegate + + # says we want to catch these subcircuits as devices + def wants_subcircuit(name) + name == "HVNMOS" || name == "HVPMOS" + end + + # translate the element + def element(circuit, el, name, model, value, nets, params) + + if el != "X" + # all other elements are left to the standard implementation + return super + end + + if nets.size != 4 + error("Subcircuit #{model} needs four nodes") + end + + # provide a device class + cls = circuit.netlist.device_class_by_name(model) + if ! cls + cls = RBA::DeviceClassMOS4Transistor::new + cls.name = model + circuit.netlist.add(cls) + end + + # create a device + device = circuit.create_device(cls, name) + + # and configure the device + [ "S", "G", "D", "B" ].each_with_index do |t,index| + device.connect_terminal(t, nets[index]) + end + params.each do |p,value| + device.set_parameter(p, value * 1.5) + end + + end + + end + + # usage: + + mydelegate = MyDelegate::new + reader = RBA::NetlistSpiceReader::new(mydelegate) + + nl = RBA::Netlist::new + nl.read(input_file, reader) + @/code + + A somewhat contrived example for using the delegate to translate net names is this: + + @code + class MyDelegate < RBA::NetlistSpiceReaderDelegate + + # translates 'VDD' to 'VXX' and leave all other net names as is: + alias translate_net_name_org translate_net_name + def translate_net_name(n) + return n == "VDD" ? "VXX" : translate_net_name_org(n)} + end + + end + @/code + + This class has been introduced in version 0.26. It has been extended in version 0.27.1. + """ + @overload + @classmethod + def new(cls) -> NetlistSpiceReader: + r""" + @brief Creates a new reader. + """ + @overload + @classmethod + def new(cls, delegate: NetlistSpiceReaderDelegate) -> NetlistSpiceReader: + r""" + @brief Creates a new reader with a delegate. + """ + def __copy__(self) -> NetlistSpiceReader: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetlistSpiceReader: + r""" + @brief Creates a copy of self + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a new reader. + """ + @overload + def __init__(self, delegate: NetlistSpiceReaderDelegate) -> None: + r""" + @brief Creates a new reader with a delegate. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistReader) -> None: + r""" + @brief Assigns another object to self + """ + def dup(self) -> NetlistSpiceReader: + r""" + @brief Creates a copy of self + """ + +class NetlistSpiceReaderDelegate: + r""" + @brief Provides a delegate for the SPICE reader for translating device statements + Supply a customized class to provide a specialized reading scheme for devices. You need a customized class if you want to implement device reading from model subcircuits or to translate device parameters. + + See \NetlistSpiceReader for more details. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls) -> NetlistSpiceReaderDelegate: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetlistSpiceReaderDelegate: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetlistSpiceReaderDelegate: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistSpiceReaderDelegate) -> None: + r""" + @brief Assigns another object to self + """ + def control_statement(self, arg0: str) -> bool: + r""" + @hide + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetlistSpiceReaderDelegate: + r""" + @brief Creates a copy of self + """ + def element(self, arg0: Circuit, arg1: str, arg2: str, arg3: str, arg4: float, arg5: Sequence[Net], arg6: Dict[str, Any]) -> bool: + r""" + @hide + """ + def error(self, msg: str) -> None: + r""" + @brief Issues an error with the given message. + Use this method to generate an error. + """ + def finish(self, arg0: Netlist) -> None: + r""" + @hide + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def parse_element(self, arg0: str, arg1: str) -> ParseElementData: + r""" + @hide + """ + def parse_element_components(self, s: str, variables: Optional[Dict[str, Any]] = ...) -> ParseElementComponentsData: + r""" + @brief Parses a string into string and parameter components. + This method is provided to simplify the implementation of 'parse_element'. It takes a string and splits it into string arguments and parameter values. For example, 'a b c=6' renders two string arguments in 'nn' and one parameter ('C'->6.0). It returns data \ParseElementComponentsData object with the strings and parameters. + The parameter names are already translated to upper case. + + The variables dictionary defines named variables with the given values. + + This method has been introduced in version 0.27.1. The variables argument has been added in version 0.28.6. + """ + def start(self, arg0: Netlist) -> None: + r""" + @hide + """ + def translate_net_name(self, arg0: str) -> str: + r""" + @hide + """ + def value_from_string(self, s: str, variables: Optional[Dict[str, Any]] = ...) -> Any: + r""" + @brief Translates a string into a value + This function simplifies the implementation of SPICE readers by providing a translation of a unit-annotated string into double values. For example, '1k' is translated to 1000.0. In addition, simple formula evaluation is supported, e.g '(1+3)*2' is translated into 8.0. + + The variables dictionary defines named variables with the given values. + + This method has been introduced in version 0.27.1. The variables argument has been added in version 0.28.6. + """ + def variables(self) -> Dict[str, Any]: + r""" + @brief Gets the variables defined inside the SPICE file during execution of 'parse_element' + In order to evaluate formulas, this method allows accessing the variables that are present during the execution of the SPICE reader. + + This method has been introduced in version 0.28.6. + """ + def wants_subcircuit(self, arg0: str) -> bool: + r""" + @hide + """ + +class NetlistSpiceWriter(NetlistWriter): + r""" + @brief Implements a netlist writer for the SPICE format. + Provide a delegate for customizing the way devices are written. + + Use the SPICE writer like this: + + @code + writer = RBA::NetlistSpiceWriter::new + netlist.write(path, writer) + @/code + + You can give a custom description for the headline: + + @code + writer = RBA::NetlistSpiceWriter::new + netlist.write(path, writer, "A custom description") + @/code + + To customize the output, you can use a device writer delegate. + The delegate is an object of a class derived from \NetlistSpiceWriterDelegate which reimplements several methods to customize the following parts: + + @ul + @li A global header (\NetlistSpiceWriterDelegate#write_header): this method is called to print the part right after the headline @/li + @li A per-device class header (\NetlistSpiceWriterDelegate#write_device_intro): this method is called for every device class and may print device-class specific headers (e.g. model definitions) @/li + @li Per-device output: this method (\NetlistSpiceWriterDelegate#write_device): this method is called for every device and may print the device statement(s) in a specific way. @/li + @/ul + + The delegate must use \NetlistSpiceWriterDelegate#emit_line to print a line, \NetlistSpiceWriterDelegate#emit_comment to print a comment etc. + For more method see \NetlistSpiceWriterDelegate. + + A sample with a delegate is this: + + @code + class MyDelegate < RBA::NetlistSpiceWriterDelegate + + def write_header + emit_line("*** My special header") + end + + def write_device_intro(cls) + emit_comment("My intro for class " + cls.name) + end + + def write_device(dev) + if dev.device_class.name != "MYDEVICE" + emit_comment("Terminal #1: " + net_to_string(dev.net_for_terminal(0))) + emit_comment("Terminal #2: " + net_to_string(dev.net_for_terminal(1))) + super(dev) + emit_comment("After device " + dev.expanded_name) + else + super(dev) + end + end + + end + + # write the netlist with delegate: + writer = RBA::NetlistSpiceWriter::new(MyDelegate::new) + netlist.write(path, writer) + @/code + + This class has been introduced in version 0.26. + """ + use_net_names: bool + r""" + Getter: + @brief Gets a value indicating whether to use net names (true) or net numbers (false). + + Setter: + @brief Sets a value indicating whether to use net names (true) or net numbers (false). + The default is to use net numbers. + """ + with_comments: bool + r""" + Getter: + @brief Gets a value indicating whether to embed comments for position etc. (true) or not (false). + + Setter: + @brief Sets a value indicating whether to embed comments for position etc. (true) or not (false). + The default is to embed comments. + """ + @overload + @classmethod + def new(cls) -> NetlistSpiceWriter: + r""" + @brief Creates a new writer without delegate. + """ + @overload + @classmethod + def new(cls, arg0: NetlistSpiceWriterDelegate) -> NetlistSpiceWriter: + r""" + @brief Creates a new writer with a delegate. + """ + def __copy__(self) -> NetlistSpiceWriter: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetlistSpiceWriter: + r""" + @brief Creates a copy of self + """ + @overload + def __init__(self) -> None: + r""" + @brief Creates a new writer without delegate. + """ + @overload + def __init__(self, arg0: NetlistSpiceWriterDelegate) -> None: + r""" + @brief Creates a new writer with a delegate. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistWriter) -> None: + r""" + @brief Assigns another object to self + """ + def dup(self) -> NetlistSpiceWriter: + r""" + @brief Creates a copy of self + """ + +class NetlistSpiceWriterDelegate: + r""" + @brief Provides a delegate for the SPICE writer for doing special formatting for devices + Supply a customized class to provide a specialized writing scheme for devices. You need a customized class if you want to implement special devices or you want to use subcircuits rather than the built-in devices. + + See \NetlistSpiceWriter for more details. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls) -> NetlistSpiceWriterDelegate: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetlistSpiceWriterDelegate: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetlistSpiceWriterDelegate: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistSpiceWriterDelegate) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetlistSpiceWriterDelegate: + r""" + @brief Creates a copy of self + """ + def emit_comment(self, comment: str) -> None: + r""" + @brief Writes the given comment into the file + """ + def emit_line(self, line: str) -> None: + r""" + @brief Writes the given line into the file + """ + def format_name(self, name: str) -> str: + r""" + @brief Formats the given name in a SPICE-compatible way + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def net_to_string(self, net: Net) -> str: + r""" + @brief Gets the node ID for the given net + The node ID is a numeric string instead of the full name of the net. Numeric IDs are used within SPICE netlist because they are usually shorter. + """ + def write_device(self, device: Device) -> None: + r""" + @hide + """ + def write_device_intro(self, arg0: DeviceClass) -> None: + r""" + @hide + """ + def write_header(self) -> None: + r""" + @hide + """ + +class NetlistWriter: + r""" + @brief Base class for netlist writers + This class is provided as a base class for netlist writers. It is not intended for reimplementation on script level, but used internally as an interface. + + This class has been introduced in version 0.26. + """ + @classmethod + def new(cls) -> NetlistWriter: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class PCellDeclaration(PCellDeclaration_Native): + r""" + @brief A PCell declaration providing the parameters and code to produce the PCell + + A PCell declaration is basically the recipe of how to create a PCell layout from + a parameter set. The declaration includes + + @ul + @li Parameters: names, types, default values @/li + @li Layers: the layers the PCell wants to create @/li + @li Code: a production callback that is called whenever a PCell is instantiated with a certain parameter set @/li + @li Display name: the name that is shown for a given PCell instance @/li + @/ul + + All these declarations are implemented by deriving from the PCellDeclaration class + and reimplementing the specific methods. Reimplementing the \display_name method is + optional. The default implementation creates a name from the PCell name plus the + parameters. + + By supplying the information about the layers it wants to create, KLayout is able to + call the production callback with a defined set of the layer ID's which are already + mapped to valid actual layout layers. + + This class has been introduced in version 0.22. + """ + def _assign(self, other: PCellDeclaration_Native) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> PCellDeclaration: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def callback(self, arg0: Layout, arg1: str, arg2: PCellParameterStates) -> None: + r""" + @hide + """ + def can_create_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> bool: + r""" + @hide + """ + def display_text(self, arg0: Sequence[Any]) -> str: + r""" + @hide + """ + def get_parameters(self) -> List[PCellParameterDeclaration]: + r""" + @hide + """ + def parameters_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> List[Any]: + r""" + @hide + """ + def produce(self, arg0: Layout, arg1: Sequence[int], arg2: Sequence[Any], arg3: Cell) -> None: + r""" + @hide + """ + def transformation_from_shape(self, arg0: Layout, arg1: Shape, arg2: int) -> Trans: + r""" + @hide + """ + def wants_lazy_evaluation(self) -> bool: + r""" + @hide + """ + +class PCellDeclaration_Native: + r""" + @hide + @alias PCellDeclaration + """ + @classmethod + def new(cls) -> PCellDeclaration_Native: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> PCellDeclaration_Native: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> PCellDeclaration_Native: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: PCellDeclaration_Native) -> None: + r""" + @brief Assigns another object to self + """ + def callback(self, layout: Layout, name: str, states: PCellParameterStates) -> None: + r""" + """ + def can_create_from_shape(self, layout: Layout, shape: Shape, layer: int) -> bool: + r""" + """ + def coerce_parameters(self, layout: Layout, parameters: Sequence[Any]) -> List[Any]: + r""" + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def display_text(self, parameters: Sequence[Any]) -> str: + r""" + """ + def dup(self) -> PCellDeclaration_Native: + r""" + @brief Creates a copy of self + """ + def get_layers(self, parameters: Sequence[Any]) -> List[LayerInfo]: + r""" + """ + def get_parameters(self) -> List[PCellParameterDeclaration]: + r""" + """ + def id(self) -> int: + r""" + @brief Gets the integer ID of the PCell declaration + This ID is used to identify the PCell in the context of a Layout object for example + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def layout(self) -> Layout: + r""" + @brief Gets the Layout object the PCell is registered in or nil if it is not registered yet. + This attribute has been added in version 0.27.5. + """ + def name(self) -> str: + r""" + @brief Gets the name of the PCell + """ + def parameters_from_shape(self, layout: Layout, shape: Shape, layer: int) -> List[Any]: + r""" + """ + def produce(self, layout: Layout, layers: Sequence[int], parameters: Sequence[Any], cell: Cell) -> None: + r""" + """ + def transformation_from_shape(self, layout: Layout, shape: Shape, layer: int) -> Trans: + r""" + """ + def wants_lazy_evaluation(self) -> bool: + r""" + """ + +class PCellParameterDeclaration: + r""" + @brief A PCell parameter declaration + + This class declares a PCell parameter by providing a name, the type and a value + and additional + information like description, unit string and default value. It is used in the \PCellDeclaration class to + deliver the necessary information. + + This class has been introduced in version 0.22. + """ + TypeBoolean: ClassVar[int] + r""" + @brief Type code: boolean data + """ + TypeCallback: ClassVar[int] + r""" + @brief Type code: a button triggering a callback + + This code has been introduced in version 0.28. + """ + TypeDouble: ClassVar[int] + r""" + @brief Type code: floating-point data + """ + TypeInt: ClassVar[int] + r""" + @brief Type code: integer data + """ + TypeLayer: ClassVar[int] + r""" + @brief Type code: a layer (a \LayerInfo object) + """ + TypeList: ClassVar[int] + r""" + @brief Type code: a list of variants + """ + TypeNone: ClassVar[int] + r""" + @brief Type code: unspecific type + """ + TypeShape: ClassVar[int] + r""" + @brief Type code: a guiding shape (Box, Edge, Point, Polygon or Path) + """ + TypeString: ClassVar[int] + r""" + @brief Type code: string data + """ + default: Any + r""" + Getter: + @brief Gets the default value + + Setter: + @brief Sets the default value + If a default value is defined, it will be used to initialize the parameter value + when a PCell is created. + """ + description: str + r""" + Getter: + @brief Gets the description text + + Setter: + @brief Sets the description + """ + hidden: bool + r""" + Getter: + @brief Returns true, if the parameter is a hidden parameter that should not be shown in the user interface + By making a parameter hidden, it is possible to create internal parameters which cannot be + edited. + + Setter: + @brief Makes the parameter hidden if this attribute is set to true + """ + name: str + r""" + Getter: + @brief Gets the name + + Setter: + @brief Sets the name + """ + readonly: bool + r""" + Getter: + @brief Returns true, if the parameter is a read-only parameter + By making a parameter read-only, it is shown but cannot be + edited. + + Setter: + @brief Makes the parameter read-only if this attribute is set to true + """ + type: int + r""" + Getter: + @brief Gets the type + The type is one of the T... constants. + Setter: + @brief Sets the type + """ + unit: str + r""" + Getter: + @brief Gets the unit string + + Setter: + @brief Sets the unit string + The unit string is shown right to the edit fields for numeric parameters. + """ + @overload + @classmethod + def new(cls, name: str, type: int, description: str) -> PCellParameterDeclaration: + r""" + @brief Create a new parameter declaration with the given name and type + @param name The parameter name + @param type One of the Type... constants describing the type of the parameter + @param description The description text + """ + @overload + @classmethod + def new(cls, name: str, type: int, description: str, default: Any) -> PCellParameterDeclaration: + r""" + @brief Create a new parameter declaration with the given name, type and default value + @param name The parameter name + @param type One of the Type... constants describing the type of the parameter + @param description The description text + @param default The default (initial) value + """ + @overload + @classmethod + def new(cls, name: str, type: int, description: str, default: Any, unit: str) -> PCellParameterDeclaration: + r""" + @brief Create a new parameter declaration with the given name, type, default value and unit string + @param name The parameter name + @param type One of the Type... constants describing the type of the parameter + @param description The description text + @param default The default (initial) value + @param unit The unit string + """ + def __copy__(self) -> PCellParameterDeclaration: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> PCellParameterDeclaration: + r""" + @brief Creates a copy of self + """ + @overload + def __init__(self, name: str, type: int, description: str) -> None: + r""" + @brief Create a new parameter declaration with the given name and type + @param name The parameter name + @param type One of the Type... constants describing the type of the parameter + @param description The description text + """ + @overload + def __init__(self, name: str, type: int, description: str, default: Any) -> None: + r""" + @brief Create a new parameter declaration with the given name, type and default value + @param name The parameter name + @param type One of the Type... constants describing the type of the parameter + @param description The description text + @param default The default (initial) value + """ + @overload + def __init__(self, name: str, type: int, description: str, default: Any, unit: str) -> None: + r""" + @brief Create a new parameter declaration with the given name, type, default value and unit string + @param name The parameter name + @param type One of the Type... constants describing the type of the parameter + @param description The description text + @param default The default (initial) value + @param unit The unit string + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_choice(self, description: str, value: Any) -> None: + r""" + @brief Add a new value to the list of choices + This method will add the given value with the given description to the list of + choices. If choices are defined, KLayout will show a drop-down box instead of an + entry field in the parameter user interface. + """ + def assign(self, other: PCellParameterDeclaration) -> None: + r""" + @brief Assigns another object to self + """ + def choice_descriptions(self) -> List[str]: + r""" + @brief Returns a list of choice descriptions + """ + def choice_values(self) -> List[Any]: + r""" + @brief Returns a list of choice values + """ + def clear_choices(self) -> None: + r""" + @brief Clears the list of choices + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> PCellParameterDeclaration: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class PCellParameterState: + r""" + @brief Provides access to the attributes of a single parameter within \PCellParameterStates. + + See \PCellParameterStates for details about this feature. + + This class has been introduced in version 0.28. + """ + class ParameterStateIcon: + r""" + @brief This enum specifies the icon shown next to the parameter in PCell parameter list. + + This enum was introduced in version 0.28. + """ + ErrorIcon: ClassVar[PCellParameterState.ParameterStateIcon] + r""" + @brief An icon indicating an error is shown + """ + InfoIcon: ClassVar[PCellParameterState.ParameterStateIcon] + r""" + @brief A general 'information' icon is shown + """ + NoIcon: ClassVar[PCellParameterState.ParameterStateIcon] + r""" + @brief No icon is shown for the parameter + """ + WarningIcon: ClassVar[PCellParameterState.ParameterStateIcon] + r""" + @brief An icon indicating a warning is shown + """ + @overload + @classmethod + def new(cls, i: int) -> PCellParameterState.ParameterStateIcon: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> PCellParameterState.ParameterStateIcon: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: PCellParameterState.ParameterStateIcon) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + ErrorIcon: ClassVar[PCellParameterState.ParameterStateIcon] + r""" + @brief An icon indicating an error is shown + """ + InfoIcon: ClassVar[PCellParameterState.ParameterStateIcon] + r""" + @brief A general 'information' icon is shown + """ + NoIcon: ClassVar[PCellParameterState.ParameterStateIcon] + r""" + @brief No icon is shown for the parameter + """ + WarningIcon: ClassVar[PCellParameterState.ParameterStateIcon] + r""" + @brief An icon indicating a warning is shown + """ + @property + def icon(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the icon for the parameter + """ + enabled: bool + r""" + Getter: + @brief Gets a value indicating whether the parameter is enabled in the parameter form + + Setter: + @brief Sets a value indicating whether the parameter is enabled in the parameter form + """ + readonly: bool + r""" + Getter: + @brief Gets a value indicating whether the parameter is read-only (not editable) in the parameter form + + Setter: + @brief Sets a value indicating whether the parameter is made read-only (not editable) in the parameter form + """ + tooltip: str + r""" + Getter: + @brief Gets the tool tip text + + Setter: + @brief Sets the tool tip text + + The tool tip is shown when hovering over the parameter label or edit field. + """ + value: Any + r""" + Getter: + @brief Gets the value of the parameter + + Setter: + @brief Sets the value of the parameter + """ + visible: bool + r""" + Getter: + @brief Gets a value indicating whether the parameter is visible in the parameter form + + Setter: + @brief Sets a value indicating whether the parameter is visible in the parameter form + """ + @classmethod + def new(cls) -> PCellParameterState: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> PCellParameterState: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> PCellParameterState: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: PCellParameterState) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> PCellParameterState: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_enabled(self) -> bool: + r""" + @brief Gets a value indicating whether the parameter is enabled in the parameter form + """ + def is_readonly(self) -> bool: + r""" + @brief Gets a value indicating whether the parameter is read-only (not editable) in the parameter form + """ + def is_visible(self) -> bool: + r""" + @brief Gets a value indicating whether the parameter is visible in the parameter form + """ + +class PCellParameterStates: + r""" + @brief Provides access to the parameter states inside a 'callback' implementation of a PCell + + Example: enables or disables a parameter 'n' based on the value: + + @code + n_param = states.parameter("n") + n_param.enabled = n_param.value > 1.0 + @/code + + This class has been introduced in version 0.28. + """ + @classmethod + def new(cls) -> PCellParameterStates: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> PCellParameterStates: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> PCellParameterStates: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: PCellParameterStates) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> PCellParameterStates: + r""" + @brief Creates a copy of self + """ + def has_parameter(self, name: str) -> bool: + r""" + @brief Gets a value indicating whether a parameter with that name exists + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def parameter(self, name: str) -> PCellParameterState: + r""" + @brief Gets the parameter by name + + This will return a \PCellParameterState object that can be used to manipulate the parameter state. + """ + +class ParentInstArray: + r""" + @brief A parent instance + + A parent instance is basically an inverse instance: instead of pointing + to the child cell, it is pointing to the parent cell and the transformation + is representing the shift of the parent cell relative to the child cell. + For memory performance, a parent instance is not stored as a instance but + rather as a reference to a child instance and a reference to the cell which + is the parent. + The parent instance itself is computed on the fly. It is representative for + a set of instances belonging to the same cell index. The special parent instance + iterator takes care of producing the right sequence (\Cell#each_parent_inst). + + See @The Database API@ for more details about the database objects. + """ + @classmethod + def new(cls) -> ParentInstArray: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> ParentInstArray: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> ParentInstArray: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: ParentInstArray) -> None: + r""" + @brief Assigns another object to self + """ + def child_inst(self) -> Instance: + r""" + @brief Retrieve the child instance associated with this parent instance + + Starting with version 0.15, this method returns an \Instance object rather than a \CellInstArray reference. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dinst(self) -> DCellInstArray: + r""" + @brief Compute the inverse instance by which the parent is seen from the child in micrometer units + + This convenience method has been introduced in version 0.28. + """ + def dup(self) -> ParentInstArray: + r""" + @brief Creates a copy of self + """ + def inst(self) -> CellInstArray: + r""" + @brief Compute the inverse instance by which the parent is seen from the child + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def parent_cell_index(self) -> int: + r""" + @brief Gets the index of the parent cell + """ + +class ParseElementComponentsData: + r""" + @brief Supplies the return value for \NetlistSpiceReaderDelegate#parse_element_components. + This is a structure with two members: 'strings' for the string arguments and 'parameters' for the named arguments. + + This helper class has been introduced in version 0.27.1. Starting with version 0.28.6, named parameters can be string types too. + """ + parameters: Dict[str, Any] + r""" + Getter: + @brief Gets the (named) parameters + Named parameters are typically (but not neccessarily) numerical, like 'w=0.15u'. + Setter: + @brief Sets the (named) parameters + """ + strings: List[str] + r""" + Getter: + @brief Gets the (unnamed) string parameters + These parameters are typically net names or model name. + Setter: + @brief Sets the (unnamed) string parameters + """ + @classmethod + def new(cls) -> ParseElementComponentsData: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> ParseElementComponentsData: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> ParseElementComponentsData: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: ParseElementComponentsData) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> ParseElementComponentsData: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class ParseElementData: + r""" + @brief Supplies the return value for \NetlistSpiceReaderDelegate#parse_element. + This is a structure with four members: 'model_name' for the model name, 'value' for the default numerical value, 'net_names' for the net names and 'parameters' for the named parameters. + + This helper class has been introduced in version 0.27.1. Starting with version 0.28.6, named parameters can be string types too. + """ + model_name: str + r""" + Getter: + @brief Gets the model name + + Setter: + @brief Sets the model name + """ + net_names: List[str] + r""" + Getter: + @brief Gets the net names + + Setter: + @brief Sets the net names + """ + parameters: Dict[str, Any] + r""" + Getter: + @brief Gets the (named) parameters + + Setter: + @brief Sets the (named) parameters + """ + value: float + r""" + Getter: + @brief Gets the value + + Setter: + @brief Sets the value + """ + @classmethod + def new(cls) -> ParseElementData: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> ParseElementData: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> ParseElementData: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: ParseElementData) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> ParseElementData: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class Path: + r""" + @brief A path class + + A path consists of an sequence of line segments forming the 'spine' of the path and a width. In addition, the starting point can be drawn back by a certain extent (the 'begin extension') and the end point can be pulled forward somewhat (by the 'end extension'). + + A path may have round ends for special purposes. In particular, a round-ended path with a single point can represent a circle. Round-ended paths should have being and end extensions equal to half the width. Non-round-ended paths with a single point are allowed but the definition of the resulting shape in not well defined and may differ in other tools. + + See @The Database API@ for more details about the database objects. + """ + bgn_ext: int + r""" + Getter: + @brief Get the begin extension + + Setter: + @brief Set the begin extension + """ + end_ext: int + r""" + Getter: + @brief Get the end extension + + Setter: + @brief Set the end extension + """ + points: int + r""" + Getter: + @brief Get the number of points + Setter: + @brief Set the points of the path + @param p An array of points to assign to the path's spine + """ + round: bool + r""" + Getter: + @brief Returns true, if the path has round ends + + Setter: + @brief Set the 'round ends' flag + A path with round ends show half circles at the ends, instead of square or rectangular ends. Paths with this flag set should use a begin and end extension of half the width (see \bgn_ext and \end_ext). The interpretation of such paths in other tools may differ otherwise. + """ + width: int + r""" + Getter: + @brief Get the width + + Setter: + @brief Set the width + """ + @classmethod + def from_dpath(cls, dpath: DPath) -> Path: + r""" + @brief Creates an integer coordinate path from a floating-point coordinate path + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. + """ + @classmethod + def from_s(cls, s: str) -> Path: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> Path: + r""" + @brief Default constructor: creates an empty (invalid) path with width 0 + """ + @overload + @classmethod + def new(cls, dpath: DPath) -> Path: + r""" + @brief Creates an integer coordinate path from a floating-point coordinate path + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. + """ + @overload + @classmethod + def new(cls, pts: Sequence[Point], width: int) -> Path: + r""" + @brief Constructor given the points of the path's spine and the width + + + @param pts The points forming the spine of the path + @param width The width of the path + """ + @overload + @classmethod + def new(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> Path: + r""" + @brief Constructor given the points of the path's spine, the width and the extensions + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + """ + @overload + @classmethod + def new(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> Path: + r""" + @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + @param round If this flag is true, the path will get rounded ends + """ + @classmethod + def new_pw(cls, pts: Sequence[Point], width: int) -> Path: + r""" + @brief Constructor given the points of the path's spine and the width + + + @param pts The points forming the spine of the path + @param width The width of the path + """ + @classmethod + def new_pwx(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> Path: + r""" + @brief Constructor given the points of the path's spine, the width and the extensions + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + """ + @classmethod + def new_pwxr(cls, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> Path: + r""" + @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + @param round If this flag is true, the path will get rounded ends + """ + def __copy__(self) -> Path: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Path: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Equality test + @param p The object to compare against + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates an empty (invalid) path with width 0 + """ + @overload + def __init__(self, dpath: DPath) -> None: + r""" + @brief Creates an integer coordinate path from a floating-point coordinate path + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpath'. + """ + @overload + def __init__(self, pts: Sequence[Point], width: int) -> None: + r""" + @brief Constructor given the points of the path's spine and the width + + + @param pts The points forming the spine of the path + @param width The width of the path + """ + @overload + def __init__(self, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int) -> None: + r""" + @brief Constructor given the points of the path's spine, the width and the extensions + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + """ + @overload + def __init__(self, pts: Sequence[Point], width: int, bgn_ext: int, end_ext: int, round: bool) -> None: + r""" + @brief Constructor given the points of the path's spine, the width, the extensions and the round end flag + + + @param pts The points forming the spine of the path + @param width The width of the path + @param bgn_ext The begin extension of the path + @param end_ext The end extension of the path + @param round If this flag is true, the path will get rounded ends + """ + def __lt__(self, p: Path) -> bool: + r""" + @brief Less operator + @param p The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + """ + def __mul__(self, f: float) -> Path: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Inequality test + @param p The object to compare against + """ + def __rmul__(self, f: float) -> Path: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self) -> str: + r""" + @brief Convert to a string + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def area(self) -> int: + r""" + @brief Returns the approximate area of the path + This method returns the approximate value of the area. It is computed from the length times the width. end extensions are taken into account correctly, but not effects of the corner interpolation. + This method was added in version 0.22. + """ + def assign(self, other: Path) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Returns the bounding box of the path + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> Path: + r""" + @brief Creates a copy of self + """ + def each_point(self) -> Iterator[Point]: + r""" + @brief Get the points that make up the path's spine + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_round(self) -> bool: + r""" + @brief Returns true, if the path has round ends + """ + def length(self) -> int: + r""" + @brief Returns the length of the path + the length of the path is determined by summing the lengths of the segments and adding begin and end extensions. For round-ended paths the length of the paths between the tips of the ends. + + This method was added in version 0.23. + """ + @overload + def move(self, dx: int, dy: int) -> Path: + r""" + @brief Moves the path. + + Moves the path by the given offset and returns the + moved path. The path is overwritten. + + @param dx The x distance to move the path. + @param dy The y distance to move the path. + + @return The moved path. + + This version has been added in version 0.23. + """ + @overload + def move(self, p: Vector) -> Path: + r""" + @brief Moves the path. + + Moves the path by the given offset and returns the + moved path. The path is overwritten. + + @param p The distance to move the path. + + @return The moved path. + """ + @overload + def moved(self, dx: int, dy: int) -> Path: + r""" + @brief Returns the moved path (does not change self) + + Moves the path by the given offset and returns the + moved path. The path is not modified. + + @param dx The x distance to move the path. + @param dy The y distance to move the path. + + @return The moved path. + + This version has been added in version 0.23. + """ + @overload + def moved(self, p: Vector) -> Path: + r""" + @brief Returns the moved path (does not change self) + + Moves the path by the given offset and returns the + moved path. The path is not modified. + + @param p The distance to move the path. + + @return The moved path. + """ + def num_points(self) -> int: + r""" + @brief Get the number of points + """ + def perimeter(self) -> int: + r""" + @brief Returns the approximate perimeter of the path + This method returns the approximate value of the perimeter. It is computed from the length and the width. end extensions are taken into account correctly, but not effects of the corner interpolation. + This method was added in version 0.24.4. + """ + def polygon(self) -> Polygon: + r""" + @brief Convert the path to a polygon + The returned polygon is not guaranteed to be non-self overlapping. This may happen if the path overlaps itself or contains very short segments. + """ + def round_corners(self, radius: float, npoints: int) -> Path: + r""" + @brief Creates a new path whose corners are interpolated with circular bends + + @param radius The radius of the bends + @param npoints The number of points (per full circle) used for interpolating the bends + + This method has been introduced in version 0.25. + """ + def simple_polygon(self) -> SimplePolygon: + r""" + @brief Convert the path to a simple polygon + The returned polygon is not guaranteed to be non-selfoverlapping. This may happen if the path overlaps itself or contains very short segments. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DPath: + r""" + @brief Converts the path to a floating-point coordinate path + + The database unit can be specified to translate the integer-coordinate path into a floating-point coordinate path in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self) -> str: + r""" + @brief Convert to a string + """ + @overload + def transformed(self, t: CplxTrans) -> DPath: + r""" + @brief Transform the path. + + Transforms the path with the given complex transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path. + """ + @overload + def transformed(self, t: ICplxTrans) -> Path: + r""" + @brief Transform the path. + + Transforms the path with the given complex transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path (in this case an integer coordinate path). + + This method has been introduced in version 0.18. + """ + @overload + def transformed(self, t: Trans) -> Path: + r""" + @brief Transform the path. + + Transforms the path with the given transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path. + """ + def transformed_cplx(self, t: CplxTrans) -> DPath: + r""" + @brief Transform the path. + + Transforms the path with the given complex transformation. + Does not modify the path but returns the transformed path. + + @param t The transformation to apply. + + @return The transformed path. + """ + +class Pin(NetlistObject): + r""" + @brief A pin of a circuit. + Pin objects are used to describe the outgoing pins of a circuit. To create a new pin of a circuit, use \Circuit#create_pin. + + This class has been added in version 0.26. + """ + def _assign(self, other: NetlistObject) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> Pin: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def expanded_name(self) -> str: + r""" + @brief Gets the expanded name of the pin. + The expanded name is the name or a generic identifier made from the ID if the name is empty. + """ + def id(self) -> int: + r""" + @brief Gets the ID of the pin. + """ + def name(self) -> str: + r""" + @brief Gets the name of the pin. + """ + +class Point: + r""" + @brief An integer point class + Points represent a coordinate in the two-dimensional coordinate space of layout. They are not geometrical objects by itself. But they are frequently used in the database API for various purposes. + + See @The Database API@ for more details about the database objects. + """ + x: int + r""" + Getter: + @brief Accessor to the x coordinate + + Setter: + @brief Write accessor to the x coordinate + """ + y: int + r""" + Getter: + @brief Accessor to the y coordinate + + Setter: + @brief Write accessor to the y coordinate + """ + @classmethod + def from_dpoint(cls, dpoint: DPoint) -> Point: + r""" + @brief Creates an integer coordinate point from a floating-point coordinate point + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'. + """ + @classmethod + def from_s(cls, s: str) -> Point: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> Point: + r""" + @brief Default constructor: creates a point at 0,0 + """ + @overload + @classmethod + def new(cls, dpoint: DPoint) -> Point: + r""" + @brief Creates an integer coordinate point from a floating-point coordinate point + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'. + """ + @overload + @classmethod + def new(cls, v: Vector) -> Point: + r""" + @brief Default constructor: creates a point at from an vector + This constructor is equivalent to computing point(0,0)+v. + This method has been introduced in version 0.25. + """ + @overload + @classmethod + def new(cls, x: int, y: int) -> Point: + r""" + @brief Constructor for a point from two coordinate values + + """ + def __add__(self, v: Vector) -> Point: + r""" + @brief Adds a vector to a point + + + Adds vector v to self by adding the coordinates. + + Starting with version 0.25, this method expects a vector argument. + """ + def __copy__(self) -> Point: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Point: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Equality test operator + + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given point. This method enables points as hash keys. + + This method has been introduced in version 0.25. + """ + def __imul__(self, f: float) -> Point: + r""" + @brief Scaling by some factor + + + Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. + """ + @overload + def __init__(self) -> None: + r""" + @brief Default constructor: creates a point at 0,0 + """ + @overload + def __init__(self, dpoint: DPoint) -> None: + r""" + @brief Creates an integer coordinate point from a floating-point coordinate point + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoint'. + """ + @overload + def __init__(self, v: Vector) -> None: + r""" + @brief Default constructor: creates a point at from an vector + This constructor is equivalent to computing point(0,0)+v. + This method has been introduced in version 0.25. + """ + @overload + def __init__(self, x: int, y: int) -> None: + r""" + @brief Constructor for a point from two coordinate values + + """ + def __itruediv__(self, d: float) -> Point: + r""" + @brief Division by some divisor + + + Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. + """ + def __lt__(self, p: Point) -> bool: + r""" + @brief "less" comparison operator + + + This operator is provided to establish a sorting + order + """ + def __mul__(self, f: float) -> Point: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Inequality test operator + + """ + def __neg__(self) -> Point: + r""" + @brief Compute the negative of a point + + + Returns a new point with -x, -y. + + This method has been added in version 0.23. + """ + def __rmul__(self, f: float) -> Point: + r""" + @brief Scaling by some factor + + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + @overload + def __sub__(self, p: Point) -> Vector: + r""" + @brief Subtract one point from another + + + Subtract point p from self by subtracting the coordinates. This renders a vector. + + Starting with version 0.25, this method renders a vector. + """ + @overload + def __sub__(self, v: Vector) -> Point: + r""" + @brief Subtract one vector from a point + + + Subtract vector v from from self by subtracting the coordinates. This renders a point. + + This method has been added in version 0.27. + """ + def __truediv__(self, d: float) -> Point: + r""" + @brief Division by some divisor + + + Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def abs(self) -> float: + r""" + @brief The absolute value of the point (Euclidian distance to 0,0) + + The returned value is 'sqrt(x*x+y*y)'. + + This method has been introduced in version 0.23. + """ + def assign(self, other: Point) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def distance(self, d: Point) -> float: + r""" + @brief The Euclidian distance to another point + + + @param d The other point to compute the distance to. + """ + def dup(self) -> Point: + r""" + @brief Creates a copy of self + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given point. This method enables points as hash keys. + + This method has been introduced in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def sq_abs(self) -> float: + r""" + @brief The square of the absolute value of the point (Euclidian distance to 0,0) + + The returned value is 'x*x+y*y'. + + This method has been introduced in version 0.23. + """ + def sq_distance(self, d: Point) -> float: + r""" + @brief The square Euclidian distance to another point + + + @param d The other point to compute the distance to. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DPoint: + r""" + @brief Converts the point to a floating-point coordinate point + + The database unit can be specified to translate the integer-coordinate point into a floating-point coordinate point in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self, dbu: Optional[float] = ...) -> str: + r""" + @brief String conversion. + If a DBU is given, the output units will be micrometers. + + The DBU argument has been added in version 0.27.6. + """ + def to_v(self) -> Vector: + r""" + @brief Turns the point into a vector + This method returns a vector representing the distance from (0,0) to the point.This method has been introduced in version 0.25. + """ + class Polygon: r""" @brief A polygon class @@ -21513,14 +37596,6 @@ class Polygon: """ @overload @classmethod - def new(cls, sp: SimplePolygon) -> Polygon: - r""" - @brief Creates a polygon from a simple polygon - @param sp The simple polygon that is converted into the polygon - This method was introduced in version 0.22. - """ - @overload - @classmethod def new(cls, pts: Sequence[Point], raw: Optional[bool] = ...) -> Polygon: r""" @brief Creates a polygon from a point array for the hull @@ -21530,6 +37605,14 @@ class Polygon: The 'raw' argument was added in version 0.24. """ + @overload + @classmethod + def new(cls, sp: SimplePolygon) -> Polygon: + r""" + @brief Creates a polygon from a simple polygon + @param sp The simple polygon that is converted into the polygon + This method was introduced in version 0.22. + """ def __copy__(self) -> Polygon: r""" @brief Creates a copy of self @@ -21570,13 +37653,6 @@ class Polygon: This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpolygon'. """ @overload - def __init__(self, sp: SimplePolygon) -> None: - r""" - @brief Creates a polygon from a simple polygon - @param sp The simple polygon that is converted into the polygon - This method was introduced in version 0.22. - """ - @overload def __init__(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: r""" @brief Creates a polygon from a point array for the hull @@ -21586,6 +37662,13 @@ class Polygon: The 'raw' argument was added in version 0.24. """ + @overload + def __init__(self, sp: SimplePolygon) -> None: + r""" + @brief Creates a polygon from a simple polygon + @param sp The simple polygon that is converted into the polygon + This method was introduced in version 0.22. + """ def __lt__(self, p: Polygon) -> bool: r""" @brief Returns a value indicating whether self is less than p @@ -22353,203 +38436,99 @@ class Polygon: With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. """ -class DPolygon: +class PreferredOrientation: r""" - @brief A polygon class + @brief This class represents the PreferredOrientation enum used within polygon decomposition - A polygon consists of an outer hull and zero to many - holes. Each contour consists of several points. The point - list is normalized such that the leftmost, lowest point is - the first one. The orientation is normalized such that - the orientation of the hull contour is clockwise, while - the orientation of the holes is counterclockwise. - - It is in no way checked that the contours are not overlapping. - This must be ensured by the user of the object - when filling the contours. - - A polygon can be asked for the number of holes using the \holes method. \each_point_hull delivers the points of the hull contour. \each_point_hole delivers the points of a specific hole. \each_edge delivers the edges (point-to-point connections) of both hull and holes. \bbox delivers the bounding box, \area the area and \perimeter the perimeter of the polygon. - - Here's an example of how to create a polygon: - - @code - hull = [ RBA::DPoint::new(0, 0), RBA::DPoint::new(6000, 0), - RBA::DPoint::new(6000, 3000), RBA::DPoint::new(0, 3000) ] - hole1 = [ RBA::DPoint::new(1000, 1000), RBA::DPoint::new(2000, 1000), - RBA::DPoint::new(2000, 2000), RBA::DPoint::new(1000, 2000) ] - hole2 = [ RBA::DPoint::new(3000, 1000), RBA::DPoint::new(4000, 1000), - RBA::DPoint::new(4000, 2000), RBA::DPoint::new(3000, 2000) ] - poly = RBA::DPolygon::new(hull) - poly.insert_hole(hole1) - poly.insert_hole(hole2) - - # ask the polygon for some properties - poly.holes # -> 2 - poly.area # -> 16000000.0 - poly.perimeter # -> 26000.0 - poly.bbox # -> (0,0;6000,3000) - @/code - - The \DPolygon class stores coordinates in floating-point format which gives a higher precision for some operations. A class that stores integer coordinates is \Polygon. - - See @The Database API@ for more details about the database objects. + This enum has been introduced in version 0.27. """ - @property - def hull(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the points of the hull of polygon - @param p An array of points to assign to the polygon's hull - The 'assign_hull' variant is provided in analogy to 'assign_hole'. - """ + PO_any: ClassVar[PreferredOrientation] + r""" + @brief Indicates any orientation. + """ + PO_horizontal: ClassVar[PreferredOrientation] + r""" + @brief Indicates horizontal orientation. + """ + PO_htrapezoids: ClassVar[PreferredOrientation] + r""" + @brief Indicates horizontal trapezoid decomposition. + """ + PO_vertical: ClassVar[PreferredOrientation] + r""" + @brief Indicates vertical orientation. + """ + PO_vtrapezoids: ClassVar[PreferredOrientation] + r""" + @brief Indicates vertical trapezoid decomposition. + """ + @overload @classmethod - def ellipse(cls, box: DBox, n: int) -> DPolygon: + def new(cls, i: int) -> PreferredOrientation: r""" - @brief Creates a simple polygon approximating an ellipse - - @param box The bounding box of the ellipse - @param n The number of points that will be used to approximate the ellipse - - This method has been introduced in version 0.23. - """ - @classmethod - def from_ipoly(cls, polygon: Polygon) -> DPolygon: - r""" - @brief Creates a floating-point coordinate polygon from an integer coordinate polygon - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'. - """ - @classmethod - def from_s(cls, s: str) -> DPolygon: - r""" - @brief Creates a polygon from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. + @brief Creates an enum from an integer value """ @overload @classmethod - def new(cls) -> DPolygon: + def new(cls, s: str) -> PreferredOrientation: r""" - @brief Creates an empty (invalid) polygon + @brief Creates an enum from a string value """ - @overload - @classmethod - def new(cls, box: DBox) -> DPolygon: - r""" - @brief Creates a polygon from a box - - @param box The box to convert to a polygon - """ - @overload - @classmethod - def new(cls, polygon: Polygon) -> DPolygon: - r""" - @brief Creates a floating-point coordinate polygon from an integer coordinate polygon - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'. - """ - @overload - @classmethod - def new(cls, sp: DSimplePolygon) -> DPolygon: - r""" - @brief Creates a polygon from a simple polygon - @param sp The simple polygon that is converted into the polygon - This method was introduced in version 0.22. - """ - @overload - @classmethod - def new(cls, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> DPolygon: - r""" - @brief Creates a polygon from a point array for the hull - - @param pts The points forming the polygon hull - @param raw If true, the point list won't be modified (see \assign_hull) - - The 'raw' argument was added in version 0.24. - """ - def __copy__(self) -> DPolygon: + def __copy__(self) -> PreferredOrientation: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> DPolygon: + def __deepcopy__(self) -> PreferredOrientation: r""" @brief Creates a copy of self """ - def __eq__(self, p: object) -> bool: + @overload + def __eq__(self, other: object) -> bool: r""" - @brief Returns a value indicating whether the polygons are equal - @param p The object to compare against - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. + @brief Compares two enums """ @overload - def __init__(self) -> None: + def __eq__(self, other: object) -> bool: r""" - @brief Creates an empty (invalid) polygon + @brief Compares an enum with an integer value """ @overload - def __init__(self, box: DBox) -> None: + def __init__(self, i: int) -> None: r""" - @brief Creates a polygon from a box - - @param box The box to convert to a polygon + @brief Creates an enum from an integer value """ @overload - def __init__(self, polygon: Polygon) -> None: + def __init__(self, s: str) -> None: r""" - @brief Creates a floating-point coordinate polygon from an integer coordinate polygon - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_ipolygon'. + @brief Creates an enum from a string value """ @overload - def __init__(self, sp: DSimplePolygon) -> None: + def __lt__(self, other: PreferredOrientation) -> bool: r""" - @brief Creates a polygon from a simple polygon - @param sp The simple polygon that is converted into the polygon - This method was introduced in version 0.22. + @brief Returns true if the first enum is less (in the enum symbol order) than the second """ @overload - def __init__(self, pts: Sequence[DPoint], raw: Optional[bool] = ...) -> None: + def __lt__(self, other: int) -> bool: r""" - @brief Creates a polygon from a point array for the hull - - @param pts The points forming the polygon hull - @param raw If true, the point list won't be modified (see \assign_hull) - - The 'raw' argument was added in version 0.24. + @brief Returns true if the enum is less (in the enum symbol order) than the integer value """ - def __lt__(self, p: DPolygon) -> bool: + @overload + def __ne__(self, other: object) -> bool: r""" - @brief Returns a value indicating whether self is less than p - @param p The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order + @brief Compares an enum with an integer for inequality """ - def __mul__(self, f: float) -> DPolygon: + @overload + def __ne__(self, other: object) -> bool: r""" - @brief Scales the polygon by some factor - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + @brief Compares two enums for inequality """ - def __ne__(self, p: object) -> bool: + def __repr__(self) -> str: r""" - @brief Returns a value indicating whether the polygons are not equal - @param p The object to compare against - """ - def __rmul__(self, f: float) -> DPolygon: - r""" - @brief Scales the polygon by some factor - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + @brief Converts an enum to a visual string """ def __str__(self) -> str: r""" - @brief Returns a string representing the polygon + @brief Gets the symbolic string from an enum """ def _create(self) -> None: r""" @@ -22588,73 +38567,10 @@ class DPolygon: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def area(self) -> float: - r""" - @brief Gets the area of the polygon - The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise.Orientation is ensured automatically in most cases. - """ - def area2(self) -> float: - r""" - @brief Gets the double area of the polygon - This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. - - This method has been introduced in version 0.26.1 - """ - def assign(self, other: DPolygon) -> None: + def assign(self, other: PreferredOrientation) -> None: r""" @brief Assigns another object to self """ - @overload - def assign_hole(self, n: int, b: DBox) -> None: - r""" - @brief Sets the box as the given hole of the polygon - @param n The index of the hole to which the points should be assigned - @param b The box to assign to the polygon's hole - If the hole index is not valid, this method does nothing. - This method was introduced in version 0.23. - """ - @overload - def assign_hole(self, n: int, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: - r""" - @brief Sets the points of the given hole of the polygon - @param n The index of the hole to which the points should be assigned - @param p An array of points to assign to the polygon's hole - @param raw If true, the points won't be compressed (see \assign_hull) - If the hole index is not valid, this method does nothing. - - This method was introduced in version 0.18. - The 'raw' argument was added in version 0.24. - """ - def assign_hull(self, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: - r""" - @brief Sets the points of the hull of polygon - @param p An array of points to assign to the polygon's hull - @param raw If true, the points won't be compressed - - If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. - - Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. - - The 'assign_hull' variant is provided in analogy to 'assign_hole'. - - The 'raw' argument was added in version 0.24. - """ - def bbox(self) -> DBox: - r""" - @brief Returns the bounding box of the polygon - The bounding box is the box enclosing all points of the polygon. - """ - def compress(self, remove_reflected: bool) -> None: - r""" - @brief Compresses the polygon. - - This method removes redundant points from the polygon, such as points being on a line formed by two other points. - If remove_reflected is true, points are also removed if the two adjacent edges form a spike. - - @param remove_reflected See description of the functionality. - - This method was introduced in version 0.18. - """ def create(self) -> None: r""" @brief Ensures the C++ object is created @@ -22672,103 +38588,13 @@ class DPolygon: 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. """ - def dup(self) -> DPolygon: + def dup(self) -> PreferredOrientation: r""" @brief Creates a copy of self """ - @overload - def each_edge(self) -> Iterator[DEdge]: + def inspect(self) -> str: r""" - @brief Iterates over the edges that make up the polygon - - This iterator will deliver all edges, including those of the holes. Hole edges are oriented counterclockwise while hull edges are oriented clockwise. - """ - @overload - def each_edge(self, contour: int) -> Iterator[DEdge]: - r""" - @brief Iterates over the edges of one contour of the polygon - - @param contour The contour number (0 for hull, 1 for first hole ...) - - This iterator will deliver all edges of the contour specified by the contour parameter. The hull has contour number 0, the first hole has contour 1 etc. - Hole edges are oriented counterclockwise while hull edges are oriented clockwise. - - This method was introduced in version 0.24. - """ - def each_point_hole(self, n: int) -> Iterator[DPoint]: - r""" - @brief Iterates over the points that make up the nth hole - The hole number must be less than the number of holes (see \holes) - """ - def each_point_hull(self) -> Iterator[DPoint]: - r""" - @brief Iterates over the points that make up the hull - """ - def extract_rad(self) -> List[Any]: - r""" - @brief Extracts the corner radii from a rounded polygon - - Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul - @li The polygon with the rounded corners replaced by edgy ones @/li - @li The radius of the inner corners @/li - @li The radius of the outer corners @/li - @li The number of points per full circle @/li - @/ul - - This method is based on some assumptions and may fail. In this case, an empty array is returned. - - If successful, the following code will more or less render the original polygon and parameters - - @code - p = ... # some polygon - p.round_corners(ri, ro, n) - (p2, ri2, ro2, n2) = p.extract_rad - # -> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits) - @/code - - This method was introduced in version 0.25. - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given polygon. This method enables polygons as hash keys. - - This method has been introduced in version 0.25. - """ - def holes(self) -> int: - r""" - @brief Returns the number of holes - """ - @overload - def insert_hole(self, b: DBox) -> None: - r""" - @brief Inserts a hole from the given box - @param b The box to insert as a new hole - This method was introduced in version 0.23. - """ - @overload - def insert_hole(self, p: Sequence[DPoint], raw: Optional[bool] = ...) -> None: - r""" - @brief Inserts a hole with the given points - @param p An array of points to insert as a new hole - @param raw If true, the points won't be compressed (see \assign_hull) - - The 'raw' argument was added in version 0.24. - """ - def inside(self, p: DPoint) -> bool: - r""" - @brief Tests, if the given point is inside the polygon - If the given point is inside or on the edge of the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. - """ - def is_box(self) -> bool: - r""" - @brief Returns true, if the polygon is a simple box. - - A polygon is a box if it is identical to it's bounding box. - - @return True if the polygon is a box. - - This method was introduced in version 0.23. + @brief Converts an enum to a visual string """ def is_const_object(self) -> bool: r""" @@ -22776,420 +38602,118 @@ class DPolygon: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def is_empty(self) -> bool: + def to_i(self) -> int: r""" - @brief Returns a value indicating whether the polygon is empty - """ - def is_halfmanhattan(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is half-manhattan - Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping. - - This predicate was introduced in version 0.27. - """ - def is_rectilinear(self) -> bool: - r""" - @brief Returns a value indicating whether the polygon is rectilinear - """ - @overload - def move(self, p: DVector) -> DPolygon: - r""" - @brief Moves the polygon. - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is overwritten. - - @param p The distance to move the polygon. - - @return The moved polygon (self). - - This method has been introduced in version 0.23. - """ - @overload - def move(self, x: float, y: float) -> DPolygon: - r""" - @brief Moves the polygon. - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is overwritten. - - @param x The x distance to move the polygon. - @param y The y distance to move the polygon. - - @return The moved polygon (self). - """ - @overload - def moved(self, p: DVector) -> DPolygon: - r""" - @brief Returns the moved polygon (does not modify self) - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is not modified. - - @param p The distance to move the polygon. - - @return The moved polygon. - - This method has been introduced in version 0.23. - """ - @overload - def moved(self, x: float, y: float) -> DPolygon: - r""" - @brief Returns the moved polygon (does not modify self) - - Moves the polygon by the given offset and returns the - moved polygon. The polygon is not modified. - - @param x The x distance to move the polygon. - @param y The y distance to move the polygon. - - @return The moved polygon. - - This method has been introduced in version 0.23. - """ - def num_points(self) -> int: - r""" - @brief Gets the total number of points (hull plus holes) - This method was introduced in version 0.18. - """ - def num_points_hole(self, n: int) -> int: - r""" - @brief Gets the number of points of the given hole - The argument gives the index of the hole of which the number of points are requested. The index must be less than the number of holes (see \holes). - """ - def num_points_hull(self) -> int: - r""" - @brief Gets the number of points of the hull - """ - def perimeter(self) -> float: - r""" - @brief Gets the perimeter of the polygon - The perimeter is sum of the lengths of all edges making up the polygon. - - This method has been introduce in version 0.23. - """ - def point_hole(self, n: int, p: int) -> DPoint: - r""" - @brief Gets a specific point of a hole - @param n The index of the hole to which the points should be assigned - @param p The index of the point to get - If the index of the point or of the hole is not valid, a default value is returned. - This method was introduced in version 0.18. - """ - def point_hull(self, p: int) -> DPoint: - r""" - @brief Gets a specific point of the hull - @param p The index of the point to get - If the index of the point is not a valid index, a default value is returned. - This method was introduced in version 0.18. - """ - def round_corners(self, rinner: float, router: float, n: int) -> DPolygon: - r""" - @brief Rounds the corners of the polygon - - Replaces the corners of the polygon with circle segments. - - @param rinner The circle radius of inner corners (in database units). - @param router The circle radius of outer corners (in database units). - @param n The number of points per full circle. - - @return The new polygon. - - This method was introduced in version 0.20 for integer coordinates and in 0.25 for all coordinate types. - """ - @overload - def size(self, d: float, mode: Optional[int] = ...) -> None: - r""" - @brief Sizes the polygon (biasing) - - Shifts the contour outwards (d>0) or inwards (d<0). - This method is equivalent to - @code - size(d, d, mode) - @/code - - See \size for a detailed description. - - This method has been introduced in version 0.23. - """ - @overload - def size(self, dv: Vector, mode: Optional[int] = ...) -> None: - r""" - @brief Sizes the polygon (biasing) - - This method is equivalent to - @code - size(dv.x, dv.y, mode) - @/code - - See \size for a detailed description. - - This version has been introduced in version 0.28. - """ - @overload - def size(self, dx: float, dy: float, mode: int) -> None: - r""" - @brief Sizes the polygon (biasing) - - Shifts the contour outwards (dx,dy>0) or inwards (dx,dy<0). - dx is the sizing in x-direction and dy is the sizing in y-direction. The sign of dx and dy should be identical. - The sizing operation create invalid (self-overlapping, reverse oriented) contours. - - The mode defines at which bending angle cutoff occurs - (0:>0, 1:>45, 2:>90, 3:>135, 4:>approx. 168, other:>approx. 179) - - In order to obtain a proper polygon in the general case, the - sized polygon must be merged in 'greater than zero' wrap count mode. This is necessary since in the general case, - sizing can be complicated operation which lets a single polygon fall apart into disjoint pieces for example. - This can be achieved using the \EdgeProcessor class for example: - - @code - poly = ... # a RBA::Polygon - poly.size(-50, 2) - ep = RBA::EdgeProcessor::new - # result is an array of RBA::Polygon objects - result = ep.simple_merge_p2p([ poly ], false, false, 1) - @/code - """ - @overload - def sized(self, d: float, mode: Optional[int] = ...) -> DPolygon: - r""" - @brief Sizes the polygon (biasing) without modifying self - - Shifts the contour outwards (d>0) or inwards (d<0). - This method is equivalent to - @code - sized(d, d, mode) - @/code - - See \size and \sized for a detailed description. - """ - @overload - def sized(self, dv: Vector, mode: Optional[int] = ...) -> DPolygon: - r""" - @brief Sizes the polygon (biasing) without modifying self - - This method is equivalent to - @code - sized(dv.x, dv.y, mode) - @/code - - See \size and \sized for a detailed description. - - This version has been introduced in version 0.28. - """ - @overload - def sized(self, dx: float, dy: float, mode: int) -> DPolygon: - r""" - @brief Sizes the polygon (biasing) without modifying self - - This method applies sizing to the polygon but does not modify self. Instead a sized copy is returned. - See \size for a description of the operation. - - This method has been introduced in version 0.23. - """ - def split(self) -> List[DPolygon]: - r""" - @brief Splits the polygon into two or more parts - This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. - - The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit. - - This method has been introduced in version 0.25.3. - """ - def to_itype(self, dbu: Optional[float] = ...) -> Polygon: - r""" - @brief Converts the polygon to an integer coordinate polygon - - The database unit can be specified to translate the floating-point coordinate polygon in micron units to an integer-coordinate polygon in database units. The polygons coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. + @brief Gets the integer value from the enum """ def to_s(self) -> str: r""" - @brief Returns a string representing the polygon - """ - @overload - def touches(self, box: DBox) -> bool: - r""" - @brief Returns true, if the polygon touches the given box. - The box and the polygon touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, edge: DEdge) -> bool: - r""" - @brief Returns true, if the polygon touches the given edge. - The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, polygon: DPolygon) -> bool: - r""" - @brief Returns true, if the polygon touches the other polygon. - The polygons touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def touches(self, simple_polygon: DSimplePolygon) -> bool: - r""" - @brief Returns true, if the polygon touches the other polygon. - The polygons touch if they overlap or their contours share at least one point. - - This method was introduced in version 0.25.1. - """ - @overload - def transform(self, t: DCplxTrans) -> DPolygon: - r""" - @brief Transforms the polygon with a complex transformation (in-place) - - Transforms the polygon with the given complex transformation. - Modifies self and returns self. An out-of-place version which does not modify self is \transformed. - - @param t The transformation to apply. - - This method has been introduced in version 0.24. - """ - @overload - def transform(self, t: DTrans) -> DPolygon: - r""" - @brief Transforms the polygon (in-place) - - Transforms the polygon with the given transformation. - Modifies self and returns self. An out-of-place version which does not modify self is \transformed. - - @param t The transformation to apply. - - This method has been introduced in version 0.24. - """ - @overload - def transformed(self, t: DCplxTrans) -> DPolygon: - r""" - @brief Transforms the polygon with a complex transformation - - Transforms the polygon with the given complex transformation. - Does not modify the polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed polygon. - - With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. - """ - @overload - def transformed(self, t: DTrans) -> DPolygon: - r""" - @brief Transforms the polygon - - Transforms the polygon with the given transformation. - Does not modify the polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed polygon. - """ - @overload - def transformed(self, t: VCplxTrans) -> Polygon: - r""" - @brief Transforms the polygon with the given complex transformation - - - @param t The magnifying transformation to apply - @return The transformed polygon (in this case an integer coordinate polygon) - - This method has been introduced in version 0.25. - """ - def transformed_cplx(self, t: DCplxTrans) -> DPolygon: - r""" - @brief Transforms the polygon with a complex transformation - - Transforms the polygon with the given complex transformation. - Does not modify the polygon but returns the transformed polygon. - - @param t The transformation to apply. - - @return The transformed polygon. - - With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + @brief Gets the symbolic string from an enum """ -class LayerMap: +class PropertyConstraint: r""" - @brief An object representing an arbitrary mapping of physical layers to logical layers + @brief This class represents the property constraint for boolean and check functions. - "Physical" layers are stream layers or other separated layers in a CAD file. "Logical" layers are the layers present in a \Layout object. Logical layers are represented by an integer index while physical layers are given by a layer and datatype number or name. A logical layer is created automatically in the layout on reading if it does not exist yet. - - The mapping describes an association of a set of physical layers to a set of logical ones, where multiple - physical layers can be mapped to a single logical one, which effectively merges the layers. - - For each logical layer, a target layer can be specified. A target layer is the layer/datatype/name combination - as which the logical layer appears in the layout. By using a target layer different from the source layer - renaming a layer can be achieved while loading a layout. Another use case for that feature is to assign - layer names to GDS layer/datatype combinations which are numerical only. - - LayerMap objects are used in two ways: as input for the reader (inside a \LoadLayoutOptions class) and - as output from the reader (i.e. Layout::read method). For layer map objects used as input, the layer indexes - (logical layers) can be consecutive numbers. They do not need to correspond with real layer indexes from - a layout object. When used as output, the layer map's logical layers correspond to the layer indexes inside - the layout that the layer map was used upon. - - This is a sample how to use the LayerMap object. It maps all datatypes of layers 1, 2 and 3 to datatype 0 and - assigns the names 'ONE', 'TWO' and 'THREE' to these layout layers: - - @codelm = RBA::LayerMap::new - lm.map("1/0-255 : ONE (1/0)") - lm.map("2/0-255 : TWO (2/0)") - lm.map("3/0-255 : THREE (3/0)") - - # read the layout using the layer map - lo = RBA::LoadLayoutOptions::new - lo.layer_map.assign(lm) - ly = RBA::Layout::new - ly.read("input.gds", lo) - @/code - - 1:n mapping is supported: a physical layer can be mapped to multiple logical layers using 'mmap' instead of 'map'. When using this variant, mapping acts additive. - The following example will map layer 1, datatypes 0 to 255 to logical layer 0, and layer 1, datatype 17 to logical layers 0 plus 1: - @codelm = RBA::LayerMap::new - lm.map("1/0-255", 0) # (can be 'mmap' too) - lm.mmap("1/17", 1) - @/code - - 'unmapping' allows removing a mapping. This allows creating 'holes' in mapping ranges. The following example maps layer 1, datatypes 0 to 16 and 18 to 255 to logical layer 0: - @codelm = RBA::LayerMap::new - lm.map("1/0-255", 0) - lm.unmap("1/17") - @/code - - The LayerMap class has been introduced in version 0.18. Target layer have been introduced in version 0.20. 1:n mapping and unmapping has been introduced in version 0.27. + This enum has been introduced in version 0.28.4. """ + DifferentPropertiesConstraint: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are different + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are different. Properties are generated on the output shapes where applicable. + """ + DifferentPropertiesConstraintDrop: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are different + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are the same. No properties are generated on the output shapes. + """ + IgnoreProperties: ClassVar[PropertyConstraint] + r""" + @brief Specifies to ignore properties + When using this constraint - for example on a boolean operation - properties are ignored and are not generated in the output. + """ + NoPropertyConstraint: ClassVar[PropertyConstraint] + r""" + @brief Specifies not to apply any property constraint + When using this constraint - for example on a boolean operation - shapes are considered regardless of their user properties. Properties are generated on the output shapes where applicable. + """ + SamePropertiesConstraint: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are the same + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are the same. Properties are generated on the output shapes where applicable. + """ + SamePropertiesConstraintDrop: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are the same + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are the same. No properties are generated on the output shapes. + """ + @overload @classmethod - def from_string(cls, arg0: str) -> LayerMap: + def new(cls, i: int) -> PropertyConstraint: r""" - @brief Creates a layer map from the given string - The format of the string is that used in layer mapping files: one mapping entry per line, comments are allowed using '#' or '//'. The format of each line is that used in the 'map(string, index)' method. - - This method has been introduced in version 0.23. + @brief Creates an enum from an integer value """ + @overload @classmethod - def new(cls) -> LayerMap: + def new(cls, s: str) -> PropertyConstraint: r""" - @brief Creates a new object of this class + @brief Creates an enum from a string value """ - def __copy__(self) -> LayerMap: + def __copy__(self) -> PropertyConstraint: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> LayerMap: + def __deepcopy__(self) -> PropertyConstraint: r""" @brief Creates a copy of self """ - def __init__(self) -> None: + @overload + def __eq__(self, other: object) -> bool: r""" - @brief Creates a new object of this class + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: PropertyConstraint) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum """ def _create(self) -> None: r""" @@ -23228,14 +38752,10 @@ class LayerMap: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: LayerMap) -> None: + def assign(self, other: PropertyConstraint) -> None: r""" @brief Assigns another object to self """ - def clear(self) -> None: - r""" - @brief Clears the map - """ def create(self) -> None: r""" @brief Ensures the C++ object is created @@ -23253,1236 +38773,27 @@ class LayerMap: 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. """ - def dup(self) -> LayerMap: + def dup(self) -> PropertyConstraint: r""" @brief Creates a copy of self """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ def is_const_object(self) -> bool: r""" @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. """ - def is_mapped(self, layer: LayerInfo) -> bool: + def to_i(self) -> int: r""" - @brief Check, if a given physical layer is mapped - @param layer The physical layer specified with an \LayerInfo object. - @return True, if the layer is mapped. + @brief Gets the integer value from the enum """ - def logical(self, layer: LayerInfo) -> int: + def to_s(self) -> str: r""" - @brief Returns the logical layer (the layer index in the layout object) for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. - @return The logical layer index or -1 if the layer is not mapped. - This method is deprecated with version 0.27 as in this version, layers can be mapped to multiple targets which this method can't capture. Use \logicals instead. - """ - def logicals(self, layer: LayerInfo) -> List[int]: - r""" - @brief Returns the logical layers for a given physical layer.n@param layer The physical layer specified with an \LayerInfo object. - @return This list of logical layers this physical layer as mapped to or empty if there is no mapping. - This method has been introduced in version 0.27. - """ - @overload - def map(self, map_expr: str, log_layer: Optional[int] = ...) -> None: - r""" - @brief Maps a physical layer given by a string to a logical one - @param map_expr The string describing the physical layer to map. - @param log_layer The logical layer to which the physical layers are mapped. - - The string expression is constructed using the syntax: - "list[/list][;..]" for layer/datatype pairs. "list" is a - sequence of numbers, separated by comma values or a range - separated by a hyphen. Examples are: "1/2", "1-5/0", "1,2,5/0", - "1/5;5/6". - - layer/datatype wildcards can be specified with "*". When "*" is used - for the upper limit, it is equivalent to "all layer above". When used - alone, it is equivalent to "all layers". Examples: "1 / *", "* / 10-*" - - Named layers are specified simply by specifying the name, if - necessary in single or double quotes (if the name begins with a digit or - contains non-word characters). layer/datatype and name descriptions can - be mixed, i.e. "AA;1/5" (meaning: name "AA" or layer 1/datatype 5). - - A target layer can be specified with the ":" notation, where - target is a valid string for a LayerProperties() object. - - A target can include relative layer/datatype specifications and wildcards. - For example, "1-10/0: *+1/0" will add 1 to the original layer number. - "1-10/0-50: * / *" will use the original layers. - - If the logical layer is negative or omitted, the method will select the next available one. - - Target mapping has been added in version 0.20. The logical layer is optional since version 0.28. - """ - @overload - def map(self, phys_layer: LayerInfo, log_layer: int) -> None: - r""" - @brief Maps a physical layer to a logical one - @param phys_layer The physical layer (a \LayerInfo object). - @param log_layer The logical layer to which the physical layer is mapped. - - In general, there may be more than one physical layer mapped - to one logical layer. This method will add the given physical layer to the mapping for the logical layer. - """ - @overload - def map(self, phys_layer: LayerInfo, log_layer: int, target_layer: LayerInfo) -> None: - r""" - @brief Maps a physical layer to a logical one with a target layer - @param phys_layer The physical layer (a \LayerInfo object). - @param log_layer The logical layer to which the physical layer is mapped. - @param target_layer The properties of the layer that will be created unless it already exists. - - In general, there may be more than one physical layer mapped - to one logical layer. This method will add the given physical layer to the mapping for the logical layer. - - This method has been added in version 0.20. - """ - @overload - def map(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int) -> None: - r""" - @brief Maps a physical layer interval to a logical one - @param pl_start The first physical layer (a \LayerInfo object). - @param pl_stop The last physical layer (a \LayerInfo object). - @param log_layer The logical layer to which the physical layers are mapped. - - This method maps an interval of layers l1..l2 and datatypes d1..d2 to the mapping for the given logical layer. l1 and d1 are given by the pl_start argument, while l2 and d2 are given by the pl_stop argument. - """ - @overload - def map(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int, layer_properties: LayerInfo) -> None: - r""" - @brief Maps a physical layer interval to a logical one with a target layer - @param pl_start The first physical layer (a \LayerInfo object). - @param pl_stop The last physical layer (a \LayerInfo object). - @param log_layer The logical layer to which the physical layers are mapped. - @param target_layer The properties of the layer that will be created unless it already exists. - - This method maps an interval of layers l1..l2 and datatypes d1..d2 to the mapping for the given logical layer. l1 and d1 are given by the pl_start argument, while l2 and d2 are given by the pl_stop argument. - This method has been added in version 0.20. - """ - def mapping(self, log_layer: int) -> LayerInfo: - r""" - @brief Returns the mapped physical (or target if one is specified) layer for a given logical layer - @param log_layer The logical layer for which the mapping is requested. - @return A \LayerInfo object which is the physical layer mapped to the logical layer. - In general, there may be more than one physical layer mapped - to one logical layer. This method will return a single one of - them. It will return the one with the lowest layer and datatype. - """ - def mapping_str(self, log_layer: int) -> str: - r""" - @brief Returns the mapping string for a given logical layer - @param log_layer The logical layer for which the mapping is requested. - @return A string describing the mapping. - The mapping string is compatible with the string that the "map" method accepts. - """ - @overload - def mmap(self, map_expr: str, log_layer: Optional[int] = ...) -> None: - r""" - @brief Maps a physical layer given by an expression to a logical one and adds to existing mappings - - This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. - For backward compatibility, 'map' still substitutes mapping. - - If the logical layer is negative or omitted, the method will select the next available one. - - Multi-mapping has been added in version 0.27. The logical layer is optional since version 0.28. - """ - @overload - def mmap(self, phys_layer: LayerInfo, log_layer: int) -> None: - r""" - @brief Maps a physical layer to a logical one and adds to existing mappings - - This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. - For backward compatibility, 'map' still substitutes mapping. - - Multi-mapping has been added in version 0.27. - """ - @overload - def mmap(self, phys_layer: LayerInfo, log_layer: int, target_layer: LayerInfo) -> None: - r""" - @brief Maps a physical layer to a logical one, adds to existing mappings and specifies a target layer - - This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. - For backward compatibility, 'map' still substitutes mapping. - - Multi-mapping has been added in version 0.27. - """ - @overload - def mmap(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int) -> None: - r""" - @brief Maps a physical layer from the given interval to a logical one and adds to existing mappings - - This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. - For backward compatibility, 'map' still substitutes mapping. - - Multi-mapping has been added in version 0.27. - """ - @overload - def mmap(self, pl_start: LayerInfo, pl_stop: LayerInfo, log_layer: int, layer_properties: LayerInfo) -> None: - r""" - @brief Maps a physical layer from the given interval to a logical one, adds to existing mappings and specifies a target layer - - This method acts like the corresponding 'map' method, but adds the logical layer to the receivers of the given physical one. Hence this method implements 1:n mapping capabilities. - For backward compatibility, 'map' still substitutes mapping. - - Multi-mapping has been added in version 0.27. - """ - def to_string(self) -> str: - r""" - @brief Converts a layer mapping object to a string - This method is the inverse of the \from_string method. - - This method has been introduced in version 0.23. - """ - @overload - def unmap(self, expr: str) -> None: - r""" - @brief Unmaps the layers from the given expression - This method has been introduced in version 0.27. - """ - @overload - def unmap(self, phys_layer: LayerInfo) -> None: - r""" - @brief Unmaps the given layer - Unmapping will remove the specific layer from the mapping. This method allows generating 'mapping holes' by first mapping a range and then unmapping parts of it. - - This method has been introduced in version 0.27. - """ - @overload - def unmap(self, pl_start: LayerInfo, pl_stop: LayerInfo) -> None: - r""" - @brief Unmaps the layers from the given interval - This method has been introduced in version 0.27. - """ - -class LoadLayoutOptions: - r""" - @brief Layout reader options - - This object describes various layer reader options used for loading layouts. - - This class has been introduced in version 0.18. - """ - class CellConflictResolution: - r""" - @brief This enum specifies how cell conflicts are handled if a layout read into another layout and a cell name conflict arises. - Until version 0.26.8 and before, the mode was always 'AddToCell'. On reading, a cell was 'reopened' when encountering a cell name which already existed. This mode is still the default. The other modes are made available to support other ways of merging layouts. - - Proxy cells are never modified in the existing layout. Proxy cells are always local to their layout file. So if the existing cell is a proxy cell, the new cell will be renamed. - - If the new or existing cell is a ghost cell, both cells are merged always. - - This enum was introduced in version 0.27. - """ - AddToCell: ClassVar[LoadLayoutOptions.CellConflictResolution] - r""" - @brief Add content to existing cell - This is the mode use in before version 0.27. Content of new cells is simply added to existing cells with the same name. - """ - OverwriteCell: ClassVar[LoadLayoutOptions.CellConflictResolution] - r""" - @brief The old cell is overwritten entirely (including child cells which are not used otherwise) - """ - RenameCell: ClassVar[LoadLayoutOptions.CellConflictResolution] - r""" - @brief The new cell will be renamed to become unique - """ - SkipNewCell: ClassVar[LoadLayoutOptions.CellConflictResolution] - r""" - @brief The new cell is skipped entirely (including child cells which are not used otherwise) - """ - @overload - @classmethod - def new(cls, i: int) -> LoadLayoutOptions.CellConflictResolution: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> LoadLayoutOptions.CellConflictResolution: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: LoadLayoutOptions.CellConflictResolution) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - AddToCell: ClassVar[LoadLayoutOptions.CellConflictResolution] - r""" - @brief Add content to existing cell - This is the mode use in before version 0.27. Content of new cells is simply added to existing cells with the same name. - """ - OverwriteCell: ClassVar[LoadLayoutOptions.CellConflictResolution] - r""" - @brief The old cell is overwritten entirely (including child cells which are not used otherwise) - """ - RenameCell: ClassVar[LoadLayoutOptions.CellConflictResolution] - r""" - @brief The new cell will be renamed to become unique - """ - SkipNewCell: ClassVar[LoadLayoutOptions.CellConflictResolution] - r""" - @brief The new cell is skipped entirely (including child cells which are not used otherwise) - """ - cell_conflict_resolution: LoadLayoutOptions.CellConflictResolution - r""" - Getter: - @brief Gets the cell conflict resolution mode - - Multiple layout files can be collected into a single Layout object by reading file after file into the Layout object. Cells with same names are considered a conflict. This mode indicates how such conflicts are resolved. See \LoadLayoutOptions::CellConflictResolution for the values allowed. The default mode is \LoadLayoutOptions::CellConflictResolution#AddToCell. - - This option has been introduced in version 0.27. - Setter: - @brief Sets the cell conflict resolution mode - - See \cell_conflict_resolution for details about this option. - - This option has been introduced in version 0.27. - """ - cif_create_other_layers: bool - r""" - Getter: - @brief Gets a value indicating whether other layers shall be created - @return True, if other layers will be created. - This attribute acts together with a layer map (see \cif_layer_map=). Layers not listed in this map are created as well when \cif_create_other_layers? is true. Otherwise they are ignored. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - Setter: - @brief Specifies whether other layers shall be created - @param create True, if other layers will be created. - See \cif_create_other_layers? for a description of this attribute. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - cif_dbu: float - r""" - Getter: - @brief Specifies the database unit which the reader uses and produces - See \cif_dbu= method for a description of this property. - This property has been added in version 0.21. - - Setter: - @brief Specifies the database unit which the reader uses and produces - - This property has been added in version 0.21. - """ - cif_keep_layer_names: bool - r""" - Getter: - @brief Gets a value indicating whether layer names are kept - @return True, if layer names are kept. - - When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. - - This method has been added in version 0.25.3. - Setter: - @brief Gets a value indicating whether layer names are kept - @param keep True, if layer names are to be kept. - - See \cif_keep_layer_names? for a description of this property. - - This method has been added in version 0.25.3. - """ - cif_layer_map: LayerMap - r""" - Getter: - @brief Gets the layer map - @return A reference to the layer map - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - - Python note: this method has been turned into a property in version 0.26. - Setter: - @brief Sets the layer map - This sets a layer mapping for the reader. Unlike \cif_set_layer_map, the 'create_other_layers' flag is not changed. - @param map The layer map to set. - - This convenience method has been added in version 0.26. - """ - cif_wire_mode: int - r""" - Getter: - @brief Specifies how to read 'W' objects - See \cif_wire_mode= method for a description of this mode. - This property has been added in version 0.21 and was renamed to cif_wire_mode in 0.25. - - Setter: - @brief How to read 'W' objects - - This property specifies how to read 'W' (wire) objects. - Allowed values are 0 (as square ended paths), 1 (as flush ended paths), 2 (as round paths) - - This property has been added in version 0.21. - """ - create_other_layers: bool - r""" - Getter: - @brief Gets a value indicating whether other layers shall be created - @return True, if other layers should be created. - This attribute acts together with a layer map (see \layer_map=). Layers not listed in this map are created as well when \create_other_layers? is true. Otherwise they are ignored. - - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - Setter: - @brief Specifies whether other layers shall be created - @param create True, if other layers should be created. - See \create_other_layers? for a description of this attribute. - - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - dxf_circle_accuracy: float - r""" - Getter: - @brief Gets the accuracy of the circle approximation - - This property has been added in version 0.24.9. - - Setter: - @brief Specifies the accuracy of the circle approximation - - In addition to the number of points per circle, the circle accuracy can be specified. If set to a value larger than the database unit, the number of points per circle will be chosen such that the deviation from the ideal circle becomes less than this value. - - The actual number of points will not become bigger than the points specified through \dxf_circle_points=. The accuracy value is given in the DXF file units (see \dxf_unit) which is usually micrometers. - - \dxf_circle_points and \dxf_circle_accuracy also apply to other "round" structures such as arcs, ellipses and splines in the same sense than for circles. - - - This property has been added in version 0.24.9. - """ - dxf_circle_points: int - r""" - Getter: - @brief Gets the number of points used per full circle for arc interpolation - - This property has been added in version 0.21.6. - - Setter: - @brief Specifies the number of points used per full circle for arc interpolation - See also \dxf_circle_accuracy for how to specify the number of points based on an approximation accuracy. - - \dxf_circle_points and \dxf_circle_accuracy also apply to other "round" structures such as arcs, ellipses and splines in the same sense than for circles. - - - This property has been added in version 0.21.6. - """ - dxf_contour_accuracy: float - r""" - Getter: - @brief Gets the accuracy for contour closing - - - This property has been added in version 0.25.3. - - Setter: - @brief Specifies the accuracy for contour closing - - When polylines need to be connected or closed, this - value is used to indicate the accuracy. This is the value (in DXF units) - by which points may be separated and still be considered - connected. The default is 0.0 which implies exact - (within one DBU) closing. - - This value is effective in polyline mode 3 and 4. - - - This property has been added in version 0.25.3. - """ - dxf_create_other_layers: bool - r""" - Getter: - @brief Gets a value indicating whether other layers shall be created - @return True, if other layers will be created. - This attribute acts together with a layer map (see \dxf_layer_map=). Layers not listed in this map are created as well when \dxf_create_other_layers? is true. Otherwise they are ignored. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - Setter: - @brief Specifies whether other layers shall be created - @param create True, if other layers will be created. - See \dxf_create_other_layers? for a description of this attribute. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - dxf_dbu: float - r""" - Getter: - @brief Specifies the database unit which the reader uses and produces - - This property has been added in version 0.21. - - Setter: - @brief Specifies the database unit which the reader uses and produces - - This property has been added in version 0.21. - """ - dxf_keep_layer_names: bool - r""" - Getter: - @brief Gets a value indicating whether layer names are kept - @return True, if layer names are kept. - - When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. - - This method has been added in version 0.25.3. - Setter: - @brief Gets a value indicating whether layer names are kept - @param keep True, if layer names are to be kept. - - See \cif_keep_layer_names? for a description of this property. - - This method has been added in version 0.25.3. - """ - dxf_keep_other_cells: bool - r""" - Getter: - @brief If this option is true, all cells are kept, not only the top cell and it's children - - This property has been added in version 0.21.15. - - Setter: - @brief If this option is set to true, all cells are kept, not only the top cell and it's children - - This property has been added in version 0.21.15. - """ - dxf_layer_map: LayerMap - r""" - Getter: - @brief Gets the layer map - @return A reference to the layer map - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - Python note: this method has been turned into a property in version 0.26. - Setter: - @brief Sets the layer map - This sets a layer mapping for the reader. Unlike \dxf_set_layer_map, the 'create_other_layers' flag is not changed. - @param map The layer map to set. - - This convenience method has been added in version 0.26. - """ - dxf_polyline_mode: int - r""" - Getter: - @brief Specifies whether closed POLYLINE and LWPOLYLINE entities with width 0 are converted to polygons. - See \dxf_polyline_mode= for a description of this property. - - This property has been added in version 0.21.3. - - Setter: - @brief Specifies how to treat POLYLINE/LWPOLYLINE entities. - The mode is 0 (automatic), 1 (keep lines), 2 (create polygons from closed polylines with width = 0), 3 (merge all lines with width = 0 into polygons), 4 (as 3 plus auto-close open contours). - - This property has been added in version 0.21.3. - """ - dxf_render_texts_as_polygons: bool - r""" - Getter: - @brief If this option is true, text objects are rendered as polygons - - This property has been added in version 0.21.15. - - Setter: - @brief If this option is set to true, text objects are rendered as polygons - - This property has been added in version 0.21.15. - """ - dxf_text_scaling: float - r""" - Getter: - @brief Gets the text scaling factor (see \dxf_text_scaling=) - - This property has been added in version 0.21.20. - - Setter: - @brief Specifies the text scaling in percent of the default scaling - - The default value 100, meaning that the letter pitch is roughly 92 percent of the specified text height. Decrease this value to get smaller fonts and increase it to get larger fonts. - - This property has been added in version 0.21.20. - """ - dxf_unit: float - r""" - Getter: - @brief Specifies the unit in which the DXF file is drawn - - This property has been added in version 0.21.3. - - Setter: - @brief Specifies the unit in which the DXF file is drawn. - - This property has been added in version 0.21.3. - """ - gds2_allow_big_records: bool - r""" - Getter: - @brief Gets a value specifying whether to allow big records with a length of 32768 to 65535 bytes. - See \gds2_allow_big_records= method for a description of this property. - This property has been added in version 0.18. - - Setter: - @brief Allows big records with more than 32767 bytes - - Setting this property to true allows larger records by treating the record length as unsigned short, which for example allows larger polygons (~8000 points rather than ~4000 points) without using multiple XY records. - For strict compatibility with the standard, this property should be set to false. The default is true. - - This property has been added in version 0.18. - """ - gds2_allow_multi_xy_records: bool - r""" - Getter: - @brief Gets a value specifying whether to allow big polygons with multiple XY records. - See \gds2_allow_multi_xy_records= method for a description of this property. - This property has been added in version 0.18. - - Setter: - @brief Allows the use of multiple XY records in BOUNDARY elements for unlimited large polygons - - Setting this property to true allows big polygons that span over multiple XY records. - For strict compatibility with the standard, this property should be set to false. The default is true. - - This property has been added in version 0.18. - """ - gds2_box_mode: int - r""" - Getter: - @brief Gets a value specifying how to treat BOX records - See \gds2_box_mode= method for a description of this mode. - This property has been added in version 0.18. - - Setter: - @brief Sets a value specifying how to treat BOX records - This property specifies how BOX records are treated. - Allowed values are 0 (ignore), 1 (treat as rectangles), 2 (treat as boundaries) or 3 (treat as errors). The default is 1. - - This property has been added in version 0.18. - """ - layer_map: LayerMap - r""" - Getter: - @brief Gets the layer map - @return A reference to the layer map - - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - Python note: this method has been turned into a property in version 0.26. - Setter: - @brief Sets the layer map, but does not affect the "create_other_layers" flag. - Use \create_other_layers? to enable or disable other layers not listed in the layer map. - @param map The layer map to set. - This convenience method has been introduced with version 0.26. - """ - lefdef_config: LEFDEFReaderConfiguration - r""" - Getter: - @brief Gets a copy of the LEF/DEF reader configuration - The LEF/DEF reader configuration is wrapped in a separate object of class \LEFDEFReaderConfiguration. See there for details. - This method will return a copy of the reader configuration. To modify the configuration, modify the copy and set the modified configuration with \lefdef_config=. - - - This method has been added in version 0.25. - - Setter: - @brief Sets the LEF/DEF reader configuration - - - This method has been added in version 0.25. - """ - mag_create_other_layers: bool - r""" - Getter: - @brief Gets a value indicating whether other layers shall be created - @return True, if other layers will be created. - This attribute acts together with a layer map (see \mag_layer_map=). Layers not listed in this map are created as well when \mag_create_other_layers? is true. Otherwise they are ignored. - - This method has been added in version 0.26.2. - Setter: - @brief Specifies whether other layers shall be created - @param create True, if other layers will be created. - See \mag_create_other_layers? for a description of this attribute. - - This method has been added in version 0.26.2. - """ - mag_dbu: float - r""" - Getter: - @brief Specifies the database unit which the reader uses and produces - See \mag_dbu= method for a description of this property. - - This property has been added in version 0.26.2. - - Setter: - @brief Specifies the database unit which the reader uses and produces - The database unit is the final resolution of the produced layout. This physical resolution is usually defined by the layout system - GDS for example typically uses 1nm (mag_dbu=0.001). - All geometry in the MAG file will first be scaled to \mag_lambda and is then brought to the database unit. - - This property has been added in version 0.26.2. - """ - mag_keep_layer_names: bool - r""" - Getter: - @brief Gets a value indicating whether layer names are kept - @return True, if layer names are kept. - - When set to true, no attempt is made to translate layer names to GDS layer/datatype numbers. If set to false (the default), a layer named "L2D15" will be translated to GDS layer 2, datatype 15. - - This method has been added in version 0.26.2. - Setter: - @brief Gets a value indicating whether layer names are kept - @param keep True, if layer names are to be kept. - - See \mag_keep_layer_names? for a description of this property. - - This method has been added in version 0.26.2. - """ - mag_lambda: float - r""" - Getter: - @brief Gets the lambda value - See \mag_lambda= method for a description of this attribute. - - This property has been added in version 0.26.2. - - Setter: - @brief Specifies the lambda value to used for reading - - The lambda value is the basic unit of the layout. Magic draws layout as multiples of this basic unit. The layout read by the MAG reader will use the database unit specified by \mag_dbu, but the physical layout coordinates will be multiples of \mag_lambda. - - This property has been added in version 0.26.2. - """ - mag_layer_map: LayerMap - r""" - Getter: - @brief Gets the layer map - @return A reference to the layer map - - This method has been added in version 0.26.2. - Setter: - @brief Sets the layer map - This sets a layer mapping for the reader. Unlike \mag_set_layer_map, the 'create_other_layers' flag is not changed. - @param map The layer map to set. - - This method has been added in version 0.26.2. - """ - mag_library_paths: List[str] - r""" - Getter: - @brief Gets the locations where to look up libraries (in this order) - See \mag_library_paths= method for a description of this attribute. - - This property has been added in version 0.26.2. - - Setter: - @brief Specifies the locations where to look up libraries (in this order) - - The reader will look up library reference in these paths when it can't find them locally. - Relative paths in this collection are resolved relative to the initial file's path. - Expression interpolation is supported in the path strings. - - This property has been added in version 0.26.2. - """ - mag_merge: bool - r""" - Getter: - @brief Gets a value indicating whether boxes are merged into polygons - @return True, if boxes are merged. - - When set to true, the boxes and triangles of the Magic layout files are merged into polygons where possible. - - This method has been added in version 0.26.2. - Setter: - @brief Sets a value indicating whether boxes are merged into polygons - @param merge True, if boxes and triangles will be merged into polygons. - - See \mag_merge? for a description of this property. - - This method has been added in version 0.26.2. - """ - mebes_boundary_datatype: int - r""" - Getter: - @brief Gets the datatype number of the boundary layer to produce - See \mebes_produce_boundary= for a description of this attribute. - - This property has been added in version 0.23.10. - - Setter: - @brief Sets the datatype number of the boundary layer to produce - See \mebes_produce_boundary= for a description of this attribute. - - This property has been added in version 0.23.10. - """ - mebes_boundary_layer: int - r""" - Getter: - @brief Gets the layer number of the boundary layer to produce - See \mebes_produce_boundary= for a description of this attribute. - - This property has been added in version 0.23.10. - - Setter: - @brief Sets the layer number of the boundary layer to produce - See \mebes_produce_boundary= for a description of this attribute. - - This property has been added in version 0.23.10. - """ - mebes_boundary_name: str - r""" - Getter: - @brief Gets the name of the boundary layer to produce - See \mebes_produce_boundary= for a description of this attribute. - - This property has been added in version 0.23.10. - - Setter: - @brief Sets the name of the boundary layer to produce - See \mebes_produce_boundary= for a description of this attribute. - - This property has been added in version 0.23.10. - """ - mebes_create_other_layers: bool - r""" - Getter: - @brief Gets a value indicating whether other layers shall be created - @return True, if other layers will be created. - This attribute acts together with a layer map (see \mebes_layer_map=). Layers not listed in this map are created as well when \mebes_create_other_layers? is true. Otherwise they are ignored. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - Setter: - @brief Specifies whether other layers shall be created - @param create True, if other layers will be created. - See \mebes_create_other_layers? for a description of this attribute. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - mebes_data_datatype: int - r""" - Getter: - @brief Gets the datatype number of the data layer to produce - - This property has been added in version 0.23.10. - - Setter: - @brief Sets the datatype number of the data layer to produce - - This property has been added in version 0.23.10. - """ - mebes_data_layer: int - r""" - Getter: - @brief Gets the layer number of the data layer to produce - - This property has been added in version 0.23.10. - - Setter: - @brief Sets the layer number of the data layer to produce - - This property has been added in version 0.23.10. - """ - mebes_data_name: str - r""" - Getter: - @brief Gets the name of the data layer to produce - - This property has been added in version 0.23.10. - - Setter: - @brief Sets the name of the data layer to produce - - This property has been added in version 0.23.10. - """ - mebes_invert: bool - r""" - Getter: - @brief Gets a value indicating whether to invert the MEBES pattern - If this property is set to true, the pattern will be inverted. - - This property has been added in version 0.22. - - Setter: - @brief Specify whether to invert the MEBES pattern - If this property is set to true, the pattern will be inverted. - - This property has been added in version 0.22. - """ - mebes_layer_map: LayerMap - r""" - Getter: - @brief Gets the layer map - @return The layer map. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - Setter: - @brief Sets the layer map - This sets a layer mapping for the reader. Unlike \mebes_set_layer_map, the 'create_other_layers' flag is not changed. - @param map The layer map to set. - - This convenience method has been added in version 0.26.2. - """ - mebes_num_shapes_per_cell: int - r""" - Getter: - @brief Gets the number of stripes collected per cell - See \mebes_num_stripes_per_cell= for details about this property. - - This property has been added in version 0.24.5. - - Setter: - @brief Specify the number of stripes collected per cell - See \mebes_num_stripes_per_cell= for details about this property. - - This property has been added in version 0.24.5. - """ - mebes_num_stripes_per_cell: int - r""" - Getter: - @brief Gets the number of stripes collected per cell - See \mebes_num_stripes_per_cell= for details about this property. - - This property has been added in version 0.23.10. - - Setter: - @brief Specify the number of stripes collected per cell - This property specifies how many stripes will be collected into one cell. - A smaller value means less but bigger cells. The default value is 64. - New cells will be formed whenever more than this number of stripes has been read - or a new segment is started and the number of shapes given by \mebes_num_shapes_per_cell - is exceeded. - - This property has been added in version 0.23.10. - """ - mebes_produce_boundary: bool - r""" - Getter: - @brief Gets a value indicating whether a boundary layer will be produced - See \mebes_produce_boundary= for details about this property. - - This property has been added in version 0.23.10. - - Setter: - @brief Specify whether to produce a boundary layer - If this property is set to true, the pattern boundary will be written to the layer and datatype specified with \mebes_boundary_name, \mebes_boundary_layer and \mebes_boundary_datatype. - By default, the boundary layer is produced. - - This property has been added in version 0.23.10. - """ - mebes_subresolution: bool - r""" - Getter: - @brief Gets a value indicating whether to invert the MEBES pattern - See \subresolution= for details about this property. - - This property has been added in version 0.23.10. - - Setter: - @brief Specify whether subresolution trapezoids are supported - If this property is set to true, subresolution trapezoid vertices are supported. - In order to implement support, the reader will create magnified instances with a magnification of 1/16. - By default this property is enabled. - - This property has been added in version 0.23.10. - """ - mebes_top_cell_index: int - r""" - Getter: - @brief Gets the cell index for the top cell to use - See \mebes_top_cell_index= for a description of this property. - - This property has been added in version 0.23.10. - - Setter: - @brief Specify the cell index for the top cell to use - If this property is set to a valid cell index, the MEBES reader will put the subcells and shapes into this cell. - - This property has been added in version 0.23.10. - """ - oasis_expect_strict_mode: int - r""" - Getter: - @hide - Setter: - @hide - """ - oasis_read_all_properties: int - r""" - Getter: - @hide - Setter: - @hide - """ - properties_enabled: bool - r""" - Getter: - @brief Gets a value indicating whether properties shall be read - @return True, if properties should be read. - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - Setter: - @brief Specifies whether properties should be read - @param enabled True, if properties should be read. - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - text_enabled: bool - r""" - Getter: - @brief Gets a value indicating whether text objects shall be read - @return True, if text objects should be read. - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - Setter: - @brief Specifies whether text objects shall be read - @param enabled True, if text objects should be read. - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - warn_level: int - r""" - Getter: - @brief Sets the warning level. - See \warn_level= for details about this attribute. - - This attribute has been added in version 0.28. - Setter: - @brief Sets the warning level. - The warning level is a reader-specific setting which enables or disables warnings - on specific levels. Level 0 is always "warnings off". The default level is 1 - which means "reasonable warnings emitted". - - This attribute has been added in version 0.28. - """ - @classmethod - def new(cls) -> LoadLayoutOptions: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> LoadLayoutOptions: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> LoadLayoutOptions: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: LoadLayoutOptions) -> None: - r""" - @brief Assigns another object to self - """ - def cif_select_all_layers(self) -> None: - r""" - @brief Selects all layers and disables the layer map - - This disables any layer map and enables reading of all layers. - New layers will be created when required. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - def cif_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: - r""" - @brief Sets the layer map - This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. - @param map The layer map to set. - @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> LoadLayoutOptions: - r""" - @brief Creates a copy of self - """ - def dxf_select_all_layers(self) -> None: - r""" - @brief Selects all layers and disables the layer map - - This disables any layer map and enables reading of all layers. - New layers will be created when required. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - def dxf_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: - r""" - @brief Sets the layer map - This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. - @param map The layer map to set. - @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_properties_enabled(self) -> bool: - r""" - @brief Gets a value indicating whether properties shall be read - @return True, if properties should be read. - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - def is_text_enabled(self) -> bool: - r""" - @brief Gets a value indicating whether text objects shall be read - @return True, if text objects should be read. - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - def mag_select_all_layers(self) -> None: - r""" - @brief Selects all layers and disables the layer map - - This disables any layer map and enables reading of all layers. - New layers will be created when required. - - This method has been added in version 0.26.2. - """ - def mag_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: - r""" - @brief Sets the layer map - This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to assign layer/datatype numbers to the named layers. - @param map The layer map to set. - @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. - - This method has been added in version 0.26.2. - """ - def mebes_select_all_layers(self) -> None: - r""" - @brief Selects all layers and disables the layer map - - This disables any layer map and enables reading of all layers. - New layers will be created when required. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - def mebes_set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: - r""" - @brief Sets the layer map - This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers. - @param map The layer map to set. - @param create_other_layers The flag indicating whether other layers will be created as well. Set to false to read only the layers in the layer map. - - This method has been added in version 0.25 and replaces the respective global option in \LoadLayoutOptions in a format-specific fashion. - """ - def select_all_layers(self) -> None: - r""" - @brief Selects all layers and disables the layer map - - This disables any layer map and enables reading of all layers. - New layers will be created when required. - - Starting with version 0.25 this method only applies to GDS2 and OASIS format. Other formats provide their own configuration. - """ - def set_layer_map(self, map: LayerMap, create_other_layers: bool) -> None: - r""" - @brief Sets the layer map - This sets a layer mapping for the reader. The layer map allows selection and translation of the original layers, for example to add a layer name. - @param map The layer map to set.@param create_other_layers The flag telling whether other layer should be created as well. Set to false if just the layers in the mapping table should be read. - - Starting with version 0.25 this option only applies to GDS2 and OASIS format. Other formats provide their own configuration. + @brief Gets the symbolic string from an enum """ class RecursiveInstanceIterator: @@ -25204,20 +39515,6 @@ class RecursiveShapeIterator: """ @overload @classmethod - def new(cls, layout: Layout, cell: Cell, layers: Sequence[int]) -> RecursiveShapeIterator: - r""" - @brief Creates a recursive, multi-layer shape iterator. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param layers The layer indexes from which the shapes are taken - - This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. - While iterating use the \layer method to retrieve the layer of the current shape. - - This constructor has been introduced in version 0.23. - """ - @overload - @classmethod def new(cls, layout: Layout, cell: Cell, layer: int, box: Box, overlapping: Optional[bool] = ...) -> RecursiveShapeIterator: r""" @brief Creates a recursive, single-layer shape iterator with a region. @@ -25253,6 +39550,20 @@ class RecursiveShapeIterator: """ @overload @classmethod + def new(cls, layout: Layout, cell: Cell, layers: Sequence[int]) -> RecursiveShapeIterator: + r""" + @brief Creates a recursive, multi-layer shape iterator. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layers The layer indexes from which the shapes are taken + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. + While iterating use the \layer method to retrieve the layer of the current shape. + + This constructor has been introduced in version 0.23. + """ + @overload + @classmethod def new(cls, layout: Layout, cell: Cell, layers: Sequence[int], box: Box, overlapping: Optional[bool] = ...) -> RecursiveShapeIterator: r""" @brief Creates a recursive, multi-layer shape iterator with a region. @@ -25315,19 +39626,6 @@ class RecursiveShapeIterator: This constructor has been introduced in version 0.23. """ @overload - def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int]) -> None: - r""" - @brief Creates a recursive, multi-layer shape iterator. - @param layout The layout which shall be iterated - @param cell The initial cell which shall be iterated (including its children) - @param layers The layer indexes from which the shapes are taken - - This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. - While iterating use the \layer method to retrieve the layer of the current shape. - - This constructor has been introduced in version 0.23. - """ - @overload def __init__(self, layout: Layout, cell: Cell, layer: int, box: Box, overlapping: Optional[bool] = ...) -> None: r""" @brief Creates a recursive, single-layer shape iterator with a region. @@ -25361,6 +39659,19 @@ class RecursiveShapeIterator: This constructor has been introduced in version 0.25. The 'overlapping' parameter has been made optional in version 0.27. """ @overload + def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int]) -> None: + r""" + @brief Creates a recursive, multi-layer shape iterator. + @param layout The layout which shall be iterated + @param cell The initial cell which shall be iterated (including its children) + @param layers The layer indexes from which the shapes are taken + + This constructor creates a new recursive shape iterator which delivers the shapes of the given cell plus its children from the layers given by the layer indexes in the "layers" parameter. + While iterating use the \layer method to retrieve the layer of the current shape. + + This constructor has been introduced in version 0.23. + """ + @overload def __init__(self, layout: Layout, cell: Cell, layers: Sequence[int], box: Box, overlapping: Optional[bool] = ...) -> None: r""" @brief Creates a recursive, multi-layer shape iterator with a region. @@ -25556,6 +39867,26 @@ class RecursiveShapeIterator: This feature has been introduced in version 0.28. """ + def enable_properties(self) -> None: + r""" + @brief Enables properties for the given iterator. + Afer enabling properties, \prop_id will deliver the effective properties ID for the current shape. By default, properties are not enabled and \prop_id will always return 0 (no properties attached). Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key. + + Note that property filters/mappers are additive and act in addition (after) the currently installed filter. + + This feature has been introduced in version 0.28.4. + """ + def filter_properties(self, keys: Sequence[Any]) -> None: + r""" + @brief Filters properties by certain keys. + Calling this method will reduce the properties to values with name keys from the 'keys' list. + As a side effect, this method enables properties. + As with \enable_properties or \remove_properties, this filter has an effect on the value returned by \prop_id, not on the properties ID attached to the shape directly. + + Note that property filters/mappers are additive and act in addition (after) the currently installed filter. + + This feature has been introduced in version 0.28.4. + """ def is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -25583,6 +39914,17 @@ class RecursiveShapeIterator: This method has been introduced in version 0.23. """ + def map_properties(self, key_map: Dict[Any, Any]) -> None: + r""" + @brief Maps properties by name key. + Calling this method will reduce the properties to values with name keys from the 'keys' hash and renames the properties. Property values with keys not listed in the key map will be removed. + As a side effect, this method enables properties. + As with \enable_properties or \remove_properties, this filter has an effect on the value returned by \prop_id, not on the properties ID attached to the shape directly. + + Note that property filters/mappers are additive and act in addition (after) the currently installed filter. + + This feature has been introduced in version 0.28.4. + """ def next(self) -> None: r""" @brief Increments the iterator @@ -25596,6 +39938,28 @@ class RecursiveShapeIterator: This method has been introduced in version 0.25. """ + def prop_id(self) -> int: + r""" + @brief Gets the effective properties ID + The shape iterator supports property filtering and translation. This method will deliver the effective property ID after translation. The original property ID can be obtained from 'shape.prop_id' and is not changed by installing filters or mappers. + + \prop_id is evaluated by \Region objects for example, when they are created from a shape iterator. + + See \enable_properties, \filter_properties, \remove_properties and \map_properties for details on this feature. + + This attribute has been introduced in version 0.28.4. + """ + def remove_properties(self) -> None: + r""" + @brief Removes properties for the given container. + This will remove all properties and \prop_id will deliver 0 always (no properties attached). + Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key. + + Note that property filters/mappers are additive and act in addition (after) the currently installed filter. + So effectively after 'remove_properties' you cannot get them back. + + This feature has been introduced in version 0.28.4. + """ def reset(self) -> None: r""" @brief Resets the iterator to the initial state @@ -25741,60 +40105,45 @@ class Region(ShapeCollection): This class has been introduced in version 0.23. """ - class Metrics: + class OppositeFilter: r""" - @brief This class represents the metrics type for \Region#width and related checks. + @brief This class represents the opposite error filter mode for \Region#separation and related checks. This enum has been introduced in version 0.27. """ - Euclidian: ClassVar[Region.Metrics] + NoOppositeFilter: ClassVar[Region.OppositeFilter] r""" - @brief Specifies Euclidian metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by: - - @code - d = sqrt(dx^2 + dy^2) - @/code - - All points within a circle with radius d around one point are considered to have a smaller distance than d. + @brief No opposite filtering """ - Projection: ClassVar[Region.Metrics] + NotOpposite: ClassVar[Region.OppositeFilter] r""" - @brief Specifies projected distance metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other. + @brief Only errors NOT appearing on opposite sides of a figure will be reported """ - Square: ClassVar[Region.Metrics] + OnlyOpposite: ClassVar[Region.OppositeFilter] r""" - @brief Specifies square metrics for the check functions - This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies square metrics, i.e. the distance between two points is measured by: - - @code - d = max(abs(dx), abs(dy)) - @/code - - All points within a square with length 2*d around one point are considered to have a smaller distance than d in this metrics. + @brief Only errors appearing on opposite sides of a figure will be reported """ @overload @classmethod - def new(cls, i: int) -> Region.Metrics: + def new(cls, i: int) -> Region.OppositeFilter: r""" @brief Creates an enum from an integer value """ @overload @classmethod - def new(cls, s: str) -> Region.Metrics: + def new(cls, s: str) -> Region.OppositeFilter: r""" @brief Creates an enum from a string value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __init__(self, i: int) -> None: @@ -25807,25 +40156,25 @@ class Region(ShapeCollection): @brief Creates an enum from a string value """ @overload + def __lt__(self, other: Region.OppositeFilter) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload def __lt__(self, other: int) -> bool: r""" @brief Returns true if the enum is less (in the enum symbol order) than the integer value """ @overload - def __lt__(self, other: Region.Metrics) -> bool: + def __ne__(self, other: object) -> bool: r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" @brief Compares two enums for inequality """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ def __repr__(self) -> str: r""" @brief Converts an enum to a visual string @@ -25895,12 +40244,12 @@ class Region(ShapeCollection): @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __init__(self, i: int) -> None: @@ -25913,115 +40262,25 @@ class Region(ShapeCollection): @brief Creates an enum from a string value """ @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload def __lt__(self, other: Region.RectFilter) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - class OppositeFilter: - r""" - @brief This class represents the opposite error filter mode for \Region#separation and related checks. - - This enum has been introduced in version 0.27. - """ - NoOppositeFilter: ClassVar[Region.OppositeFilter] - r""" - @brief No opposite filtering - """ - NotOpposite: ClassVar[Region.OppositeFilter] - r""" - @brief Only errors NOT appearing on opposite sides of a figure will be reported - """ - OnlyOpposite: ClassVar[Region.OppositeFilter] - r""" - @brief Only errors appearing on opposite sides of a figure will be reported - """ - @overload - @classmethod - def new(cls, i: int) -> Region.OppositeFilter: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> Region.OppositeFilter: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload def __lt__(self, other: int) -> bool: r""" @brief Returns true if the enum is less (in the enum symbol order) than the integer value """ @overload - def __lt__(self, other: Region.OppositeFilter) -> bool: + def __ne__(self, other: object) -> bool: r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second + @brief Compares an enum with an integer for inequality """ @overload def __ne__(self, other: object) -> bool: r""" @brief Compares two enums for inequality """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ def __repr__(self) -> str: r""" @brief Converts an enum to a visual string @@ -26042,7 +40301,17 @@ class Region(ShapeCollection): r""" @brief Gets the symbolic string from an enum """ - Euclidian: ClassVar[Region.Metrics] + DifferentPropertiesConstraint: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are different + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are different. Properties are generated on the output shapes where applicable. + """ + DifferentPropertiesConstraintDrop: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are different + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are the same. No properties are generated on the output shapes. + """ + Euclidian: ClassVar[Metrics] r""" @brief Specifies Euclidian metrics for the check functions This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies Euclidian metrics, i.e. the distance between two points is measured by: @@ -26057,10 +40326,20 @@ class Region(ShapeCollection): r""" @brief Allow errors when on all sides """ + IgnoreProperties: ClassVar[PropertyConstraint] + r""" + @brief Specifies to ignore properties + When using this constraint - for example on a boolean operation - properties are ignored and are not generated in the output. + """ NoOppositeFilter: ClassVar[Region.OppositeFilter] r""" @brief No opposite filtering """ + NoPropertyConstraint: ClassVar[PropertyConstraint] + r""" + @brief Specifies not to apply any property constraint + When using this constraint - for example on a boolean operation - shapes are considered regardless of their user properties. Properties are generated on the output shapes where applicable. + """ NoRectFilter: ClassVar[Region.RectFilter] r""" @brief Specifies no filtering @@ -26077,12 +40356,22 @@ class Region(ShapeCollection): r""" @brief Only errors appearing on opposite sides of a figure will be reported """ - Projection: ClassVar[Region.Metrics] + Projection: ClassVar[Metrics] r""" @brief Specifies projected distance metrics for the check functions This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies projected metrics, i.e. the distance is defined as the minimum distance measured perpendicular to one edge. That implies that the distance is defined only where two edges have a non-vanishing projection onto each other. """ - Square: ClassVar[Region.Metrics] + SamePropertiesConstraint: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are the same + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are the same. Properties are generated on the output shapes where applicable. + """ + SamePropertiesConstraintDrop: ClassVar[PropertyConstraint] + r""" + @brief Specifies to consider shapes only if their user properties are the same + When using this constraint - for example on a boolean operation - shapes are considered only if their user properties are the same. No properties are generated on the output shapes. + """ + Square: ClassVar[Metrics] r""" @brief Specifies square metrics for the check functions This value can be used for the metrics parameter in the check functions, i.e. \width_check. This value specifies square metrics, i.e. the distance between two points is measured by: @@ -26239,36 +40528,6 @@ class Region(ShapeCollection): """ @overload @classmethod - def new(cls, shapes: Shapes) -> Region: - r""" - @brief Shapes constructor - - This constructor creates a region from a \Shapes collection. - - This constructor has been introduced in version 0.25. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> Region: - r""" - @brief Constructor from a hierarchical shape set with a transformation - - This constructor creates a region from the shapes delivered by the given recursive shape iterator. - Text objects and edges are not inserted, because they cannot be converted to polygons. - On the delivered shapes it applies the given transformation. - This method allows feeding the shapes from a hierarchy of cells into the region. - The transformation is useful to scale to a specific database unit for example. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Region::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - """ - @overload - @classmethod def new(cls, shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> Region: r""" @brief Constructor for a deep region from a hierarchical shape set @@ -26285,27 +40544,6 @@ class Region(ShapeCollection): """ @overload @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: - r""" - @brief Constructor from a text set - - @param shape_iterator The iterator from which to derive the texts - @param expr The selection string - @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. - @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) - This special constructor will create a region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. - Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: - - @code - region = RBA::Region::new(iter, "*") # all texts - region = RBA::Region::new(iter, "A*") # all texts starting with an 'A' - region = RBA::Region::new(iter, "A*", false) # all texts exactly matching 'A*' - @/code - - This method has been introduced in version 0.25. The enlargement parameter has been added in version 0.26. - """ - @overload - @classmethod def new(cls, shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, trans: ICplxTrans, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> Region: r""" @brief Constructor for a deep region from a hierarchical shape set @@ -26345,6 +40583,57 @@ class Region(ShapeCollection): This variant has been introduced in version 0.26. """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) + This special constructor will create a region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + region = RBA::Region::new(iter, "*") # all texts + region = RBA::Region::new(iter, "A*") # all texts starting with an 'A' + region = RBA::Region::new(iter, "A*", false) # all texts exactly matching 'A*' + @/code + + This method has been introduced in version 0.25. The enlargement parameter has been added in version 0.26. + """ + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> Region: + r""" + @brief Constructor from a hierarchical shape set with a transformation + + This constructor creates a region from the shapes delivered by the given recursive shape iterator. + Text objects and edges are not inserted, because they cannot be converted to polygons. + On the delivered shapes it applies the given transformation. + This method allows feeding the shapes from a hierarchy of cells into the region. + The transformation is useful to scale to a specific database unit for example. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Region::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + """ + @overload + @classmethod + def new(cls, shapes: Shapes) -> Region: + r""" + @brief Shapes constructor + + This constructor creates a region from a \Shapes collection. + + This constructor has been introduced in version 0.25. + """ def __add__(self, other: Region) -> Region: r""" @brief Returns the combined region of self and the other region @@ -26453,34 +40742,6 @@ class Region(ShapeCollection): @/code """ @overload - def __init__(self, shapes: Shapes) -> None: - r""" - @brief Shapes constructor - - This constructor creates a region from a \Shapes collection. - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: - r""" - @brief Constructor from a hierarchical shape set with a transformation - - This constructor creates a region from the shapes delivered by the given recursive shape iterator. - Text objects and edges are not inserted, because they cannot be converted to polygons. - On the delivered shapes it applies the given transformation. - This method allows feeding the shapes from a hierarchy of cells into the region. - The transformation is useful to scale to a specific database unit for example. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Region::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - """ - @overload def __init__(self, shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> None: r""" @brief Constructor for a deep region from a hierarchical shape set @@ -26496,26 +40757,6 @@ class Region(ShapeCollection): This method has been introduced in version 0.26. """ @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> None: - r""" - @brief Constructor from a text set - - @param shape_iterator The iterator from which to derive the texts - @param expr The selection string - @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. - @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) - This special constructor will create a region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. - Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: - - @code - region = RBA::Region::new(iter, "*") # all texts - region = RBA::Region::new(iter, "A*") # all texts starting with an 'A' - region = RBA::Region::new(iter, "A*", false) # all texts exactly matching 'A*' - @/code - - This method has been introduced in version 0.25. The enlargement parameter has been added in version 0.26. - """ - @overload def __init__(self, shape_iterator: RecursiveShapeIterator, deep_shape_store: DeepShapeStore, trans: ICplxTrans, area_ratio: Optional[float] = ..., max_vertex_count: Optional[int] = ...) -> None: r""" @brief Constructor for a deep region from a hierarchical shape set @@ -26554,6 +40795,54 @@ class Region(ShapeCollection): This variant has been introduced in version 0.26. """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, expr: str, as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> None: + r""" + @brief Constructor from a text set + + @param shape_iterator The iterator from which to derive the texts + @param expr The selection string + @param as_pattern If true, the selection string is treated as a glob pattern. Otherwise the match is exact. + @param enl The per-side enlargement of the box to mark the text (1 gives a 2x2 DBU box) + This special constructor will create a region from the text objects delivered by the shape iterator. Each text object will give a small (non-empty) box that represents the text origin. + Texts can be selected by their strings - either through a glob pattern or by exact comparison with the given string. The following options are available: + + @code + region = RBA::Region::new(iter, "*") # all texts + region = RBA::Region::new(iter, "A*") # all texts starting with an 'A' + region = RBA::Region::new(iter, "A*", false) # all texts exactly matching 'A*' + @/code + + This method has been introduced in version 0.25. The enlargement parameter has been added in version 0.26. + """ + @overload + def __init__(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: + r""" + @brief Constructor from a hierarchical shape set with a transformation + + This constructor creates a region from the shapes delivered by the given recursive shape iterator. + Text objects and edges are not inserted, because they cannot be converted to polygons. + On the delivered shapes it applies the given transformation. + This method allows feeding the shapes from a hierarchy of cells into the region. + The transformation is useful to scale to a specific database unit for example. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Region::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + """ + @overload + def __init__(self, shapes: Shapes) -> None: + r""" + @brief Shapes constructor + + This constructor creates a region from a \Shapes collection. + + This constructor has been introduced in version 0.25. + """ def __ior__(self, other: Region) -> Region: r""" @brief Performs the boolean OR between self and the other region @@ -26659,7 +40948,29 @@ class Region(ShapeCollection): Usually it's not required to call this method. It has been introduced in version 0.24. """ - def andnot(self, other: Region) -> List[Region]: + def and_(self, other: Region, property_constraint: Optional[PropertyConstraint] = ...) -> Region: + r""" + @brief Returns the boolean AND between self and the other region + + @return The result of the boolean AND operation + + This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged. + It allows specification of a property constaint - e.g. only performing the boolean operation between shapes with the same user properties. + + This variant has been introduced in version 0.28.4. + """ + def and_with(self, other: Region, property_constraint: Optional[PropertyConstraint] = ...) -> Region: + r""" + @brief Performs the boolean AND between self and the other region + + @return The region after modification (self) + + This method will compute the boolean AND (intersection) between two regions. The result is often but not necessarily always merged. + It allows specification of a property constaint - e.g. only performing the boolean operation between shapes with the same user properties. + + This variant has been introduced in version 0.28.4. + """ + def andnot(self, other: Region, property_constraint: Optional[PropertyConstraint] = ...) -> List[Region]: r""" @brief Returns the boolean AND and NOT between self and the other region @@ -26709,11 +41020,12 @@ class Region(ShapeCollection): r""" @brief Clears the region """ - def complex_op(self, node: CompoundRegionOperationNode) -> Any: + def complex_op(self, node: CompoundRegionOperationNode, property_constraint: Optional[PropertyConstraint] = ...) -> Any: r""" @brief Executes a complex operation (see \CompoundRegionOperationNode for details) This method has been introduced in version 0.27. + The 'property_constraint' parameter controls whether properties are considered: with 'SamePropertiesConstraint' the operation is only applied between shapes with identical properties. With 'DifferentPropertiesConstraint' only between shapes with different properties. This option has been introduced in version 0.28.4. """ def corners(self, angle_min: Optional[float] = ..., angle_max: Optional[float] = ..., dim: Optional[int] = ..., include_min_angle: Optional[bool] = ..., include_max_angle: Optional[bool] = ...) -> Region: r""" @@ -26861,7 +41173,14 @@ class Region(ShapeCollection): The label is a text which is put in front of the progress bar. Using a progress bar will imply a performance penalty of a few percent typically. """ - def enclosed_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + def enable_properties(self) -> None: + r""" + @brief Enables properties for the given container. + This method has an effect mainly on original layers and will import properties from such layers. By default, properties are not enabled on original layers. Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key. + + This method has been introduced in version 0.28.4. + """ + def enclosed_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ..., property_constraint: Optional[PropertyConstraint] = ...) -> EdgePairs: r""" @brief Performs an inside check with options @param d The minimum distance for which the polygons are checked @@ -26874,6 +41193,7 @@ class Region(ShapeCollection): @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative Negative output from the first input + @param property_constraint Specifies whether to consider only shapes with a certain property relation If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. @@ -26895,8 +41215,9 @@ class Region(ShapeCollection): The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. The 'enclosed_check' alias was introduced in version 0.27.5. + 'property_constraint' has been added in version 0.28.4. """ - def enclosing_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + def enclosing_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ..., property_constraint: Optional[PropertyConstraint] = ...) -> EdgePairs: r""" @brief Performs an enclosing check with options @param d The minimum enclosing distance for which the polygons are checked @@ -26909,6 +41230,7 @@ class Region(ShapeCollection): @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative Negative output from the first input + @param property_constraint Specifies whether to consider only shapes with a certain property relation If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. @@ -26929,6 +41251,7 @@ class Region(ShapeCollection): Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. + 'property_constraint' has been added in version 0.28.4. """ def extent_refs(self, arg0: float, arg1: float, arg2: float, arg3: float, arg4: int, arg5: int) -> Region: r""" @@ -26995,6 +41318,14 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ + def filter_properties(self, keys: Sequence[Any]) -> None: + r""" + @brief Filters properties by certain keys. + Calling this method on a container will reduce the properties to values with name keys from the 'keys' list. + As a side effect, this method enables properties on original layers. + + This method has been introduced in version 0.28.4. + """ def flatten(self) -> Region: r""" @brief Explicitly flattens a region @@ -27104,14 +41435,6 @@ class Region(ShapeCollection): Text objects and edges are not inserted, because they cannot be converted to polygons. """ @overload - def insert(self, shapes: Shapes) -> None: - r""" - @brief Inserts all polygons from the shape collection into this region - This method takes each "polygon-like" shape from the shape collection and inserts this shape into the region. Paths and boxes are converted to polygons during this process. Edges and text objects are ignored. - - This method has been introduced in version 0.25. - """ - @overload def insert(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: r""" @brief Inserts all shapes delivered by the recursive shape iterator into this region with a transformation @@ -27121,6 +41444,14 @@ class Region(ShapeCollection): This variant will apply the given transformation to the shapes. This is useful to scale the shapes to a specific database unit for example. """ @overload + def insert(self, shapes: Shapes) -> None: + r""" + @brief Inserts all polygons from the shape collection into this region + This method takes each "polygon-like" shape from the shape collection and inserts this shape into the region. Paths and boxes are converted to polygons during this process. Edges and text objects are ignored. + + This method has been introduced in version 0.25. + """ + @overload def insert(self, shapes: Shapes, trans: ICplxTrans) -> None: r""" @brief Inserts all polygons from the shape collection into this region with complex transformation @@ -27151,7 +41482,7 @@ class Region(ShapeCollection): Merged semantics applies for this method (see \merged_semantics= for a description of this concept) """ - def inside_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + def inside_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ..., property_constraint: Optional[PropertyConstraint] = ...) -> EdgePairs: r""" @brief Performs an inside check with options @param d The minimum distance for which the polygons are checked @@ -27164,6 +41495,7 @@ class Region(ShapeCollection): @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative Negative output from the first input + @param property_constraint Specifies whether to consider only shapes with a certain property relation If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. @@ -27185,6 +41517,7 @@ class Region(ShapeCollection): The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. The 'enclosed_check' alias was introduced in version 0.27.5. + 'property_constraint' has been added in version 0.28.4. """ @overload def interacting(self, other: Edges, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: @@ -27257,7 +41590,7 @@ class Region(ShapeCollection): @brief Returns true if the region is merged If the region is merged, polygons will not touch or overlap. You can ensure merged state by calling \merge. """ - def isolated_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + def isolated_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ..., property_constraint: Optional[PropertyConstraint] = ...) -> EdgePairs: r""" @brief Performs a space check between edges of different polygons with options @param d The minimum space for which the polygons are checked @@ -27269,6 +41602,7 @@ class Region(ShapeCollection): @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative If true, edges not violation the condition will be output as pseudo-edge pairs + @param property_constraint Specifies whether to consider only shapes with a certain property relation If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. @@ -27287,6 +41621,15 @@ class Region(ShapeCollection): Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. + 'property_constraint' has been added in version 0.28.4. + """ + def map_properties(self, key_map: Dict[Any, Any]) -> None: + r""" + @brief Maps properties by name key. + Calling this method on a container will reduce the properties to values with name keys from the 'keys' hash and renames the properties. Properties not listed in the key map will be removed. + As a side effect, this method enables properties on original layers. + + This method has been introduced in version 0.28.4. """ def members_of(self, other: Region) -> Region: r""" @@ -27304,6 +41647,18 @@ class Region(ShapeCollection): If the region is already merged, this method does nothing """ @overload + def merge(self, min_coherence: bool, min_wc: int) -> Region: + r""" + @brief Merge the region with options + + @param min_coherence A flag indicating whether the resulting polygons shall have minimum coherence + @param min_wc Overlap selection + @return The region after is has been merged (self). + + Merging removes overlaps and joins touching polygons. + This version provides two additional options: if "min_coherence" is set to true, "kissing corners" are resolved by producing separate polygons. "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. + """ + @overload def merge(self, min_wc: int) -> Region: r""" @brief Merge the region with options @@ -27317,18 +41672,6 @@ class Region(ShapeCollection): This method is equivalent to "merge(false, min_wc). """ @overload - def merge(self, min_coherence: bool, min_wc: int) -> Region: - r""" - @brief Merge the region with options - - @param min_coherence A flag indicating whether the resulting polygons shall have minimum coherence - @param min_wc Overlap selection - @return The region after is has been merged (self). - - Merging removes overlaps and joins touching polygons. - This version provides two additional options: if "min_coherence" is set to true, "kissing corners" are resolved by producing separate polygons. "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. - """ - @overload def merged(self) -> Region: r""" @brief Returns the merged region @@ -27340,19 +41683,6 @@ class Region(ShapeCollection): In contrast to \merge, this method does not modify the region but returns a merged copy. """ @overload - def merged(self, min_wc: int) -> Region: - r""" - @brief Returns the merged region (with options) - - @return The region after is has been merged. - - This version provides one additional options: "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. - - This method is equivalent to "merged(false, min_wc)". - - In contrast to \merge, this method does not modify the region but returns a merged copy. - """ - @overload def merged(self, min_coherence: bool, min_wc: int) -> Region: r""" @brief Returns the merged region (with options) @@ -27367,6 +41697,19 @@ class Region(ShapeCollection): In contrast to \merge, this method does not modify the region but returns a merged copy. """ @overload + def merged(self, min_wc: int) -> Region: + r""" + @brief Returns the merged region (with options) + + @return The region after is has been merged. + + This version provides one additional options: "min_wc" controls whether output is only produced if multiple polygons overlap. The value specifies the number of polygons that need to overlap. A value of 2 means that output is only produced if two or more polygons overlap. + + This method is equivalent to "merged(false, min_wc)". + + In contrast to \merge, this method does not modify the region but returns a merged copy. + """ + @overload def minkowski_sum(self, b: Box) -> Region: r""" @brief Compute the Minkowski sum of the region and a box @@ -27524,6 +41867,24 @@ class Region(ShapeCollection): @return The moved region. """ + def nets(self, extracted: LayoutToNetlist, net_prop_name: Optional[Any] = ..., net_filter: Optional[Sequence[Net]] = ...) -> Region: + r""" + @brief Pulls the net shapes from a LayoutToNetlist database + This method will create a new layer with the net shapes from the LayoutToNetlist database, provided that this region was an input to the netlist extraction on this database. + + A (circuit name, net name) tuple will be attached as properties to the shapes if 'net_prop_name' is given and not nil. This allows generating unique properties per shape, flagging the net the shape is on. This feature is good for performing net-dependent booleans and DRC checks. + + A net filter can be provided with the 'net_filter' argument. If given, only nets from this set are produced. Example: + + @code + connect(metal1, via1) + connect(via1, metal2) + + metal1_all_nets = metal1.nets + @/code + + This method was introduced in version 0.28.4 + """ def non_rectangles(self) -> Region: r""" @brief Returns all polygons which are not rectangles @@ -27541,6 +41902,17 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ + def not_(self, other: Region, property_constraint: Optional[PropertyConstraint] = ...) -> Region: + r""" + @brief Returns the boolean NOT between self and the other region + + @return The result of the boolean NOT operation + + This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged. + It allows specification of a property constaint - e.g. only performing the boolean operation between shapes with the same user properties. + + This variant has been introduced in version 0.28.4. + """ def not_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: r""" @brief Returns the polygons of this region which are not completely covering polygons from the other region @@ -27629,7 +42001,18 @@ class Region(ShapeCollection): The count options have been introduced in version 0.27. """ - def notch_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> EdgePairs: + def not_with(self, other: Region, property_constraint: Optional[PropertyConstraint] = ...) -> Region: + r""" + @brief Performs the boolean NOT between self and the other region + + @return The region after modification (self) + + This method will compute the boolean NOT (intersection) between two regions. The result is often but not necessarily always merged. + It allows specification of a property constaint - e.g. only performing the boolean operation between shapes with the same user properties. + + This variant has been introduced in version 0.28.4. + """ + def notch_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ..., property_constraint: Optional[PropertyConstraint] = ...) -> EdgePairs: r""" @brief Performs a space check between edges of the same polygon with options @param d The minimum space for which the polygons are checked @@ -27640,7 +42023,8 @@ class Region(ShapeCollection): @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding @param negative If true, edges not violation the condition will be output as pseudo-edge pairs - + @param property_constraint Specifies whether to consider only shapes with a certain property relation + @param property_constraint Only \IgnoreProperties and \NoPropertyConstraint are allowed - in the last case, properties are copied from the original shapes to the output This version is similar to the simple version with one parameter. In addition, it allows to specify many more options. If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the space check. @@ -27658,6 +42042,7 @@ class Region(ShapeCollection): Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) The 'shielded' and 'negative' options have been introduced in version 0.27. + 'property_constraint' has been added in version 0.28.4. """ def outside(self, other: Region) -> Region: r""" @@ -27667,7 +42052,7 @@ class Region(ShapeCollection): Merged semantics applies for this method (see \merged_semantics= for a description of this concept) """ - def overlap_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + def overlap_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ..., property_constraint: Optional[PropertyConstraint] = ...) -> EdgePairs: r""" @brief Performs an overlap check with options @param d The minimum overlap for which the polygons are checked @@ -27680,6 +42065,7 @@ class Region(ShapeCollection): @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative Negative output from the first input + @param property_constraint Specifies whether to consider only shapes with a certain property relation If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. @@ -27700,6 +42086,7 @@ class Region(ShapeCollection): Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. + 'property_constraint' has been added in version 0.28.4. """ def overlapping(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> Region: r""" @@ -27797,6 +42184,13 @@ class Region(ShapeCollection): @brief Returns all polygons which are rectilinear This method returns all polygons in self which are rectilinear.Merged semantics applies for this method (see \merged_semantics= for a description of this concept) """ + def remove_properties(self) -> None: + r""" + @brief Removes properties for the given container. + This will remove all properties on the given container. + + This method has been introduced in version 0.28.4. + """ def round_corners(self, r_inner: float, r_outer: float, n: int) -> None: r""" @brief Corner rounding @@ -27991,7 +42385,7 @@ class Region(ShapeCollection): The count options have been introduced in version 0.27. """ - def separation_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + def separation_check(self, other: Region, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ..., property_constraint: Optional[PropertyConstraint] = ...) -> EdgePairs: r""" @brief Performs a separation check with options @param d The minimum separation for which the polygons are checked @@ -28004,6 +42398,7 @@ class Region(ShapeCollection): @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative Negative output from the first input + @param property_constraint Specifies whether to consider only shapes with a certain property relation If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. @@ -28024,6 +42419,7 @@ class Region(ShapeCollection): Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. The interpretation of the 'negative' flag has been restriced to first-layout only output in 0.27.1. + 'property_constraint' has been added in version 0.28.4. """ @overload def size(self) -> int: @@ -28158,7 +42554,7 @@ class Region(ShapeCollection): @brief Returns the snapped region This method will snap the region to the given grid and return the snapped region (see \snap). The original region is not modified. """ - def space_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ...) -> EdgePairs: + def space_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., opposite_filter: Optional[Region.OppositeFilter] = ..., rect_filter: Optional[Region.RectFilter] = ..., negative: Optional[bool] = ..., property_constraint: Optional[PropertyConstraint] = ...) -> EdgePairs: r""" @brief Performs a space check with options @param d The minimum space for which the polygons are checked @@ -28170,6 +42566,7 @@ class Region(ShapeCollection): @param opposite_filter Specifies a filter mode for errors happening on opposite sides of inputs shapes @param rect_filter Specifies an error filter for rectangular input shapes @param negative If true, edges not violation the condition will be output as pseudo-edge pairs + @param property_constraint Specifies whether to consider only shapes with a certain property relation If "whole_edges" is true, the resulting \EdgePairs collection will receive the whole edges which contribute in the width check. @@ -28188,6 +42585,7 @@ class Region(ShapeCollection): Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) The 'shielded', 'negative', 'not_opposite' and 'rect_sides' options have been introduced in version 0.27. + 'property_constraint' has been added in version 0.28.4. """ def split_covering(self, other: Region, min_count: Optional[int] = ..., max_count: Optional[int] = ...) -> List[Region]: r""" @@ -28289,19 +42687,13 @@ class Region(ShapeCollection): This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare. """ @overload - def texts(self, expr: Optional[str] = ..., as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: - r""" - @hide - This method is provided for DRC implementation only. - """ - @overload def texts(self, dss: DeepShapeStore, expr: Optional[str] = ..., as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: r""" @hide This method is provided for DRC implementation only. """ @overload - def texts_dots(self, expr: Optional[str] = ..., as_pattern: Optional[bool] = ...) -> Edges: + def texts(self, expr: Optional[str] = ..., as_pattern: Optional[bool] = ..., enl: Optional[int] = ...) -> Region: r""" @hide This method is provided for DRC implementation only. @@ -28313,6 +42705,12 @@ class Region(ShapeCollection): This method is provided for DRC implementation only. """ @overload + def texts_dots(self, expr: Optional[str] = ..., as_pattern: Optional[bool] = ...) -> Edges: + r""" + @hide + This method is provided for DRC implementation only. + """ + @overload def to_s(self) -> str: r""" @brief Converts the region to a string @@ -28450,7 +42848,7 @@ class Region(ShapeCollection): @return The transformed region. """ - def width_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Region.Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ...) -> EdgePairs: + def width_check(self, d: int, whole_edges: Optional[bool] = ..., metrics: Optional[Metrics] = ..., ignore_angle: Optional[Any] = ..., min_projection: Optional[Any] = ..., max_projection: Optional[Any] = ..., shielded: Optional[bool] = ..., negative: Optional[bool] = ..., property_constraint: Optional[PropertyConstraint] = ...) -> EdgePairs: r""" @brief Performs a width check with options @param d The minimum width for which the polygons are checked @@ -28461,6 +42859,7 @@ class Region(ShapeCollection): @param max_projection The upper limit of the projected length of one edge onto another @param shielded Enables shielding @param negative If true, edges not violation the condition will be output as pseudo-edge pairs + @param property_constraint Only \IgnoreProperties and \NoPropertyConstraint are allowed - in the last case, properties are copied from the original shapes to the output. Other than 'width' allow more options here. This version is similar to the simple version with one parameter. In addition, it allows to specify many more options. @@ -28478,17 +42877,7 @@ class Region(ShapeCollection): Merged semantics applies for the input of this method (see \merged_semantics= for a description of this concept) - The 'shielded' and 'negative' options have been introduced in version 0.27. - """ - @overload - def with_angle(self, angle: float, inverse: bool) -> EdgePairs: - r""" - @brief Returns markers on every corner with the given angle (or not with the given angle) - If the inverse flag is false, this method returns an error marker (an \EdgePair object) for every corner whose connected edges form an angle with the given value (in degree). If the inverse flag is true, the method returns markers for every corner whose angle is not the given value. - - The edge pair objects returned will contain both edges forming the angle. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + The 'shielded' and 'negative' options have been introduced in version 0.27. 'property_constraint' has been added in version 0.28.4. """ @overload def with_angle(self, amin: float, amax: float, inverse: bool) -> EdgePairs: @@ -28501,6 +42890,16 @@ class Region(ShapeCollection): Merged semantics applies for this method (see \merged_semantics= for a description of this concept) """ @overload + def with_angle(self, angle: float, inverse: bool) -> EdgePairs: + r""" + @brief Returns markers on every corner with the given angle (or not with the given angle) + If the inverse flag is false, this method returns an error marker (an \EdgePair object) for every corner whose connected edges form an angle with the given value (in degree). If the inverse flag is true, the method returns markers for every corner whose angle is not the given value. + + The edge pair objects returned will contain both edges forming the angle. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + """ + @overload def with_area(self, area: int, inverse: bool) -> Region: r""" @brief Filter the polygons by area @@ -28519,18 +42918,6 @@ class Region(ShapeCollection): Merged semantics applies for this method (see \merged_semantics= for a description of this concept) """ @overload - def with_area_ratio(self, ratio: float, inverse: bool) -> Region: - r""" - @brief Filters the polygons by the bounding box area to polygon area ratio - The area ratio is defined by the ratio of bounding box area to polygon area. It's a measure how much the bounding box is approximating the polygon. 'Thin polygons' have a large area ratio, boxes has an area ratio of 1. - The area ratio is always larger or equal to 1. - With 'inverse' set to false, this version filters polygons which have an area ratio equal to the given value. With 'inverse' set to true, all other polygons will be returned. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. - """ - @overload def with_area_ratio(self, min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region: r""" @brief Filters the polygons by the aspect ratio of their bounding boxes @@ -28545,12 +42932,12 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ @overload - def with_bbox_aspect_ratio(self, ratio: float, inverse: bool) -> Region: + def with_area_ratio(self, ratio: float, inverse: bool) -> Region: r""" - @brief Filters the polygons by the aspect ratio of their bounding boxes - Filters the polygons of the region by the aspect ratio of their bounding boxes. The aspect ratio is the ratio of larger to smaller dimension of the bounding box. A square has an aspect ratio of 1. - - With 'inverse' set to false, this version filters polygons which have a bounding box aspect ratio equal to the given value. With 'inverse' set to true, all other polygons will be returned. + @brief Filters the polygons by the bounding box area to polygon area ratio + The area ratio is defined by the ratio of bounding box area to polygon area. It's a measure how much the bounding box is approximating the polygon. 'Thin polygons' have a large area ratio, boxes has an area ratio of 1. + The area ratio is always larger or equal to 1. + With 'inverse' set to false, this version filters polygons which have an area ratio equal to the given value. With 'inverse' set to true, all other polygons will be returned. Merged semantics applies for this method (see \merged_semantics= for a description of this concept) @@ -28571,6 +42958,18 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ @overload + def with_bbox_aspect_ratio(self, ratio: float, inverse: bool) -> Region: + r""" + @brief Filters the polygons by the aspect ratio of their bounding boxes + Filters the polygons of the region by the aspect ratio of their bounding boxes. The aspect ratio is the ratio of larger to smaller dimension of the bounding box. A square has an aspect ratio of 1. + + With 'inverse' set to false, this version filters polygons which have a bounding box aspect ratio equal to the given value. With 'inverse' set to true, all other polygons will be returned. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + @overload def with_bbox_height(self, height: int, inverse: bool) -> Region: r""" @brief Filter the polygons by bounding box height @@ -28620,14 +43019,6 @@ class Region(ShapeCollection): Merged semantics applies for this method (see \merged_semantics= for a description of this concept) """ @overload - def with_bbox_width(self, width: int, inverse: bool) -> Region: - r""" - @brief Filter the polygons by bounding box width - Filters the polygons of the region by the width of their bounding box. If "inverse" is false, only polygons whose bounding box has the given width are returned. If "inverse" is true, polygons whose bounding box does not have the given width are returned. - - Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - """ - @overload def with_bbox_width(self, min_width: Any, max_width: Any, inverse: bool) -> Region: r""" @brief Filter the polygons by bounding box width @@ -28637,14 +43028,12 @@ class Region(ShapeCollection): Merged semantics applies for this method (see \merged_semantics= for a description of this concept) """ @overload - def with_holes(self, nholes: int, inverse: bool) -> Region: + def with_bbox_width(self, width: int, inverse: bool) -> Region: r""" - @brief Filters the polygons by their number of holes - Filters the polygons of the region by number of holes. If "inverse" is false, only polygons which have the given number of holes are returned. If "inverse" is true, polygons not having the given of holes are returned. + @brief Filter the polygons by bounding box width + Filters the polygons of the region by the width of their bounding box. If "inverse" is false, only polygons whose bounding box has the given width are returned. If "inverse" is true, polygons whose bounding box does not have the given width are returned. Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. """ @overload def with_holes(self, min_bholes: Any, max_nholes: Any, inverse: bool) -> Region: @@ -28659,12 +43048,14 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ @overload - def with_perimeter(self, perimeter: int, inverse: bool) -> Region: + def with_holes(self, nholes: int, inverse: bool) -> Region: r""" - @brief Filter the polygons by perimeter - Filters the polygons of the region by perimeter. If "inverse" is false, only polygons which have the given perimeter are returned. If "inverse" is true, polygons not having the given perimeter are returned. + @brief Filters the polygons by their number of holes + Filters the polygons of the region by number of holes. If "inverse" is false, only polygons which have the given number of holes are returned. If "inverse" is true, polygons not having the given of holes are returned. Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. """ @overload def with_perimeter(self, min_perimeter: Any, max_perimeter: Any, inverse: bool) -> Region: @@ -28677,18 +43068,12 @@ class Region(ShapeCollection): Merged semantics applies for this method (see \merged_semantics= for a description of this concept) """ @overload - def with_relative_height(self, ratio: float, inverse: bool) -> Region: + def with_perimeter(self, perimeter: int, inverse: bool) -> Region: r""" - @brief Filters the polygons by the ratio of height to width - This method filters the polygons of the region by the ratio of height vs. width of their bounding boxes. 'Tall' polygons have a large value while 'flat' polygons have a small value. A square has a relative height of 1. - - An alternative method is 'with_area_ratio' which can be more efficient because it's isotropic. - - With 'inverse' set to false, this version filters polygons which have a relative height equal to the given value. With 'inverse' set to true, all other polygons will be returned. + @brief Filter the polygons by perimeter + Filters the polygons of the region by perimeter. If "inverse" is false, only polygons which have the given perimeter are returned. If "inverse" is true, polygons not having the given perimeter are returned. Merged semantics applies for this method (see \merged_semantics= for a description of this concept) - - This method has been introduced in version 0.27. """ @overload def with_relative_height(self, min_ratio: Any, max_ratio: Any, inverse: bool, min_included: Optional[bool] = ..., max_included: Optional[bool] = ...) -> Region: @@ -28706,6 +43091,653 @@ class Region(ShapeCollection): This method has been introduced in version 0.27. """ + @overload + def with_relative_height(self, ratio: float, inverse: bool) -> Region: + r""" + @brief Filters the polygons by the ratio of height to width + This method filters the polygons of the region by the ratio of height vs. width of their bounding boxes. 'Tall' polygons have a large value while 'flat' polygons have a small value. A square has a relative height of 1. + + An alternative method is 'with_area_ratio' which can be more efficient because it's isotropic. + + With 'inverse' set to false, this version filters polygons which have a relative height equal to the given value. With 'inverse' set to true, all other polygons will be returned. + + Merged semantics applies for this method (see \merged_semantics= for a description of this concept) + + This method has been introduced in version 0.27. + """ + +class SaveLayoutOptions: + r""" + @brief Options for saving layouts + + This class describes the various options for saving a layout to a stream file (GDS2, OASIS and others). + There are: layers to be saved, cell or cells to be saved, scale factor, format, database unit + and format specific options. + + Usually the default constructor provides a suitable object. Please note, that the format written is "GDS2" by default. Either explicitly set a format using \format= or derive the format from the file name using \set_format_from_filename. + + The layers are specified by either selecting all layers or by defining layer by layer using the + \add_layer method. \select_all_layers will explicitly select all layers for saving, \deselect_all_layers will explicitly clear the list of layers. + + Cells are selected in a similar fashion: by default, all cells are selected. Using \add_cell, specific + cells can be selected for saving. All these cells plus their hierarchy will then be written to the stream file. + + """ + cif_blank_separator: bool + r""" + Getter: + @brief Gets a flag indicating whether blanks shall be used as x/y separator characters + See \cif_blank_separator= method for a description of that property. + This property has been added in version 0.23.10. + + The predicate version (cif_blank_separator?) has been added in version 0.25.1. + + Setter: + @brief Sets a flag indicating whether blanks shall be used as x/y separator characters + If this property is set to true, the x and y coordinates are separated with blank characters rather than comma characters. + This property has been added in version 0.23.10. + """ + cif_dummy_calls: bool + r""" + Getter: + @brief Gets a flag indicating whether dummy calls shall be written + See \cif_dummy_calls= method for a description of that property. + This property has been added in version 0.23.10. + + The predicate version (cif_blank_separator?) has been added in version 0.25.1. + + Setter: + @brief Sets a flag indicating whether dummy calls shall be written + If this property is set to true, dummy calls will be written in the top level entity of the CIF file calling every top cell. + This option is useful for enhanced compatibility with other tools. + + This property has been added in version 0.23.10. + """ + dbu: float + r""" + Getter: + @brief Get the explicit database unit if one is set + + See \dbu= for a description of that attribute. + + Setter: + @brief Set the database unit to be used in the stream file + + By default, the database unit of the layout is used. This method allows one to explicitly use a different + database unit. A scale factor is introduced automatically which scales all layout objects accordingly so their physical dimensions remain the same. When scaling to a larger database unit or one that is not an integer fraction of the original one, rounding errors may occur and the layout may become slightly distorted. + """ + dxf_polygon_mode: int + r""" + Getter: + @brief Specifies how to write polygons. + See \dxf_polygon_mode= for a description of this property. + + This property has been added in version 0.21.3. + + Setter: + @brief Specifies how to write polygons. + The mode is 0 (write POLYLINE entities), 1 (write LWPOLYLINE entities), 2 (decompose into SOLID entities), 3 (write HATCH entities), or 4 (write LINE entities). + + This property has been added in version 0.21.3. '4', in version 0.25.6. + """ + format: str + r""" + Getter: + @brief Gets the format name + + See \format= for a description of that method. + + Setter: + @brief Select a format + The format string can be either "GDS2", "OASIS", "CIF" or "DXF". Other formats may be available if + a suitable plugin is installed. + """ + gds2_libname: str + r""" + Getter: + @brief Get the library name + See \gds2_libname= method for a description of the library name. + This property has been added in version 0.18. + + Setter: + @brief Set the library name + + The library name is the string written into the LIBNAME records of the GDS file. + The library name should not be an empty string and is subject to certain limitations in the character choice. + + This property has been added in version 0.18. + """ + gds2_max_cellname_length: int + r""" + Getter: + @brief Get the maximum length of cell names + See \gds2_max_cellname_length= method for a description of the maximum cell name length. + This property has been added in version 0.18. + + Setter: + @brief Maximum length of cell names + + This property describes the maximum number of characters for cell names. + Longer cell names will be shortened. + + This property has been added in version 0.18. + """ + gds2_max_vertex_count: int + r""" + Getter: + @brief Gets the maximum number of vertices for polygons to write + See \gds2_max_vertex_count= method for a description of the maximum vertex count. + This property has been added in version 0.18. + + Setter: + @brief Sets the maximum number of vertices for polygons to write + This property describes the maximum number of point for polygons in GDS2 files. + Polygons with more points will be split. + The minimum value for this property is 4. The maximum allowed value is about 4000 or 8000, depending on the + GDS2 interpretation. If \gds2_multi_xy_records is true, this + property is not used. Instead, the number of points is unlimited. + + This property has been added in version 0.18. + """ + gds2_multi_xy_records: bool + r""" + Getter: + @brief Gets the property enabling multiple XY records for BOUNDARY elements + See \gds2_multi_xy_records= method for a description of this property. + This property has been added in version 0.18. + + Setter: + @brief Uses multiple XY records in BOUNDARY elements for unlimited large polygons + + Setting this property to true allows producing polygons with an unlimited number of points + at the cost of incompatible formats. Setting it to true disables the \gds2_max_vertex_count setting. + + This property has been added in version 0.18. + """ + gds2_no_zero_length_paths: bool + r""" + Getter: + @brief Gets a value indicating whether zero-length paths are eliminated + + This property has been added in version 0.23. + + Setter: + @brief Eliminates zero-length paths if true + + If this property is set to true, paths with zero length will be converted to BOUNDARY objects. + + + This property has been added in version 0.23. + """ + gds2_resolve_skew_arrays: bool + r""" + Getter: + @brief Gets a value indicating whether to resolve skew arrays into single instances + See \gds2_resolve_skew_arrays= method for a description of this property. + This property has been added in version 0.27.1. + + Setter: + @brief Resolves skew arrays into single instances + + Setting this property to true will make skew (non-orthogonal) arrays being resolved into single instances. + Skew arrays happen if either the row or column vector isn't parallel to x or y axis. Such arrays can cause problems with some legacy software and can be disabled with this option. + + This property has been added in version 0.27.1. + """ + gds2_user_units: float + r""" + Getter: + @brief Get the user units + See \gds2_user_units= method for a description of the user units. + This property has been added in version 0.18. + + Setter: + @brief Set the users units to write into the GDS file + + The user units of a GDS file are rarely used and usually are set to 1 (micron). + The intention of the user units is to specify the display units. KLayout ignores the user unit and uses microns as the display unit. + The user unit must be larger than zero. + + This property has been added in version 0.18. + """ + gds2_write_cell_properties: bool + r""" + Getter: + @brief Gets a value indicating whether cell properties are written + + This property has been added in version 0.23. + + Setter: + @brief Enables writing of cell properties if set to true + + If this property is set to true, cell properties will be written as PROPATTR/PROPVALUE records immediately following the BGNSTR records. This is a non-standard extension and is therefore disabled by default. + + + This property has been added in version 0.23. + """ + gds2_write_file_properties: bool + r""" + Getter: + @brief Gets a value indicating whether layout properties are written + + This property has been added in version 0.24. + + Setter: + @brief Enables writing of file properties if set to true + + If this property is set to true, layout properties will be written as PROPATTR/PROPVALUE records immediately following the BGNLIB records. This is a non-standard extension and is therefore disabled by default. + + + This property has been added in version 0.24. + """ + gds2_write_timestamps: bool + r""" + Getter: + @brief Gets a value indicating whether the current time is written into the GDS2 timestamp fields + + This property has been added in version 0.21.16. + + Setter: + @brief Writes the current time into the GDS2 timestamps if set to true + + If this property is set to false, the time fields will all be zero. This somewhat simplifies compare and diff applications. + + + This property has been added in version 0.21.16. + """ + keep_instances: bool + r""" + Getter: + @brief Gets a flag indicating whether instances will be kept even if the target cell is dropped + + See \keep_instances= for details about this flag. + + This method was introduced in version 0.23. + + Setter: + @brief Enables or disables instances for dropped cells + + If this flag is set to true, instances for cells will be written, even if the cell is dropped. That may happen, if cells are selected with \select_this_cell or \add_this_cell or \no_empty_cells is used. Even if cells called by such cells are not selected, instances will be written for that cell if "keep_instances" is true. That feature is supported by the GDS format currently and results in "ghost cells" which have instances but no cell definition. + + The default value is false (instances of dropped cells are not written). + + This method was introduced in version 0.23. + """ + mag_lambda: float + r""" + Getter: + @brief Gets the lambda value + See \mag_lambda= method for a description of this attribute. + This property has been added in version 0.26.2. + + Setter: + @brief Specifies the lambda value to used for writing + + The lambda value is the basic unit of the layout. + The layout is brought to units of this value. If the layout is not on-grid on this unit, snapping will happen. If the value is less or equal to zero, KLayout will use the lambda value stored inside the layout set by a previous read operation of a MAGIC file. The lambda value is stored in the Layout object as the "lambda" metadata attribute. + + This property has been added in version 0.26.2. + """ + mag_tech: str + r""" + Getter: + @brief Gets the technology string used for writing + See \mag_tech= method for a description of this attribute. + This property has been added in version 0.26.2. + + Setter: + @brief Specifies the technology string used for writing + + If this string is empty, the writer will try to obtain the technology from the "technology" metadata attribute of the layout. + + This property has been added in version 0.26.2. + """ + mag_write_timestamp: bool + r""" + Getter: + @brief Gets a value indicating whether to write a timestamp + See \write_timestamp= method for a description of this attribute. + + This property has been added in version 0.26.2. + + Setter: + @brief Specifies whether to write a timestamp + + If this attribute is set to false, the timestamp written is 0. This is not permitted in the strict sense, but simplifies comparison of Magic files. + + This property has been added in version 0.26.2. + """ + no_empty_cells: bool + r""" + Getter: + @brief Returns a flag indicating whether empty cells are not written. + + Setter: + @brief Don't write empty cells if this flag is set + + By default, all cells are written (no_empty_cells is false). + This applies to empty cells which do not contain shapes for the specified layers as well as cells which are empty because they reference empty cells only. + """ + oasis_compression_level: int + r""" + Getter: + @brief Get the OASIS compression level + See \oasis_compression_level= method for a description of the OASIS compression level. + Setter: + @brief Set the OASIS compression level + The OASIS compression level is an integer number between 0 and 10. 0 basically is no compression, 1 produces shape arrays in a simple fashion. 2 and higher compression levels will use a more elaborate algorithm to find shape arrays which uses 2nd and further neighbor distances. The higher the level, the higher the memory requirements and run times. + """ + oasis_permissive: bool + r""" + Getter: + @brief Gets the OASIS permissive mode + See \oasis_permissive= method for a description of this predicate. + This method has been introduced in version 0.25.1. + Setter: + @brief Sets OASIS permissive mode + If this flag is true, certain shapes which cannot be written to OASIS are reported as warnings, not as errors. For example, paths with odd width (are rounded) or polygons with less than three points (are skipped). + + This method has been introduced in version 0.25.1. + """ + oasis_recompress: bool + r""" + Getter: + @brief Gets the OASIS recompression mode + See \oasis_recompress= method for a description of this predicate. + This method has been introduced in version 0.23. + Setter: + @brief Sets OASIS recompression mode + If this flag is true, shape arrays already existing will be resolved and compression is applied to the individual shapes again. If this flag is false (the default), shape arrays already existing will be written as such. + + This method has been introduced in version 0.23. + """ + oasis_strict_mode: bool + r""" + Getter: + @brief Gets a value indicating whether to write strict-mode OASIS files + + Setter: + @brief Sets a value indicating whether to write strict-mode OASIS files + Setting this property clears all format specific options for other formats such as GDS. + """ + oasis_substitution_char: str + r""" + Getter: + @brief Gets the substitution character + + See \oasis_substitution_char for details. This attribute has been introduced in version 0.23. + + Setter: + @brief Sets the substitution character for a-strings and n-strings + The substitution character is used in place of invalid characters. The value of this attribute is a string which is either empty or a single character. If the string is empty, no substitution is made at the risk of producing invalid OASIS files. + + This attribute has been introduce in version 0.23. + """ + oasis_write_cblocks: bool + r""" + Getter: + @brief Gets a value indicating whether to write compressed CBLOCKS per cell + + Setter: + @brief Sets a value indicating whether to write compressed CBLOCKS per cell + Setting this property clears all format specific options for other formats such as GDS. + """ + oasis_write_cell_bounding_boxes: bool + r""" + Getter: + @brief Gets a value indicating whether cell bounding boxes are written + See \oasis_write_cell_bounding_boxes= method for a description of this flag. + This method has been introduced in version 0.24.3. + Setter: + @brief Sets a value indicating whether cell bounding boxes are written + If this value is set to true, cell bounding boxes are written (S_BOUNDING_BOX). The S_BOUNDING_BOX properties will be attached to the CELLNAME records. + + Setting this value to true will also enable writing of other standard properties like S_TOP_CELL (see \oasis_write_std_properties=). + By default, cell bounding boxes are not written, but standard properties are. + + This method has been introduced in version 0.24.3. + """ + oasis_write_std_properties: bool + r""" + Getter: + @brief Gets a value indicating whether standard properties will be written + See \oasis_write_std_properties= method for a description of this flag. + This method has been introduced in version 0.24. + Setter: + @brief Sets a value indicating whether standard properties will be written + If this value is false, no standard properties are written. If true, S_TOP_CELL and some other global standard properties are written. In addition, \oasis_write_cell_bounding_boxes= can be used to write cell bounding boxes using S_BOUNDING_BOX. + + By default, this flag is true and standard properties are written. + + Setting this property to false clears the oasis_write_cell_bounding_boxes flag too. + + This method has been introduced in version 0.24. + """ + oasis_write_std_properties_ext: int + r""" + Getter: + @hide + Setter: + @hide + """ + scale_factor: float + r""" + Getter: + @brief Gets the scaling factor currently set + + Setter: + @brief Set the scaling factor for the saving + + Using a scaling factor will scale all objects accordingly. This scale factor adds to a potential scaling implied by using an explicit database unit. + + Be aware that rounding effects may occur if fractional scaling factors are used. + + By default, no scaling is applied. + """ + write_context_info: bool + r""" + Getter: + @brief Gets a flag indicating whether context information will be stored + + See \write_context_info= for details about this flag. + + This method was introduced in version 0.23. + + Setter: + @brief Enables or disables context information + + If this flag is set to false, no context information for PCell or library cell instances is written. Those cells will be converted to plain cells and KLayout will not be able to restore the identity of those cells. Use this option to enforce compatibility with other tools that don't understand the context information of KLayout. + + The default value is true (context information is stored). Not all formats support context information, hence that flag has no effect for formats like CIF or DXF. + + This method was introduced in version 0.23. + """ + @classmethod + def new(cls) -> SaveLayoutOptions: + r""" + @brief Default constructor + + This will initialize the scale factor to 1.0, the database unit is set to + "same as original" and all layers are selected as well as all cells. + The default format is GDS2. + """ + def __copy__(self) -> SaveLayoutOptions: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> SaveLayoutOptions: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Default constructor + + This will initialize the scale factor to 1.0, the database unit is set to + "same as original" and all layers are selected as well as all cells. + The default format is GDS2. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_cell(self, cell_index: int) -> None: + r""" + @brief Add a cell (plus hierarchy) to be saved + + + The index of the cell must be a valid index in the context of the layout that will be saved. + This method clears the 'select all cells' flag. + + This method also implicitly adds the children of that cell. A method that does not add the children in \add_this_cell. + """ + def add_layer(self, layer_index: int, properties: LayerInfo) -> None: + r""" + @brief Add a layer to be saved + + + Adds the layer with the given index to the layer list that will be written. + If all layers have been selected previously, all layers will + be unselected first and only the new layer remains. + + The 'properties' argument can be used to assign different layer properties than the ones + present in the layout. Pass a default \LayerInfo object to this argument to use the + properties from the layout object. Construct a valid \LayerInfo object with explicit layer, + datatype and possibly a name to override the properties stored in the layout. + """ + def add_this_cell(self, cell_index: int) -> None: + r""" + @brief Adds a cell to be saved + + + The index of the cell must be a valid index in the context of the layout that will be saved. + This method clears the 'select all cells' flag. + Unlike \add_cell, this method does not implicitly add all children of that cell. + + This method has been added in version 0.23. + """ + def assign(self, other: SaveLayoutOptions) -> None: + r""" + @brief Assigns another object to self + """ + def clear_cells(self) -> None: + r""" + @brief Clears all cells to be saved + + This method can be used to ensure that no cell is selected before \add_cell is called to specify a cell. + This method clears the 'select all cells' flag. + + This method has been added in version 0.22. + """ + def create(self) -> None: + r""" + @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. + """ + def deselect_all_layers(self) -> None: + r""" + @brief Unselect all layers: no layer will be saved + + This method will clear all layers selected with \add_layer so far and clear the 'select all layers' flag. + Using this method is the only way to save a layout without any layers. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> SaveLayoutOptions: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def select_all_cells(self) -> None: + r""" + @brief Select all cells to save + + This method will clear all cells specified with \add_cells so far and set the 'select all cells' flag. + This is the default. + """ + def select_all_layers(self) -> None: + r""" + @brief Select all layers to be saved + + This method will clear all layers selected with \add_layer so far and set the 'select all layers' flag. + This is the default. + """ + def select_cell(self, cell_index: int) -> None: + r""" + @brief Selects a cell to be saved (plus hierarchy below) + + + This method is basically a convenience method that combines \clear_cells and \add_cell. + This method clears the 'select all cells' flag. + + This method has been added in version 0.22. + """ + def select_this_cell(self, cell_index: int) -> None: + r""" + @brief Selects a cell to be saved + + + This method is basically a convenience method that combines \clear_cells and \add_this_cell. + This method clears the 'select all cells' flag. + + This method has been added in version 0.23. + """ + def set_format_from_filename(self, filename: str) -> bool: + r""" + @brief Select a format from the given file name + + This method will set the format according to the file's extension. + + This method has been introduced in version 0.22. Beginning with version 0.23, this method always returns true, since the only consumer for the return value, Layout#write, now ignores that parameter and automatically determines the compression mode from the file name. + """ class Shape: r""" @@ -29120,11 +44152,10 @@ class Shape: Starting with version 0.23, this method returns nil, if the shape does not represent an edge. Setter: - @brief Replaces the shape by the given edge - This method replaces the shape by the given edge. This method can only be called for editable layouts. It does not change the user properties of the shape. - Calling this method will invalidate any iterators. It should not be called inside a loop iterating over shapes. + @brief Replaces the shape by the given edge (in micrometer units) + This method replaces the shape by the given edge, like \edge= with a \Edge argument does. This version translates the edge from micrometer units to database units internally. - This method has been introduced in version 0.22. + This method has been introduced in version 0.25. """ edge_pair: Any r""" @@ -30029,6 +45060,82 @@ class Shape: The returned values are the t_... constants available through the corresponding class members. """ +class ShapeCollection: + r""" + @brief A base class for the shape collections (\Region, \Edges, \EdgePairs and \Texts) + + This class has been introduced in version 0.27. + """ + @classmethod + def new(cls) -> ShapeCollection: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + class ShapeProcessor: r""" @brief The shape processor (boolean, sizing, merge on shapes) @@ -30669,23 +45776,6 @@ class Shapes: @param flags An "or"-ed combination of the S... constants """ @overload - def each_overlapping(self, region: Box) -> Iterator[Shape]: - r""" - @brief Gets all shapes that overlap the search box (region) - @param region The rectangular search region - - This call is equivalent to each_overlapping(SAll,region). This convenience method has been introduced in version 0.16 - """ - @overload - def each_overlapping(self, region: DBox) -> Iterator[Shape]: - r""" - @brief Gets all shapes that overlap the search box (region) where the search box is given in micrometer units - @param region The rectangular search region as a \DBox object in micrometer units - This call is equivalent to each_touching(SAll,region). - - This method was introduced in version 0.25 - """ - @overload def each_overlapping(self, flags: int, region: Box) -> Iterator[Shape]: r""" @brief Gets all shapes that overlap the search box (region) @@ -30704,17 +45794,17 @@ class Shapes: This method was introduced in version 0.25 """ @overload - def each_touching(self, region: Box) -> Iterator[Shape]: + def each_overlapping(self, region: Box) -> Iterator[Shape]: r""" - @brief Gets all shapes that touch the search box (region) + @brief Gets all shapes that overlap the search box (region) @param region The rectangular search region - This call is equivalent to each_touching(SAll,region). This convenience method has been introduced in version 0.16 + This call is equivalent to each_overlapping(SAll,region). This convenience method has been introduced in version 0.16 """ @overload - def each_touching(self, region: DBox) -> Iterator[Shape]: + def each_overlapping(self, region: DBox) -> Iterator[Shape]: r""" - @brief Gets all shapes that touch the search box (region) where the search box is given in micrometer units + @brief Gets all shapes that overlap the search box (region) where the search box is given in micrometer units @param region The rectangular search region as a \DBox object in micrometer units This call is equivalent to each_touching(SAll,region). @@ -30736,6 +45826,23 @@ class Shapes: @param flags An "or"-ed combination of the S... constants @param region The rectangular search region as a \DBox object in micrometer units + This method was introduced in version 0.25 + """ + @overload + def each_touching(self, region: Box) -> Iterator[Shape]: + r""" + @brief Gets all shapes that touch the search box (region) + @param region The rectangular search region + + This call is equivalent to each_touching(SAll,region). This convenience method has been introduced in version 0.16 + """ + @overload + def each_touching(self, region: DBox) -> Iterator[Shape]: + r""" + @brief Gets all shapes that touch the search box (region) where the search box is given in micrometer units + @param region The rectangular search region as a \DBox object in micrometer units + This call is equivalent to each_touching(SAll,region). + This method was introduced in version 0.25 """ def erase(self, shape: Shape) -> None: @@ -30761,6 +45868,14 @@ class Shapes: Starting with version 0.16, this method returns a reference to the newly created shape """ @overload + def insert(self, box: Box, property_id: int) -> Shape: + r""" + @brief Inserts a box with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload def insert(self, box: DBox) -> Shape: r""" @brief Inserts a micrometer-unit box into the shapes list @@ -30770,6 +45885,15 @@ class Shapes: This variant has been introduced in version 0.25. """ @overload + def insert(self, box: DBox, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit box with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Box argument and a property ID, except that it will internally translate the box from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload def insert(self, edge: DEdge) -> Shape: r""" @brief Inserts a micrometer-unit edge into the shapes list @@ -30779,6 +45903,15 @@ class Shapes: This variant has been introduced in version 0.25. """ @overload + def insert(self, edge: DEdge, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit edge with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Edge argument and a property ID, except that it will internally translate the edge from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload def insert(self, edge: Edge) -> Shape: r""" @brief Inserts an edge into the shapes list @@ -30786,6 +45919,14 @@ class Shapes: Starting with version 0.16, this method returns a reference to the newly created shape """ @overload + def insert(self, edge: Edge, property_id: int) -> Shape: + r""" + @brief Inserts an edge with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape. + """ + @overload def insert(self, edge_pair: DEdgePair) -> Shape: r""" @brief Inserts a micrometer-unit edge pair into the shapes list @@ -30795,6 +45936,15 @@ class Shapes: This variant has been introduced in version 0.26. """ @overload + def insert(self, edge_pair: DEdgePair, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit edge pair with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \EdgePair argument and a property ID, except that it will internally translate the edge pair from micrometer to database units. + + This variant has been introduced in version 0.26. + """ + @overload def insert(self, edge_pair: EdgePair) -> Shape: r""" @brief Inserts an edge pair into the shapes list @@ -30802,6 +45952,14 @@ class Shapes: This method has been introduced in version 0.26. """ @overload + def insert(self, edge_pair: EdgePair, property_id: int) -> Shape: + r""" + @brief Inserts an edge pair with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + This method has been introduced in version 0.26. + """ + @overload def insert(self, edge_pairs: EdgePairs) -> None: r""" @brief Inserts the edges from the edge pair collection into this shape container @@ -30812,6 +45970,30 @@ class Shapes: This method has been introduced in version 0.26. """ @overload + def insert(self, edge_pairs: EdgePairs, trans: DCplxTrans) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection into this shape container with a transformation (given in micrometer units) + @param edges The edge pairs to insert + @param trans The transformation to apply (displacement in micrometer units) + + This method inserts all edge pairs from the edge pair collection into this shape container. + Before an edge pair is inserted, the given transformation is applied. + + This method has been introduced in version 0.26. + """ + @overload + def insert(self, edge_pairs: EdgePairs, trans: ICplxTrans) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection into this shape container with a transformation + @param edges The edge pairs to insert + @param trans The transformation to apply + + This method inserts all edge pairs from the edge pair collection into this shape container. + Before an edge pair is inserted, the given transformation is applied. + + This method has been introduced in version 0.26. + """ + @overload def insert(self, edges: Edges) -> None: r""" @brief Inserts the edges from the edge collection into this shape container @@ -30822,6 +46004,30 @@ class Shapes: This method has been introduced in version 0.23. """ @overload + def insert(self, edges: Edges, trans: DCplxTrans) -> None: + r""" + @brief Inserts the edges from the edge collection into this shape container with a transformation (given in micrometer units) + @param edges The edges to insert + @param trans The transformation to apply (displacement in micrometer units) + + This method inserts all edges from the edge collection into this shape container. + Before an edge is inserted, the given transformation is applied. + + This method has been introduced in version 0.25. + """ + @overload + def insert(self, edges: Edges, trans: ICplxTrans) -> None: + r""" + @brief Inserts the edges from the edge collection into this shape container with a transformation + @param edges The edges to insert + @param trans The transformation to apply + + This method inserts all edges from the edge collection into this shape container. + Before an edge is inserted, the given transformation is applied. + + This method has been introduced in version 0.23. + """ + @overload def insert(self, iter: RecursiveShapeIterator) -> None: r""" @brief Inserts the shapes taken from a recursive shape iterator @@ -30832,6 +46038,18 @@ class Shapes: This method has been introduced in version 0.25.3. """ @overload + def insert(self, iter: RecursiveShapeIterator, trans: ICplxTrans) -> None: + r""" + @brief Inserts the shapes taken from a recursive shape iterator with a transformation + @param iter The iterator from which to take the shapes from + @param trans The transformation to apply + + This method iterates over all shapes from the iterator and inserts them into the container. + The given transformation is applied before the shapes are inserted. + + This method has been introduced in version 0.25.3. + """ + @overload def insert(self, path: DPath) -> Shape: r""" @brief Inserts a micrometer-unit path into the shapes list @@ -30841,6 +46059,15 @@ class Shapes: This variant has been introduced in version 0.25. """ @overload + def insert(self, path: DPath, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit path with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Path argument and a property ID, except that it will internally translate the path from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload def insert(self, path: Path) -> Shape: r""" @brief Inserts a path into the shapes list @@ -30849,6 +46076,14 @@ class Shapes: Starting with version 0.16, this method returns a reference to the newly created shape """ @overload + def insert(self, path: Path, property_id: int) -> Shape: + r""" + @brief Inserts a path with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload def insert(self, point: DPoint) -> Shape: r""" @brief Inserts a micrometer-unit point into the shapes list @@ -30874,6 +46109,15 @@ class Shapes: This variant has been introduced in version 0.25. """ @overload + def insert(self, polygon: DPolygon, property_id: int) -> Shape: + r""" + @brief Inserts a micrometer-unit polygon with properties into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Polygon argument and a property ID, except that it will internally translate the polygon from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload def insert(self, polygon: Polygon) -> Shape: r""" @brief Inserts a polygon into the shapes list @@ -30882,6 +46126,14 @@ class Shapes: Starting with version 0.16, this method returns a reference to the newly created shape """ @overload + def insert(self, polygon: Polygon, property_id: int) -> Shape: + r""" + @brief Inserts a polygon with properties into the shapes list + @return A reference to the new shape (a \Shape object) + The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload def insert(self, region: Region) -> None: r""" @brief Inserts the polygons from the region into this shape container @@ -30892,212 +46144,6 @@ class Shapes: This method has been introduced in version 0.23. """ @overload - def insert(self, shape: Shape) -> Shape: - r""" - @brief Inserts a shape from a shape reference into the shapes list - @return A reference (a \Shape object) to the newly created shape - This method has been introduced in version 0.16. - """ - @overload - def insert(self, shapes: Shapes) -> None: - r""" - @brief Inserts the shapes taken from another shape container - @param shapes The other container from which to take the shapes from - - This method takes all shapes from the given container and inserts them into this one. - - This method has been introduced in version 0.25.3. - """ - @overload - def insert(self, simple_polygon: DSimplePolygon) -> Shape: - r""" - @brief Inserts a micrometer-unit simple polygon into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \SimplePolygon argument, except that it will internally translate the polygon from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, simple_polygon: SimplePolygon) -> Shape: - r""" - @brief Inserts a simple polygon into the shapes list - @return A reference to the new shape (a \Shape object) - - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, text: DText) -> Shape: - r""" - @brief Inserts a micrometer-unit text into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Text argument, except that it will internally translate the text from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, text: Text) -> Shape: - r""" - @brief Inserts a text into the shapes list - @return A reference to the new shape (a \Shape object) - - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, texts: Texts) -> None: - r""" - @brief Inserts the texts from the text collection into this shape container - @param texts The texts to insert - - This method inserts all texts from the text collection into this shape container. - - This method has been introduced in version 0.27. - """ - @overload - def insert(self, box: Box, property_id: int) -> Shape: - r""" - @brief Inserts a box with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, box: DBox, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit box with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Box argument and a property ID, except that it will internally translate the box from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, edge: DEdge, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit edge with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Edge argument and a property ID, except that it will internally translate the edge from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, edge: Edge, property_id: int) -> Shape: - r""" - @brief Inserts an edge with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - Starting with version 0.16, this method returns a reference to the newly created shape. - """ - @overload - def insert(self, edge_pair: DEdgePair, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit edge pair with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \EdgePair argument and a property ID, except that it will internally translate the edge pair from micrometer to database units. - - This variant has been introduced in version 0.26. - """ - @overload - def insert(self, edge_pair: EdgePair, property_id: int) -> Shape: - r""" - @brief Inserts an edge pair with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - This method has been introduced in version 0.26. - """ - @overload - def insert(self, edge_pairs: EdgePairs, trans: DCplxTrans) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection into this shape container with a transformation (given in micrometer units) - @param edges The edge pairs to insert - @param trans The transformation to apply (displacement in micrometer units) - - This method inserts all edge pairs from the edge pair collection into this shape container. - Before an edge pair is inserted, the given transformation is applied. - - This method has been introduced in version 0.26. - """ - @overload - def insert(self, edge_pairs: EdgePairs, trans: ICplxTrans) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection into this shape container with a transformation - @param edges The edge pairs to insert - @param trans The transformation to apply - - This method inserts all edge pairs from the edge pair collection into this shape container. - Before an edge pair is inserted, the given transformation is applied. - - This method has been introduced in version 0.26. - """ - @overload - def insert(self, edges: Edges, trans: DCplxTrans) -> None: - r""" - @brief Inserts the edges from the edge collection into this shape container with a transformation (given in micrometer units) - @param edges The edges to insert - @param trans The transformation to apply (displacement in micrometer units) - - This method inserts all edges from the edge collection into this shape container. - Before an edge is inserted, the given transformation is applied. - - This method has been introduced in version 0.25. - """ - @overload - def insert(self, edges: Edges, trans: ICplxTrans) -> None: - r""" - @brief Inserts the edges from the edge collection into this shape container with a transformation - @param edges The edges to insert - @param trans The transformation to apply - - This method inserts all edges from the edge collection into this shape container. - Before an edge is inserted, the given transformation is applied. - - This method has been introduced in version 0.23. - """ - @overload - def insert(self, iter: RecursiveShapeIterator, trans: ICplxTrans) -> None: - r""" - @brief Inserts the shapes taken from a recursive shape iterator with a transformation - @param iter The iterator from which to take the shapes from - @param trans The transformation to apply - - This method iterates over all shapes from the iterator and inserts them into the container. - The given transformation is applied before the shapes are inserted. - - This method has been introduced in version 0.25.3. - """ - @overload - def insert(self, path: DPath, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit path with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Path argument and a property ID, except that it will internally translate the path from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, path: Path, property_id: int) -> Shape: - r""" - @brief Inserts a path with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload - def insert(self, polygon: DPolygon, property_id: int) -> Shape: - r""" - @brief Inserts a micrometer-unit polygon with properties into the shapes list - @return A reference to the new shape (a \Shape object) - This method behaves like the \insert version with a \Polygon argument and a property ID, except that it will internally translate the polygon from micrometer to database units. - - This variant has been introduced in version 0.25. - """ - @overload - def insert(self, polygon: Polygon, property_id: int) -> Shape: - r""" - @brief Inserts a polygon with properties into the shapes list - @return A reference to the new shape (a \Shape object) - The property Id must be obtained from the \Layout object's property_id method which associates a property set with a property Id. - Starting with version 0.16, this method returns a reference to the newly created shape - """ - @overload def insert(self, region: Region, trans: DCplxTrans) -> None: r""" @brief Inserts the polygons from the region into this shape container with a transformation (given in micrometer units) @@ -31122,6 +46168,13 @@ class Shapes: This method has been introduced in version 0.23. """ @overload + def insert(self, shape: Shape) -> Shape: + r""" + @brief Inserts a shape from a shape reference into the shapes list + @return A reference (a \Shape object) to the newly created shape + This method has been introduced in version 0.16. + """ + @overload def insert(self, shape: Shape, trans: DCplxTrans) -> Shape: r""" @brief Inserts a shape from a shape reference into the shapes list with a complex integer transformation (given in micrometer units) @@ -31158,6 +46211,16 @@ class Shapes: This method has been introduced in version 0.22. """ @overload + def insert(self, shapes: Shapes) -> None: + r""" + @brief Inserts the shapes taken from another shape container + @param shapes The other container from which to take the shapes from + + This method takes all shapes from the given container and inserts them into this one. + + This method has been introduced in version 0.25.3. + """ + @overload def insert(self, shapes: Shapes, flags: int) -> None: r""" @brief Inserts the shapes taken from another shape container @@ -31169,6 +46232,18 @@ class Shapes: This method has been introduced in version 0.25.3. """ @overload + def insert(self, shapes: Shapes, flags: int, trans: ICplxTrans) -> None: + r""" + @brief Inserts the shapes taken from another shape container with a transformation + @param shapes The other container from which to take the shapes from + @param flags The filter flags for taking the shapes from the input container (see S... constants) + @param trans The transformation to apply + + This method takes all selected shapes from the given container and inserts them into this one after applying the given transformation. + + This method has been introduced in version 0.25.3. + """ + @overload def insert(self, shapes: Shapes, trans: ICplxTrans) -> None: r""" @brief Inserts the shapes taken from another shape container with a transformation @@ -31180,6 +46255,15 @@ class Shapes: This method has been introduced in version 0.25.3. """ @overload + def insert(self, simple_polygon: DSimplePolygon) -> Shape: + r""" + @brief Inserts a micrometer-unit simple polygon into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \SimplePolygon argument, except that it will internally translate the polygon from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload def insert(self, simple_polygon: DSimplePolygon, property_id: int) -> Shape: r""" @brief Inserts a micrometer-unit simple polygon with properties into the shapes list @@ -31189,6 +46273,14 @@ class Shapes: This variant has been introduced in version 0.25. """ @overload + def insert(self, simple_polygon: SimplePolygon) -> Shape: + r""" + @brief Inserts a simple polygon into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload def insert(self, simple_polygon: SimplePolygon, property_id: int) -> Shape: r""" @brief Inserts a simple polygon with properties into the shapes list @@ -31197,6 +46289,15 @@ class Shapes: Starting with version 0.16, this method returns a reference to the newly created shape """ @overload + def insert(self, text: DText) -> Shape: + r""" + @brief Inserts a micrometer-unit text into the shapes list + @return A reference to the new shape (a \Shape object) + This method behaves like the \insert version with a \Text argument, except that it will internally translate the text from micrometer to database units. + + This variant has been introduced in version 0.25. + """ + @overload def insert(self, text: DText, property_id: int) -> Shape: r""" @brief Inserts a micrometer-unit text with properties into the shapes list @@ -31206,6 +46307,14 @@ class Shapes: This variant has been introduced in version 0.25. """ @overload + def insert(self, text: Text) -> Shape: + r""" + @brief Inserts a text into the shapes list + @return A reference to the new shape (a \Shape object) + + Starting with version 0.16, this method returns a reference to the newly created shape + """ + @overload def insert(self, text: Text, property_id: int) -> Shape: r""" @brief Inserts a text with properties into the shapes list @@ -31214,6 +46323,16 @@ class Shapes: Starting with version 0.16, this method returns a reference to the newly created shape """ @overload + def insert(self, texts: Texts) -> None: + r""" + @brief Inserts the texts from the text collection into this shape container + @param texts The texts to insert + + This method inserts all texts from the text collection into this shape container. + + This method has been introduced in version 0.27. + """ + @overload def insert(self, texts: Texts, trans: DCplxTrans) -> None: r""" @brief Inserts the texts from the text collection into this shape container with a transformation (given in micrometer units) @@ -31238,18 +46357,6 @@ class Shapes: This method has been introduced in version 0.27. """ @overload - def insert(self, shapes: Shapes, flags: int, trans: ICplxTrans) -> None: - r""" - @brief Inserts the shapes taken from another shape container with a transformation - @param shapes The other container from which to take the shapes from - @param flags The filter flags for taking the shapes from the input container (see S... constants) - @param trans The transformation to apply - - This method takes all selected shapes from the given container and inserts them into this one after applying the given transformation. - - This method has been introduced in version 0.25.3. - """ - @overload def insert_as_edges(self, edge_pairs: EdgePairs) -> None: r""" @brief Inserts the edge pairs from the edge pair collection as individual edges into this shape container @@ -31287,30 +46394,6 @@ class Shapes: This method has been introduced in version 0.23. """ @overload - def insert_as_polygons(self, edge_pairs: EdgePairs, e: int) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container - @param edge_pairs The edge pairs to insert - @param e The extension to apply when converting the edges to polygons (in database units) - - This method inserts all edge pairs from the edge pair collection into this shape container. - The edge pairs are converted to polygons covering the area between the edges. - The extension parameter specifies a sizing which is applied when converting the edge pairs to polygons. This way, degenerated edge pairs (i.e. two point-like edges) do not vanish. - - This method has been introduced in version 0.23. - """ - @overload - def insert_as_polygons(self, edge_pairs: EdgePairs, e: float) -> None: - r""" - @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container - @param edge_pairs The edge pairs to insert - @param e The extension to apply when converting the edges to polygons (in micrometer units) - - This method is identical to the version with a integer-type \e parameter, but for this version the \e parameter is given in micrometer units. - - This method has been introduced in version 0.25. - """ - @overload def insert_as_polygons(self, edge_pairs: EdgePairs, e: DCplxTrans, trans: float) -> None: r""" @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container with a transformation @@ -31335,6 +46418,30 @@ class Shapes: The extension parameter specifies a sizing which is applied when converting the edge pairs to polygons. This way, degenerated edge pairs (i.e. two point-like edges) do not vanish. Before a polygon is inserted into the shape collection, the given transformation is applied. + This method has been introduced in version 0.23. + """ + @overload + def insert_as_polygons(self, edge_pairs: EdgePairs, e: float) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container + @param edge_pairs The edge pairs to insert + @param e The extension to apply when converting the edges to polygons (in micrometer units) + + This method is identical to the version with a integer-type \e parameter, but for this version the \e parameter is given in micrometer units. + + This method has been introduced in version 0.25. + """ + @overload + def insert_as_polygons(self, edge_pairs: EdgePairs, e: int) -> None: + r""" + @brief Inserts the edge pairs from the edge pair collection as polygons into this shape container + @param edge_pairs The edge pairs to insert + @param e The extension to apply when converting the edges to polygons (in database units) + + This method inserts all edge pairs from the edge pair collection into this shape container. + The edge pairs are converted to polygons covering the area between the edges. + The extension parameter specifies a sizing which is applied when converting the edge pairs to polygons. This way, degenerated edge pairs (i.e. two point-like edges) do not vanish. + This method has been introduced in version 0.23. """ def insert_box(self, box: Box) -> Shape: @@ -31617,40 +46724,6 @@ class Shapes: @return The number of shapes in this container """ @overload - def transform(self, trans: DCplxTrans) -> None: - r""" - @brief Transforms all shapes with the given transformation (given in micrometer units) - This method will invalidate all references to shapes inside this collection. - The displacement of the transformation is given in micrometer units. - - It has been introduced in version 0.25. - """ - @overload - def transform(self, trans: DTrans) -> None: - r""" - @brief Transforms all shapes with the given transformation (given in micrometer units) - This method will invalidate all references to shapes inside this collection. - The displacement of the transformation is given in micrometer units. - - It has been introduced in version 0.25. - """ - @overload - def transform(self, trans: ICplxTrans) -> None: - r""" - @brief Transforms all shapes with the given complex integer transformation - This method will invalidate all references to shapes inside this collection. - - It has been introduced in version 0.23. - """ - @overload - def transform(self, trans: Trans) -> None: - r""" - @brief Transforms all shapes with the given transformation - This method will invalidate all references to shapes inside this collection. - - It has been introduced in version 0.23. - """ - @overload def transform(self, shape: Shape, trans: DCplxTrans) -> Shape: r""" @brief Transforms the shape given by the reference with the given complex transformation, where the transformation is given in micrometer units @@ -31689,24 +46762,212 @@ class Shapes: This method has been introduced in version 0.16. """ - -class TechnologyComponent: - r""" - @brief A part of a technology definition - Technology components extend technology definitions (class \Technology) by specialized subfeature definitions. For example, the net tracer supplies it's technology-dependent specification through a technology component called \NetTracerTechnology. - - Components are managed within technologies and can be accessed from a technology using \Technology#component. - - This class has been introduced in version 0.25. - """ - @classmethod - def new(cls) -> TechnologyComponent: + @overload + def transform(self, trans: DCplxTrans) -> None: r""" - @brief Creates a new object of this class + @brief Transforms all shapes with the given transformation (given in micrometer units) + This method will invalidate all references to shapes inside this collection. + The displacement of the transformation is given in micrometer units. + + It has been introduced in version 0.25. """ + @overload + def transform(self, trans: DTrans) -> None: + r""" + @brief Transforms all shapes with the given transformation (given in micrometer units) + This method will invalidate all references to shapes inside this collection. + The displacement of the transformation is given in micrometer units. + + It has been introduced in version 0.25. + """ + @overload + def transform(self, trans: ICplxTrans) -> None: + r""" + @brief Transforms all shapes with the given complex integer transformation + This method will invalidate all references to shapes inside this collection. + + It has been introduced in version 0.23. + """ + @overload + def transform(self, trans: Trans) -> None: + r""" + @brief Transforms all shapes with the given transformation + This method will invalidate all references to shapes inside this collection. + + It has been introduced in version 0.23. + """ + +class SimplePolygon: + r""" + @brief A simple polygon class + + A simple polygon consists of an outer hull only. To support polygons with holes, use \Polygon. + The hull contour consists of several points. The point + list is normalized such that the leftmost, lowest point is + the first one. The orientation is normalized such that + the orientation of the hull contour is clockwise. + + It is in no way checked that the contours are not overlapping + This must be ensured by the user of the object + when filling the contours. + + The \SimplePolygon class stores coordinates in integer format. A class that stores floating-point coordinates is \DSimplePolygon. + + See @The Database API@ for more details about the database objects. + """ + @property + def points(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the points of the simple polygon + + @param pts An array of points to assign to the simple polygon + + See the constructor description for details about raw mode. + """ + @classmethod + def ellipse(cls, box: Box, n: int) -> SimplePolygon: + r""" + @brief Creates a simple polygon approximating an ellipse + + @param box The bounding box of the ellipse + @param n The number of points that will be used to approximate the ellipse + + This method has been introduced in version 0.23. + """ + @classmethod + def from_dpoly(cls, dpolygon: DSimplePolygon) -> SimplePolygon: + r""" + @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. + """ + @classmethod + def from_s(cls, s: str) -> SimplePolygon: + r""" + @brief Creates an object from a string + Creates the object from a string representation (as returned by \to_s) + + This method has been added in version 0.23. + """ + @overload + @classmethod + def new(cls) -> SimplePolygon: + r""" + @brief Default constructor: creates an empty (invalid) polygon + """ + @overload + @classmethod + def new(cls, box: Box) -> SimplePolygon: + r""" + @brief Constructor converting a box to a polygon + + @param box The box to convert to a polygon + """ + @overload + @classmethod + def new(cls, dpolygon: DSimplePolygon) -> SimplePolygon: + r""" + @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. + """ + @overload + @classmethod + def new(cls, pts: Sequence[Point], raw: Optional[bool] = ...) -> SimplePolygon: + r""" + @brief Constructor given the points of the simple polygon + + @param pts The points forming the simple polygon + @param raw If true, the points are taken as they are (see below) + + If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. + + Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. + + The 'raw' argument has been added in version 0.24. + """ + def __copy__(self) -> SimplePolygon: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> SimplePolygon: + r""" + @brief Creates a copy of self + """ + def __eq__(self, p: object) -> bool: + r""" + @brief Returns a value indicating whether self is equal to p + @param p The object to compare against + """ + def __hash__(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + @overload def __init__(self) -> None: r""" - @brief Creates a new object of this class + @brief Default constructor: creates an empty (invalid) polygon + """ + @overload + def __init__(self, box: Box) -> None: + r""" + @brief Constructor converting a box to a polygon + + @param box The box to convert to a polygon + """ + @overload + def __init__(self, dpolygon: DSimplePolygon) -> None: + r""" + @brief Creates an integer coordinate polygon from a floating-point coordinate polygon + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dpoly'. + """ + @overload + def __init__(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: + r""" + @brief Constructor given the points of the simple polygon + + @param pts The points forming the simple polygon + @param raw If true, the points are taken as they are (see below) + + If the 'raw' argument is set to true, the points are taken as they are. Specifically no removal of redundant points or joining of coincident edges will take place. In effect, polygons consisting of a single point or two points can be constructed as well as polygons with duplicate points. Note that such polygons may cause problems in some applications. + + Regardless of raw mode, the point list will be adjusted such that the first point is the lowest-leftmost one and the orientation is clockwise always. + + The 'raw' argument has been added in version 0.24. + """ + def __lt__(self, p: SimplePolygon) -> bool: + r""" + @brief Returns a value indicating whether self is less than p + @param p The object to compare against + This operator is provided to establish some, not necessarily a certain sorting order + + This method has been introduced in version 0.25. + """ + def __mul__(self, f: float) -> SimplePolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __ne__(self, p: object) -> bool: + r""" + @brief Returns a value indicating whether self is not equal to p + @param p The object to compare against + """ + def __rmul__(self, f: float) -> SimplePolygon: + r""" + @brief Scales the polygon by some factor + + Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. + """ + def __str__(self) -> str: + r""" + @brief Returns a string representing the polygon """ def _create(self) -> None: r""" @@ -31745,15 +47006,42 @@ class TechnologyComponent: Usually it's not required to call this method. It has been introduced in version 0.24. """ + def area(self) -> int: + r""" + @brief Gets the area of the polygon + The area is correct only if the polygon is not self-overlapping and the polygon is oriented clockwise. + """ + def area2(self) -> int: + r""" + @brief Gets the double area of the polygon + This method is provided because the area for an integer-type polygon is a multiple of 1/2. Hence the double area can be expresses precisely as an integer for these types. + + This method has been introduced in version 0.26.1 + """ + def assign(self, other: SimplePolygon) -> None: + r""" + @brief Assigns another object to self + """ + def bbox(self) -> Box: + r""" + @brief Returns the bounding box of the simple polygon + """ + def compress(self, remove_reflected: bool) -> None: + r""" + @brief Compressed the simple polygon. + + This method removes redundant points from the polygon, such as points being on a line formed by two other points. + If remove_reflected is true, points are also removed if the two adjacent edges form a spike. + + @param remove_reflected See description of the functionality. + + This method was introduced in version 0.18. + """ def create(self) -> None: r""" @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. """ - def description(self) -> str: - r""" - @brief Gets the human-readable description string of the technology component - """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -31766,16 +47054,558 @@ class TechnologyComponent: 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. """ + def dup(self) -> SimplePolygon: + r""" + @brief Creates a copy of self + """ + def each_edge(self) -> Iterator[Edge]: + r""" + @brief Iterates over the edges that make up the simple polygon + """ + def each_point(self) -> Iterator[Point]: + r""" + @brief Iterates over the points that make up the simple polygon + """ + def extract_rad(self) -> List[Any]: + r""" + @brief Extracts the corner radii from a rounded polygon + + Attempts to extract the radii of rounded corner polygon. This is essentially the inverse of the \round_corners method. If this method succeeds, if will return an array of four elements: @ul + @li The polygon with the rounded corners replaced by edgy ones @/li + @li The radius of the inner corners @/li + @li The radius of the outer corners @/li + @li The number of points per full circle @/li + @/ul + + This method is based on some assumptions and may fail. In this case, an empty array is returned. + + If successful, the following code will more or less render the original polygon and parameters + + @code + p = ... # some polygon + p.round_corners(ri, ro, n) + (p2, ri2, ro2, n2) = p.extract_rad + # -> p2 == p, ro2 == ro, ri2 == ri, n2 == n (within some limits) + @/code + + This method was introduced in version 0.25. + """ + def hash(self) -> int: + r""" + @brief Computes a hash value + Returns a hash value for the given polygon. This method enables polygons as hash keys. + + This method has been introduced in version 0.25. + """ + def inside(self, p: Point) -> bool: + r""" + @brief Gets a value indicating whether the given point is inside the polygon + If the given point is inside or on the edge the polygon, true is returned. This tests works well only if the polygon is not self-overlapping and oriented clockwise. + """ + def is_box(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is a simple box. + + A polygon is a box if it is identical to it's bounding box. + + @return True if the polygon is a box. + + This method was introduced in version 0.23. + """ def is_const_object(self) -> bool: r""" @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. """ - def name(self) -> str: + def is_empty(self) -> bool: r""" - @brief Gets the formal name of the technology component - This is the name by which the component can be obtained from a technology using \Technology#component. + @brief Returns a value indicating whether the polygon is empty + """ + def is_halfmanhattan(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is half-manhattan + Half-manhattan polygons have edges which are multiples of 45 degree. These polygons can be clipped at a rectangle without potential grid snapping. + + This predicate was introduced in version 0.27. + """ + def is_rectilinear(self) -> bool: + r""" + @brief Returns a value indicating whether the polygon is rectilinear + """ + @overload + def minkowski_sum(self, b: Box, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a box + + @param b The box. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and b. + + This method was introduced in version 0.22. + """ + @overload + def minkowski_sum(self, c: Sequence[Point], resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a contour of points (a trace) + + @param c The contour (a series of points forming the trace). + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and c. + + This method was introduced in version 0.22. + """ + @overload + def minkowski_sum(self, e: Edge, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and an edge + + @param e The edge. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and e. + + This method was introduced in version 0.22. + """ + @overload + def minkowski_sum(self, p: SimplePolygon, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a polygon + + @param p The other polygon. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and p. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, b: Box, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a box + + @param b The box. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and b. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, c: Sequence[Point], resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a contour of points (a trace) + + @param c The contour (a series of points forming the trace). + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and c. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, e: Edge, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and an edge + + @param e The edge. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and e. + + This method was introduced in version 0.22. + """ + @overload + def minkowsky_sum(self, p: SimplePolygon, resolve_holes: bool) -> Polygon: + r""" + @brief Computes the Minkowski sum of a polygon and a polygon + + @param p The other polygon. + @param resolve_holes If true, the output polygon will not contain holes, but holes are resolved by joining the holes with the hull. + + @return The new polygon representing the Minkowski sum of self and p. + + This method was introduced in version 0.22. + """ + @overload + def move(self, p: Vector) -> SimplePolygon: + r""" + @brief Moves the simple polygon. + + Moves the simple polygon by the given offset and returns the + moved simple polygon. The polygon is overwritten. + + @param p The distance to move the simple polygon. + + @return The moved simple polygon. + """ + @overload + def move(self, x: int, y: int) -> SimplePolygon: + r""" + @brief Moves the polygon. + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is overwritten. + + @param x The x distance to move the polygon. + @param y The y distance to move the polygon. + + @return The moved polygon (self). + """ + @overload + def moved(self, p: Vector) -> SimplePolygon: + r""" + @brief Returns the moved simple polygon + + Moves the simple polygon by the given offset and returns the + moved simple polygon. The polygon is not modified. + + @param p The distance to move the simple polygon. + + @return The moved simple polygon. + """ + @overload + def moved(self, x: int, y: int) -> SimplePolygon: + r""" + @brief Returns the moved polygon (does not modify self) + + Moves the polygon by the given offset and returns the + moved polygon. The polygon is not modified. + + @param x The x distance to move the polygon. + @param y The y distance to move the polygon. + + @return The moved polygon. + + This method has been introduced in version 0.23. + """ + def num_points(self) -> int: + r""" + @brief Gets the number of points + """ + def perimeter(self) -> int: + r""" + @brief Gets the perimeter of the polygon + The perimeter is sum of the lengths of all edges making up the polygon. + """ + def point(self, p: int) -> Point: + r""" + @brief Gets a specific point of the contour@param p The index of the point to get + If the index of the point is not a valid index, a default value is returned. + This method was introduced in version 0.18. + """ + def round_corners(self, rinner: float, router: float, n: int) -> SimplePolygon: + r""" + @brief Rounds the corners of the polygon + + Replaces the corners of the polygon with circle segments. + + @param rinner The circle radius of inner corners (in database units). + @param router The circle radius of outer corners (in database units). + @param n The number of points per full circle. + + @return The new polygon. + + This method was introduced in version 0.22 for integer coordinates and in 0.25 for all coordinate types. + """ + def set_points(self, pts: Sequence[Point], raw: Optional[bool] = ...) -> None: + r""" + @brief Sets the points of the simple polygon + + @param pts An array of points to assign to the simple polygon + @param raw If true, the points are taken as they are + + See the constructor description for details about raw mode. + + This method has been added in version 0.24. + """ + def split(self) -> List[SimplePolygon]: + r""" + @brief Splits the polygon into two or more parts + This method will break the polygon into parts. The exact breaking algorithm is unspecified, the result are smaller polygons of roughly equal number of points and 'less concave' nature. Usually the returned polygon set consists of two polygons, but there can be more. The merged region of the resulting polygons equals the original polygon with the exception of small snapping effects at new vertexes. + + The intended use for this method is a iteratively split polygons until the satisfy some maximum number of points limit. + + This method has been introduced in version 0.25.3. + """ + def to_dtype(self, dbu: Optional[float] = ...) -> DSimplePolygon: + r""" + @brief Converts the polygon to a floating-point coordinate polygon + + The database unit can be specified to translate the integer-coordinate polygon into a floating-point coordinate polygon in micron units. The database unit is basically a scaling factor. + + This method has been introduced in version 0.25. + """ + def to_s(self) -> str: + r""" + @brief Returns a string representing the polygon + """ + @overload + def touches(self, box: Box) -> bool: + r""" + @brief Returns true, if the polygon touches the given box. + The box and the polygon touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, edge: Edge) -> bool: + r""" + @brief Returns true, if the polygon touches the given edge. + The edge and the polygon touch if they overlap or the edge shares at least one point with the polygon's contour. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, polygon: Polygon) -> bool: + r""" + @brief Returns true, if the polygon touches the other polygon. + The polygons touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def touches(self, simple_polygon: SimplePolygon) -> bool: + r""" + @brief Returns true, if the polygon touches the other polygon. + The polygons touch if they overlap or their contours share at least one point. + + This method was introduced in version 0.25.1. + """ + @overload + def transform(self, t: ICplxTrans) -> SimplePolygon: + r""" + @brief Transforms the simple polygon with a complex transformation (in-place) + + Transforms the simple polygon with the given complex transformation. + Modifies self and returns self. An out-of-place version which does not modify self is \transformed. + + @param t The transformation to apply. + + This method has been introduced in version 0.24. + """ + @overload + def transform(self, t: Trans) -> SimplePolygon: + r""" + @brief Transforms the simple polygon (in-place) + + Transforms the simple polygon with the given transformation. + Modifies self and returns self. An out-of-place version which does not modify self is \transformed. + + @param t The transformation to apply. + + This method has been introduced in version 0.24. + """ + @overload + def transformed(self, t: CplxTrans) -> DSimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given complex transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon. + + With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + """ + @overload + def transformed(self, t: ICplxTrans) -> SimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given complex transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon (in this case an integer coordinate object). + + This method has been introduced in version 0.18. + """ + @overload + def transformed(self, t: Trans) -> SimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon. + """ + def transformed_cplx(self, t: CplxTrans) -> DSimplePolygon: + r""" + @brief Transforms the simple polygon. + + Transforms the simple polygon with the given complex transformation. + Does not modify the simple polygon but returns the transformed polygon. + + @param t The transformation to apply. + + @return The transformed simple polygon. + + With version 0.25, the original 'transformed_cplx' method is deprecated and 'transformed' takes both simple and complex transformations. + """ + +class SubCircuit(NetlistObject): + r""" + @brief A subcircuit inside a circuit. + Circuits may instantiate other circuits as subcircuits similar to cells in layouts. Such an instance is a subcircuit. A subcircuit refers to a circuit implementation (a \Circuit object), and presents connections through pins. The pins of a subcircuit can be connected to nets. The subcircuit pins are identical to the outgoing pins of the circuit the subcircuit refers to. + + Subcircuits connect to nets through the \SubCircuit#connect_pin method. SubCircuit pins can be disconnected using \SubCircuit#disconnect_pin. + + Subcircuit objects are created inside a circuit with \Circuit#create_subcircuit. + + This class has been added in version 0.26. + """ + name: str + r""" + Getter: + @brief Gets the name of the subcircuit. + + Setter: + @brief Sets the name of the subcircuit. + SubCircuit names are used to name a subcircuits inside a netlist file. SubCircuit names should be unique within a circuit. + """ + trans: DCplxTrans + r""" + Getter: + @brief Gets the physical transformation for the subcircuit. + + This property applies to subcircuits derived from a layout. It specifies the placement of the respective cell. + + This property has been introduced in version 0.27. + Setter: + @brief Sets the physical transformation for the subcircuit. + + See \trans for details about this property. + + This property has been introduced in version 0.27. + """ + def _assign(self, other: NetlistObject) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> SubCircuit: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def circuit(self) -> Circuit: + r""" + @brief Gets the circuit the subcircuit lives in. + This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. + """ + @overload + def circuit(self) -> Circuit: + r""" + @brief Gets the circuit the subcircuit lives in (non-const version). + This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def circuit_ref(self) -> Circuit: + r""" + @brief Gets the circuit referenced by the subcircuit (non-const version). + + + This constness variant has been introduced in version 0.26.8 + """ + @overload + def circuit_ref(self) -> Circuit: + r""" + @brief Gets the circuit referenced by the subcircuit. + """ + @overload + def connect_pin(self, pin: Pin, net: Net) -> None: + r""" + @brief Connects the given pin to the specified net. + This version takes a \Pin reference instead of a pin ID. + """ + @overload + def connect_pin(self, pin_id: int, net: Net) -> None: + r""" + @brief Connects the given pin to the specified net. + """ + @overload + def disconnect_pin(self, pin: Pin) -> None: + r""" + @brief Disconnects the given pin from any net. + This version takes a \Pin reference instead of a pin ID. + """ + @overload + def disconnect_pin(self, pin_id: int) -> None: + r""" + @brief Disconnects the given pin from any net. + """ + def expanded_name(self) -> str: + r""" + @brief Gets the expanded name of the subcircuit. + The expanded name takes the name of the subcircuit. If the name is empty, the numeric ID will be used to build a name. + """ + def id(self) -> int: + r""" + @brief Gets the subcircuit ID. + The ID is a unique integer which identifies the subcircuit. + It can be used to retrieve the subcircuit from the circuit using \Circuit#subcircuit_by_id. + When assigned, the subcircuit ID is not 0. + """ + @overload + def net_for_pin(self, pin_id: int) -> Net: + r""" + @brief Gets the net connected to the specified pin of the subcircuit. + If the pin is not connected, nil is returned for the net. + """ + @overload + def net_for_pin(self, pin_id: int) -> Net: + r""" + @brief Gets the net connected to the specified pin of the subcircuit (non-const version). + If the pin is not connected, nil is returned for the net. + + This constness variant has been introduced in version 0.26.8 """ class Technology: @@ -32100,6 +47930,94 @@ class Technology: \technology_from_xml can be used to restore the technology definition. """ +class TechnologyComponent: + r""" + @brief A part of a technology definition + Technology components extend technology definitions (class \Technology) by specialized subfeature definitions. For example, the net tracer supplies it's technology-dependent specification through a technology component called \NetTracerTechnology. + + Components are managed within technologies and can be accessed from a technology using \Technology#component. + + This class has been introduced in version 0.25. + """ + @classmethod + def new(cls) -> TechnologyComponent: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def description(self) -> str: + r""" + @brief Gets the human-readable description string of the technology component + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def name(self) -> str: + r""" + @brief Gets the formal name of the technology component + This is the name by which the component can be obtained from a technology using \Technology#component. + """ + class Text: r""" @brief A text object @@ -32201,8 +48119,7 @@ class Text: Setter: @brief Sets the vertical alignment - This property specifies how the text is aligned relative to the anchor point. - This property has been introduced in version 0.22 and extended to enums in 0.28. + This is the version accepting integer values. It's provided for backward compatibility. """ x: int r""" @@ -32262,6 +48179,15 @@ class Text: """ @overload @classmethod + def new(cls, string: str, trans: Trans, height: int, font: int) -> Text: + r""" + @brief Constructor with string, transformation, text height and font + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. + """ + @overload + @classmethod def new(cls, string: str, x: int, y: int) -> Text: r""" @brief Constructor with string and location @@ -32271,15 +48197,6 @@ class Text: This method has been introduced in version 0.23. """ - @overload - @classmethod - def new(cls, string: str, trans: Trans, height: int, font: int) -> Text: - r""" - @brief Constructor with string, transformation, text height and font - - - A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. - """ def __copy__(self) -> Text: r""" @brief Creates a copy of self @@ -32324,6 +48241,14 @@ class Text: A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. """ @overload + def __init__(self, string: str, trans: Trans, height: int, font: int) -> None: + r""" + @brief Constructor with string, transformation, text height and font + + + A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. + """ + @overload def __init__(self, string: str, x: int, y: int) -> None: r""" @brief Constructor with string and location @@ -32333,14 +48258,6 @@ class Text: This method has been introduced in version 0.23. """ - @overload - def __init__(self, string: str, trans: Trans, height: int, font: int) -> None: - r""" - @brief Constructor with string, transformation, text height and font - - - A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. - """ def __lt__(self, t: Text) -> bool: r""" @brief Less operator @@ -32553,549 +48470,543 @@ class Text: @return The transformed text """ -class DText: +class TextGenerator: r""" - @brief A text object + @brief A text generator class - A text object has a point (location), a text, a text transformation, - a text size and a font id. Text size and font id are provided to be - be able to render the text correctly. - Text objects are used as labels (i.e. for pins) or to indicate a particular position. + A text generator is basically a way to produce human-readable text for labelling layouts. It's similar to the Basic.TEXT PCell, but more convenient to use in a scripting context. - The \DText class uses floating-point coordinates. A class that operates with integer coordinates is \Text. + Generators can be constructed from font files (or resources) or one of the registered generators can be used. - See @The Database API@ for more details about the database objects. - """ - HAlignCenter: ClassVar[HAlign] - r""" - @brief Centered horizontal alignment - """ - HAlignLeft: ClassVar[HAlign] - r""" - @brief Left horizontal alignment - """ - HAlignRight: ClassVar[HAlign] - r""" - @brief Right horizontal alignment - """ - NoHAlign: ClassVar[HAlign] - r""" - @brief Undefined horizontal alignment - """ - NoVAlign: ClassVar[VAlign] - r""" - @brief Undefined vertical alignment - """ - VAlignBottom: ClassVar[VAlign] - r""" - @brief Bottom vertical alignment - """ - VAlignCenter: ClassVar[VAlign] - r""" - @brief Centered vertical alignment - """ - VAlignTop: ClassVar[VAlign] - r""" - @brief Top vertical alignment - """ - font: int - r""" - Getter: - @brief Gets the font number - See \font= for a description of this property. - Setter: - @brief Sets the font number - The font number does not play a role for KLayout. This property is provided for compatibility with other systems which allow using different fonts for the text objects. - """ - halign: HAlign - r""" - Getter: - @brief Gets the horizontal alignment + To create a generator from a font file proceed this way: + @code + gen = RBA::TextGenerator::new + gen.load_from_file("myfont.gds") + region = gen.text("A TEXT", 0.001) + @/code - See \halign= for a description of this property. + This code produces a RBA::Region with a database unit of 0.001 micron. This region can be fed into a \Shapes container to place it into a cell for example. - Setter: - @brief Sets the horizontal alignment + By convention the font files must have two to three layers: - This property specifies how the text is aligned relative to the anchor point. - This property has been introduced in version 0.22 and extended to enums in 0.28. - """ - size: float - r""" - Getter: - @brief Gets the text height + @ul + @li 1/0 for the actual data @/li + @li 2/0 for the borders @/li + @li 3/0 for an optional additional background @/li + @/ul - Setter: - @brief Sets the text height of this object - """ - string: str - r""" - Getter: - @brief Get the text string + Currently, all glyphs must be bottom-left aligned at 0, 0. The + border must be drawn in at least one glyph cell. The border is taken + as the overall bbox of all borders. - Setter: - @brief Assign a text string to this object - """ - trans: DTrans - r""" - Getter: - @brief Gets the transformation + The glyph cells must be named with a single character or "nnn" where "d" is the + ASCII code of the character (i.e. "032" for space). Allowed ASCII codes are 32 through 127. + If a lower-case "a" character is defined, lower-case letters are supported. + Otherwise, lowercase letters are mapped to uppercase letters. - Setter: - @brief Assign a transformation (text position and orientation) to this object - """ - valign: VAlign - r""" - Getter: - @brief Gets the vertical alignment + Undefined characters are left blank in the output. - See \valign= for a description of this property. + A comment cell can be defined ("COMMENT") which must hold one text in layer 1 + stating the comment, and additional descriptions such as line width: - Setter: - @brief Sets the vertical alignment + @ul + @li "line_width=": Specifies the intended line width in micron units @/li + @li "design_grid=": Specifies the intended design grid in micron units @/li + @li any other text: The description string @/li + @/ul - This is the version accepting integer values. It's provided for backward compatibility. - """ - x: float - r""" - Getter: - @brief Gets the x location of the text + Generators can be picked form a list of predefined generator. See \generators, \default_generator and \generator_by_name for picking a generator from the list. - This method has been introduced in version 0.23. - - Setter: - @brief Sets the x location of the text - - This method has been introduced in version 0.23. - """ - y: float - r""" - Getter: - @brief Gets the y location of the text - - This method has been introduced in version 0.23. - - Setter: - @brief Sets the y location of the text - - This method has been introduced in version 0.23. + This class has been introduced in version 0.25. """ @classmethod - def from_s(cls, s: str) -> DText: + def default_generator(cls) -> TextGenerator: r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. + @brief Gets the default text generator (a standard font) + This method delivers the default generator or nil if no such generator is installed. """ + @classmethod + def font_paths(cls) -> List[str]: + r""" + @brief Gets the paths where to look for font files + See \set_font_paths for a description of this function. + + This method has been introduced in version 0.27.4. + """ + @classmethod + def generator_by_name(cls, name: str) -> TextGenerator: + r""" + @brief Gets the text generator for a given name + This method delivers the generator with the given name or nil if no such generator is registered. + """ + @classmethod + def generators(cls) -> List[TextGenerator]: + r""" + @brief Gets the generators registered in the system + This method delivers a list of generator objects that can be used to create texts. + """ + @classmethod + def new(cls) -> TextGenerator: + r""" + @brief Creates a new object of this class + """ + @classmethod + def set_font_paths(cls, arg0: Sequence[str]) -> None: + r""" + @brief Sets the paths where to look for font files + This function sets the paths where to look for font files. After setting such a path, each font found will render a specific generator. The generator can be found under the font file's name. As the text generator is also the basis for the Basic.TEXT PCell, using this function also allows configuring custom fonts for this library cell. + + This method has been introduced in version 0.27.4. + """ + def __copy__(self) -> TextGenerator: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> TextGenerator: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: TextGenerator) -> None: + r""" + @brief Assigns another object to self + """ + def background(self) -> Box: + r""" + @brief Gets the background rectangle of each glyph in the generator's database units + The background rectangle is the one that is used as background for inverted rendering. A version that delivers this value in micrometer units is \dbackground. + """ + def create(self) -> None: + r""" + @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. + """ + def dbackground(self) -> DBox: + r""" + @brief Gets the background rectangle in micron units + The background rectangle is the one that is used as background for inverted rendering. + """ + def dbu(self) -> float: + r""" + @brief Gets the basic database unit the design of the glyphs was made + This database unit the basic resolution of the glyphs. + """ + def ddesign_grid(self) -> float: + r""" + @brief Gets the design grid of the glyphs in micron units + The design grid is the basic grid used when designing the glyphs. In most cases this grid is bigger than the database unit. + """ + def description(self) -> str: + r""" + @brief Gets the description text of the generator + The generator's description text is a human-readable text that is used to identify the generator (aka 'font') in user interfaces. + """ + def design_grid(self) -> int: + r""" + @brief Gets the design grid of the glyphs in the generator's database units + The design grid is the basic grid used when designing the glyphs. In most cases this grid is bigger than the database unit. A version that delivers this value in micrometer units is \ddesign_grid. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dheight(self) -> float: + r""" + @brief Gets the design height of the glyphs in micron units + The height is the height of the rectangle occupied by each character. + """ + def dline_width(self) -> float: + r""" + @brief Gets the line width of the glyphs in micron units + The line width is the intended (not necessarily precisely) line width of typical character lines (such as the bar of an 'I'). + """ + def dup(self) -> TextGenerator: + r""" + @brief Creates a copy of self + """ + def dwidth(self) -> float: + r""" + @brief Gets the design width of the glyphs in micron units + The width is the width of the rectangle occupied by each character. + """ + def glyph(self, char: str) -> Region: + r""" + @brief Gets the glyph of the given character as a region + The region represents the glyph's outline and is delivered in the generator's database units .A more elaborate way to getting the text's outline is \text. + """ + def height(self) -> int: + r""" + @brief Gets the design height of the glyphs in the generator's database units + The height is the height of the rectangle occupied by each character. A version that delivers this value in micrometer units is \dheight. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def line_width(self) -> int: + r""" + @brief Gets the line width of the glyphs in the generator's database units + The line width is the intended (not necessarily precisely) line width of typical character lines (such as the bar of an 'I'). A version that delivers this value in micrometer units is \dline_width. + """ + def load_from_file(self, path: str) -> None: + r""" + @brief Loads the given file into the generator + See the description of the class how the layout data is read. + """ + def load_from_resource(self, resource_path: str) -> None: + r""" + @brief Loads the given resource data (as layout data) into the generator + The resource path has to start with a colon, i.e. ':/my/resource.gds'. See the description of the class how the layout data is read. + """ + def name(self) -> str: + r""" + @brief Gets the name of the generator + The generator's name is the basic key by which the generator is identified. + """ + def text(self, text: str, target_dbu: float, mag: Optional[float] = ..., inv: Optional[bool] = ..., bias: Optional[float] = ..., char_spacing: Optional[float] = ..., line_spacing: Optional[float] = ...) -> Region: + r""" + @brief Gets the rendered text as a region + @param text The text string + @param target_dbu The database unit for which to produce the text + @param mag The magnification (1.0 for original size) + @param inv inverted rendering: if true, the glyphs are rendered inverse with the background box as the outer bounding box + @param bias An additional bias to be applied (happens before inversion, can be negative) + @param char_spacing Additional space between characters (in micron units) + @param line_spacing Additional space between lines (in micron units) + Various options can be specified to control the appearance of the text. See the description of the parameters. It's important to specify the target database unit in \target_dbu to indicate what database unit shall be used to create the output for. + """ + def width(self) -> int: + r""" + @brief Gets the design height of the glyphs in the generator's database units + The width is the width of the rectangle occupied by each character. A version that delivers this value in micrometer units is \dwidth. + """ + +class Texts(ShapeCollection): + r""" + @brief Texts (a collection of texts) + + Text objects are useful as labels for net names, to identify certain regions and to specify specific locations in general. Text collections provide a way to store - also in a hierarchical fashion - and manipulate a collection of text objects. + + Text objects can be turned into polygons by creating small boxes around the texts (\polygons). Texts can also be turned into dot-like edges (\edges). Texts can be filtered by string, either by matching against a fixed string (\with_text) or a glob-style pattern (\with_match). + + Text collections can be filtered geometrically against a polygon \Region using \interacting or \non-interacting. Vice versa, texts can be used to select polygons from a \Region using \pull_interacting. + + Beside that, text collections can be transformed, flattened and combined, similar to \EdgePairs. + + This class has been introduced in version 0.27. + """ @overload @classmethod - def new(cls) -> DText: + def new(cls) -> Texts: r""" @brief Default constructor - Creates a text with unit transformation and empty text. + This constructor creates an empty text collection. """ @overload @classmethod - def new(cls, Text: Text) -> DText: + def new(cls, array: Sequence[Text]) -> Texts: r""" - @brief Creates a floating-point coordinate text from an integer coordinate text + @brief Constructor from an text array - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itext'. + This constructor creates an text collection from an array of \Text objects. """ @overload @classmethod - def new(cls, string: str, trans: DTrans) -> DText: + def new(cls, shape_iterator: RecursiveShapeIterator) -> Texts: r""" - @brief Constructor with string and transformation + @brief Constructor from a hierarchical shape set + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + Only texts are taken from the shape set and other shapes are ignored. + This method allows feeding the text collection from a hierarchy of cells. - A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Texts::new(layout.begin_shapes(cell, layer)) + @/code """ @overload @classmethod - def new(cls, string: str, x: float, y: float) -> DText: + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> Texts: r""" - @brief Constructor with string and location + @brief Creates a hierarchical text collection from an original layer + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical text collection which supports hierarchical operations. - A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. - - This method has been introduced in version 0.23. + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Texts::new(layout.begin_shapes(cell, layer)) + @/code """ @overload @classmethod - def new(cls, string: str, trans: DTrans, height: float, font: int) -> DText: + def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> Texts: r""" - @brief Constructor with string, transformation, text height and font + @brief Creates a hierarchical text collection from an original layer with a transformation + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical text collection which supports hierarchical operations. + The transformation is useful to scale to a specific database unit for example. - A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code """ - def __copy__(self) -> DText: + @overload + @classmethod + def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> Texts: + r""" + @brief Constructor from a hierarchical shape set with a transformation + + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + Only texts are taken from the shape set and other shapes are ignored. + The given transformation is applied to each text taken. + This method allows feeding the text collection from a hierarchy of cells. + The transformation is useful to scale to a specific database unit for example. + + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code + """ + @overload + @classmethod + def new(cls, shapes: Shapes) -> Texts: + r""" + @brief Shapes constructor + + This constructor creates an text collection from a \Shapes collection. + """ + @overload + @classmethod + def new(cls, text: Text) -> Texts: + r""" + @brief Constructor from a single edge pair object + + This constructor creates an text collection with a single text. + """ + def __add__(self, other: Texts) -> Texts: + r""" + @brief Returns the combined text collection of self and the other one + + @return The resulting text collection + + This operator adds the texts of the other collection to self and returns a new combined set. + """ + def __and__(self, other: Region) -> Texts: + r""" + @brief Returns the texts from this text collection which are inside or on the edge of polygons from the given region + + @return A new text collection containing the texts inside or on the edge of polygons from the region + """ + def __copy__(self) -> Texts: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> DText: + def __deepcopy__(self) -> Texts: r""" @brief Creates a copy of self """ - def __eq__(self, text: object) -> bool: + def __getitem__(self, n: int) -> Text: r""" - @brief Equality + @brief Returns the nth text + This method returns nil if the index is out of range. It is available for flat texts only - i.e. those for which \has_valid_texts? is true. Use \flatten to explicitly flatten an text collection. - Return true, if this text object and the given text are equal + The \each iterator is the more general approach to access the texts. """ - def __hash__(self) -> int: + def __iadd__(self, other: Texts) -> Texts: r""" - @brief Computes a hash value - Returns a hash value for the given text object. This method enables texts as hash keys. + @brief Adds the texts of the other text collection to self - This method has been introduced in version 0.25. + @return The text collection after modification (self) + + This operator adds the texts of the other collection to self. """ @overload def __init__(self) -> None: r""" @brief Default constructor - Creates a text with unit transformation and empty text. + This constructor creates an empty text collection. """ @overload - def __init__(self, Text: Text) -> None: + def __init__(self, array: Sequence[Text]) -> None: r""" - @brief Creates a floating-point coordinate text from an integer coordinate text + @brief Constructor from an text array - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itext'. + This constructor creates an text collection from an array of \Text objects. """ @overload - def __init__(self, string: str, trans: DTrans) -> None: + def __init__(self, shape_iterator: RecursiveShapeIterator) -> None: r""" - @brief Constructor with string and transformation + @brief Constructor from a hierarchical shape set + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + Only texts are taken from the shape set and other shapes are ignored. + This method allows feeding the text collection from a hierarchy of cells. - A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Texts::new(layout.begin_shapes(cell, layer)) + @/code """ @overload - def __init__(self, string: str, x: float, y: float) -> None: + def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> None: r""" - @brief Constructor with string and location + @brief Creates a hierarchical text collection from an original layer + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical text collection which supports hierarchical operations. - A string and a location is provided to this constructor. The location is specifies as a pair of x and y coordinates. - - This method has been introduced in version 0.23. + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + r = RBA::Texts::new(layout.begin_shapes(cell, layer)) + @/code """ @overload - def __init__(self, string: str, trans: DTrans, height: float, font: int) -> None: + def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> None: r""" - @brief Constructor with string, transformation, text height and font + @brief Creates a hierarchical text collection from an original layer with a transformation + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + This version will create a hierarchical text collection which supports hierarchical operations. + The transformation is useful to scale to a specific database unit for example. - A string and a transformation is provided to this constructor. The transformation specifies the location and orientation of the text object. In addition, the text height and font can be specified. - """ - def __lt__(self, t: DText) -> bool: - r""" - @brief Less operator - @param t The object to compare against - This operator is provided to establish some, not necessarily a certain sorting order - """ - def __ne__(self, text: object) -> bool: - r""" - @brief Inequality - - - Return true, if this text object and the given text are not equal - """ - def __str__(self, dbu: Optional[float] = ...) -> str: - r""" - @brief Converts the object to a string. - If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DText) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> DBox: - r""" - @brief Gets the bounding box of the text - The bounding box of the text is a single point - the location of the text. Both points of the box are identical. - - This method has been added in version 0.28. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DText: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given text object. This method enables texts as hash keys. - - This method has been introduced in version 0.25. - """ - def is_const_object(self) -> bool: - r""" - @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. + @code + dss = RBA::DeepShapeStore::new + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code """ @overload - def move(self, distance: DVector) -> DText: + def __init__(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: r""" - @brief Moves the text by a certain distance (modifies self) + @brief Constructor from a hierarchical shape set with a transformation + This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. + Only texts are taken from the shape set and other shapes are ignored. + The given transformation is applied to each text taken. + This method allows feeding the text collection from a hierarchy of cells. + The transformation is useful to scale to a specific database unit for example. - Moves the text by a given offset and returns the moved - text. Does not check for coordinate overflows. - - @param p The offset to move the text. - - @return A reference to this text object + @code + layout = ... # a layout + cell = ... # the index of the initial cell + layer = ... # the index of the layer from where to take the shapes from + dbu = 0.1 # the target database unit + r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) + @/code """ @overload - def move(self, dx: float, dy: float) -> DText: + def __init__(self, shapes: Shapes) -> None: r""" - @brief Moves the text by a certain distance (modifies self) + @brief Shapes constructor - - Moves the text by a given distance in x and y direction and returns the moved - text. Does not check for coordinate overflows. - - @param dx The x distance to move the text. - @param dy The y distance to move the text. - - @return A reference to this text object - - This method was introduced in version 0.23. + This constructor creates an text collection from a \Shapes collection. """ @overload - def moved(self, distance: DVector) -> DText: + def __init__(self, text: Text) -> None: r""" - @brief Returns the text moved by a certain distance (does not modify self) + @brief Constructor from a single edge pair object - - Moves the text by a given offset and returns the moved - text. Does not modify *this. Does not check for coordinate - overflows. - - @param p The offset to move the text. - - @return The moved text. + This constructor creates an text collection with a single text. """ - @overload - def moved(self, dx: float, dy: float) -> DText: + def __iter__(self) -> Iterator[Text]: r""" - @brief Returns the text moved by a certain distance (does not modify self) + @brief Returns each text of the text collection + """ + def __len__(self) -> int: + r""" + @brief Returns the (flat) number of texts in the text collection + The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated. - Moves the text by a given offset and returns the moved - text. Does not modify *this. Does not check for coordinate - overflows. - - @param dx The x distance to move the text. - @param dy The y distance to move the text. - - @return The moved text. - - This method was introduced in version 0.23. - """ - def position(self) -> DPoint: - r""" - @brief Gets the position of the text - - This convenience method has been added in version 0.28. - """ - def to_itype(self, dbu: Optional[float] = ...) -> Text: - r""" - @brief Converts the text to an integer coordinate text - - The database unit can be specified to translate the floating-point coordinate Text in micron units to an integer-coordinate text in database units. The text's coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self, dbu: Optional[float] = ...) -> str: - r""" - @brief Converts the object to a string. - If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - @overload - def transformed(self, t: DCplxTrans) -> DText: - r""" - @brief Transforms the text with the given complex transformation - - - @param t The magnifying transformation to apply - @return The transformed text (a DText now) - """ - @overload - def transformed(self, t: DTrans) -> DText: - r""" - @brief Transforms the text with the given simple transformation - - - @param t The transformation to apply - @return The transformed text - """ - @overload - def transformed(self, t: VCplxTrans) -> Text: - r""" - @brief Transforms the text with the given complex transformation - - - @param t The magnifying transformation to apply - @return The transformed text (in this case an integer coordinate text) - - This method has been introduced in version 0.25. - """ - -class HAlign: - r""" - @brief This class represents the horizontal alignment modes. - This enum has been introduced in version 0.28. - """ - HAlignCenter: ClassVar[HAlign] - r""" - @brief Centered horizontal alignment - """ - HAlignLeft: ClassVar[HAlign] - r""" - @brief Left horizontal alignment - """ - HAlignRight: ClassVar[HAlign] - r""" - @brief Right horizontal alignment - """ - NoHAlign: ClassVar[HAlign] - r""" - @brief Undefined horizontal alignment - """ - @overload - @classmethod - def new(cls, i: int) -> HAlign: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> HAlign: - r""" - @brief Creates an enum from a string value - """ - def __copy__(self) -> HAlign: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> HAlign: - r""" - @brief Creates a copy of self - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: HAlign) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. """ def __str__(self) -> str: r""" - @brief Gets the symbolic string from an enum + @brief Converts the text collection to a string + The length of the output is limited to 20 texts to avoid giant strings on large collections. For full output use "to_s" with a maximum count parameter. + """ + def __sub__(self, other: Region) -> Texts: + r""" + @brief Returns the texts from this text collection which are not inside or on the edge of polygons from the given region + + @return A new text collection containing the texts not inside or on the edge of polygons from the region """ def _create(self) -> None: r""" @@ -33134,15 +49045,36 @@ class HAlign: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: HAlign) -> None: + def assign(self, other: ShapeCollection) -> None: r""" @brief Assigns another object to self """ + def bbox(self) -> Box: + r""" + @brief Return the bounding box of the text collection + The bounding box is the box enclosing all origins of all texts. + """ + def clear(self) -> None: + r""" + @brief Clears the text collection + """ + def count(self) -> int: + r""" + @brief Returns the (flat) number of texts in the text collection + + The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ def create(self) -> None: r""" @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. """ + def data_id(self) -> int: + r""" + @brief Returns the data ID (a unique identifier for the underlying data storage) + """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -33155,13 +49087,105 @@ class HAlign: 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. """ - def dup(self) -> HAlign: + def disable_progress(self) -> None: + r""" + @brief Disable progress reporting + Calling this method will disable progress reporting. See \enable_progress. + """ + def dup(self) -> Texts: r""" @brief Creates a copy of self """ - def inspect(self) -> str: + def each(self) -> Iterator[Text]: r""" - @brief Converts an enum to a visual string + @brief Returns each text of the text collection + """ + def edges(self) -> Edges: + r""" + @brief Returns dot-like edges for the texts + @return An edge collection containing the individual, dot-like edges + """ + def enable_progress(self, label: str) -> None: + r""" + @brief Enable progress reporting + After calling this method, the text collection will report the progress through a progress bar while expensive operations are running. + The label is a text which is put in front of the progress bar. + Using a progress bar will imply a performance penalty of a few percent typically. + """ + def enable_properties(self) -> None: + r""" + @brief Enables properties for the given container. + This method has an effect mainly on original layers and will import properties from such layers. By default, properties are not enabled on original layers. Alternatively you can apply \filter_properties or \map_properties to enable properties with a specific name key. + + This method has been introduced in version 0.28.4. + """ + @overload + def extents(self, d: Optional[int] = ...) -> Region: + r""" + @brief Returns a region with the enlarged bounding boxes of the texts + Text bounding boxes are point-like boxes which vanish unless an enlargement of >0 is specified. + The bounding box is centered at the text's location. + The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. + """ + @overload + def extents(self, dx: int, dy: int) -> Region: + r""" + @brief Returns a region with the enlarged bounding boxes of the texts + This method acts like the other version of \extents, but allows giving different enlargements for x and y direction. + """ + def filter_properties(self, keys: Sequence[Any]) -> None: + r""" + @brief Filters properties by certain keys. + Calling this method on a container will reduce the properties to values with name keys from the 'keys' list. + As a side effect, this method enables properties on original layers. + + This method has been introduced in version 0.28.4. + """ + def flatten(self) -> None: + r""" + @brief Explicitly flattens an text collection + + If the collection is already flat (i.e. \has_valid_texts? returns true), this method will not change the collection. + """ + def has_valid_texts(self) -> bool: + r""" + @brief Returns true if the text collection is flat and individual texts can be accessed randomly + """ + def hier_count(self) -> int: + r""" + @brief Returns the (hierarchical) number of texts in the text collection + + The count is computed 'hierarchical', i.e. texts inside a cell are counted once even if the cell is instantiated multiple times. + + This method has been introduced in version 0.27. + """ + @overload + def insert(self, text: Text) -> None: + r""" + @brief Inserts a text into the collection + """ + @overload + def insert(self, texts: Texts) -> None: + r""" + @brief Inserts all texts from the other text collection into this collection + """ + def insert_into(self, layout: Layout, cell_index: int, layer: int) -> None: + r""" + @brief Inserts this texts into the given layout, below the given cell and into the given layer. + If the text collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. + """ + def insert_into_as_polygons(self, layout: Layout, cell_index: int, layer: int, e: int) -> None: + r""" + @brief Inserts this texts into the given layout, below the given cell and into the given layer. + If the text collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. + + The texts will be converted to polygons with the enlargement value given be 'e'. See \polygon or \extents for details. + """ + def interacting(self, other: Region) -> Texts: + r""" + @brief Returns the texts from this text collection which are inside or on the edge of polygons from the given region + + @return A new text collection containing the texts inside or on the edge of polygons from the region """ def is_const_object(self) -> bool: r""" @@ -33169,103 +49193,235 @@ class HAlign: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def to_i(self) -> int: + def is_deep(self) -> bool: r""" - @brief Gets the integer value from the enum + @brief Returns true if the edge pair collection is a deep (hierarchical) one """ + def is_empty(self) -> bool: + r""" + @brief Returns true if the collection is empty + """ + def map_properties(self, key_map: Dict[Any, Any]) -> None: + r""" + @brief Maps properties by name key. + Calling this method on a container will reduce the properties to values with name keys from the 'keys' hash and renames the properties. Properties not listed in the key map will be removed. + As a side effect, this method enables properties on original layers. + + This method has been introduced in version 0.28.4. + """ + @overload + def move(self, p: Vector) -> Texts: + r""" + @brief Moves the text collection + + Moves the texts by the given offset and returns the + moved text collection. The text collection is overwritten. + + @param p The distance to move the texts. + + @return The moved texts (self). + """ + @overload + def move(self, x: int, y: int) -> Texts: + r""" + @brief Moves the text collection + + Moves the edge pairs by the given offset and returns the + moved texts. The edge pair collection is overwritten. + + @param x The x distance to move the texts. + @param y The y distance to move the texts. + + @return The moved texts (self). + """ + @overload + def moved(self, p: Vector) -> Texts: + r""" + @brief Returns the moved text collection (does not modify self) + + Moves the texts by the given offset and returns the + moved texts. The text collection is not modified. + + @param p The distance to move the texts. + + @return The moved texts. + """ + @overload + def moved(self, x: int, y: int) -> Texts: + r""" + @brief Returns the moved edge pair collection (does not modify self) + + Moves the texts by the given offset and returns the + moved texts. The text collection is not modified. + + @param x The x distance to move the texts. + @param y The y distance to move the texts. + + @return The moved texts. + """ + def not_interacting(self, other: Region) -> Texts: + r""" + @brief Returns the texts from this text collection which are not inside or on the edge of polygons from the given region + + @return A new text collection containing the texts not inside or on the edge of polygons from the region + """ + def polygons(self, e: Optional[int] = ...) -> Region: + r""" + @brief Converts the edge pairs to polygons + This method creates polygons from the texts. This is equivalent to calling \extents. + """ + def pull_interacting(self, other: Region) -> Region: + r""" + @brief Returns all polygons of "other" which are including texts of this text set + The "pull_..." method is similar to "select_..." but works the opposite way: it selects shapes from the argument region rather than self. In a deep (hierarchical) context the output region will be hierarchically aligned with self, so the "pull_..." method provide a way for re-hierarchization. + + @return The region after the polygons have been selected (from other) + + Merged semantics applies for the polygon region. + """ + def remove_properties(self) -> None: + r""" + @brief Removes properties for the given container. + This will remove all properties on the given container. + + This method has been introduced in version 0.28.4. + """ + def select_interacting(self, other: Region) -> Texts: + r""" + @brief Selects the texts from this text collection which are inside or on the edge of polygons from the given region + + @return A text collection after the texts have been selected (self) + + In contrast to \interacting, this method will modify self. + """ + def select_not_interacting(self, other: Region) -> Texts: + r""" + @brief Selects the texts from this text collection which are not inside or on the edge of polygons from the given region + + @return A text collection after the texts have been selected (self) + + In contrast to \interacting, this method will modify self. + """ + def size(self) -> int: + r""" + @brief Returns the (flat) number of texts in the text collection + + The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated. + + Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. + """ + def swap(self, other: Texts) -> None: + r""" + @brief Swap the contents of this collection with the contents of another collection + This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare. + """ + @overload def to_s(self) -> str: r""" - @brief Gets the symbolic string from an enum + @brief Converts the text collection to a string + The length of the output is limited to 20 texts to avoid giant strings on large collections. For full output use "to_s" with a maximum count parameter. + """ + @overload + def to_s(self, max_count: int) -> str: + r""" + @brief Converts the text collection to a string + This version allows specification of the maximum number of texts contained in the string. + """ + @overload + def transform(self, t: ICplxTrans) -> Texts: + r""" + @brief Transform the text collection with a complex transformation (modifies self) + + Transforms the text collection with the given transformation. + This version modifies the text collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed text collection. + """ + @overload + def transform(self, t: Trans) -> Texts: + r""" + @brief Transform the text collection (modifies self) + + Transforms the text collection with the given transformation. + This version modifies the text collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed text collection. + """ + def transform_icplx(self, t: ICplxTrans) -> Texts: + r""" + @brief Transform the text collection with a complex transformation (modifies self) + + Transforms the text collection with the given transformation. + This version modifies the text collection and returns a reference to self. + + @param t The transformation to apply. + + @return The transformed text collection. + """ + @overload + def transformed(self, t: ICplxTrans) -> Texts: + r""" + @brief Transform the text collection with a complex transformation + + Transforms the text with the given complex transformation. + Does not modify the text collection but returns the transformed texts. + + @param t The transformation to apply. + + @return The transformed texts. + """ + @overload + def transformed(self, t: Trans) -> Texts: + r""" + @brief Transform the edge pair collection + + Transforms the texts with the given transformation. + Does not modify the edge pair collection but returns the transformed texts. + + @param t The transformation to apply. + + @return The transformed texts. + """ + def transformed_icplx(self, t: ICplxTrans) -> Texts: + r""" + @brief Transform the text collection with a complex transformation + + Transforms the text with the given complex transformation. + Does not modify the text collection but returns the transformed texts. + + @param t The transformation to apply. + + @return The transformed texts. + """ + def with_match(self, pattern: str, inverse: bool) -> Texts: + r""" + @brief Filter the text by glob pattern + "pattern" is a glob-style pattern (e.g. "A*" will select all texts starting with a capital "A"). + If "inverse" is false, this method returns the texts matching the pattern. + If "inverse" is true, this method returns the texts not matching the pattern. + """ + def with_text(self, text: str, inverse: bool) -> Texts: + r""" + @brief Filter the text by text string + If "inverse" is false, this method returns the texts with the given string. + If "inverse" is true, this method returns the texts not having the given string. """ -class VAlign: +class TileOutputReceiver(TileOutputReceiverBase): r""" - @brief This class represents the vertical alignment modes. - This enum has been introduced in version 0.28. + @brief A receiver abstraction for the tiling processor. + + The tiling processor (\TilingProcessor) is a framework for executing sequences of operations on tiles of a layout or multiple layouts. The \TileOutputReceiver class is used to specify an output channel for the tiling processor. See \TilingProcessor#output for more details. + + This class has been introduced in version 0.23. """ - NoVAlign: ClassVar[VAlign] - r""" - @brief Undefined vertical alignment - """ - VAlignBottom: ClassVar[VAlign] - r""" - @brief Bottom vertical alignment - """ - VAlignCenter: ClassVar[VAlign] - r""" - @brief Centered vertical alignment - """ - VAlignTop: ClassVar[VAlign] - r""" - @brief Top vertical alignment - """ - @overload - @classmethod - def new(cls, i: int) -> VAlign: + def _assign(self, other: TileOutputReceiverBase) -> None: r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> VAlign: - r""" - @brief Creates an enum from a string value - """ - def __copy__(self) -> VAlign: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> VAlign: - r""" - @brief Creates a copy of self - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: VAlign) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum + @brief Assigns another object to self """ def _create(self) -> None: r""" @@ -33284,6 +49440,10 @@ class VAlign: 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. """ + def _dup(self) -> TileOutputReceiver: + r""" + @brief Creates a copy of self + """ def _is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -33304,49 +49464,6 @@ class VAlign: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: VAlign) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> VAlign: - r""" - @brief Creates a copy of self - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ class TileOutputReceiverBase: r""" @@ -33447,60 +49564,6 @@ class TileOutputReceiverBase: This method has been introduced in version 0.25. """ -class TileOutputReceiver(TileOutputReceiverBase): - r""" - @brief A receiver abstraction for the tiling processor. - - The tiling processor (\TilingProcessor) is a framework for executing sequences of operations on tiles of a layout or multiple layouts. The \TileOutputReceiver class is used to specify an output channel for the tiling processor. See \TilingProcessor#output for more details. - - This class has been introduced in version 0.23. - """ - def _assign(self, other: TileOutputReceiverBase) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> TileOutputReceiver: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - class TilingProcessor: r""" @brief A processor for layout which distributes tasks over tiles @@ -33698,45 +49761,6 @@ class TilingProcessor: This variant has been introduced in version 0.27. """ @overload - def input(self, name: str, edges: Edges) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from an \Edges object. Edge collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - Caution: the Edges object must stay valid during the lifetime of the tiling processor. Take care to store it in a variable to prevent early destruction of the Edges object. Not doing so may crash the application. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, iter: RecursiveShapeIterator) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a recursive shape iterator, hence from a hierarchy of shapes from a layout. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, region: Region) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a \Region object. Regions don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - Caution: the Region object must stay valid during the lifetime of the tiling processor. Take care to store it in a variable to prevent early destruction of the Region object. Not doing so may crash the application. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, texts: Texts) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from an \Texts object. Text collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. - - Caution: the Texts object must stay valid during the lifetime of the tiling processor. Take care to store it in a variable to prevent early destruction of the Texts object. Not doing so may crash the application. - - The name specifies the variable under which the input can be used in the scripts. - This variant has been introduced in version 0.27. - """ - @overload def input(self, name: str, edge_pairs: EdgePairs, trans: ICplxTrans) -> None: r""" @brief Specifies input for the tiling processor @@ -33748,6 +49772,16 @@ class TilingProcessor: This variant has been introduced in version 0.27. """ @overload + def input(self, name: str, edges: Edges) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from an \Edges object. Edge collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + Caution: the Edges object must stay valid during the lifetime of the tiling processor. Take care to store it in a variable to prevent early destruction of the Edges object. Not doing so may crash the application. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload def input(self, name: str, edges: Edges, trans: ICplxTrans) -> None: r""" @brief Specifies input for the tiling processor @@ -33760,6 +49794,14 @@ class TilingProcessor: """ @overload + def input(self, name: str, iter: RecursiveShapeIterator) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a recursive shape iterator, hence from a hierarchy of shapes from a layout. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload def input(self, name: str, iter: RecursiveShapeIterator, trans: ICplxTrans) -> None: r""" @brief Specifies input for the tiling processor @@ -33769,6 +49811,54 @@ class TilingProcessor: The name specifies the variable under which the input can be used in the scripts. """ @overload + def input(self, name: str, layout: Layout, cell_index: int, layer: int) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. + "layer" is the layer index of the input layer. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, layout: Layout, cell_index: int, layer: int, trans: ICplxTrans) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. + "layer" is the layer index of the input layer. + In addition, a transformation can be specified which will be applied to the shapes before they are used. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, layout: Layout, cell_index: int, lp: LayerInfo) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. + "lp" is a \LayerInfo object specifying the input layer. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, layout: Layout, cell_index: int, lp: LayerInfo, trans: ICplxTrans) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. + "lp" is a \LayerInfo object specifying the input layer. + In addition, a transformation can be specified which will be applied to the shapes before they are used. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload + def input(self, name: str, region: Region) -> None: + r""" + @brief Specifies input for the tiling processor + This method will establish an input channel for the processor. This version receives input from a \Region object. Regions don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + Caution: the Region object must stay valid during the lifetime of the tiling processor. Take care to store it in a variable to prevent early destruction of the Region object. Not doing so may crash the application. + + The name specifies the variable under which the input can be used in the scripts. + """ + @overload def input(self, name: str, region: Region, trans: ICplxTrans) -> None: r""" @brief Specifies input for the tiling processor @@ -33780,7 +49870,7 @@ class TilingProcessor: This variant allows one to specify an additional transformation too. It has been introduced in version 0.23.2. """ @overload - def input(self, name: str, texts: Texts, trans: ICplxTrans) -> None: + def input(self, name: str, texts: Texts) -> None: r""" @brief Specifies input for the tiling processor This method will establish an input channel for the processor. This version receives input from an \Texts object. Text collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. @@ -33791,42 +49881,15 @@ class TilingProcessor: This variant has been introduced in version 0.27. """ @overload - def input(self, name: str, layout: Layout, cell_index: int, layer: int) -> None: + def input(self, name: str, texts: Texts, trans: ICplxTrans) -> None: r""" @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. - "layer" is the layer index of the input layer. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, layout: Layout, cell_index: int, lp: LayerInfo) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. - "lp" is a \LayerInfo object specifying the input layer. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, layout: Layout, cell_index: int, layer: int, trans: ICplxTrans) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. - "layer" is the layer index of the input layer. - In addition, a transformation can be specified which will be applied to the shapes before they are used. - - The name specifies the variable under which the input can be used in the scripts. - """ - @overload - def input(self, name: str, layout: Layout, cell_index: int, lp: LayerInfo, trans: ICplxTrans) -> None: - r""" - @brief Specifies input for the tiling processor - This method will establish an input channel for the processor. This version receives input from a layout and the hierarchy below the cell with the given cell index. - "lp" is a \LayerInfo object specifying the input layer. - In addition, a transformation can be specified which will be applied to the shapes before they are used. + This method will establish an input channel for the processor. This version receives input from an \Texts object. Text collections don't always come with a database unit, hence a database unit should be specified with the \dbu= method unless a layout object is specified as input too. + + Caution: the Texts object must stay valid during the lifetime of the tiling processor. Take care to store it in a variable to prevent early destruction of the Texts object. Not doing so may crash the application. The name specifies the variable under which the input can be used in the scripts. + This variant has been introduced in version 0.27. """ def is_const_object(self) -> bool: r""" @@ -33859,6 +49922,48 @@ class TilingProcessor: @param edges The \Edges object to which the data is sent """ @overload + def output(self, name: str, image: lay.BasicImage) -> None: + r""" + @brief Specifies output to an image + This method will establish an output channel which delivers float data to image data. The image is a monochrome image where each pixel corresponds to a single tile. This method for example is useful to collect density information into an image. The image is configured such that each pixel covers one tile. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + """ + @overload + def output(self, name: str, layout: Layout, cell: int, layer_index: int) -> None: + r""" + @brief Specifies output to a layout layer + This method will establish an output channel to a layer in a layout. The output sent to that channel will be put into the specified layer and cell. In this version, the layer is specified through a layer index, hence it must be created before. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + + @param name The name of the channel + @param layout The layout to which the data is sent + @param cell The index of the cell to which the data is sent + @param layer_index The layer index where the output will be sent to + """ + @overload + def output(self, name: str, layout: Layout, cell: int, lp: LayerInfo) -> None: + r""" + @brief Specifies output to a layout layer + This method will establish an output channel to a layer in a layout. The output sent to that channel will be put into the specified layer and cell. In this version, the layer is specified through a \LayerInfo object, i.e. layer and datatype number. If no such layer exists, it will be created. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + + @param name The name of the channel + @param layout The layout to which the data is sent + @param cell The index of the cell to which the data is sent + @param lp The layer specification where the output will be sent to + """ + @overload + def output(self, name: str, rdb: rdb.ReportDatabase, cell_id: int, category_id: int) -> None: + r""" + @brief Specifies output to a report database + This method will establish an output channel for the processor. The output sent to that channel will be put into the report database given by the "rdb" parameter. "cell_id" specifies the cell and "category_id" the category to use. + + The name is the name which must be used in the _output function of the scripts in order to address that channel. + """ + @overload def output(self, name: str, rec: TileOutputReceiverBase) -> None: r""" @brief Specifies output for the tiling processor @@ -33926,32 +50031,6 @@ class TilingProcessor: This variant has been introduced in version 0.27. """ - @overload - def output(self, name: str, layout: Layout, cell: int, layer_index: int) -> None: - r""" - @brief Specifies output to a layout layer - This method will establish an output channel to a layer in a layout. The output sent to that channel will be put into the specified layer and cell. In this version, the layer is specified through a layer index, hence it must be created before. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - - @param name The name of the channel - @param layout The layout to which the data is sent - @param cell The index of the cell to which the data is sent - @param layer_index The layer index where the output will be sent to - """ - @overload - def output(self, name: str, layout: Layout, cell: int, lp: LayerInfo) -> None: - r""" - @brief Specifies output to a layout layer - This method will establish an output channel to a layer in a layout. The output sent to that channel will be put into the specified layer and cell. In this version, the layer is specified through a \LayerInfo object, i.e. layer and datatype number. If no such layer exists, it will be created. - - The name is the name which must be used in the _output function of the scripts in order to address that channel. - - @param name The name of the channel - @param layout The layout to which the data is sent - @param cell The index of the cell to which the data is sent - @param lp The layer specification where the output will be sent to - """ def queue(self, script: str) -> None: r""" @brief Queues a script for parallel execution @@ -34132,22 +50211,6 @@ class Trans: """ @overload @classmethod - def new(cls, dtrans: DTrans) -> Trans: - r""" - @brief Creates an integer coordinate transformation from a floating-point coordinate transformation - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. - """ - @overload - @classmethod - def new(cls, u: Vector) -> Trans: - r""" - @brief Creates a transformation using a displacement only - - @param u The displacement - """ - @overload - @classmethod def new(cls, c: Trans, u: Optional[Vector] = ...) -> Trans: r""" @brief Creates a transformation from another transformation plus a displacement @@ -34161,15 +50224,6 @@ class Trans: """ @overload @classmethod - def new(cls, x: int, y: int) -> Trans: - r""" - @brief Creates a transformation using a displacement given as two coordinates - - @param x The horizontal displacement - @param y The vertical displacement - """ - @overload - @classmethod def new(cls, c: Trans, x: int, y: int) -> Trans: r""" @brief Creates a transformation from another transformation plus a displacement @@ -34184,6 +50238,14 @@ class Trans: """ @overload @classmethod + def new(cls, dtrans: DTrans) -> Trans: + r""" + @brief Creates an integer coordinate transformation from a floating-point coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload + @classmethod def new(cls, rot: int, mirr: Optional[bool] = ..., u: Optional[Vector] = ...) -> Trans: r""" @brief Creates a transformation using angle and mirror flag @@ -34206,6 +50268,23 @@ class Trans: @param rot The rotation in units of 90 degree @param mirrx True, if mirrored at x axis + @param x The horizontal displacement + @param y The vertical displacement + """ + @overload + @classmethod + def new(cls, u: Vector) -> Trans: + r""" + @brief Creates a transformation using a displacement only + + @param u The displacement + """ + @overload + @classmethod + def new(cls, x: int, y: int) -> Trans: + r""" + @brief Creates a transformation using a displacement given as two coordinates + @param x The horizontal displacement @param y The vertical displacement """ @@ -34234,20 +50313,6 @@ class Trans: @brief Creates a unit transformation """ @overload - def __init__(self, dtrans: DTrans) -> None: - r""" - @brief Creates an integer coordinate transformation from a floating-point coordinate transformation - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. - """ - @overload - def __init__(self, u: Vector) -> None: - r""" - @brief Creates a transformation using a displacement only - - @param u The displacement - """ - @overload def __init__(self, c: Trans, u: Optional[Vector] = ...) -> None: r""" @brief Creates a transformation from another transformation plus a displacement @@ -34260,14 +50325,6 @@ class Trans: @param u The Additional displacement """ @overload - def __init__(self, x: int, y: int) -> None: - r""" - @brief Creates a transformation using a displacement given as two coordinates - - @param x The horizontal displacement - @param y The vertical displacement - """ - @overload def __init__(self, c: Trans, x: int, y: int) -> None: r""" @brief Creates a transformation from another transformation plus a displacement @@ -34281,6 +50338,13 @@ class Trans: @param y The Additional displacement (y) """ @overload + def __init__(self, dtrans: DTrans) -> None: + r""" + @brief Creates an integer coordinate transformation from a floating-point coordinate transformation + + This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + """ + @overload def __init__(self, rot: int, mirr: Optional[bool] = ..., u: Optional[Vector] = ...) -> None: r""" @brief Creates a transformation using angle and mirror flag @@ -34302,6 +50366,21 @@ class Trans: @param rot The rotation in units of 90 degree @param mirrx True, if mirrored at x axis + @param x The horizontal displacement + @param y The vertical displacement + """ + @overload + def __init__(self, u: Vector) -> None: + r""" + @brief Creates a transformation using a displacement only + + @param u The displacement + """ + @overload + def __init__(self, x: int, y: int) -> None: + r""" + @brief Creates a transformation using a displacement given as two coordinates + @param x The horizontal displacement @param y The vertical displacement """ @@ -34746,541 +50825,91 @@ class Trans: @return The transformed vector """ -class DTrans: +class TrapezoidDecompositionMode: r""" - @brief A simple transformation + @brief This class represents the TrapezoidDecompositionMode enum used within trapezoid decomposition - Simple transformations only provide rotations about angles which a multiples of 90 degree. - Together with the mirror options, this results in 8 distinct orientations (fixpoint transformations). - These can be combined with a displacement which is applied after the rotation/mirror. - This version acts on floating-point coordinates. A version for integer coordinates is \Trans. - - Here are some examples for using the DTrans class: - - @code - t = RBA::DTrans::new(0, 100) # displacement by 100 DBU in y direction - # the inverse: -> "r0 0,-100" - t.inverted.to_s - # concatenation: -> "r90 -100,0" - (RBA::DTrans::new(RBA::DTrans::R90) * t).to_s - # apply to a point: -> "0,100" - RBA::DTrans::new(RBA::DTrans::R90).trans(RBA::DPoint::new(100, 0)) - @/code - - See @The Database API@ for more details about the database objects. + This enum has been introduced in version 0.27. """ - M0: ClassVar[DTrans] + TD_htrapezoids: ClassVar[TrapezoidDecompositionMode] r""" - @brief A constant giving "mirrored at the x-axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. + @brief Indicates horizontal trapezoid decomposition. """ - M135: ClassVar[DTrans] + TD_simple: ClassVar[TrapezoidDecompositionMode] r""" - @brief A constant giving "mirrored at the 135 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. + @brief Indicates unspecific decomposition. """ - M45: ClassVar[DTrans] + TD_vtrapezoids: ClassVar[TrapezoidDecompositionMode] r""" - @brief A constant giving "mirrored at the 45 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M90: ClassVar[DTrans] - r""" - @brief A constant giving "mirrored at the y (90 degree) axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R0: ClassVar[DTrans] - r""" - @brief A constant giving "unrotated" (unit) transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R180: ClassVar[DTrans] - r""" - @brief A constant giving "rotated by 180 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R270: ClassVar[DTrans] - r""" - @brief A constant giving "rotated by 270 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R90: ClassVar[DTrans] - r""" - @brief A constant giving "rotated by 90 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - angle: int - r""" - Getter: - @brief Gets the angle in units of 90 degree - - This value delivers the rotation component. In addition, a mirroring at the x axis may be applied before if the \is_mirror? property is true. - Setter: - @brief Sets the angle in units of 90 degree - @param a The new angle - - This method was introduced in version 0.20. - """ - disp: DVector - r""" - Getter: - @brief Gets to the displacement vector - - Staring with version 0.25 the displacement type is a vector. - Setter: - @brief Sets the displacement - @param u The new displacement - - This method was introduced in version 0.20. - Staring with version 0.25 the displacement type is a vector. - """ - mirror: bool - r""" - Getter: - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - Setter: - @brief Sets the mirror flag - "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag - - This method was introduced in version 0.20. - """ - rot: int - r""" - Getter: - @brief Gets the angle/mirror code - - The angle/mirror code is one of the constants R0, R90, R180, R270, M0, M45, M90 and M135. rx is the rotation by an angle of x counter clockwise. mx is the mirroring at the axis given by the angle x (to the x-axis). - Setter: - @brief Sets the angle/mirror code - @param r The new angle/rotation code (see \rot property) - - This method was introduced in version 0.20. + @brief Indicates vertical trapezoid decomposition. """ + @overload @classmethod - def from_itrans(cls, trans: Trans) -> DTrans: + def new(cls, i: int) -> TrapezoidDecompositionMode: r""" - @brief Creates a floating-point coordinate transformation from an integer coordinate transformation - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. - """ - @classmethod - def from_s(cls, s: str) -> DTrans: - r""" - @brief Creates a transformation from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. + @brief Creates an enum from an integer value """ @overload @classmethod - def new(cls) -> DTrans: + def new(cls, s: str) -> TrapezoidDecompositionMode: r""" - @brief Creates a unit transformation + @brief Creates an enum from a string value """ - @overload - @classmethod - def new(cls, trans: Trans) -> DTrans: - r""" - @brief Creates a floating-point coordinate transformation from an integer coordinate transformation - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. - """ - @overload - @classmethod - def new(cls, u: DVector) -> DTrans: - r""" - @brief Creates a transformation using a displacement only - - @param u The displacement - """ - @overload - @classmethod - def new(cls, c: DTrans, u: Optional[DVector] = ...) -> DTrans: - r""" - @brief Creates a transformation from another transformation plus a displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - @classmethod - def new(cls, x: float, y: float) -> DTrans: - r""" - @brief Creates a transformation using a displacement given as two coordinates - - @param x The horizontal displacement - @param y The vertical displacement - """ - @overload - @classmethod - def new(cls, c: DTrans, x: float, y: float) -> DTrans: - r""" - @brief Creates a transformation from another transformation plus a displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - @classmethod - def new(cls, rot: int, mirr: Optional[bool] = ..., u: Optional[DVector] = ...) -> DTrans: - r""" - @brief Creates a transformation using angle and mirror flag - - The sequence of operations is: mirroring at x axis, - rotation, application of displacement. - - @param rot The rotation in units of 90 degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - @classmethod - def new(cls, rot: int, mirr: bool, x: float, y: float) -> DTrans: - r""" - @brief Creates a transformation using angle and mirror flag and two coordinate values for displacement - - The sequence of operations is: mirroring at x axis, - rotation, application of displacement. - - @param rot The rotation in units of 90 degree - @param mirrx True, if mirrored at x axis - @param x The horizontal displacement - @param y The vertical displacement - """ - def __copy__(self) -> DTrans: + def __copy__(self) -> TrapezoidDecompositionMode: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> DTrans: + def __deepcopy__(self) -> TrapezoidDecompositionMode: r""" @brief Creates a copy of self """ + @overload def __eq__(self, other: object) -> bool: r""" - @brief Tests for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. + @brief Compares an enum with an integer value """ @overload - def __init__(self) -> None: + def __eq__(self, other: object) -> bool: r""" - @brief Creates a unit transformation + @brief Compares two enums """ @overload - def __init__(self, trans: Trans) -> None: + def __init__(self, i: int) -> None: r""" - @brief Creates a floating-point coordinate transformation from an integer coordinate transformation - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + @brief Creates an enum from an integer value """ @overload - def __init__(self, u: DVector) -> None: + def __init__(self, s: str) -> None: r""" - @brief Creates a transformation using a displacement only - - @param u The displacement + @brief Creates an enum from a string value """ @overload - def __init__(self, c: DTrans, u: Optional[DVector] = ...) -> None: + def __lt__(self, other: TrapezoidDecompositionMode) -> bool: r""" - @brief Creates a transformation from another transformation plus a displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement + @brief Returns true if the first enum is less (in the enum symbol order) than the second """ @overload - def __init__(self, x: float, y: float) -> None: + def __lt__(self, other: int) -> bool: r""" - @brief Creates a transformation using a displacement given as two coordinates - - @param x The horizontal displacement - @param y The vertical displacement + @brief Returns true if the enum is less (in the enum symbol order) than the integer value """ @overload - def __init__(self, c: DTrans, x: float, y: float) -> None: - r""" - @brief Creates a transformation from another transformation plus a displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, rot: int, mirr: Optional[bool] = ..., u: Optional[DVector] = ...) -> None: - r""" - @brief Creates a transformation using angle and mirror flag - - The sequence of operations is: mirroring at x axis, - rotation, application of displacement. - - @param rot The rotation in units of 90 degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, rot: int, mirr: bool, x: float, y: float) -> None: - r""" - @brief Creates a transformation using angle and mirror flag and two coordinate values for displacement - - The sequence of operations is: mirroring at x axis, - rotation, application of displacement. - - @param rot The rotation in units of 90 degree - @param mirrx True, if mirrored at x axis - @param x The horizontal displacement - @param y The vertical displacement - """ - def __lt__(self, other: DTrans) -> bool: - r""" - @brief Provides a 'less' criterion for sorting - This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. - """ - @overload - def __mul__(self, box: DBox) -> DBox: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, d: float) -> float: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. - """ - @overload - def __mul__(self, edge: DEdge) -> DEdge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __mul__(self, path: DPath) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, polygon: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, t: DTrans) -> DTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, text: DText) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, v: DVector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ def __ne__(self, other: object) -> bool: r""" - @brief Tests for inequality + @brief Compares an enum with an integer for inequality """ @overload - def __rmul__(self, box: DBox) -> DBox: + def __ne__(self, other: object) -> bool: r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. + @brief Compares two enums for inequality """ - @overload - def __rmul__(self, d: float) -> float: + def __repr__(self) -> str: r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. + @brief Converts an enum to a visual string """ - @overload - def __rmul__(self, edge: DEdge) -> DEdge: + def __str__(self) -> str: r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __rmul__(self, path: DPath) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, polygon: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, text: DText) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, v: DVector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - def __str__(self, dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion - If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. + @brief Gets the symbolic string from an enum """ def _create(self) -> None: r""" @@ -35319,7 +50948,7 @@ class DTrans: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: DTrans) -> None: + def assign(self, other: TrapezoidDecompositionMode) -> None: r""" @brief Assigns another object to self """ @@ -35328,20 +50957,6 @@ class DTrans: @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. """ - def ctrans(self, d: float) -> float: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. - """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -35354,32 +50969,13 @@ class DTrans: 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. """ - def dup(self) -> DTrans: + def dup(self) -> TrapezoidDecompositionMode: r""" @brief Creates a copy of self """ - def hash(self) -> int: + def inspect(self) -> str: r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> DTrans: - r""" - @brief Inverts the transformation (in place) - - Inverts the transformation and replaces this object by the - inverted one. - - @return The inverted transformation - """ - def inverted(self) -> DTrans: - r""" - @brief Returns the inverted transformation - Returns the inverted transformation - - @return The inverted transformation + @brief Converts an enum to a visual string """ def is_const_object(self) -> bool: r""" @@ -35387,749 +50983,84 @@ class DTrans: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def is_mirror(self) -> bool: + def to_i(self) -> int: r""" - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. + @brief Gets the integer value from the enum """ - def to_itype(self, dbu: Optional[float] = ...) -> Trans: + def to_s(self) -> str: r""" - @brief Converts the transformation to an integer coordinate transformation - - The database unit can be specified to translate the floating-point coordinate transformation in micron units to an integer-coordinate transformation in database units. The transformation's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self, dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion - If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - @overload - def trans(self, box: DBox) -> DBox: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, edge: DEdge) -> DEdge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def trans(self, path: DPath) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, polygon: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, text: DText) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, v: DVector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector + @brief Gets the symbolic string from an enum """ -class DCplxTrans: +class Utils: r""" - @brief A complex transformation + @brief This namespace provides a collection of utility functions - A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary - angle and a displacement. This is also the order, the operations are applied. - - A complex transformation provides a superset of the simple transformation. - In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. - This version can transform floating-point coordinate objects. - - Complex transformations are extensions of the simple transformation classes (\DTrans in that case) and behave similar. - - Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: - - @code - # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree - # and displacement of 10 in x and 20 units in y direction: - t = RBA::CplxTrans::new(1.5, 90, false, 10.0, 20.0) - t.to_s # r90 *1.5 10,20 - # compute the inverse: - t.inverted.to_s # r270 *0.666666667 -13,7 - # Combine with another displacement (applied after that): - (RBA::CplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 - # Transform a point: - t.trans(RBA::Point::new(100, 200)).to_s # -290,170 - @/code - - See @The Database API@ for more details about the database objects. - """ - M0: ClassVar[DCplxTrans] - r""" - @brief A constant giving "mirrored at the x-axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M135: ClassVar[DCplxTrans] - r""" - @brief A constant giving "mirrored at the 135 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M45: ClassVar[DCplxTrans] - r""" - @brief A constant giving "mirrored at the 45 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M90: ClassVar[DCplxTrans] - r""" - @brief A constant giving "mirrored at the y (90 degree) axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R0: ClassVar[DCplxTrans] - r""" - @brief A constant giving "unrotated" (unit) transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R180: ClassVar[DCplxTrans] - r""" - @brief A constant giving "rotated by 180 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R270: ClassVar[DCplxTrans] - r""" - @brief A constant giving "rotated by 270 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R90: ClassVar[DCplxTrans] - r""" - @brief A constant giving "rotated by 90 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - angle: float - r""" - Getter: - @brief Gets the angle - - Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. - - @return The rotation angle this transformation provides in degree units (0..360 deg). - - Setter: - @brief Sets the angle - @param a The new angle - See \angle for a description of that attribute. - """ - disp: DVector - r""" - Getter: - @brief Gets the displacement - - Setter: - @brief Sets the displacement - @param u The new displacement - """ - mag: float - r""" - Getter: - @brief Gets the magnification - - Setter: - @brief Sets the magnification - @param m The new magnification - """ - mirror: bool - r""" - Getter: - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - Setter: - @brief Sets the mirror flag - "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + This class has been introduced in version 0.27. """ @classmethod - def from_itrans(cls, trans: CplxTrans) -> DCplxTrans: + def new(cls) -> Utils: r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. - """ - @classmethod - def from_s(cls, s: str) -> DCplxTrans: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. + @brief Creates a new object of this class """ @overload @classmethod - def new(cls) -> DCplxTrans: + def spline_interpolation(cls, control_points: Sequence[DPoint], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]: r""" - @brief Creates a unit transformation + @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. + + This is the version for non-rational splines. It lacks the weight vector. """ @overload @classmethod - def new(cls, m: float) -> DCplxTrans: + def spline_interpolation(cls, control_points: Sequence[DPoint], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]: r""" - @brief Creates a transformation from a magnification + @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - Creates a magnifying transformation without displacement and rotation given the magnification m. + The knot vector needs to be padded and it's size must fulfill the condition: + + @code + knots.size == control_points.size + degree + 1 + @/code + + The accuracy parameters allow tuning the resolution of the curve to target a specific approximation quality. + "relative_accuracy" gives the accuracy relative to the local curvature radius, "absolute" accuracy gives the + absolute accuracy. "accuracy" is the allowed deviation of polygon approximation from the ideal curve. + The computed curve should meet at least one of the accuracy criteria. Setting both limits to a very small + value will result in long run times and a large number of points returned. + + This function supports both rational splines (NURBS) and non-rational splines. The latter use weights of + 1.0 for each point. + + The return value is a list of points forming a path which approximates the spline curve. """ @overload @classmethod - def new(cls, t: DTrans) -> DCplxTrans: + def spline_interpolation(cls, control_points: Sequence[Point], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]: r""" - @brief Creates a transformation from a simple transformation alone + @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + This is the version for integer-coordinate points for non-rational splines. """ @overload @classmethod - def new(cls, trans: CplxTrans) -> DCplxTrans: + def spline_interpolation(cls, control_points: Sequence[Point], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]: r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour + @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. + This is the version for integer-coordinate points. """ - @overload - @classmethod - def new(cls, trans: ICplxTrans) -> DCplxTrans: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - @classmethod - def new(cls, trans: VCplxTrans) -> DCplxTrans: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - @classmethod - def new(cls, u: DVector) -> DCplxTrans: - r""" - @brief Creates a transformation from a displacement - - Creates a transformation with a displacement only. - - This method has been added in version 0.25. - """ - @overload - @classmethod - def new(cls, t: DTrans, m: float) -> DCplxTrans: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - @classmethod - def new(cls, x: float, y: float) -> DCplxTrans: - r""" - @brief Creates a transformation from a x and y displacement - - This constructor will create a transformation with the specified displacement - but no rotation. - - @param x The x displacement - @param y The y displacement - """ - @overload - @classmethod - def new(cls, c: DCplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> DCplxTrans: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - @classmethod - def new(cls, c: DCplxTrans, m: float, x: float, y: float) -> DCplxTrans: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - @classmethod - def new(cls, mag: float, rot: float, mirrx: bool, u: DVector) -> DCplxTrans: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - @classmethod - def new(cls, mag: float, rot: float, mirrx: bool, x: float, y: float) -> DCplxTrans: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param x The x displacement - @param y The y displacement - """ - def __copy__(self) -> DCplxTrans: + def __copy__(self) -> Utils: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> DCplxTrans: + def __deepcopy__(self) -> Utils: r""" @brief Creates a copy of self """ - def __eq__(self, other: object) -> bool: - r""" - @brief Tests for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - @overload def __init__(self) -> None: r""" - @brief Creates a unit transformation - """ - @overload - def __init__(self, m: float) -> None: - r""" - @brief Creates a transformation from a magnification - - Creates a magnifying transformation without displacement and rotation given the magnification m. - """ - @overload - def __init__(self, t: DTrans) -> None: - r""" - @brief Creates a transformation from a simple transformation alone - - Creates a magnifying transformation from a simple transformation and a magnification of 1.0. - """ - @overload - def __init__(self, trans: CplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_itrans'. - """ - @overload - def __init__(self, trans: ICplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, trans: VCplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, u: DVector) -> None: - r""" - @brief Creates a transformation from a displacement - - Creates a transformation with a displacement only. - - This method has been added in version 0.25. - """ - @overload - def __init__(self, t: DTrans, m: float) -> None: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - def __init__(self, x: float, y: float) -> None: - r""" - @brief Creates a transformation from a x and y displacement - - This constructor will create a transformation with the specified displacement - but no rotation. - - @param x The x displacement - @param y The y displacement - """ - @overload - def __init__(self, c: DCplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - def __init__(self, c: DCplxTrans, m: float, x: float, y: float) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, u: DVector) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, x: float, y: float) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param x The x displacement - @param y The y displacement - """ - def __lt__(self, other: DCplxTrans) -> bool: - r""" - @brief Provides a 'less' criterion for sorting - This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. - """ - @overload - def __mul__(self, box: DBox) -> DBox: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, d: float) -> float: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. - """ - @overload - def __mul__(self, edge: DEdge) -> DEdge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __mul__(self, p: DVector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __mul__(self, path: DPath) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, polygon: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, t: CplxTrans) -> CplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, t: DCplxTrans) -> DCplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, text: DText) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Tests for inequality - """ - @overload - def __rmul__(self, box: DBox) -> DBox: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, d: float) -> float: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. - """ - @overload - def __rmul__(self, edge: DEdge) -> DEdge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __rmul__(self, p: DVector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __rmul__(self, path: DPath) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, polygon: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, text: DText) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __str__(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion - If 'lazy' is true, some parts are omitted when not required. - If a DBU is given, the output units will be micrometers. - - The lazy and DBU arguments have been added in version 0.27.6. + @brief Creates a new object of this class """ def _create(self) -> None: r""" @@ -36168,7 +51099,7 @@ class DCplxTrans: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: DCplxTrans) -> None: + def assign(self, other: Utils) -> None: r""" @brief Assigns another object to self """ @@ -36177,20 +51108,6 @@ class DCplxTrans: @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. """ - def ctrans(self, d: float) -> float: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. - """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -36203,849 +51120,105 @@ class DCplxTrans: 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. """ - def dup(self) -> DCplxTrans: + def dup(self) -> Utils: r""" @brief Creates a copy of self """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> DCplxTrans: - r""" - @brief Inverts the transformation (in place) - - Inverts the transformation and replaces this transformation by it's - inverted one. - - @return The inverted transformation - """ - def inverted(self) -> DCplxTrans: - r""" - @brief Returns the inverted transformation - - Returns the inverted transformation. This method does not modify the transformation. - - @return The inverted transformation - """ - def is_complex(self) -> bool: - r""" - @brief Returns true if the transformation is a complex one - - If this predicate is false, the transformation can safely be converted to a simple transformation. - Otherwise, this conversion will be lossy. - The predicate value is equivalent to 'is_mag || !is_ortho'. - - This method has been introduced in version 0.27.5. - """ def is_const_object(self) -> bool: r""" @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. """ - def is_mag(self) -> bool: - r""" - @brief Tests, if the transformation is a magnifying one - This is the recommended test for checking if the transformation represents - a magnification. - """ - def is_mirror(self) -> bool: - r""" - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - """ - def is_ortho(self) -> bool: - r""" - @brief Tests, if the transformation is an orthogonal transformation - - If the rotation is by a multiple of 90 degree, this method will return true. - """ - def is_unity(self) -> bool: - r""" - @brief Tests, whether this is a unit transformation - """ - def rot(self) -> int: - r""" - @brief Returns the respective simple transformation equivalent rotation code if possible - - If this transformation is orthogonal (is_ortho () == true), then this method - will return the corresponding fixpoint transformation, not taking into account - magnification and displacement. If the transformation is not orthogonal, the result - reflects the quadrant the rotation goes into. - """ - def s_trans(self) -> DTrans: - r""" - @brief Extracts the simple transformation part - - The simple transformation part does not reflect magnification or arbitrary angles. - Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. - """ - def to_itrans(self, dbu: Optional[float] = ...) -> ICplxTrans: - r""" - @brief Converts the transformation to another transformation with integer input and output coordinates - - The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion - If 'lazy' is true, some parts are omitted when not required. - If a DBU is given, the output units will be micrometers. - - The lazy and DBU arguments have been added in version 0.27.6. - """ - def to_trans(self) -> CplxTrans: - r""" - @brief Converts the transformation to another transformation with integer input coordinates - - This method has been introduced in version 0.25. - """ - def to_vtrans(self, dbu: Optional[float] = ...) -> VCplxTrans: - r""" - @brief Converts the transformation to another transformation with integer output coordinates - - The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - @overload - def trans(self, box: DBox) -> DBox: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, edge: DEdge) -> DEdge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, p: DPoint) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def trans(self, p: DVector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def trans(self, path: DPath) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, polygon: DPolygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, text: DText) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - -class CplxTrans: +class VAlign: r""" - @brief A complex transformation - - A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary - angle and a displacement. This is also the order, the operations are applied. - This version can transform integer-coordinate objects into floating-point coordinate objects. This is the generic and exact case, for example for non-integer magnifications. - - Complex transformations are extensions of the simple transformation classes (\Trans or \DTrans in that case) and behave similar. - - Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: - - @code - # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree - # and displacement of 10 in x and 20 units in y direction: - t = RBA::DCplxTrans::new(1.5, 90, false, 10.0, 20.0) - t.to_s # r90 *1.5 10,20 - # compute the inverse: - t.inverted.to_s # r270 *0.666666667 -13,7 - # Combine with another displacement (applied after that): - (RBA::DCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 - # Transform a point: - t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170 - @/code - - The inverse type of the CplxTrans type is VCplxTrans which will transform floating-point to integer coordinate objects. Transformations of CplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator CplxTrans * ICplxTrans is allowed (output types of ICplxTrans and input of CplxTrans are identical) while CplxTrans * DCplxTrans is not. - See @The Database API@ for more details about the database objects. + @brief This class represents the vertical alignment modes. + This enum has been introduced in version 0.28. """ - M0: ClassVar[CplxTrans] + NoVAlign: ClassVar[VAlign] r""" - @brief A constant giving "mirrored at the x-axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. + @brief Undefined vertical alignment """ - M135: ClassVar[CplxTrans] + VAlignBottom: ClassVar[VAlign] r""" - @brief A constant giving "mirrored at the 135 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. + @brief Bottom vertical alignment """ - M45: ClassVar[CplxTrans] + VAlignCenter: ClassVar[VAlign] r""" - @brief A constant giving "mirrored at the 45 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. + @brief Centered vertical alignment """ - M90: ClassVar[CplxTrans] + VAlignTop: ClassVar[VAlign] r""" - @brief A constant giving "mirrored at the y (90 degree) axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R0: ClassVar[CplxTrans] - r""" - @brief A constant giving "unrotated" (unit) transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R180: ClassVar[CplxTrans] - r""" - @brief A constant giving "rotated by 180 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R270: ClassVar[CplxTrans] - r""" - @brief A constant giving "rotated by 270 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R90: ClassVar[CplxTrans] - r""" - @brief A constant giving "rotated by 90 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - angle: float - r""" - Getter: - @brief Gets the angle - - Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. - - @return The rotation angle this transformation provides in degree units (0..360 deg). - - Setter: - @brief Sets the angle - @param a The new angle - See \angle for a description of that attribute. - """ - disp: DVector - r""" - Getter: - @brief Gets the displacement - - Setter: - @brief Sets the displacement - @param u The new displacement - """ - mag: float - r""" - Getter: - @brief Gets the magnification - - Setter: - @brief Sets the magnification - @param m The new magnification - """ - mirror: bool - r""" - Getter: - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - Setter: - @brief Sets the mirror flag - "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag + @brief Top vertical alignment """ + @overload @classmethod - def from_dtrans(cls, trans: DCplxTrans) -> CplxTrans: + def new(cls, i: int) -> VAlign: r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. - """ - @classmethod - def from_s(cls, s: str) -> CplxTrans: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. + @brief Creates an enum from an integer value """ @overload @classmethod - def new(cls) -> CplxTrans: + def new(cls, s: str) -> VAlign: r""" - @brief Creates a unit transformation + @brief Creates an enum from a string value """ - @overload - @classmethod - def new(cls, m: float) -> CplxTrans: - r""" - @brief Creates a transformation from a magnification - - Creates a magnifying transformation without displacement and rotation given the magnification m. - """ - @overload - @classmethod - def new(cls, t: Trans) -> CplxTrans: - r""" - @brief Creates a transformation from a simple transformation alone - - Creates a magnifying transformation from a simple transformation and a magnification of 1.0. - """ - @overload - @classmethod - def new(cls, trans: DCplxTrans) -> CplxTrans: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. - """ - @overload - @classmethod - def new(cls, trans: ICplxTrans) -> CplxTrans: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - @classmethod - def new(cls, trans: VCplxTrans) -> CplxTrans: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - @classmethod - def new(cls, u: DVector) -> CplxTrans: - r""" - @brief Creates a transformation from a displacement - - Creates a transformation with a displacement only. - - This method has been added in version 0.25. - """ - @overload - @classmethod - def new(cls, t: Trans, m: float) -> CplxTrans: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - @classmethod - def new(cls, x: float, y: float) -> CplxTrans: - r""" - @brief Creates a transformation from a x and y displacement - - This constructor will create a transformation with the specified displacement - but no rotation. - - @param x The x displacement - @param y The y displacement - """ - @overload - @classmethod - def new(cls, c: CplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> CplxTrans: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - @classmethod - def new(cls, c: CplxTrans, m: float, x: int, y: int) -> CplxTrans: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - @classmethod - def new(cls, mag: float, rot: float, mirrx: bool, u: DVector) -> CplxTrans: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - @classmethod - def new(cls, mag: float, rot: float, mirrx: bool, x: float, y: float) -> CplxTrans: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param x The x displacement - @param y The y displacement - """ - def __copy__(self) -> CplxTrans: + def __copy__(self) -> VAlign: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> CplxTrans: + def __deepcopy__(self) -> VAlign: r""" @brief Creates a copy of self """ + @overload def __eq__(self, other: object) -> bool: r""" - @brief Tests for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. + @brief Compares two enums """ @overload - def __init__(self) -> None: + def __eq__(self, other: object) -> bool: r""" - @brief Creates a unit transformation + @brief Compares an enum with an integer value """ @overload - def __init__(self, m: float) -> None: + def __init__(self, i: int) -> None: r""" - @brief Creates a transformation from a magnification - - Creates a magnifying transformation without displacement and rotation given the magnification m. + @brief Creates an enum from an integer value """ @overload - def __init__(self, t: Trans) -> None: + def __init__(self, s: str) -> None: r""" - @brief Creates a transformation from a simple transformation alone - - Creates a magnifying transformation from a simple transformation and a magnification of 1.0. + @brief Creates an enum from a string value """ @overload - def __init__(self, trans: DCplxTrans) -> None: + def __lt__(self, other: VAlign) -> bool: r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. + @brief Returns true if the first enum is less (in the enum symbol order) than the second """ @overload - def __init__(self, trans: ICplxTrans) -> None: + def __lt__(self, other: int) -> bool: r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. + @brief Returns true if the enum is less (in the enum symbol order) than the integer value """ @overload - def __init__(self, trans: VCplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, u: DVector) -> None: - r""" - @brief Creates a transformation from a displacement - - Creates a transformation with a displacement only. - - This method has been added in version 0.25. - """ - @overload - def __init__(self, t: Trans, m: float) -> None: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - def __init__(self, x: float, y: float) -> None: - r""" - @brief Creates a transformation from a x and y displacement - - This constructor will create a transformation with the specified displacement - but no rotation. - - @param x The x displacement - @param y The y displacement - """ - @overload - def __init__(self, c: CplxTrans, m: Optional[float] = ..., u: Optional[DVector] = ...) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - def __init__(self, c: CplxTrans, m: float, x: int, y: int) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, u: DVector) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, x: float, y: float) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param x The x displacement - @param y The y displacement - """ - def __lt__(self, other: CplxTrans) -> bool: - r""" - @brief Provides a 'less' criterion for sorting - This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. - """ - @overload - def __mul__(self, box: Box) -> DBox: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, d: int) -> float: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. - """ - @overload - def __mul__(self, edge: Edge) -> DEdge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, p: Point) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __mul__(self, p: Vector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __mul__(self, path: Path) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, polygon: Polygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, t: CplxTrans) -> CplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, t: ICplxTrans) -> CplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, t: VCplxTrans) -> DCplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, text: Text) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ def __ne__(self, other: object) -> bool: r""" - @brief Tests for inequality + @brief Compares an enum with an integer for inequality """ @overload - def __rmul__(self, box: Box) -> DBox: + def __ne__(self, other: object) -> bool: r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. + @brief Compares two enums for inequality """ - @overload - def __rmul__(self, d: int) -> float: + def __repr__(self) -> str: r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. + @brief Converts an enum to a visual string """ - @overload - def __rmul__(self, edge: Edge) -> DEdge: + def __str__(self) -> str: r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, p: Point) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __rmul__(self, p: Vector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __rmul__(self, path: Path) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, polygon: Polygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, text: Text) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __str__(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion - If 'lazy' is true, some parts are omitted when not required. - If a DBU is given, the output units will be micrometers. - - The lazy and DBU arguments have been added in version 0.27.6. + @brief Gets the symbolic string from an enum """ def _create(self) -> None: r""" @@ -37084,7 +51257,7 @@ class CplxTrans: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: CplxTrans) -> None: + def assign(self, other: VAlign) -> None: r""" @brief Assigns another object to self """ @@ -37093,20 +51266,6 @@ class CplxTrans: @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. """ - def ctrans(self, d: int) -> float: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. - """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -37119,43 +51278,13 @@ class CplxTrans: 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. """ - def dup(self) -> CplxTrans: + def dup(self) -> VAlign: r""" @brief Creates a copy of self """ - def hash(self) -> int: + def inspect(self) -> str: r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> CplxTrans: - r""" - @brief Inverts the transformation (in place) - - Inverts the transformation and replaces this transformation by it's - inverted one. - - @return The inverted transformation - """ - def inverted(self) -> VCplxTrans: - r""" - @brief Returns the inverted transformation - - Returns the inverted transformation. This method does not modify the transformation. - - @return The inverted transformation - """ - def is_complex(self) -> bool: - r""" - @brief Returns true if the transformation is a complex one - - If this predicate is false, the transformation can safely be converted to a simple transformation. - Otherwise, this conversion will be lossy. - The predicate value is equivalent to 'is_mag || !is_ortho'. - - This method has been introduced in version 0.27.5. + @brief Converts an enum to a visual string """ def is_const_object(self) -> bool: r""" @@ -37163,1074 +51292,13 @@ class CplxTrans: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def is_mag(self) -> bool: + def to_i(self) -> int: r""" - @brief Tests, if the transformation is a magnifying one - - This is the recommended test for checking if the transformation represents - a magnification. + @brief Gets the integer value from the enum """ - def is_mirror(self) -> bool: + def to_s(self) -> str: r""" - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - """ - def is_ortho(self) -> bool: - r""" - @brief Tests, if the transformation is an orthogonal transformation - - If the rotation is by a multiple of 90 degree, this method will return true. - """ - def is_unity(self) -> bool: - r""" - @brief Tests, whether this is a unit transformation - """ - def rot(self) -> int: - r""" - @brief Returns the respective simple transformation equivalent rotation code if possible - - If this transformation is orthogonal (is_ortho () == true), then this method - will return the corresponding fixpoint transformation, not taking into account - magnification and displacement. If the transformation is not orthogonal, the result - reflects the quadrant the rotation goes into. - """ - def s_trans(self) -> Trans: - r""" - @brief Extracts the simple transformation part - - The simple transformation part does not reflect magnification or arbitrary angles. - Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. - """ - def to_itrans(self, dbu: Optional[float] = ...) -> ICplxTrans: - r""" - @brief Converts the transformation to another transformation with integer input and output coordinates - - The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion - If 'lazy' is true, some parts are omitted when not required. - If a DBU is given, the output units will be micrometers. - - The lazy and DBU arguments have been added in version 0.27.6. - """ - def to_trans(self) -> DCplxTrans: - r""" - @brief Converts the transformation to another transformation with floating-point input coordinates - - This method has been introduced in version 0.25. - """ - def to_vtrans(self, dbu: Optional[float] = ...) -> VCplxTrans: - r""" - @brief Converts the transformation to another transformation with integer output and floating-point input coordinates - - The database unit can be specified to translate the floating-point coordinate displacement in micron units to an integer-coordinate displacement in database units. The displacement's' coordinates will be divided by the database unit. - - This method has been introduced in version 0.25. - """ - @overload - def trans(self, box: Box) -> DBox: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, edge: Edge) -> DEdge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, p: Point) -> DPoint: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def trans(self, p: Vector) -> DVector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def trans(self, path: Path) -> DPath: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, polygon: Polygon) -> DPolygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, text: Text) -> DText: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - -class ICplxTrans: - r""" - @brief A complex transformation - - A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary - angle and a displacement. This is also the order, the operations are applied. - This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact. - - Complex transformations are extensions of the simple transformation classes (\Trans in that case) and behave similar. - - Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code: - - @code - # Create a transformation that applies a magnification of 1.5, a rotation by 90 degree - # and displacement of 10 in x and 20 units in y direction: - t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) - t.to_s # r90 *1.5 10,20 - # compute the inverse: - t.inverted.to_s # r270 *0.666666667 -13,7 - # Combine with another displacement (applied after that): - (RBA::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 - # Transform a point: - t.trans(RBA::Point::new(100, 200)).to_s # -290,170 - @/code - - This class has been introduced in version 0.18. - - See @The Database API@ for more details about the database objects. - """ - M0: ClassVar[ICplxTrans] - r""" - @brief A constant giving "mirrored at the x-axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M135: ClassVar[ICplxTrans] - r""" - @brief A constant giving "mirrored at the 135 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M45: ClassVar[ICplxTrans] - r""" - @brief A constant giving "mirrored at the 45 degree axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - M90: ClassVar[ICplxTrans] - r""" - @brief A constant giving "mirrored at the y (90 degree) axis" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R0: ClassVar[ICplxTrans] - r""" - @brief A constant giving "unrotated" (unit) transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R180: ClassVar[ICplxTrans] - r""" - @brief A constant giving "rotated by 180 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R270: ClassVar[ICplxTrans] - r""" - @brief A constant giving "rotated by 270 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - R90: ClassVar[ICplxTrans] - r""" - @brief A constant giving "rotated by 90 degree counterclockwise" transformation - The previous integer constant has been turned into a transformation in version 0.25. - """ - angle: float - r""" - Getter: - @brief Gets the angle - - Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. \Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree. - - @return The rotation angle this transformation provides in degree units (0..360 deg). - - Setter: - @brief Sets the angle - @param a The new angle - See \angle for a description of that attribute. - """ - disp: Vector - r""" - Getter: - @brief Gets the displacement - - Setter: - @brief Sets the displacement - @param u The new displacement - """ - mag: float - r""" - Getter: - @brief Gets the magnification - - Setter: - @brief Sets the magnification - @param m The new magnification - """ - mirror: bool - r""" - Getter: - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - Setter: - @brief Sets the mirror flag - "mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.@param m The new mirror flag - """ - @classmethod - def from_dtrans(cls, trans: DCplxTrans) -> ICplxTrans: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. - """ - @classmethod - def from_s(cls, s: str) -> ICplxTrans: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - - This method has been added in version 0.23. - """ - @classmethod - def from_trans(cls, trans: CplxTrans) -> ICplxTrans: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_trans'. - """ - @overload - @classmethod - def new(cls) -> ICplxTrans: - r""" - @brief Creates a unit transformation - """ - @overload - @classmethod - def new(cls, m: float) -> ICplxTrans: - r""" - @brief Creates a transformation from a magnification - - Creates a magnifying transformation without displacement and rotation given the magnification m. - """ - @overload - @classmethod - def new(cls, t: Trans) -> ICplxTrans: - r""" - @brief Creates a transformation from a simple transformation alone - - Creates a magnifying transformation from a simple transformation and a magnification of 1.0. - """ - @overload - @classmethod - def new(cls, trans: CplxTrans) -> ICplxTrans: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_trans'. - """ - @overload - @classmethod - def new(cls, trans: DCplxTrans) -> ICplxTrans: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. - """ - @overload - @classmethod - def new(cls, trans: VCplxTrans) -> ICplxTrans: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - @classmethod - def new(cls, u: Vector) -> ICplxTrans: - r""" - @brief Creates a transformation from a displacement - - Creates a transformation with a displacement only. - - This method has been added in version 0.25. - """ - @overload - @classmethod - def new(cls, t: Trans, m: float) -> ICplxTrans: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - @classmethod - def new(cls, x: int, y: int) -> ICplxTrans: - r""" - @brief Creates a transformation from a x and y displacement - - This constructor will create a transformation with the specified displacement - but no rotation. - - @param x The x displacement - @param y The y displacement - """ - @overload - @classmethod - def new(cls, c: ICplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> ICplxTrans: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - @classmethod - def new(cls, c: ICplxTrans, m: float, x: int, y: int) -> ICplxTrans: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - @classmethod - def new(cls, mag: float, rot: float, mirrx: bool, u: Vector) -> ICplxTrans: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - @classmethod - def new(cls, mag: float, rot: float, mirrx: bool, x: int, y: int) -> ICplxTrans: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param x The x displacement - @param y The y displacement - """ - def __copy__(self) -> ICplxTrans: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> ICplxTrans: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Tests for equality - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a unit transformation - """ - @overload - def __init__(self, m: float) -> None: - r""" - @brief Creates a transformation from a magnification - - Creates a magnifying transformation without displacement and rotation given the magnification m. - """ - @overload - def __init__(self, t: Trans) -> None: - r""" - @brief Creates a transformation from a simple transformation alone - - Creates a magnifying transformation from a simple transformation and a magnification of 1.0. - """ - @overload - def __init__(self, trans: CplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_trans'. - """ - @overload - def __init__(self, trans: DCplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dtrans'. - """ - @overload - def __init__(self, trans: VCplxTrans) -> None: - r""" - @brief Creates a floating-point coordinate transformation from another coordinate flavour - - This constructor has been introduced in version 0.25. - """ - @overload - def __init__(self, u: Vector) -> None: - r""" - @brief Creates a transformation from a displacement - - Creates a transformation with a displacement only. - - This method has been added in version 0.25. - """ - @overload - def __init__(self, t: Trans, m: float) -> None: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - def __init__(self, x: int, y: int) -> None: - r""" - @brief Creates a transformation from a x and y displacement - - This constructor will create a transformation with the specified displacement - but no rotation. - - @param x The x displacement - @param y The y displacement - """ - @overload - def __init__(self, c: ICplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - def __init__(self, c: ICplxTrans, m: float, x: int, y: int) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, u: Vector) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, x: int, y: int) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param x The x displacement - @param y The y displacement - """ - def __lt__(self, other: ICplxTrans) -> bool: - r""" - @brief Provides a 'less' criterion for sorting - This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. - """ - @overload - def __mul__(self, box: Box) -> Box: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, d: int) -> int: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. - """ - @overload - def __mul__(self, edge: Edge) -> Edge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, p: Point) -> Point: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __mul__(self, p: Vector) -> Vector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __mul__(self, path: Path) -> Path: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, polygon: Polygon) -> Polygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __mul__(self, t: ICplxTrans) -> ICplxTrans: - r""" - @brief Returns the concatenated transformation - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, t: VCplxTrans) -> VCplxTrans: - r""" - @brief Multiplication (concatenation) of transformations - - The * operator returns self*t ("t is applied before this transformation"). - - @param t The transformation to apply before - @return The modified transformation - """ - @overload - def __mul__(self, text: Text) -> Text: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Tests for inequality - """ - @overload - def __rmul__(self, box: Box) -> Box: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, d: int) -> int: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. - """ - @overload - def __rmul__(self, edge: Edge) -> Edge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, p: Point) -> Point: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def __rmul__(self, p: Vector) -> Vector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def __rmul__(self, path: Path) -> Path: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, polygon: Polygon) -> Polygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def __rmul__(self, text: Text) -> Text: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. - """ - def __str__(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion - If 'lazy' is true, some parts are omitted when not required. - If a DBU is given, the output units will be micrometers. - - The lazy and DBU arguments have been added in version 0.27.6. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ICplxTrans) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def ctrans(self, d: int) -> int: - r""" - @brief Transforms a distance - - The "ctrans" method transforms the given distance. - e = t(d). For the simple transformations, there - is no magnification and no modification of the distance - therefore. - - @param d The distance to transform - @return The transformed distance - - The product '*' has been added as a synonym in version 0.28. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> ICplxTrans: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given transformation. This method enables transformations as hash keys. - - This method has been introduced in version 0.25. - """ - def invert(self) -> ICplxTrans: - r""" - @brief Inverts the transformation (in place) - - Inverts the transformation and replaces this transformation by it's - inverted one. - - @return The inverted transformation - """ - def inverted(self) -> ICplxTrans: - r""" - @brief Returns the inverted transformation - - Returns the inverted transformation. This method does not modify the transformation. - - @return The inverted transformation - """ - def is_complex(self) -> bool: - r""" - @brief Returns true if the transformation is a complex one - - If this predicate is false, the transformation can safely be converted to a simple transformation. - Otherwise, this conversion will be lossy. - The predicate value is equivalent to 'is_mag || !is_ortho'. - - This method has been introduced in version 0.27.5. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_mag(self) -> bool: - r""" - @brief Tests, if the transformation is a magnifying one - - This is the recommended test for checking if the transformation represents - a magnification. - """ - def is_mirror(self) -> bool: - r""" - @brief Gets the mirror flag - - If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the \angle property. - """ - def is_ortho(self) -> bool: - r""" - @brief Tests, if the transformation is an orthogonal transformation - - If the rotation is by a multiple of 90 degree, this method will return true. - """ - def is_unity(self) -> bool: - r""" - @brief Tests, whether this is a unit transformation - """ - def rot(self) -> int: - r""" - @brief Returns the respective simple transformation equivalent rotation code if possible - - If this transformation is orthogonal (is_ortho () == true), then this method - will return the corresponding fixpoint transformation, not taking into account - magnification and displacement. If the transformation is not orthogonal, the result - reflects the quadrant the rotation goes into. - """ - def s_trans(self) -> Trans: - r""" - @brief Extracts the simple transformation part - - The simple transformation part does not reflect magnification or arbitrary angles. - Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. - """ - def to_itrans(self, dbu: Optional[float] = ...) -> DCplxTrans: - r""" - @brief Converts the transformation to another transformation with floating-point input and output coordinates - - The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. - - This method has been introduced in version 0.25. - """ - def to_s(self, lazy: Optional[bool] = ..., dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion - If 'lazy' is true, some parts are omitted when not required. - If a DBU is given, the output units will be micrometers. - - The lazy and DBU arguments have been added in version 0.27.6. - """ - def to_trans(self) -> VCplxTrans: - r""" - @brief Converts the transformation to another transformation with floating-point input coordinates - - This method has been introduced in version 0.25. - """ - def to_vtrans(self, dbu: Optional[float] = ...) -> CplxTrans: - r""" - @brief Converts the transformation to another transformation with floating-point output coordinates - - The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. - - This method has been introduced in version 0.25. - """ - @overload - def trans(self, box: Box) -> Box: - r""" - @brief Transforms a box - - 't*box' or 't.trans(box)' is equivalent to box.transformed(t). - - @param box The box to transform - @return The transformed box - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, edge: Edge) -> Edge: - r""" - @brief Transforms an edge - - 't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). - - @param edge The edge to transform - @return The transformed edge - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, p: Point) -> Point: - r""" - @brief Transforms a point - - The "trans" method or the * operator transforms the given point. - q = t(p) - - The * operator has been introduced in version 0.25. - - @param p The point to transform - @return The transformed point - """ - @overload - def trans(self, p: Vector) -> Vector: - r""" - @brief Transforms a vector - - The "trans" method or the * operator transforms the given vector. - w = t(v) - - Vector transformation has been introduced in version 0.25. - - @param v The vector to transform - @return The transformed vector - """ - @overload - def trans(self, path: Path) -> Path: - r""" - @brief Transforms a path - - 't*path' or 't.trans(path)' is equivalent to path.transformed(t). - - @param path The path to transform - @return The transformed path - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, polygon: Polygon) -> Polygon: - r""" - @brief Transforms a polygon - - 't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). - - @param polygon The polygon to transform - @return The transformed polygon - - This convenience method has been introduced in version 0.25. - """ - @overload - def trans(self, text: Text) -> Text: - r""" - @brief Transforms a text - - 't*text' or 't.trans(text)' is equivalent to text.transformed(t). - - @param text The text to transform - @return The transformed text - - This convenience method has been introduced in version 0.25. + @brief Gets the symbolic string from an enum """ class VCplxTrans: @@ -38362,6 +51430,33 @@ class VCplxTrans: """ @overload @classmethod + def new(cls, c: VCplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> VCplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + @classmethod + def new(cls, c: VCplxTrans, m: float, x: float, y: float) -> VCplxTrans: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload + @classmethod def new(cls, m: float) -> VCplxTrans: r""" @brief Creates a transformation from a magnification @@ -38370,6 +51465,35 @@ class VCplxTrans: """ @overload @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, u: Vector) -> VCplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + @classmethod + def new(cls, mag: float, rot: float, mirrx: bool, x: int, y: int) -> VCplxTrans: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + @overload + @classmethod def new(cls, t: DTrans) -> VCplxTrans: r""" @brief Creates a transformation from a simple transformation alone @@ -38378,6 +51502,14 @@ class VCplxTrans: """ @overload @classmethod + def new(cls, t: DTrans, m: float) -> VCplxTrans: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload + @classmethod def new(cls, trans: CplxTrans) -> VCplxTrans: r""" @brief Creates a floating-point coordinate transformation from another coordinate flavour @@ -38406,14 +51538,6 @@ class VCplxTrans: """ @overload @classmethod - def new(cls, t: DTrans, m: float) -> VCplxTrans: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload - @classmethod def new(cls, x: int, y: int) -> VCplxTrans: r""" @brief Creates a transformation from a x and y displacement @@ -38421,62 +51545,6 @@ class VCplxTrans: This constructor will create a transformation with the specified displacement but no rotation. - @param x The x displacement - @param y The y displacement - """ - @overload - @classmethod - def new(cls, c: VCplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> VCplxTrans: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - @classmethod - def new(cls, c: VCplxTrans, m: float, x: float, y: float) -> VCplxTrans: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - @classmethod - def new(cls, mag: float, rot: float, mirrx: bool, u: Vector) -> VCplxTrans: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - @classmethod - def new(cls, mag: float, rot: float, mirrx: bool, x: int, y: int) -> VCplxTrans: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis @param x The x displacement @param y The y displacement """ @@ -38505,6 +51573,31 @@ class VCplxTrans: @brief Creates a unit transformation """ @overload + def __init__(self, c: VCplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param u The Additional displacement + """ + @overload + def __init__(self, c: VCplxTrans, m: float, x: float, y: float) -> None: + r""" + @brief Creates a transformation from another transformation plus a magnification and displacement + + Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. + + This variant has been introduced in version 0.25. + + @param c The original transformation + @param x The Additional displacement (x) + @param y The Additional displacement (y) + """ + @overload def __init__(self, m: float) -> None: r""" @brief Creates a transformation from a magnification @@ -38512,6 +51605,33 @@ class VCplxTrans: Creates a magnifying transformation without displacement and rotation given the magnification m. """ @overload + def __init__(self, mag: float, rot: float, mirrx: bool, u: Vector) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param u The displacement + """ + @overload + def __init__(self, mag: float, rot: float, mirrx: bool, x: int, y: int) -> None: + r""" + @brief Creates a transformation using magnification, angle, mirror flag and displacement + + The sequence of operations is: magnification, mirroring at x axis, + rotation, application of displacement. + + @param mag The magnification + @param rot The rotation angle in units of degree + @param mirrx True, if mirrored at x axis + @param x The x displacement + @param y The y displacement + """ + @overload def __init__(self, t: DTrans) -> None: r""" @brief Creates a transformation from a simple transformation alone @@ -38519,6 +51639,13 @@ class VCplxTrans: Creates a magnifying transformation from a simple transformation and a magnification of 1.0. """ @overload + def __init__(self, t: DTrans, m: float) -> None: + r""" + @brief Creates a transformation from a simple transformation and a magnification + + Creates a magnifying transformation from a simple transformation and a magnification. + """ + @overload def __init__(self, trans: CplxTrans) -> None: r""" @brief Creates a floating-point coordinate transformation from another coordinate flavour @@ -38543,13 +51670,6 @@ class VCplxTrans: This method has been added in version 0.25. """ @overload - def __init__(self, t: DTrans, m: float) -> None: - r""" - @brief Creates a transformation from a simple transformation and a magnification - - Creates a magnifying transformation from a simple transformation and a magnification. - """ - @overload def __init__(self, x: int, y: int) -> None: r""" @brief Creates a transformation from a x and y displacement @@ -38557,58 +51677,6 @@ class VCplxTrans: This constructor will create a transformation with the specified displacement but no rotation. - @param x The x displacement - @param y The y displacement - """ - @overload - def __init__(self, c: VCplxTrans, m: Optional[float] = ..., u: Optional[Vector] = ...) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param u The Additional displacement - """ - @overload - def __init__(self, c: VCplxTrans, m: float, x: float, y: float) -> None: - r""" - @brief Creates a transformation from another transformation plus a magnification and displacement - - Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. - - This variant has been introduced in version 0.25. - - @param c The original transformation - @param x The Additional displacement (x) - @param y The Additional displacement (y) - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, u: Vector) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis - @param u The displacement - """ - @overload - def __init__(self, mag: float, rot: float, mirrx: bool, x: int, y: int) -> None: - r""" - @brief Creates a transformation using magnification, angle, mirror flag and displacement - - The sequence of operations is: magnification, mirroring at x axis, - rotation, application of displacement. - - @param mag The magnification - @param rot The rotation angle in units of degree - @param mirrx True, if mirrored at x axis @param x The x displacement @param y The y displacement """ @@ -39133,493 +52201,6 @@ class VCplxTrans: This convenience method has been introduced in version 0.25. """ -class Utils: - r""" - @brief This namespace provides a collection of utility functions - - This class has been introduced in version 0.27. - """ - @classmethod - def new(cls) -> Utils: - r""" - @brief Creates a new object of this class - """ - @overload - @classmethod - def spline_interpolation(cls, control_points: Sequence[DPoint], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]: - r""" - @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - - This is the version for non-rational splines. It lacks the weight vector. - """ - @overload - @classmethod - def spline_interpolation(cls, control_points: Sequence[Point], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]: - r""" - @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - - This is the version for integer-coordinate points for non-rational splines. - """ - @overload - @classmethod - def spline_interpolation(cls, control_points: Sequence[DPoint], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[DPoint]: - r""" - @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - - The knot vector needs to be padded and it's size must fulfill the condition: - - @code - knots.size == control_points.size + degree + 1 - @/code - - The accuracy parameters allow tuning the resolution of the curve to target a specific approximation quality. - "relative_accuracy" gives the accuracy relative to the local curvature radius, "absolute" accuracy gives the - absolute accuracy. "accuracy" is the allowed deviation of polygon approximation from the ideal curve. - The computed curve should meet at least one of the accuracy criteria. Setting both limits to a very small - value will result in long run times and a large number of points returned. - - This function supports both rational splines (NURBS) and non-rational splines. The latter use weights of - 1.0 for each point. - - The return value is a list of points forming a path which approximates the spline curve. - """ - @overload - @classmethod - def spline_interpolation(cls, control_points: Sequence[Point], weights: Sequence[float], degree: int, knots: Sequence[float], relative_accuracy: float, absolute_accuracy: float) -> List[Point]: - r""" - @brief This function computes the Spline curve for a given set of control points (point, weight), degree and knots. - - This is the version for integer-coordinate points. - """ - def __copy__(self) -> Utils: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Utils: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Utils) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> Utils: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class DVector: - r""" - @brief A vector class with double (floating-point) coordinates - A vector is a distance in cartesian, 2 dimensional space. A vector is given by two coordinates (x and y) and represents the distance between two points. Being the distance, transformations act differently on vectors: the displacement is not applied. - Vectors are not geometrical objects by itself. But they are frequently used in the database API for various purposes. Other than the integer variant (\Vector), points with floating-point coordinates can represent fractions of a database unit or vectors in physical (micron) units. - - This class has been introduced in version 0.25. - - See @The Database API@ for more details about the database objects. - """ - x: float - r""" - Getter: - @brief Accessor to the x coordinate - - Setter: - @brief Write accessor to the x coordinate - """ - y: float - r""" - Getter: - @brief Accessor to the y coordinate - - Setter: - @brief Write accessor to the y coordinate - """ - @classmethod - def from_s(cls, s: str) -> DVector: - r""" - @brief Creates an object from a string - Creates the object from a string representation (as returned by \to_s) - """ - @overload - @classmethod - def new(cls) -> DVector: - r""" - @brief Default constructor: creates a null vector with coordinates (0,0) - """ - @overload - @classmethod - def new(cls, p: DPoint) -> DVector: - r""" - @brief Default constructor: creates a vector from a point - This constructor is equivalent to computing p-point(0,0). - This method has been introduced in version 0.25. - """ - @overload - @classmethod - def new(cls, vector: Vector) -> DVector: - r""" - @brief Creates a floating-point coordinate vector from an integer coordinate vector - """ - @overload - @classmethod - def new(cls, x: float, y: float) -> DVector: - r""" - @brief Constructor for a vector from two coordinate values - - """ - @overload - def __add__(self, p: DPoint) -> DPoint: - r""" - @brief Adds a vector and a point - - - Returns the point p shifted by the vector. - """ - @overload - def __add__(self, v: DVector) -> DVector: - r""" - @brief Adds two vectors - - - Adds vector v to self by adding the coordinates. - """ - def __copy__(self) -> DVector: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DVector: - r""" - @brief Creates a copy of self - """ - def __eq__(self, v: object) -> bool: - r""" - @brief Equality test operator - - """ - def __hash__(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given vector. This method enables vectors as hash keys. - - This method has been introduced in version 0.25. - """ - def __imul__(self, f: float) -> DVector: - r""" - @brief Scaling by some factor - - - Scales object in place. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor: creates a null vector with coordinates (0,0) - """ - @overload - def __init__(self, p: DPoint) -> None: - r""" - @brief Default constructor: creates a vector from a point - This constructor is equivalent to computing p-point(0,0). - This method has been introduced in version 0.25. - """ - @overload - def __init__(self, vector: Vector) -> None: - r""" - @brief Creates a floating-point coordinate vector from an integer coordinate vector - """ - @overload - def __init__(self, x: float, y: float) -> None: - r""" - @brief Constructor for a vector from two coordinate values - - """ - def __itruediv__(self, d: float) -> DVector: - r""" - @brief Division by some divisor - - - Divides the object in place. All coordinates are divided with the given divisor and if necessary rounded. - """ - def __lt__(self, v: DVector) -> bool: - r""" - @brief "less" comparison operator - - - This operator is provided to establish a sorting - order - """ - @overload - def __mul__(self, f: float) -> DVector: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __mul__(self, v: DVector) -> float: - r""" - @brief Computes the scalar product between self and the given vector - - - The scalar product of a and b is defined as: vp = ax*bx+ay*by. - """ - def __ne__(self, v: object) -> bool: - r""" - @brief Inequality test operator - - """ - def __neg__(self) -> DVector: - r""" - @brief Compute the negative of a vector - - - Returns a new vector with -x,-y. - """ - @overload - def __rmul__(self, f: float) -> DVector: - r""" - @brief Scaling by some factor - - - Returns the scaled object. All coordinates are multiplied with the given factor and if necessary rounded. - """ - @overload - def __rmul__(self, v: DVector) -> float: - r""" - @brief Computes the scalar product between self and the given vector - - - The scalar product of a and b is defined as: vp = ax*bx+ay*by. - """ - def __str__(self, dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion - If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - def __sub__(self, v: DVector) -> DVector: - r""" - @brief Subtract two vectors - - - Subtract vector v from self by subtracting the coordinates. - """ - def __truediv__(self, d: float) -> DVector: - r""" - @brief Division by some divisor - - - Returns the scaled object. All coordinates are divided with the given divisor and if necessary rounded. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def abs(self) -> float: - r""" - @brief Returns the length of the vector - 'abs' is an alias provided for compatibility with the former point type. - """ - def assign(self, other: DVector) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DVector: - r""" - @brief Creates a copy of self - """ - def hash(self) -> int: - r""" - @brief Computes a hash value - Returns a hash value for the given vector. This method enables vectors as hash keys. - - This method has been introduced in version 0.25. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def length(self) -> float: - r""" - @brief Returns the length of the vector - 'abs' is an alias provided for compatibility with the former point type. - """ - def sprod(self, v: DVector) -> float: - r""" - @brief Computes the scalar product between self and the given vector - - - The scalar product of a and b is defined as: vp = ax*bx+ay*by. - """ - def sprod_sign(self, v: DVector) -> int: - r""" - @brief Computes the scalar product between self and the given vector and returns a value indicating the sign of the product - - - @return 1 if the scalar product is positive, 0 if it is zero and -1 if it is negative. - """ - def sq_abs(self) -> float: - r""" - @brief The square length of the vector - 'sq_abs' is an alias provided for compatibility with the former point type. - """ - def sq_length(self) -> float: - r""" - @brief The square length of the vector - 'sq_abs' is an alias provided for compatibility with the former point type. - """ - def to_itype(self, dbu: Optional[float] = ...) -> Vector: - r""" - @brief Converts the point to an integer coordinate point - - The database unit can be specified to translate the floating-point coordinate vector in micron units to an integer-coordinate vector in database units. The vector's' coordinates will be divided by the database unit. - """ - def to_p(self) -> DPoint: - r""" - @brief Turns the vector into a point - This method returns the point resulting from adding the vector to (0,0). - This method has been introduced in version 0.25. - """ - def to_s(self, dbu: Optional[float] = ...) -> str: - r""" - @brief String conversion - If a DBU is given, the output units will be micrometers. - - The DBU argument has been added in version 0.27.6. - """ - def vprod(self, v: DVector) -> float: - r""" - @brief Computes the vector product between self and the given vector - - - The vector product of a and b is defined as: vp = ax*by-ay*bx. - """ - def vprod_sign(self, v: DVector) -> int: - r""" - @brief Computes the vector product between self and the given vector and returns a value indicating the sign of the product - - - @return 1 if the vector product is positive, 0 if it is zero and -1 if it is negative. - """ - class Vector: r""" @brief A integer vector class @@ -39967,11646 +52548,3 @@ class Vector: @return 1 if the vector product is positive, 0 if it is zero and -1 if it is negative. """ -class LayoutDiff: - r""" - @brief The layout compare tool - - The layout compare tool is a facility to quickly compare layouts and derive events that give details about the differences. The events are basically emitted following a certain order: - - @ul - @li General configuration events (database units, layers ...) @/li - @li \on_begin_cell @/li - @li \on_begin_inst_differences (if the instances differ) @/li - @li details about instance differences (if \Verbose flag is given) @/li - @li \on_end_inst_differences (if the instances differ) @/li - @li \on_begin_layer @/li - @li \on_begin_polygon_differences (if the polygons differ) @/li - @li details about polygon differences (if \Verbose flag is given) @/li - @li \on_end_polygon_differences (if the polygons differ) @/li - @li other shape difference events (paths, boxes, ...) @/li - @li \on_end_layer @/li - @li repeated layer event groups @/li - @li \on_end_cell @/li - @li repeated cell event groups @/li - @/ul - - To use the diff facility, create a \LayoutDiff object and call the \compare_layout or \compare_cell method: - - @code - lya = ... # layout A - lyb = ... # layout B - - diff = RBA::LayoutDiff::new - diff.on_polygon_in_a_only do |poly| - puts "Polygon in A: #{diff.cell_a.name}@#{diff.layer_info_a.to_s}: #{poly.to_s}" - end - diff.on_polygon_in_b_only do |poly| - puts "Polygon in A: #{diff.cell_b.name}@#{diff.layer_info_b.to_s}: #{poly.to_s}" - end - diff.compare(lya, lyb, RBA::LayoutDiff::Verbose + RBA::LayoutDiff::NoLayerNames) - @/code - """ - BoxesAsPolygons: ClassVar[int] - r""" - @brief Compare boxes to polygons - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - DontSummarizeMissingLayers: ClassVar[int] - r""" - @brief Don't summarize missing layers - If this mode is present, missing layers are treated as empty ones and every shape on the other layer will be reported as difference. - - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - FlattenArrayInsts: ClassVar[int] - r""" - @brief Compare array instances instance by instance - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - NoLayerNames: ClassVar[int] - r""" - @brief Do not compare layer names - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - NoProperties: ClassVar[int] - r""" - @brief Ignore properties - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - NoTextDetails: ClassVar[int] - r""" - @brief Ignore text details (font, size, presentation) - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - NoTextOrientation: ClassVar[int] - r""" - @brief Ignore text orientation - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - PathsAsPolygons: ClassVar[int] - r""" - @brief Compare paths to polygons - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - Silent: ClassVar[int] - r""" - @brief Silent compare - just report whether the layouts are identical - Silent mode will not issue any signals, but instead the return value of the \LayoutDiff#compare method will indicate whether the layouts are identical. In silent mode, the compare method will return immediately once a difference has been encountered so that mode may be much faster than the full compare. - - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - SmartCellMapping: ClassVar[int] - r""" - @brief Derive smart cell mapping instead of name mapping (available only if top cells are specified) - Smart cell mapping is only effective currently when cells are compared (with \LayoutDiff#compare with cells instead of layout objects). - - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - Verbose: ClassVar[int] - r""" - @brief Enables verbose mode (gives details about the differences) - - See the event descriptions for details about the differences in verbose and non-verbose mode. - - This constant can be used for the flags parameter of \compare_layouts and \compare_cells. It can be compared with other constants to form a flag set. - """ - on_bbox_differs: None - r""" - Getter: - @brief This signal indicates a difference in the bounding boxes of two cells - This signal is only emitted in non-verbose mode (without \Verbose flag) as a summarizing cell property. In verbose mode detailed events will be issued indicating the differences. - - Setter: - @brief This signal indicates a difference in the bounding boxes of two cells - This signal is only emitted in non-verbose mode (without \Verbose flag) as a summarizing cell property. In verbose mode detailed events will be issued indicating the differences. - """ - on_begin_box_differences: None - r""" - Getter: - @brief This signal indicates differences in the boxes on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for boxes that are different between the two layouts. - Setter: - @brief This signal indicates differences in the boxes on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for boxes that are different between the two layouts. - """ - on_begin_cell: None - r""" - Getter: - @brief This signal initiates the sequence of events for a cell pair - All cell specific events happen between \begin_cell_event and \end_cell_event signals. - Setter: - @brief This signal initiates the sequence of events for a cell pair - All cell specific events happen between \begin_cell_event and \end_cell_event signals. - """ - on_begin_edge_differences: None - r""" - Getter: - @brief This signal indicates differences in the edges on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edges that are different between the two layouts. - Setter: - @brief This signal indicates differences in the edges on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edges that are different between the two layouts. - """ - on_begin_edge_pair_differences: None - r""" - Getter: - @brief This signal indicates differences in the edge pairs on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edge pairs that are different between the two layouts. - This event has been introduced in version 0.28. - Setter: - @brief This signal indicates differences in the edge pairs on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for edge pairs that are different between the two layouts. - This event has been introduced in version 0.28. - """ - on_begin_inst_differences: None - r""" - Getter: - @brief This signal indicates differences in the cell instances - In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\instance_in_a_only_event and \instance_in_b_only_event). - Setter: - @brief This signal indicates differences in the cell instances - In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\instance_in_a_only_event and \instance_in_b_only_event). - """ - on_begin_layer: None - r""" - Getter: - @brief This signal indicates differences on the given layer - In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\polygon_in_a_only_event, \polygon_in_b_only_event and similar). - Setter: - @brief This signal indicates differences on the given layer - In verbose mode (see \Verbose) more events will follow that indicate the instances that are present only in the first and second layout (\polygon_in_a_only_event, \polygon_in_b_only_event and similar). - """ - on_begin_path_differences: None - r""" - Getter: - @brief This signal indicates differences in the paths on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for paths that are different between the two layouts. - Setter: - @brief This signal indicates differences in the paths on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for paths that are different between the two layouts. - """ - on_begin_polygon_differences: None - r""" - Getter: - @brief This signal indicates differences in the polygons on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for polygons that are different between the two layouts. - Setter: - @brief This signal indicates differences in the polygons on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for polygons that are different between the two layouts. - """ - on_begin_text_differences: None - r""" - Getter: - @brief This signal indicates differences in the texts on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for texts that are different between the two layouts. - Setter: - @brief This signal indicates differences in the texts on the current layer - The current layer is indicated by the \begin_layer_event signal or can be obtained from the diff object through \LayoutDiff#layer_info_a, \LayoutDiff#layer_index_a, \LayoutDiff#layer_info_b and \LayoutDiff#layer_index_b. In verbose mode (see \Verbose flag) more signals will be emitted for texts that are different between the two layouts. - """ - on_box_in_a_only: None - r""" - Getter: - @brief This signal indicates a box that is present in the first layout only - Setter: - @brief This signal indicates a box that is present in the first layout only - """ - on_box_in_b_only: None - r""" - Getter: - @brief This signal indicates a box that is present in the second layout only - Setter: - @brief This signal indicates a box that is present in the second layout only - """ - on_cell_in_a_only: None - r""" - Getter: - @brief This signal indicates that the given cell is only present in the first layout - - Setter: - @brief This signal indicates that the given cell is only present in the first layout - """ - on_cell_in_b_only: None - r""" - Getter: - @brief This signal indicates that the given cell is only present in the second layout - - Setter: - @brief This signal indicates that the given cell is only present in the second layout - """ - on_cell_name_differs: None - r""" - Getter: - @brief This signal indicates a difference in the cell names - This signal is emitted in 'smart cell mapping' mode (see \SmartCellMapping) if two cells are considered identical, but have different names. - Setter: - @brief This signal indicates a difference in the cell names - This signal is emitted in 'smart cell mapping' mode (see \SmartCellMapping) if two cells are considered identical, but have different names. - """ - on_dbu_differs: None - r""" - Getter: - @brief This signal indicates a difference in the database units of the layouts - - Setter: - @brief This signal indicates a difference in the database units of the layouts - """ - on_edge_in_a_only: None - r""" - Getter: - @brief This signal indicates an edge that is present in the first layout only - Setter: - @brief This signal indicates an edge that is present in the first layout only - """ - on_edge_in_b_only: None - r""" - Getter: - @brief This signal indicates an edge that is present in the second layout only - Setter: - @brief This signal indicates an edge that is present in the second layout only - """ - on_edge_pair_in_a_only: None - r""" - Getter: - @brief This signal indicates an edge pair that is present in the first layout only - This event has been introduced in version 0.28. - Setter: - @brief This signal indicates an edge pair that is present in the first layout only - This event has been introduced in version 0.28. - """ - on_edge_pair_in_b_only: None - r""" - Getter: - @brief This signal indicates an edge pair that is present in the second layout only - This event has been introduced in version 0.28. - Setter: - @brief This signal indicates an edge pair that is present in the second layout only - This event has been introduced in version 0.28. - """ - on_end_box_differences: None - r""" - Getter: - @brief This signal indicates the end of sequence of box differences - - Setter: - @brief This signal indicates the end of sequence of box differences - """ - on_end_cell: None - r""" - Getter: - @brief This signal indicates the end of a sequence of signals for a specific cell - - Setter: - @brief This signal indicates the end of a sequence of signals for a specific cell - """ - on_end_edge_differences: None - r""" - Getter: - @brief This signal indicates the end of sequence of edge differences - - Setter: - @brief This signal indicates the end of sequence of edge differences - """ - on_end_edge_pair_differences: None - r""" - Getter: - @brief This signal indicates the end of sequence of edge pair differences - - This event has been introduced in version 0.28. - Setter: - @brief This signal indicates the end of sequence of edge pair differences - - This event has been introduced in version 0.28. - """ - on_end_inst_differences: None - r""" - Getter: - @brief This signal finishes a sequence of detailed instance difference events - - Setter: - @brief This signal finishes a sequence of detailed instance difference events - """ - on_end_layer: None - r""" - Getter: - @brief This signal indicates the end of a sequence of signals for a specific layer - - Setter: - @brief This signal indicates the end of a sequence of signals for a specific layer - """ - on_end_path_differences: None - r""" - Getter: - @brief This signal indicates the end of sequence of path differences - - Setter: - @brief This signal indicates the end of sequence of path differences - """ - on_end_polygon_differences: None - r""" - Getter: - @brief This signal indicates the end of sequence of polygon differences - - Setter: - @brief This signal indicates the end of sequence of polygon differences - """ - on_end_text_differences: None - r""" - Getter: - @brief This signal indicates the end of sequence of text differences - - Setter: - @brief This signal indicates the end of sequence of text differences - """ - on_instance_in_a_only: None - r""" - Getter: - @brief This signal indicates an instance that is present only in the first layout - This event is only emitted in verbose mode (\Verbose flag). - Setter: - @brief This signal indicates an instance that is present only in the first layout - This event is only emitted in verbose mode (\Verbose flag). - """ - on_instance_in_b_only: None - r""" - Getter: - @brief This signal indicates an instance that is present only in the second layout - This event is only emitted in verbose mode (\Verbose flag). - Setter: - @brief This signal indicates an instance that is present only in the second layout - This event is only emitted in verbose mode (\Verbose flag). - """ - on_layer_in_a_only: None - r""" - Getter: - @brief This signal indicates a layer that is present only in the first layout - - Setter: - @brief This signal indicates a layer that is present only in the first layout - """ - on_layer_in_b_only: None - r""" - Getter: - @brief This signal indicates a layer that is present only in the second layout - - Setter: - @brief This signal indicates a layer that is present only in the second layout - """ - on_layer_name_differs: None - r""" - Getter: - @brief This signal indicates a difference in the layer names - - Setter: - @brief This signal indicates a difference in the layer names - """ - on_path_in_a_only: None - r""" - Getter: - @brief This signal indicates a path that is present in the first layout only - Setter: - @brief This signal indicates a path that is present in the first layout only - """ - on_path_in_b_only: None - r""" - Getter: - @brief This signal indicates a path that is present in the second layout only - Setter: - @brief This signal indicates a path that is present in the second layout only - """ - on_per_layer_bbox_differs: None - r""" - Getter: - @brief This signal indicates differences in the per-layer bounding boxes of the current cell - - Setter: - @brief This signal indicates differences in the per-layer bounding boxes of the current cell - """ - on_polygon_in_a_only: None - r""" - Getter: - @brief This signal indicates a polygon that is present in the first layout only - - Setter: - @brief This signal indicates a polygon that is present in the first layout only - """ - on_polygon_in_b_only: None - r""" - Getter: - @brief This signal indicates a polygon that is present in the second layout only - - Setter: - @brief This signal indicates a polygon that is present in the second layout only - """ - on_text_in_a_only: None - r""" - Getter: - @brief This signal indicates a text that is present in the first layout only - Setter: - @brief This signal indicates a text that is present in the first layout only - """ - on_text_in_b_only: None - r""" - Getter: - @brief This signal indicates a text that is present in the second layout only - Setter: - @brief This signal indicates a text that is present in the second layout only - """ - @classmethod - def new(cls) -> LayoutDiff: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> LayoutDiff: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> LayoutDiff: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: LayoutDiff) -> None: - r""" - @brief Assigns another object to self - """ - def cell_a(self) -> Cell: - r""" - @brief Gets the current cell for the first layout - This attribute is the current cell and is set after \on_begin_cell and reset after \on_end_cell. - """ - def cell_b(self) -> Cell: - r""" - @brief Gets the current cell for the second layout - This attribute is the current cell and is set after \on_begin_cell and reset after \on_end_cell. - """ - @overload - def compare(self, a: Cell, b: Cell, flags: Optional[int] = ..., tolerance: Optional[int] = ...) -> bool: - r""" - @brief Compares two cells - - Compares layer definitions, cells, instances and shapes and properties of two layout hierarchies starting from the given cells. - Cells are identified by name. Only layers with valid layer and datatype are compared. - Several flags can be specified as a bitwise or combination of the constants. - - @param a The first top cell - @param b The second top cell - @param flags Flags to use for the comparison - @param tolerance A coordinate tolerance to apply (0: exact match, 1: one DBU tolerance is allowed ...) - - @return True, if the cells are identical - """ - @overload - def compare(self, a: Layout, b: Layout, flags: Optional[int] = ..., tolerance: Optional[int] = ...) -> bool: - r""" - @brief Compares two layouts - - Compares layer definitions, cells, instances and shapes and properties. - Cells are identified by name. Only layers with valid layer and datatype are compared. - Several flags can be specified as a bitwise or combination of the constants. - - @param a The first input layout - @param b The second input layout - @param flags Flags to use for the comparison - @param tolerance A coordinate tolerance to apply (0: exact match, 1: one DBU tolerance is allowed ...) - - @return True, if the layouts are identical - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> LayoutDiff: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def layer_index_a(self) -> int: - r""" - @brief Gets the current layer for the first layout - This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. - """ - def layer_index_b(self) -> int: - r""" - @brief Gets the current layer for the second layout - This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. - """ - def layer_info_a(self) -> LayerInfo: - r""" - @brief Gets the current layer properties for the first layout - This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. - """ - def layer_info_b(self) -> LayerInfo: - r""" - @brief Gets the current layer properties for the second layout - This attribute is the current cell and is set after \on_begin_layer and reset after \on_end_layer. - """ - def layout_a(self) -> Layout: - r""" - @brief Gets the first layout the difference detector runs on - """ - def layout_b(self) -> Layout: - r""" - @brief Gets the second layout the difference detector runs on - """ - -class TextGenerator: - r""" - @brief A text generator class - - A text generator is basically a way to produce human-readable text for labelling layouts. It's similar to the Basic.TEXT PCell, but more convenient to use in a scripting context. - - Generators can be constructed from font files (or resources) or one of the registered generators can be used. - - To create a generator from a font file proceed this way: - @code - gen = RBA::TextGenerator::new - gen.load_from_file("myfont.gds") - region = gen.text("A TEXT", 0.001) - @/code - - This code produces a RBA::Region with a database unit of 0.001 micron. This region can be fed into a \Shapes container to place it into a cell for example. - - By convention the font files must have two to three layers: - - @ul - @li 1/0 for the actual data @/li - @li 2/0 for the borders @/li - @li 3/0 for an optional additional background @/li - @/ul - - Currently, all glyphs must be bottom-left aligned at 0, 0. The - border must be drawn in at least one glyph cell. The border is taken - as the overall bbox of all borders. - - The glyph cells must be named with a single character or "nnn" where "d" is the - ASCII code of the character (i.e. "032" for space). Allowed ASCII codes are 32 through 127. - If a lower-case "a" character is defined, lower-case letters are supported. - Otherwise, lowercase letters are mapped to uppercase letters. - - Undefined characters are left blank in the output. - - A comment cell can be defined ("COMMENT") which must hold one text in layer 1 - stating the comment, and additional descriptions such as line width: - - @ul - @li "line_width=": Specifies the intended line width in micron units @/li - @li "design_grid=": Specifies the intended design grid in micron units @/li - @li any other text: The description string @/li - @/ul - - Generators can be picked form a list of predefined generator. See \generators, \default_generator and \generator_by_name for picking a generator from the list. - - This class has been introduced in version 0.25. - """ - @classmethod - def default_generator(cls) -> TextGenerator: - r""" - @brief Gets the default text generator (a standard font) - This method delivers the default generator or nil if no such generator is installed. - """ - @classmethod - def font_paths(cls) -> List[str]: - r""" - @brief Gets the paths where to look for font files - See \set_font_paths for a description of this function. - - This method has been introduced in version 0.27.4. - """ - @classmethod - def generator_by_name(cls, name: str) -> TextGenerator: - r""" - @brief Gets the text generator for a given name - This method delivers the generator with the given name or nil if no such generator is registered. - """ - @classmethod - def generators(cls) -> List[TextGenerator]: - r""" - @brief Gets the generators registered in the system - This method delivers a list of generator objects that can be used to create texts. - """ - @classmethod - def new(cls) -> TextGenerator: - r""" - @brief Creates a new object of this class - """ - @classmethod - def set_font_paths(cls, arg0: Sequence[str]) -> None: - r""" - @brief Sets the paths where to look for font files - This function sets the paths where to look for font files. After setting such a path, each font found will render a specific generator. The generator can be found under the font file's name. As the text generator is also the basis for the Basic.TEXT PCell, using this function also allows configuring custom fonts for this library cell. - - This method has been introduced in version 0.27.4. - """ - def __copy__(self) -> TextGenerator: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> TextGenerator: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: TextGenerator) -> None: - r""" - @brief Assigns another object to self - """ - def background(self) -> Box: - r""" - @brief Gets the background rectangle of each glyph in the generator's database units - The background rectangle is the one that is used as background for inverted rendering. A version that delivers this value in micrometer units is \dbackground. - """ - def create(self) -> None: - r""" - @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. - """ - def dbackground(self) -> DBox: - r""" - @brief Gets the background rectangle in micron units - The background rectangle is the one that is used as background for inverted rendering. - """ - def dbu(self) -> float: - r""" - @brief Gets the basic database unit the design of the glyphs was made - This database unit the basic resolution of the glyphs. - """ - def ddesign_grid(self) -> float: - r""" - @brief Gets the design grid of the glyphs in micron units - The design grid is the basic grid used when designing the glyphs. In most cases this grid is bigger than the database unit. - """ - def description(self) -> str: - r""" - @brief Gets the description text of the generator - The generator's description text is a human-readable text that is used to identify the generator (aka 'font') in user interfaces. - """ - def design_grid(self) -> int: - r""" - @brief Gets the design grid of the glyphs in the generator's database units - The design grid is the basic grid used when designing the glyphs. In most cases this grid is bigger than the database unit. A version that delivers this value in micrometer units is \ddesign_grid. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dheight(self) -> float: - r""" - @brief Gets the design height of the glyphs in micron units - The height is the height of the rectangle occupied by each character. - """ - def dline_width(self) -> float: - r""" - @brief Gets the line width of the glyphs in micron units - The line width is the intended (not necessarily precisely) line width of typical character lines (such as the bar of an 'I'). - """ - def dup(self) -> TextGenerator: - r""" - @brief Creates a copy of self - """ - def dwidth(self) -> float: - r""" - @brief Gets the design width of the glyphs in micron units - The width is the width of the rectangle occupied by each character. - """ - def glyph(self, char: str) -> Region: - r""" - @brief Gets the glyph of the given character as a region - The region represents the glyph's outline and is delivered in the generator's database units .A more elaborate way to getting the text's outline is \text. - """ - def height(self) -> int: - r""" - @brief Gets the design height of the glyphs in the generator's database units - The height is the height of the rectangle occupied by each character. A version that delivers this value in micrometer units is \dheight. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def line_width(self) -> int: - r""" - @brief Gets the line width of the glyphs in the generator's database units - The line width is the intended (not necessarily precisely) line width of typical character lines (such as the bar of an 'I'). A version that delivers this value in micrometer units is \dline_width. - """ - def load_from_file(self, path: str) -> None: - r""" - @brief Loads the given file into the generator - See the description of the class how the layout data is read. - """ - def load_from_resource(self, resource_path: str) -> None: - r""" - @brief Loads the given resource data (as layout data) into the generator - The resource path has to start with a colon, i.e. ':/my/resource.gds'. See the description of the class how the layout data is read. - """ - def name(self) -> str: - r""" - @brief Gets the name of the generator - The generator's name is the basic key by which the generator is identified. - """ - def text(self, text: str, target_dbu: float, mag: Optional[float] = ..., inv: Optional[bool] = ..., bias: Optional[float] = ..., char_spacing: Optional[float] = ..., line_spacing: Optional[float] = ...) -> Region: - r""" - @brief Gets the rendered text as a region - @param text The text string - @param target_dbu The database unit for which to produce the text - @param mag The magnification (1.0 for original size) - @param inv inverted rendering: if true, the glyphs are rendered inverse with the background box as the outer bounding box - @param bias An additional bias to be applied (happens before inversion, can be negative) - @param char_spacing Additional space between characters (in micron units) - @param line_spacing Additional space between lines (in micron units) - Various options can be specified to control the appearance of the text. See the description of the parameters. It's important to specify the target database unit in \target_dbu to indicate what database unit shall be used to create the output for. - """ - def width(self) -> int: - r""" - @brief Gets the design height of the glyphs in the generator's database units - The width is the width of the rectangle occupied by each character. A version that delivers this value in micrometer units is \dwidth. - """ - -class NetlistObject: - r""" - @brief The base class for some netlist objects. - The main purpose of this class is to supply user properties for netlist objects. - - This class has been introduced in version 0.26.2 - """ - @classmethod - def new(cls) -> NetlistObject: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetlistObject: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetlistObject: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetlistObject) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetlistObject: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def property(self, key: Any) -> Any: - r""" - @brief Gets the property value for the given key or nil if there is no value with this key. - """ - def property_keys(self) -> List[Any]: - r""" - @brief Gets the keys for the properties stored in this object. - """ - def set_property(self, key: Any, value: Any) -> None: - r""" - @brief Sets the property value for the given key. - Use a nil value to erase the property with this key. - """ - -class Pin(NetlistObject): - r""" - @brief A pin of a circuit. - Pin objects are used to describe the outgoing pins of a circuit. To create a new pin of a circuit, use \Circuit#create_pin. - - This class has been added in version 0.26. - """ - def _assign(self, other: NetlistObject) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> Pin: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def expanded_name(self) -> str: - r""" - @brief Gets the expanded name of the pin. - The expanded name is the name or a generic identifier made from the ID if the name is empty. - """ - def id(self) -> int: - r""" - @brief Gets the ID of the pin. - """ - def name(self) -> str: - r""" - @brief Gets the name of the pin. - """ - -class DeviceReconnectedTerminal: - r""" - @brief Describes a terminal rerouting in combined devices. - Combined devices are implemented as a generalization of the device abstract concept in \Device. For combined devices, multiple \DeviceAbstract references are present. To support different combination schemes, device-to-abstract routing is supported. Parallel combinations will route all outer terminals to corresponding terminals of all device abstracts (because of terminal swapping these may be different ones). - - This object describes one route to an abstract's terminal. The device index is 0 for the main device abstract and 1 for the first combined device abstract. - - This class has been introduced in version 0.26. - """ - device_index: int - r""" - Getter: - @brief The device abstract index getter. - See the class description for details. - Setter: - @brief The device abstract index setter. - See the class description for details. - """ - other_terminal_id: int - r""" - Getter: - @brief The getter for the abstract's connected terminal. - See the class description for details. - Setter: - @brief The setter for the abstract's connected terminal. - See the class description for details. - """ - @classmethod - def new(cls) -> DeviceReconnectedTerminal: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> DeviceReconnectedTerminal: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DeviceReconnectedTerminal: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DeviceReconnectedTerminal) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DeviceReconnectedTerminal: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class DeviceAbstractRef: - r""" - @brief Describes an additional device abstract reference for combined devices. - Combined devices are implemented as a generalization of the device abstract concept in \Device. For combined devices, multiple \DeviceAbstract references are present. This class describes such an additional reference. A reference is a pointer to an abstract plus a transformation by which the abstract is transformed geometrically as compared to the first (initial) abstract. - - This class has been introduced in version 0.26. - """ - device_abstract: DeviceAbstract - r""" - Getter: - @brief The getter for the device abstract reference. - See the class description for details. - Setter: - @brief The setter for the device abstract reference. - See the class description for details. - """ - trans: DCplxTrans - r""" - Getter: - @brief The getter for the relative transformation of the instance. - See the class description for details. - Setter: - @brief The setter for the relative transformation of the instance. - See the class description for details. - """ - @classmethod - def new(cls) -> DeviceAbstractRef: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> DeviceAbstractRef: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DeviceAbstractRef: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DeviceAbstractRef) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DeviceAbstractRef: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class Device(NetlistObject): - r""" - @brief A device inside a circuit. - Device object represent atomic devices such as resistors, diodes or transistors. The \Device class represents a particular device with specific parameters. The type of device is represented by a \DeviceClass object. Device objects live in \Circuit objects, the device class objects live in the \Netlist object. - - Devices connect to nets through terminals. Terminals are described by a terminal ID which is essentially the zero-based index of the terminal. Terminal definitions can be obtained from the device class using the \DeviceClass#terminal_definitions method. - - Devices connect to nets through the \Device#connect_terminal method. Device terminals can be disconnected using \Device#disconnect_terminal. - - Device objects are created inside a circuit with \Circuit#create_device. - - This class has been added in version 0.26. - """ - device_abstract: DeviceAbstract - r""" - Getter: - @brief Gets the device abstract for this device instance. - See \DeviceAbstract for more details. - - Setter: - @hide - Provided for test purposes mainly. Be careful with pointers! - """ - name: str - r""" - Getter: - @brief Gets the name of the device. - - Setter: - @brief Sets the name of the device. - Device names are used to name a device inside a netlist file. Device names should be unique within a circuit. - """ - trans: DCplxTrans - r""" - Getter: - @brief Gets the location of the device. - See \trans= for details about this method. - Setter: - @brief Sets the location of the device. - The device location is essentially describing the position of the device. The position is typically the center of some recognition shape. In this case the transformation is a plain displacement to the center of this shape. - """ - def _assign(self, other: NetlistObject) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> Device: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def add_combined_abstract(self, ref: DeviceAbstractRef) -> None: - r""" - @hide - Provided for test purposes mainly. - """ - def add_reconnected_terminal_for(self, outer_terminal: int, descriptor: DeviceReconnectedTerminal) -> None: - r""" - @hide - Provided for test purposes mainly. - """ - @overload - def circuit(self) -> Circuit: - r""" - @brief Gets the circuit the device lives in. - """ - @overload - def circuit(self) -> Circuit: - r""" - @brief Gets the circuit the device lives in (non-const version). - - This constness variant has been introduced in version 0.26.8 - """ - def clear_combined_abstracts(self) -> None: - r""" - @hide - Provided for test purposes mainly. - """ - def clear_reconnected_terminals(self) -> None: - r""" - @hide - Provided for test purposes mainly. - """ - @overload - def connect_terminal(self, terminal_id: int, net: Net) -> None: - r""" - @brief Connects the given terminal to the specified net. - """ - @overload - def connect_terminal(self, terminal_name: str, net: Net) -> None: - r""" - @brief Connects the given terminal to the specified net. - This version accepts a terminal name. If the name is not a valid terminal name, an exception is raised. - If the terminal has been connected to a global net, it will be disconnected from there. - """ - def device_class(self) -> DeviceClass: - r""" - @brief Gets the device class the device belongs to. - """ - @overload - def disconnect_terminal(self, terminal_id: int) -> None: - r""" - @brief Disconnects the given terminal from any net. - If the terminal has been connected to a global, this connection will be disconnected too. - """ - @overload - def disconnect_terminal(self, terminal_name: str) -> None: - r""" - @brief Disconnects the given terminal from any net. - This version accepts a terminal name. If the name is not a valid terminal name, an exception is raised. - """ - def each_combined_abstract(self) -> Iterator[DeviceAbstractRef]: - r""" - @brief Iterates over the combined device specifications. - This feature applies to combined devices. This iterator will deliver all device abstracts present in addition to the default device abstract. - """ - def each_reconnected_terminal_for(self, terminal_id: int) -> Iterator[DeviceReconnectedTerminal]: - r""" - @brief Iterates over the reconnected terminal specifications for a given outer terminal. - This feature applies to combined devices. This iterator will deliver all device-to-abstract terminal reroutings. - """ - def expanded_name(self) -> str: - r""" - @brief Gets the expanded name of the device. - The expanded name takes the name of the device. If the name is empty, the numeric ID will be used to build a name. - """ - def id(self) -> int: - r""" - @brief Gets the device ID. - The ID is a unique integer which identifies the device. - It can be used to retrieve the device from the circuit using \Circuit#device_by_id. - When assigned, the device ID is not 0. - """ - def is_combined_device(self) -> bool: - r""" - @brief Returns true, if the device is a combined device. - Combined devices feature multiple device abstracts and device-to-abstract terminal connections. - See \each_reconnected_terminal and \each_combined_abstract for more details. - """ - @overload - def net_for_terminal(self, terminal_id: int) -> Net: - r""" - @brief Gets the net connected to the specified terminal. - If the terminal is not connected, nil is returned for the net. - """ - @overload - def net_for_terminal(self, terminal_id: int) -> Net: - r""" - @brief Gets the net connected to the specified terminal (non-const version). - If the terminal is not connected, nil is returned for the net. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def net_for_terminal(self, terminal_name: str) -> Net: - r""" - @brief Gets the net connected to the specified terminal (non-const version). - If the terminal is not connected, nil is returned for the net. - - This convenience method has been introduced in version 0.27.3. - """ - @overload - def net_for_terminal(self, terminal_name: str) -> Net: - r""" - @brief Gets the net connected to the specified terminal. - If the terminal is not connected, nil is returned for the net. - - This convenience method has been introduced in version 0.27.3. - """ - @overload - def parameter(self, param_id: int) -> float: - r""" - @brief Gets the parameter value for the given parameter ID. - """ - @overload - def parameter(self, param_name: str) -> float: - r""" - @brief Gets the parameter value for the given parameter name. - If the parameter name is not valid, an exception is thrown. - """ - @overload - def set_parameter(self, param_id: int, value: float) -> None: - r""" - @brief Sets the parameter value for the given parameter ID. - """ - @overload - def set_parameter(self, param_name: str, value: float) -> None: - r""" - @brief Sets the parameter value for the given parameter name. - If the parameter name is not valid, an exception is thrown. - """ - -class DeviceAbstract: - r""" - @brief A geometrical device abstract - This class represents the geometrical model for the device. It links into the extracted layout to a cell which holds the terminal shapes for the device. - - This class has been added in version 0.26. - """ - name: str - r""" - Getter: - @brief Gets the name of the device abstract. - - Setter: - @brief Sets the name of the device abstract. - Device names are used to name a device abstract inside a netlist file. Device names should be unique within a netlist. - """ - @classmethod - def new(cls) -> DeviceAbstract: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> DeviceAbstract: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DeviceAbstract: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DeviceAbstract) -> None: - r""" - @brief Assigns another object to self - """ - def cell_index(self) -> int: - r""" - @brief Gets the cell index of the device abstract. - This is the cell that represents the device. - """ - def cluster_id_for_terminal(self, terminal_id: int) -> int: - r""" - @brief Gets the cluster ID for the given terminal. - The cluster ID links the terminal to geometrical shapes within the clusters of the cell (see \cell_index) - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def device_class(self) -> DeviceClass: - r""" - @brief Gets the device class of the device. - """ - def dup(self) -> DeviceAbstract: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - @overload - def netlist(self) -> Netlist: - r""" - @brief Gets the netlist the device abstract lives in (non-const version). - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def netlist(self) -> Netlist: - r""" - @brief Gets the netlist the device abstract lives in. - """ - -class SubCircuit(NetlistObject): - r""" - @brief A subcircuit inside a circuit. - Circuits may instantiate other circuits as subcircuits similar to cells in layouts. Such an instance is a subcircuit. A subcircuit refers to a circuit implementation (a \Circuit object), and presents connections through pins. The pins of a subcircuit can be connected to nets. The subcircuit pins are identical to the outgoing pins of the circuit the subcircuit refers to. - - Subcircuits connect to nets through the \SubCircuit#connect_pin method. SubCircuit pins can be disconnected using \SubCircuit#disconnect_pin. - - Subcircuit objects are created inside a circuit with \Circuit#create_subcircuit. - - This class has been added in version 0.26. - """ - name: str - r""" - Getter: - @brief Gets the name of the subcircuit. - - Setter: - @brief Sets the name of the subcircuit. - SubCircuit names are used to name a subcircuits inside a netlist file. SubCircuit names should be unique within a circuit. - """ - trans: DCplxTrans - r""" - Getter: - @brief Gets the physical transformation for the subcircuit. - - This property applies to subcircuits derived from a layout. It specifies the placement of the respective cell. - - This property has been introduced in version 0.27. - Setter: - @brief Sets the physical transformation for the subcircuit. - - See \trans for details about this property. - - This property has been introduced in version 0.27. - """ - def _assign(self, other: NetlistObject) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> SubCircuit: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - @overload - def circuit(self) -> Circuit: - r""" - @brief Gets the circuit the subcircuit lives in. - This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. - """ - @overload - def circuit(self) -> Circuit: - r""" - @brief Gets the circuit the subcircuit lives in (non-const version). - This is NOT the circuit which is referenced. For getting the circuit that the subcircuit references, use \circuit_ref. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def circuit_ref(self) -> Circuit: - r""" - @brief Gets the circuit referenced by the subcircuit. - """ - @overload - def circuit_ref(self) -> Circuit: - r""" - @brief Gets the circuit referenced by the subcircuit (non-const version). - - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def connect_pin(self, pin: Pin, net: Net) -> None: - r""" - @brief Connects the given pin to the specified net. - This version takes a \Pin reference instead of a pin ID. - """ - @overload - def connect_pin(self, pin_id: int, net: Net) -> None: - r""" - @brief Connects the given pin to the specified net. - """ - @overload - def disconnect_pin(self, pin: Pin) -> None: - r""" - @brief Disconnects the given pin from any net. - This version takes a \Pin reference instead of a pin ID. - """ - @overload - def disconnect_pin(self, pin_id: int) -> None: - r""" - @brief Disconnects the given pin from any net. - """ - def expanded_name(self) -> str: - r""" - @brief Gets the expanded name of the subcircuit. - The expanded name takes the name of the subcircuit. If the name is empty, the numeric ID will be used to build a name. - """ - def id(self) -> int: - r""" - @brief Gets the subcircuit ID. - The ID is a unique integer which identifies the subcircuit. - It can be used to retrieve the subcircuit from the circuit using \Circuit#subcircuit_by_id. - When assigned, the subcircuit ID is not 0. - """ - @overload - def net_for_pin(self, pin_id: int) -> Net: - r""" - @brief Gets the net connected to the specified pin of the subcircuit (non-const version). - If the pin is not connected, nil is returned for the net. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def net_for_pin(self, pin_id: int) -> Net: - r""" - @brief Gets the net connected to the specified pin of the subcircuit. - If the pin is not connected, nil is returned for the net. - """ - -class NetTerminalRef: - r""" - @brief A connection to a terminal of a device. - This object is used inside a net (see \Net) to describe the connections a net makes. - - This class has been added in version 0.26. - """ - @classmethod - def new(cls) -> NetTerminalRef: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetTerminalRef: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetTerminalRef: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetTerminalRef) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - @overload - def device(self) -> Device: - r""" - @brief Gets the device reference. - Gets the device object that this connection is made to. - """ - @overload - def device(self) -> Device: - r""" - @brief Gets the device reference (non-const version). - Gets the device object that this connection is made to. - - This constness variant has been introduced in version 0.26.8 - """ - def device_class(self) -> DeviceClass: - r""" - @brief Gets the class of the device which is addressed. - """ - def dup(self) -> NetTerminalRef: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - @overload - def net(self) -> Net: - r""" - @brief Gets the net this terminal reference is attached to (non-const version). - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def net(self) -> Net: - r""" - @brief Gets the net this terminal reference is attached to. - """ - def terminal_def(self) -> DeviceTerminalDefinition: - r""" - @brief Gets the terminal definition of the terminal that is connected - """ - def terminal_id(self) -> int: - r""" - @brief Gets the ID of the terminal of the device the connection is made to. - """ - -class NetPinRef: - r""" - @brief A connection to an outgoing pin of the circuit. - This object is used inside a net (see \Net) to describe the connections a net makes. - - This class has been added in version 0.26. - """ - @classmethod - def new(cls) -> NetPinRef: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetPinRef: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetPinRef: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetPinRef) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetPinRef: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - @overload - def net(self) -> Net: - r""" - @brief Gets the net this pin reference is attached to. - """ - @overload - def net(self) -> Net: - r""" - @brief Gets the net this pin reference is attached to (non-const version). - - This constness variant has been introduced in version 0.26.8 - """ - def pin(self) -> Pin: - r""" - @brief Gets the \Pin object of the pin the connection is made to. - """ - def pin_id(self) -> int: - r""" - @brief Gets the ID of the pin the connection is made to. - """ - -class NetSubcircuitPinRef: - r""" - @brief A connection to a pin of a subcircuit. - This object is used inside a net (see \Net) to describe the connections a net makes. - - This class has been added in version 0.26. - """ - @classmethod - def new(cls) -> NetSubcircuitPinRef: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetSubcircuitPinRef: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetSubcircuitPinRef: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetSubcircuitPinRef) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetSubcircuitPinRef: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - @overload - def net(self) -> Net: - r""" - @brief Gets the net this pin reference is attached to. - """ - @overload - def net(self) -> Net: - r""" - @brief Gets the net this pin reference is attached to (non-const version). - - This constness variant has been introduced in version 0.26.8 - """ - def pin(self) -> Pin: - r""" - @brief Gets the \Pin object of the pin the connection is made to. - """ - def pin_id(self) -> int: - r""" - @brief Gets the ID of the pin the connection is made to. - """ - @overload - def subcircuit(self) -> SubCircuit: - r""" - @brief Gets the subcircuit reference. - This attribute indicates the subcircuit the net attaches to. The subcircuit lives in the same circuit than the net. - """ - @overload - def subcircuit(self) -> SubCircuit: - r""" - @brief Gets the subcircuit reference (non-const version). - This attribute indicates the subcircuit the net attaches to. The subcircuit lives in the same circuit than the net. - - This constness variant has been introduced in version 0.26.8 - """ - -class Net(NetlistObject): - r""" - @brief A single net. - A net connects multiple pins or terminals together. Pins are either pin or subcircuits of outgoing pins of the circuit the net lives in. Terminals are connections made to specific terminals of devices. - - Net objects are created inside a circuit with \Circuit#create_net. - - To connect a net to an outgoing pin of a circuit, use \Circuit#connect_pin, to disconnect a net from an outgoing pin use \Circuit#disconnect_pin. To connect a net to a pin of a subcircuit, use \SubCircuit#connect_pin, to disconnect a net from a pin of a subcircuit, use \SubCircuit#disconnect_pin. To connect a net to a terminal of a device, use \Device#connect_terminal, to disconnect a net from a terminal of a device, use \Device#disconnect_terminal. - - This class has been added in version 0.26. - """ - cluster_id: int - r""" - Getter: - @brief Gets the cluster ID of the net. - See \cluster_id= for details about the cluster ID. - Setter: - @brief Sets the cluster ID of the net. - The cluster ID connects the net with a layout cluster. It is set when the net is extracted from a layout. - """ - name: str - r""" - Getter: - @brief Gets the name of the net. - See \name= for details about the name. - Setter: - @brief Sets the name of the net. - The name of the net is used for naming the net in schematic files for example. The name of the net has to be unique. - """ - def __str__(self) -> str: - r""" - @brief Gets the qualified name. - The qualified name is like the expanded name, but the circuit's name is preceded - (i.e. 'CIRCUIT:NET') if available. - """ - def _assign(self, other: NetlistObject) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> Net: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def circuit(self) -> Circuit: - r""" - @brief Gets the circuit the net lives in. - """ - def clear(self) -> None: - r""" - @brief Clears the net. - """ - @overload - def each_pin(self) -> Iterator[NetPinRef]: - r""" - @brief Iterates over all outgoing pins the net connects. - Pin connections are described by \NetPinRef objects. Pin connections are connections to outgoing pins of the circuit the net lives in. - """ - @overload - def each_pin(self) -> Iterator[NetPinRef]: - r""" - @brief Iterates over all outgoing pins the net connects (non-const version). - Pin connections are described by \NetPinRef objects. Pin connections are connections to outgoing pins of the circuit the net lives in. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_subcircuit_pin(self) -> Iterator[NetSubcircuitPinRef]: - r""" - @brief Iterates over all subcircuit pins the net connects. - Subcircuit pin connections are described by \NetSubcircuitPinRef objects. These are connections to specific pins of subcircuits. - """ - @overload - def each_subcircuit_pin(self) -> Iterator[NetSubcircuitPinRef]: - r""" - @brief Iterates over all subcircuit pins the net connects (non-const version). - Subcircuit pin connections are described by \NetSubcircuitPinRef objects. These are connections to specific pins of subcircuits. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_terminal(self) -> Iterator[NetTerminalRef]: - r""" - @brief Iterates over all terminals the net connects. - Terminals connect devices. Terminal connections are described by \NetTerminalRef objects. - """ - @overload - def each_terminal(self) -> Iterator[NetTerminalRef]: - r""" - @brief Iterates over all terminals the net connects (non-const version). - Terminals connect devices. Terminal connections are described by \NetTerminalRef objects. - - This constness variant has been introduced in version 0.26.8 - """ - def expanded_name(self) -> str: - r""" - @brief Gets the expanded name of the net. - The expanded name takes the name of the net. If the name is empty, the cluster ID will be used to build a name. - """ - def is_floating(self) -> bool: - r""" - @brief Returns true, if the net is floating. - Floating nets are those which don't have any device or subcircuit on it and are not connected through a pin. - """ - def is_internal(self) -> bool: - r""" - @brief Returns true, if the net is an internal net. - Internal nets are those which connect exactly two terminals and nothing else (pin_count = 0 and terminal_count == 2). - """ - def is_passive(self) -> bool: - r""" - @brief Returns true, if the net is passive. - Passive nets don't have devices or subcircuits on it. They can be exposed through a pin. - \is_floating? implies \is_passive?. - - This method has been introduced in version 0.26.1. - """ - def pin_count(self) -> int: - r""" - @brief Returns the number of outgoing pins connected by this net. - """ - def qname(self) -> str: - r""" - @brief Gets the qualified name. - The qualified name is like the expanded name, but the circuit's name is preceded - (i.e. 'CIRCUIT:NET') if available. - """ - def subcircuit_pin_count(self) -> int: - r""" - @brief Returns the number of subcircuit pins connected by this net. - """ - def terminal_count(self) -> int: - r""" - @brief Returns the number of terminals connected by this net. - """ - def to_s(self) -> str: - r""" - @brief Gets the qualified name. - The qualified name is like the expanded name, but the circuit's name is preceded - (i.e. 'CIRCUIT:NET') if available. - """ - -class DeviceTerminalDefinition: - r""" - @brief A terminal descriptor - This class is used inside the \DeviceClass class to describe a terminal of the device. - - This class has been added in version 0.26. - """ - description: str - r""" - Getter: - @brief Gets the description of the terminal. - Setter: - @brief Sets the description of the terminal. - """ - name: str - r""" - Getter: - @brief Gets the name of the terminal. - Setter: - @brief Sets the name of the terminal. - """ - @classmethod - def new(cls, name: str, description: Optional[str] = ...) -> DeviceTerminalDefinition: - r""" - @brief Creates a new terminal definition. - """ - def __copy__(self) -> DeviceTerminalDefinition: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DeviceTerminalDefinition: - r""" - @brief Creates a copy of self - """ - def __init__(self, name: str, description: Optional[str] = ...) -> None: - r""" - @brief Creates a new terminal definition. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DeviceTerminalDefinition) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DeviceTerminalDefinition: - r""" - @brief Creates a copy of self - """ - def id(self) -> int: - r""" - @brief Gets the ID of the terminal. - The ID of the terminal is used in some places to refer to a specific terminal (e.g. in the \NetTerminalRef object). - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class DeviceParameterDefinition: - r""" - @brief A parameter descriptor - This class is used inside the \DeviceClass class to describe a parameter of the device. - - This class has been added in version 0.26. - """ - default_value: float - r""" - Getter: - @brief Gets the default value of the parameter. - Setter: - @brief Sets the default value of the parameter. - The default value is used to initialize parameters of \Device objects. - """ - description: str - r""" - Getter: - @brief Gets the description of the parameter. - Setter: - @brief Sets the description of the parameter. - """ - is_primary: bool - r""" - Getter: - @brief Gets a value indicating whether the parameter is a primary parameter - See \is_primary= for details about this predicate. - Setter: - @brief Sets a value indicating whether the parameter is a primary parameter - If this flag is set to true (the default), the parameter is considered a primary parameter. - Only primary parameters are compared by default. - """ - name: str - r""" - Getter: - @brief Gets the name of the parameter. - Setter: - @brief Sets the name of the parameter. - """ - @classmethod - def new(cls, name: str, description: Optional[str] = ..., default_value: Optional[float] = ..., is_primary: Optional[bool] = ..., si_scaling: Optional[float] = ...) -> DeviceParameterDefinition: - r""" - @brief Creates a new parameter definition. - @param name The name of the parameter - @param description The human-readable description - @param default_value The initial value - @param is_primary True, if the parameter is a primary parameter (see \is_primary=) - @param si_scaling The scaling factor to SI units - """ - def __copy__(self) -> DeviceParameterDefinition: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DeviceParameterDefinition: - r""" - @brief Creates a copy of self - """ - def __init__(self, name: str, description: Optional[str] = ..., default_value: Optional[float] = ..., is_primary: Optional[bool] = ..., si_scaling: Optional[float] = ...) -> None: - r""" - @brief Creates a new parameter definition. - @param name The name of the parameter - @param description The human-readable description - @param default_value The initial value - @param is_primary True, if the parameter is a primary parameter (see \is_primary=) - @param si_scaling The scaling factor to SI units - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DeviceParameterDefinition) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DeviceParameterDefinition: - r""" - @brief Creates a copy of self - """ - def id(self) -> int: - r""" - @brief Gets the ID of the parameter. - The ID of the parameter is used in some places to refer to a specific parameter (e.g. in the \NetParameterRef object). - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def si_scaling(self) -> float: - r""" - @brief Gets the scaling factor to SI units. - For parameters in micrometers for example, this factor will be 1e-6. - """ - -class EqualDeviceParameters: - r""" - @brief A device parameter equality comparer. - Attach this object to a device class with \DeviceClass#equal_parameters= to make the device class use this comparer: - - @code - # 20nm tolerance for length: - equal_device_parameters = RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_L, 0.02, 0.0) - # one percent tolerance for width: - equal_device_parameters += RBA::EqualDeviceParameters::new(RBA::DeviceClassMOS4Transistor::PARAM_W, 0.0, 0.01) - # applies the compare delegate: - netlist.device_class_by_name("NMOS").equal_parameters = equal_device_parameters - @/code - - You can use this class to specify fuzzy equality criteria for the comparison of device parameters in netlist verification or to confine the equality of devices to certain parameters only. - - This class has been added in version 0.26. - """ - @classmethod - def ignore(cls, param_id: int) -> EqualDeviceParameters: - r""" - @brief Creates a device parameter comparer which ignores the parameter. - - This specification can be used to make a parameter ignored. Starting with version 0.27.4, all primary parameters are compared. Before 0.27.4, giving a tolerance meant only those parameters are compared. To exclude a primary parameter from the compare, use the 'ignore' specification for that parameter. - - This constructor has been introduced in version 0.27.4. - """ - @classmethod - def new(cls, param_id: int, absolute: Optional[float] = ..., relative: Optional[float] = ...) -> EqualDeviceParameters: - r""" - @brief Creates a device parameter comparer for a single parameter. - 'absolute' is the absolute deviation allowed for the parameter values. 'relative' is the relative deviation allowed for the parameter values (a value between 0 and 1). - - A value of 0 for both absolute and relative deviation means the parameters have to match exactly. - - If 'absolute' and 'relative' are both given, their deviations will add to the allowed difference between two parameter values. The relative deviation will be applied to the mean value of both parameter values. For example, when comparing parameter values of 40 and 60, a relative deviation of 0.35 means an absolute deviation of 17.5 (= 0.35 * average of 40 and 60) which does not make both values match. - """ - def __add__(self, other: EqualDeviceParameters) -> EqualDeviceParameters: - r""" - @brief Combines two parameters for comparison. - The '+' operator will join the parameter comparers and produce one that checks the combined parameters. - """ - def __copy__(self) -> EqualDeviceParameters: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> EqualDeviceParameters: - r""" - @brief Creates a copy of self - """ - def __iadd__(self, other: EqualDeviceParameters) -> EqualDeviceParameters: - r""" - @brief Combines two parameters for comparison (in-place). - The '+=' operator will join the parameter comparers and produce one that checks the combined parameters. - """ - def __init__(self, param_id: int, absolute: Optional[float] = ..., relative: Optional[float] = ...) -> None: - r""" - @brief Creates a device parameter comparer for a single parameter. - 'absolute' is the absolute deviation allowed for the parameter values. 'relative' is the relative deviation allowed for the parameter values (a value between 0 and 1). - - A value of 0 for both absolute and relative deviation means the parameters have to match exactly. - - If 'absolute' and 'relative' are both given, their deviations will add to the allowed difference between two parameter values. The relative deviation will be applied to the mean value of both parameter values. For example, when comparing parameter values of 40 and 60, a relative deviation of 0.35 means an absolute deviation of 17.5 (= 0.35 * average of 40 and 60) which does not make both values match. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: EqualDeviceParameters) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> EqualDeviceParameters: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def to_string(self) -> str: - r""" - @hide - """ - -class GenericDeviceParameterCompare(EqualDeviceParameters): - r""" - @brief A class implementing the comparison of device parameters. - Reimplement this class to provide a custom device parameter compare scheme. - Attach this object to a device class with \DeviceClass#equal_parameters= to make the device class use this comparer. - - This class is intended for special cases. In most scenarios it is easier to use \EqualDeviceParameters instead of implementing a custom comparer class. - - This class has been added in version 0.26. The 'equal' method has been dropped in 0.27.1 as it can be expressed as !less(a,b) && !less(b,a). - """ - def _assign(self, other: EqualDeviceParameters) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> GenericDeviceParameterCompare: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class GenericDeviceCombiner: - r""" - @brief A class implementing the combination of two devices (parallel or serial mode). - Reimplement this class to provide a custom device combiner. - Device combination requires 'supports_paralell_combination' or 'supports_serial_combination' to be set to true for the device class. In the netlist device combination step, the algorithm will try to identify devices which can be combined into single devices and use the combiner object to implement the actual joining of such devices. - - Attach this object to a device class with \DeviceClass#combiner= to make the device class use this combiner. - - This class has been added in version 0.27.3. - """ - @classmethod - def new(cls) -> GenericDeviceCombiner: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> GenericDeviceCombiner: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> GenericDeviceCombiner: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: GenericDeviceCombiner) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> GenericDeviceCombiner: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class DeviceClass: - r""" - @brief A class describing a specific type of device. - Device class objects live in the context of a \Netlist object. After a device class is created, it must be added to the netlist using \Netlist#add. The netlist will own the device class object. When the netlist is destroyed, the device class object will become invalid. - - The \DeviceClass class is the base class for other device classes. - - This class has been added in version 0.26. In version 0.27.3, the 'GenericDeviceClass' has been integrated with \DeviceClass and the device class was made writeable in most respects. This enables manipulating built-in device classes. - """ - combiner: GenericDeviceCombiner - r""" - Getter: - @brief Gets a device combiner or nil if none is registered. - - This method has been added in version 0.27.3. - - Setter: - @brief Specifies a device combiner (parallel or serial device combination). - - You can assign nil for the combiner to remove it. - - In special cases, you can even implement a custom combiner by deriving your own comparer from the \GenericDeviceCombiner class. - - This method has been added in version 0.27.3. - """ - description: str - r""" - Getter: - @brief Gets the description text of the device class. - Setter: - @brief Sets the description of the device class. - """ - equal_parameters: EqualDeviceParameters - r""" - Getter: - @brief Gets the device parameter comparer for netlist verification or nil if no comparer is registered. - See \equal_parameters= for the setter. - - This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. - - Setter: - @brief Specifies a device parameter comparer for netlist verification. - By default, all devices are compared with all parameters. If you want to select only certain parameters for comparison or use a fuzzy compare criterion, use an \EqualDeviceParameters object and assign it to the device class of one netlist. You can also chain multiple \EqualDeviceParameters objects with the '+' operator for specifying multiple parameters in the equality check. - - You can assign nil for the parameter comparer to remove it. - - In special cases, you can even implement a custom compare scheme by deriving your own comparer from the \GenericDeviceParameterCompare class. - - This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. - """ - name: str - r""" - Getter: - @brief Gets the name of the device class. - Setter: - @brief Sets the name of the device class. - """ - strict: bool - r""" - Getter: - @brief Gets a value indicating whether this class performs strict terminal mapping - See \strict= for details about this attribute. - Setter: - @brief Sets a value indicating whether this class performs strict terminal mapping - - Classes with this flag set never allow terminal swapping, even if the device symmetry supports that. If two classes are involved in a netlist compare, - terminal swapping will be disabled if one of the classes is in strict mode. - - By default, device classes are not strict and terminal swapping is allowed as far as the device symmetry supports that. - """ - @property - def supports_parallel_combination(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Specifies whether the device supports parallel device combination. - Parallel device combination means that all terminals of two combination candidates are connected to the same nets. If the device does not support this combination mode, this predicate can be set to false. This will make the device extractor skip the combination test in parallel mode and improve performance somewhat. - - This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. - """ - @property - def supports_serial_combination(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Specifies whether the device supports serial device combination. - Serial device combination means that the devices are connected by internal nodes. If the device does not support this combination mode, this predicate can be set to false. This will make the device extractor skip the combination test in serial mode and improve performance somewhat. - - This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. - """ - @classmethod - def new(cls) -> DeviceClass: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> DeviceClass: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DeviceClass: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def add_parameter(self, parameter_def: DeviceParameterDefinition) -> None: - r""" - @brief Adds the given parameter definition to the device class - This method will define a new parameter. The new parameter is added at the end of existing parameters. The parameter definition object passed as the argument is modified to contain the new ID of the parameter. - The parameter is copied into the device class. Modifying the parameter object later does not have the effect of changing the parameter definition. - - This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. - """ - def add_terminal(self, terminal_def: DeviceTerminalDefinition) -> None: - r""" - @brief Adds the given terminal definition to the device class - This method will define a new terminal. The new terminal is added at the end of existing terminals. The terminal definition object passed as the argument is modified to contain the new ID of the terminal. - - The terminal is copied into the device class. Modifying the terminal object later does not have the effect of changing the terminal definition. - - This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. - """ - def assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def clear_equivalent_terminal_ids(self) -> None: - r""" - @brief Clears all equivalent terminal ids - - This method has been added in version 0.27.3. - """ - def clear_parameters(self) -> None: - r""" - @brief Clears the list of parameters - - This method has been added in version 0.27.3. - """ - def clear_terminals(self) -> None: - r""" - @brief Clears the list of terminals - - This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DeviceClass: - r""" - @brief Creates a copy of self - """ - @overload - def enable_parameter(self, parameter_id: int, enable: bool) -> None: - r""" - @brief Enables or disables a parameter. - Some parameters are 'secondary' parameters which are extracted but not handled in device compare and are not shown in the netlist browser. For example, the 'W' parameter of the resistor is such a secondary parameter. This method allows turning a parameter in a primary one ('enable') or into a secondary one ('disable'). - - This method has been introduced in version 0.27.3. - """ - @overload - def enable_parameter(self, parameter_name: str, enable: bool) -> None: - r""" - @brief Enables or disables a parameter. - Some parameters are 'secondary' parameters which are extracted but not handled in device compare and are not shown in the netlist browser. For example, the 'W' parameter of the resistor is such a secondary parameter. This method allows turning a parameter in a primary one ('enable') or into a secondary one ('disable'). - - This version accepts a parameter name. - - This method has been introduced in version 0.27.3. - """ - def equivalent_terminal_id(self, original_id: int, equivalent_id: int) -> None: - r""" - @brief Specifies a terminal to be equivalent to another. - Use this method to specify two terminals to be exchangeable. For example to make S and D of a MOS transistor equivalent, call this method with S and D terminal IDs. In netlist matching, S will be translated to D and thus made equivalent to D. - - Note that terminal equivalence is not effective if the device class operates in strict mode (see \DeviceClass#strict=). - - This method has been moved from 'GenericDeviceClass' to 'DeviceClass' in version 0.27.3. - """ - def has_parameter(self, name: str) -> bool: - r""" - @brief Returns true, if the device class has a parameter with the given name. - """ - def has_terminal(self, name: str) -> bool: - r""" - @brief Returns true, if the device class has a terminal with the given name. - """ - def id(self) -> int: - r""" - @brief Gets the unique ID of the device class - The ID is a unique integer that identifies the device class. Use the ID to check for object identity - i.e. to determine whether two devices share the same device class. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def netlist(self) -> Netlist: - r""" - @brief Gets the netlist the device class lives in. - """ - @overload - def parameter_definition(self, parameter_id: int) -> DeviceParameterDefinition: - r""" - @brief Gets the parameter definition object for a given ID. - Parameter definition IDs are used in some places to reference a specific parameter of a device. This method obtains the corresponding definition object. - """ - @overload - def parameter_definition(self, parameter_name: str) -> DeviceParameterDefinition: - r""" - @brief Gets the parameter definition object for a given ID. - Parameter definition IDs are used in some places to reference a specific parameter of a device. This method obtains the corresponding definition object. - This version accepts a parameter name. - - This method has been introduced in version 0.27.3. - """ - def parameter_definitions(self) -> List[DeviceParameterDefinition]: - r""" - @brief Gets the list of parameter definitions of the device. - See the \DeviceParameterDefinition class description for details. - """ - def parameter_id(self, name: str) -> int: - r""" - @brief Returns the parameter ID of the parameter with the given name. - An exception is thrown if there is no parameter with the given name. Use \has_parameter to check whether the name is a valid parameter name. - """ - def terminal_definition(self, terminal_id: int) -> DeviceTerminalDefinition: - r""" - @brief Gets the terminal definition object for a given ID. - Terminal definition IDs are used in some places to reference a specific terminal of a device. This method obtains the corresponding definition object. - """ - def terminal_definitions(self) -> List[DeviceTerminalDefinition]: - r""" - @brief Gets the list of terminal definitions of the device. - See the \DeviceTerminalDefinition class description for details. - """ - def terminal_id(self, name: str) -> int: - r""" - @brief Returns the terminal ID of the terminal with the given name. - An exception is thrown if there is no terminal with the given name. Use \has_terminal to check whether the name is a valid terminal name. - """ - -class Circuit(NetlistObject): - r""" - @brief Circuits are the basic building blocks of the netlist - A circuit has pins by which it can connect to the outside. Pins are created using \create_pin and are represented by the \Pin class. - - Furthermore, a circuit manages the components of the netlist. Components are devices (class \Device) and subcircuits (class \SubCircuit). Devices are basic devices such as resistors or transistors. Subcircuits are other circuits to which nets from this circuit connect. Devices are created using the \create_device method. Subcircuits are created using the \create_subcircuit method. - - Devices are connected through 'terminals', subcircuits are connected through their pins. Terminals and pins are described by integer ID's in the context of most methods. - - Finally, the circuit consists of the nets. Nets connect terminals of devices and pins of subcircuits or the circuit itself. Nets are created using \create_net and are represented by objects of the \Net class. - See there for more about nets. - - The Circuit object is only valid if the netlist object is alive. Circuits must be added to a netlist using \Netlist#add to become part of the netlist. - - The Circuit class has been introduced in version 0.26. - """ - boundary: DPolygon - r""" - Getter: - @brief Gets the boundary of the circuit - Setter: - @brief Sets the boundary of the circuit - """ - cell_index: int - r""" - Getter: - @brief Gets the cell index of the circuit - See \cell_index= for details. - - Setter: - @brief Sets the cell index - The cell index relates a circuit with a cell from a layout. It's intended to hold a cell index number if the netlist was extracted from a layout. - """ - dont_purge: bool - r""" - Getter: - @brief Gets a value indicating whether the circuit can be purged on \Netlist#purge. - - Setter: - @brief Sets a value indicating whether the circuit can be purged on \Netlist#purge. - If this attribute is set to true, \Netlist#purge will never delete this circuit. - This flag therefore marks this circuit as 'precious'. - """ - name: str - r""" - Getter: - @brief Gets the name of the circuit - Setter: - @brief Sets the name of the circuit - """ - def _assign(self, other: NetlistObject) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> Circuit: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def blank(self) -> None: - r""" - @brief Blanks out the circuit - This method will remove all the innards of the circuit and just leave the pins. The pins won't be connected to inside nets anymore, but the circuit can still be called by subcircuit references. This method will eventually create a 'circuit abstract' (or black box). It will set the \dont_purge flag to mark this circuit as 'intentionally empty'. - """ - def clear(self) -> None: - r""" - @brief Clears the circuit - This method removes all objects and clears the other attributes. - """ - def combine_devices(self) -> None: - r""" - @brief Combines devices where possible - This method will combine devices that can be combined according to their device classes 'combine_devices' method. - For example, serial or parallel resistors can be combined into a single resistor. - """ - @overload - def connect_pin(self, pin: Pin, net: Net) -> None: - r""" - @brief Connects the given pin with the given net. - The net and the pin must be objects from inside the circuit. Any previous connected is resolved before this connection is made. A pin can only be connected to one net at a time. - """ - @overload - def connect_pin(self, pin_id: int, net: Net) -> None: - r""" - @brief Connects the given pin with the given net. - The net must be one inside the circuit. Any previous connected is resolved before this connection is made. A pin can only be connected to one net at a time. - """ - def create_device(self, device_class: DeviceClass, name: Optional[str] = ...) -> Device: - r""" - @brief Creates a new bound \Device object inside the circuit - This object describes a device of the circuit. The device is already attached to the device class. The name is optional and is used to identify the device in a netlist file. - - For more details see the \Device class. - """ - def create_net(self, name: Optional[str] = ...) -> Net: - r""" - @brief Creates a new \Net object inside the circuit - This object will describe a net of the circuit. The nets are basically connections between the different components of the circuit (subcircuits, devices and pins). - - A net needs to be filled with references to connect to specific objects. See the \Net class for more details. - """ - def create_pin(self, name: str) -> Pin: - r""" - @brief Creates a new \Pin object inside the circuit - This object will describe a pin of the circuit. A circuit connects to the outside through such a pin. The pin is added after all existing pins. For more details see the \Pin class. - - Starting with version 0.26.8, this method returns a reference to a \Pin object rather than a copy. - """ - def create_subcircuit(self, circuit: Circuit, name: Optional[str] = ...) -> SubCircuit: - r""" - @brief Creates a new bound \SubCircuit object inside the circuit - This object describes an instance of another circuit inside the circuit. The subcircuit is already attached to the other circuit. The name is optional and is used to identify the subcircuit in a netlist file. - - For more details see the \SubCircuit class. - """ - @overload - def device_by_id(self, id: int) -> Device: - r""" - @brief Gets the device object for a given ID. - If the ID is not a valid device ID, nil is returned. - """ - @overload - def device_by_id(self, id: int) -> Device: - r""" - @brief Gets the device object for a given ID (const version). - If the ID is not a valid device ID, nil is returned. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def device_by_name(self, name: str) -> Device: - r""" - @brief Gets the device object for a given name. - If the ID is not a valid device name, nil is returned. - """ - @overload - def device_by_name(self, name: str) -> Device: - r""" - @brief Gets the device object for a given name (const version). - If the ID is not a valid device name, nil is returned. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def disconnect_pin(self, pin: Pin) -> None: - r""" - @brief Disconnects the given pin from any net. - """ - @overload - def disconnect_pin(self, pin_id: int) -> None: - r""" - @brief Disconnects the given pin from any net. - """ - @overload - def each_child(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the child circuits of this circuit - Child circuits are the ones that are referenced from this circuit via subcircuits. - """ - @overload - def each_child(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the child circuits of this circuit (const version) - Child circuits are the ones that are referenced from this circuit via subcircuits. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_device(self) -> Iterator[Device]: - r""" - @brief Iterates over the devices of the circuit - """ - @overload - def each_device(self) -> Iterator[Device]: - r""" - @brief Iterates over the devices of the circuit (const version) - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_net(self) -> Iterator[Net]: - r""" - @brief Iterates over the nets of the circuit - """ - @overload - def each_net(self) -> Iterator[Net]: - r""" - @brief Iterates over the nets of the circuit (const version) - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_parent(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the parent circuits of this circuit - Child circuits are the ones that are referencing this circuit via subcircuits. - """ - @overload - def each_parent(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the parent circuits of this circuit (const version) - Child circuits are the ones that are referencing this circuit via subcircuits. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_pin(self) -> Iterator[Pin]: - r""" - @brief Iterates over the pins of the circuit - """ - @overload - def each_pin(self) -> Iterator[Pin]: - r""" - @brief Iterates over the pins of the circuit (const version) - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_ref(self) -> Iterator[SubCircuit]: - r""" - @brief Iterates over the subcircuit objects referencing this circuit - """ - @overload - def each_ref(self) -> Iterator[SubCircuit]: - r""" - @brief Iterates over the subcircuit objects referencing this circuit (const version) - - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_subcircuit(self) -> Iterator[SubCircuit]: - r""" - @brief Iterates over the subcircuits of the circuit - """ - @overload - def each_subcircuit(self) -> Iterator[SubCircuit]: - r""" - @brief Iterates over the subcircuits of the circuit (const version) - - This constness variant has been introduced in version 0.26.8 - """ - def flatten_subcircuit(self, subcircuit: SubCircuit) -> None: - r""" - @brief Flattens a subcircuit - This method will substitute the given subcircuit by it's contents. The subcircuit is removed after this. - """ - def has_refs(self) -> bool: - r""" - @brief Returns a value indicating whether the circuit has references - A circuit has references if there is at least one subcircuit referring to it. - """ - def join_nets(self, net: Net, with_: Net) -> None: - r""" - @brief Joins (connects) two nets into one - This method will connect the 'with' net with 'net' and remove 'with'. - - This method has been introduced in version 0.26.4. - """ - def net_by_cluster_id(self, cluster_id: int) -> Net: - r""" - @brief Gets the net object corresponding to a specific cluster ID - If the ID is not a valid pin cluster ID, nil is returned. - """ - @overload - def net_by_name(self, name: str) -> Net: - r""" - @brief Gets the net object for a given name. - If the ID is not a valid net name, nil is returned. - """ - @overload - def net_by_name(self, name: str) -> Net: - r""" - @brief Gets the net object for a given name (const version). - If the ID is not a valid net name, nil is returned. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def net_for_pin(self, pin: Pin) -> Net: - r""" - @brief Gets the net object attached to a specific pin. - This is the net object inside the circuit which attaches to the given outward-bound pin. - This method returns nil if the pin is not connected or the pin object is nil. - """ - @overload - def net_for_pin(self, pin: Pin) -> Net: - r""" - @brief Gets the net object attached to a specific pin (const version). - This is the net object inside the circuit which attaches to the given outward-bound pin. - This method returns nil if the pin is not connected or the pin object is nil. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def net_for_pin(self, pin_id: int) -> Net: - r""" - @brief Gets the net object attached to a specific pin. - This is the net object inside the circuit which attaches to the given outward-bound pin. - This method returns nil if the pin is not connected or the pin ID is invalid. - """ - @overload - def net_for_pin(self, pin_id: int) -> Net: - r""" - @brief Gets the net object attached to a specific pin (const version). - This is the net object inside the circuit which attaches to the given outward-bound pin. - This method returns nil if the pin is not connected or the pin ID is invalid. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def netlist(self) -> Netlist: - r""" - @brief Gets the netlist object the circuit lives in - """ - @overload - def netlist(self) -> Netlist: - r""" - @brief Gets the netlist object the circuit lives in (const version) - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def nets_by_name(self, name_pattern: str) -> List[Net]: - r""" - @brief Gets the net objects for a given name filter. - The name filter is a glob pattern. This method will return all \Net objects matching the glob pattern. - - This method has been introduced in version 0.27.3. - """ - @overload - def nets_by_name(self, name_pattern: str) -> List[Net]: - r""" - @brief Gets the net objects for a given name filter (const version). - The name filter is a glob pattern. This method will return all \Net objects matching the glob pattern. - - - This constness variant has been introduced in version 0.27.3 - """ - @overload - def pin_by_id(self, id: int) -> Pin: - r""" - @brief Gets the \Pin object corresponding to a specific ID - If the ID is not a valid pin ID, nil is returned. - """ - @overload - def pin_by_id(self, id: int) -> Pin: - r""" - @brief Gets the \Pin object corresponding to a specific ID (const version) - If the ID is not a valid pin ID, nil is returned. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def pin_by_name(self, name: str) -> Pin: - r""" - @brief Gets the \Pin object corresponding to a specific name - If the ID is not a valid pin name, nil is returned. - """ - @overload - def pin_by_name(self, name: str) -> Pin: - r""" - @brief Gets the \Pin object corresponding to a specific name (const version) - If the ID is not a valid pin name, nil is returned. - - This constness variant has been introduced in version 0.26.8 - """ - def pin_count(self) -> int: - r""" - @brief Gets the number of pins in the circuit - """ - def purge_nets(self) -> None: - r""" - @brief Purges floating nets. - Floating nets are nets with no device or subcircuit attached to. Such floating nets are removed in this step. If these nets are connected outward to a circuit pin, this circuit pin is also removed. - """ - def purge_nets_keep_pins(self) -> None: - r""" - @brief Purges floating nets but keep pins. - This method will remove floating nets like \purge_nets, but if these nets are attached to a pin, the pin will be left disconnected from any net. - - This method has been introduced in version 0.26.2. - """ - def remove_device(self, device: Device) -> None: - r""" - @brief Removes the given device from the circuit - """ - def remove_net(self, net: Net) -> None: - r""" - @brief Removes the given net from the circuit - """ - def remove_pin(self, id: int) -> None: - r""" - @brief Removes the pin with the given ID from the circuit - - This method has been introduced in version 0.26.2. - """ - def remove_subcircuit(self, subcircuit: SubCircuit) -> None: - r""" - @brief Removes the given subcircuit from the circuit - """ - def rename_pin(self, id: int, new_name: str) -> None: - r""" - @brief Renames the pin with the given ID to 'new_name' - - This method has been introduced in version 0.26.8. - """ - @overload - def subcircuit_by_id(self, id: int) -> SubCircuit: - r""" - @brief Gets the subcircuit object for a given ID. - If the ID is not a valid subcircuit ID, nil is returned. - """ - @overload - def subcircuit_by_id(self, id: int) -> SubCircuit: - r""" - @brief Gets the subcircuit object for a given ID (const version). - If the ID is not a valid subcircuit ID, nil is returned. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def subcircuit_by_name(self, name: str) -> SubCircuit: - r""" - @brief Gets the subcircuit object for a given name. - If the ID is not a valid subcircuit name, nil is returned. - """ - @overload - def subcircuit_by_name(self, name: str) -> SubCircuit: - r""" - @brief Gets the subcircuit object for a given name (const version). - If the ID is not a valid subcircuit name, nil is returned. - - This constness variant has been introduced in version 0.26.8 - """ - -class Netlist: - r""" - @brief The netlist top-level class - A netlist is a hierarchical structure of circuits. At least one circuit is the top-level circuit, other circuits may be referenced as subcircuits. - Circuits are created with \create_circuit and are represented by objects of the \Circuit class. - - Beside circuits, the netlist manages device classes. Device classes describe specific types of devices. Device classes are represented by objects of the \DeviceClass class and are created using \create_device_class. - - The netlist class has been introduced with version 0.26. - """ - case_sensitive: bool - r""" - Getter: - @brief Returns a value indicating whether the netlist names are case sensitive - This method has been added in version 0.27.3. - - Setter: - @brief Sets a value indicating whether the netlist names are case sensitive - This method has been added in version 0.27.3. - """ - @classmethod - def new(cls) -> Netlist: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> Netlist: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Netlist: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def __str__(self) -> str: - r""" - @brief Converts the netlist to a string representation. - This method is intended for test purposes mainly. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - @overload - def add(self, circuit: Circuit) -> None: - r""" - @brief Adds the circuit to the netlist - This method will add the given circuit object to the netlist. After the circuit has been added, it will be owned by the netlist. - """ - @overload - def add(self, device_class: DeviceClass) -> None: - r""" - @brief Adds the device class to the netlist - This method will add the given device class object to the netlist. After the device class has been added, it will be owned by the netlist. - """ - def assign(self, other: Netlist) -> None: - r""" - @brief Assigns another object to self - """ - def blank_circuit(self, pattern: str) -> None: - r""" - @brief Blanks circuits matching a certain pattern - This method will erase everything from inside the circuits matching the given pattern. It will only leave pins which are not connected to any net. Hence, this method forms 'abstract' or black-box circuits which can be instantiated through subcircuits like the former ones, but are empty shells. - The name pattern is a glob expression. For example, 'blank_circuit("np*")' will blank out all circuits with names starting with 'np'. - - For more details see \Circuit#blank which is the corresponding method on the actual object. - """ - @overload - def circuit_by_cell_index(self, cell_index: int) -> Circuit: - r""" - @brief Gets the circuit object for a given cell index (const version). - If the cell index is not valid or no circuit is registered with this index, nil is returned. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def circuit_by_cell_index(self, cell_index: int) -> Circuit: - r""" - @brief Gets the circuit object for a given cell index. - If the cell index is not valid or no circuit is registered with this index, nil is returned. - """ - @overload - def circuit_by_name(self, name: str) -> Circuit: - r""" - @brief Gets the circuit object for a given name. - If the name is not a valid circuit name, nil is returned. - """ - @overload - def circuit_by_name(self, name: str) -> Circuit: - r""" - @brief Gets the circuit object for a given name (const version). - If the name is not a valid circuit name, nil is returned. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def circuits_by_name(self, name_pattern: str) -> List[Circuit]: - r""" - @brief Gets the circuit objects for a given name filter. - The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. - - This method has been introduced in version 0.26.4. - """ - @overload - def circuits_by_name(self, name_pattern: str) -> List[Circuit]: - r""" - @brief Gets the circuit objects for a given name filter (const version). - The name filter is a glob pattern. This method will return all \Circuit objects matching the glob pattern. - - - This constness variant has been introduced in version 0.26.8 - """ - def combine_devices(self) -> None: - r""" - @brief Combines devices where possible - This method will combine devices that can be combined according to their device classes 'combine_devices' method. - For example, serial or parallel resistors can be combined into a single resistor. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - @overload - def device_class_by_name(self, name: str) -> DeviceClass: - r""" - @brief Gets the device class for a given name. - If the name is not a valid device class name, nil is returned. - """ - @overload - def device_class_by_name(self, name: str) -> DeviceClass: - r""" - @brief Gets the device class for a given name (const version). - If the name is not a valid device class name, nil is returned. - - This constness variant has been introduced in version 0.26.8 - """ - def dup(self) -> Netlist: - r""" - @brief Creates a copy of self - """ - @overload - def each_circuit(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the circuits of the netlist - """ - @overload - def each_circuit(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the circuits of the netlist (const version) - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_circuit_bottom_up(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the circuits bottom-up (const version) - Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_circuit_bottom_up(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the circuits bottom-up - Iterating bottom-up means the parent circuits come after the child circuits. This is the basically the reverse order as delivered by \each_circuit_top_down. - """ - @overload - def each_circuit_top_down(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the circuits top-down - Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. - """ - @overload - def each_circuit_top_down(self) -> Iterator[Circuit]: - r""" - @brief Iterates over the circuits top-down (const version) - Iterating top-down means the parent circuits come before the child circuits. The first \top_circuit_count circuits are top circuits - i.e. those which are not referenced by other circuits. - - This constness variant has been introduced in version 0.26.8 - """ - @overload - def each_device_class(self) -> Iterator[DeviceClass]: - r""" - @brief Iterates over the device classes of the netlist - """ - @overload - def each_device_class(self) -> Iterator[DeviceClass]: - r""" - @brief Iterates over the device classes of the netlist (const version) - - This constness variant has been introduced in version 0.26.8 - """ - def flatten(self) -> None: - r""" - @brief Flattens all circuits of the netlist - After calling this method, only the top circuits will remain. - """ - @overload - def flatten_circuit(self, circuit: Circuit) -> None: - r""" - @brief Flattens a subcircuit - This method will substitute all instances (subcircuits) of the given circuit by it's contents. After this, the circuit is removed. - """ - @overload - def flatten_circuit(self, pattern: str) -> None: - r""" - @brief Flattens circuits matching a certain pattern - This method will substitute all instances (subcircuits) of all circuits with names matching the given name pattern. The name pattern is a glob expression. For example, 'flatten_circuit("np*")' will flatten all circuits with names starting with 'np'. - """ - def flatten_circuits(self, arg0: Sequence[Circuit]) -> None: - r""" - @brief Flattens all given circuits of the netlist - This method is equivalent to calling \flatten_circuit for all given circuits, but more efficient. - - This method has been introduced in version 0.26.1 - """ - def from_s(self, str: str) -> None: - r""" - @brief Reads the netlist from a string representation. - This method is intended for test purposes mainly. It turns a string returned by \to_s back into a netlist. Note that the device classes must be created before as they are not persisted inside the string. - """ - def is_case_sensitive(self) -> bool: - r""" - @brief Returns a value indicating whether the netlist names are case sensitive - This method has been added in version 0.27.3. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def make_top_level_pins(self) -> None: - r""" - @brief Creates pins for top-level circuits. - This method will turn all named nets of top-level circuits (such that are not referenced by subcircuits) into pins. This method can be used before purge to avoid that purge will remove nets which are directly connecting to subcircuits. - """ - def purge(self) -> None: - r""" - @brief Purge unused nets, circuits and subcircuits. - This method will purge all nets which return \floating == true. Circuits which don't have any nets (or only floating ones) and removed. Their subcircuits are disconnected. - This method respects the \Circuit#dont_purge attribute and will never delete circuits with this flag set. - """ - def purge_circuit(self, circuit: Circuit) -> None: - r""" - @brief Removes the given circuit object and all child circuits which are not used otherwise from the netlist - After the circuit has been removed, the object becomes invalid and cannot be used further. A circuit with references (see \has_refs?) should not be removed as the subcircuits calling it would afterwards point to nothing. - """ - def purge_nets(self) -> None: - r""" - @brief Purges floating nets. - Floating nets can be created as effect of reconnections of devices or pins. This method will eliminate all nets that make less than two connections. - """ - def read(self, file: str, reader: NetlistReader) -> None: - r""" - @brief Writes the netlist to the given file using the given reader object to parse the file - See \NetlistSpiceReader for an example for a parser. - """ - @overload - def remove(self, circuit: Circuit) -> None: - r""" - @brief Removes the given circuit object from the netlist - After the circuit has been removed, the object becomes invalid and cannot be used further. A circuit with references (see \has_refs?) should not be removed as the subcircuits calling it would afterwards point to nothing. - """ - @overload - def remove(self, device_class: DeviceClass) -> None: - r""" - @brief Removes the given device class object from the netlist - After the object has been removed, it becomes invalid and cannot be used further. Use this method with care as it may corrupt the internal structure of the netlist. Only use this method when device refers to this device class. - """ - def simplify(self) -> None: - r""" - @brief Convenience method that combines the simplification. - This method is a convenience method that runs \make_top_level_pins, \purge, \combine_devices and \purge_nets. - """ - def to_s(self) -> str: - r""" - @brief Converts the netlist to a string representation. - This method is intended for test purposes mainly. - """ - def top_circuit_count(self) -> int: - r""" - @brief Gets the number of top circuits. - Top circuits are those which are not referenced by other circuits via subcircuits. A well-formed netlist has a single top circuit. - """ - def write(self, file: str, writer: NetlistWriter, description: Optional[str] = ...) -> None: - r""" - @brief Writes the netlist to the given file using the given writer object to format the file - See \NetlistSpiceWriter for an example for a formatter. The description is an arbitrary text which will be put into the file somewhere at the beginning. - """ - -class NetlistSpiceWriterDelegate: - r""" - @brief Provides a delegate for the SPICE writer for doing special formatting for devices - Supply a customized class to provide a specialized writing scheme for devices. You need a customized class if you want to implement special devices or you want to use subcircuits rather than the built-in devices. - - See \NetlistSpiceWriter for more details. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls) -> NetlistSpiceWriterDelegate: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetlistSpiceWriterDelegate: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetlistSpiceWriterDelegate: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetlistSpiceWriterDelegate) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetlistSpiceWriterDelegate: - r""" - @brief Creates a copy of self - """ - def emit_comment(self, comment: str) -> None: - r""" - @brief Writes the given comment into the file - """ - def emit_line(self, line: str) -> None: - r""" - @brief Writes the given line into the file - """ - def format_name(self, name: str) -> str: - r""" - @brief Formats the given name in a SPICE-compatible way - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def net_to_string(self, net: Net) -> str: - r""" - @brief Gets the node ID for the given net - The node ID is a numeric string instead of the full name of the net. Numeric IDs are used within SPICE netlist because they are usually shorter. - """ - def write_device(self, device: Device) -> None: - r""" - @hide - """ - def write_device_intro(self, arg0: DeviceClass) -> None: - r""" - @hide - """ - def write_header(self) -> None: - r""" - @hide - """ - -class NetlistWriter: - r""" - @brief Base class for netlist writers - This class is provided as a base class for netlist writers. It is not intended for reimplementation on script level, but used internally as an interface. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls) -> NetlistWriter: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class NetlistSpiceWriter(NetlistWriter): - r""" - @brief Implements a netlist writer for the SPICE format. - Provide a delegate for customizing the way devices are written. - - Use the SPICE writer like this: - - @code - writer = RBA::NetlistSpiceWriter::new - netlist.write(path, writer) - @/code - - You can give a custom description for the headline: - - @code - writer = RBA::NetlistSpiceWriter::new - netlist.write(path, writer, "A custom description") - @/code - - To customize the output, you can use a device writer delegate. - The delegate is an object of a class derived from \NetlistSpiceWriterDelegate which reimplements several methods to customize the following parts: - - @ul - @li A global header (\NetlistSpiceWriterDelegate#write_header): this method is called to print the part right after the headline @/li - @li A per-device class header (\NetlistSpiceWriterDelegate#write_device_intro): this method is called for every device class and may print device-class specific headers (e.g. model definitions) @/li - @li Per-device output: this method (\NetlistSpiceWriterDelegate#write_device): this method is called for every device and may print the device statement(s) in a specific way. @/li - @/ul - - The delegate must use \NetlistSpiceWriterDelegate#emit_line to print a line, \NetlistSpiceWriterDelegate#emit_comment to print a comment etc. - For more method see \NetlistSpiceWriterDelegate. - - A sample with a delegate is this: - - @code - class MyDelegate < RBA::NetlistSpiceWriterDelegate - - def write_header - emit_line("*** My special header") - end - - def write_device_intro(cls) - emit_comment("My intro for class " + cls.name) - end - - def write_device(dev) - if dev.device_class.name != "MYDEVICE" - emit_comment("Terminal #1: " + net_to_string(dev.net_for_terminal(0))) - emit_comment("Terminal #2: " + net_to_string(dev.net_for_terminal(1))) - super(dev) - emit_comment("After device " + dev.expanded_name) - else - super(dev) - end - end - - end - - # write the netlist with delegate: - writer = RBA::NetlistSpiceWriter::new(MyDelegate::new) - netlist.write(path, writer) - @/code - - This class has been introduced in version 0.26. - """ - use_net_names: bool - r""" - Getter: - @brief Gets a value indicating whether to use net names (true) or net numbers (false). - - Setter: - @brief Sets a value indicating whether to use net names (true) or net numbers (false). - The default is to use net numbers. - """ - with_comments: bool - r""" - Getter: - @brief Gets a value indicating whether to embed comments for position etc. (true) or not (false). - - Setter: - @brief Sets a value indicating whether to embed comments for position etc. (true) or not (false). - The default is to embed comments. - """ - @overload - @classmethod - def new(cls) -> NetlistSpiceWriter: - r""" - @brief Creates a new writer without delegate. - """ - @overload - @classmethod - def new(cls, arg0: NetlistSpiceWriterDelegate) -> NetlistSpiceWriter: - r""" - @brief Creates a new writer with a delegate. - """ - def __copy__(self) -> NetlistSpiceWriter: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetlistSpiceWriter: - r""" - @brief Creates a copy of self - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a new writer without delegate. - """ - @overload - def __init__(self, arg0: NetlistSpiceWriterDelegate) -> None: - r""" - @brief Creates a new writer with a delegate. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetlistWriter) -> None: - r""" - @brief Assigns another object to self - """ - def dup(self) -> NetlistSpiceWriter: - r""" - @brief Creates a copy of self - """ - -class NetlistReader: - r""" - @brief Base class for netlist readers - This class is provided as a base class for netlist readers. It is not intended for reimplementation on script level, but used internally as an interface. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls) -> NetlistReader: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class ParseElementComponentsData: - r""" - @brief Supplies the return value for \NetlistSpiceReaderDelegate#parse_element_components. - This is a structure with two members: 'strings' for the string arguments and 'parameters' for the named numerical arguments. - - This helper class has been introduced in version 0.27.1. - """ - parameters: Dict[str, float] - r""" - Getter: - @brief Gets the (named) numerical parameters - - Setter: - @brief Sets the (named) numerical parameters - """ - strings: List[str] - r""" - Getter: - @brief Gets the string parameters - - Setter: - @brief Sets the string parameters - """ - @classmethod - def new(cls) -> ParseElementComponentsData: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> ParseElementComponentsData: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> ParseElementComponentsData: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ParseElementComponentsData) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> ParseElementComponentsData: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class ParseElementData: - r""" - @brief Supplies the return value for \NetlistSpiceReaderDelegate#parse_element. - This is a structure with four members: 'model_name' for the model name, 'value' for the default numerical value, 'net_names' for the net names and 'parameters' for the named numerical parameters. - - This helper class has been introduced in version 0.27.1. - """ - model_name: str - r""" - Getter: - @brief Gets the model name - - Setter: - @brief Sets the model name - """ - net_names: List[str] - r""" - Getter: - @brief Gets the net names - - Setter: - @brief Sets the net names - """ - parameters: Dict[str, float] - r""" - Getter: - @brief Gets the (named) numerical parameters - - Setter: - @brief Sets the (named) numerical parameters - """ - value: float - r""" - Getter: - @brief Gets the value - - Setter: - @brief Sets the value - """ - @classmethod - def new(cls) -> ParseElementData: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> ParseElementData: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> ParseElementData: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ParseElementData) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> ParseElementData: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class NetlistSpiceReaderDelegate: - r""" - @brief Provides a delegate for the SPICE reader for translating device statements - Supply a customized class to provide a specialized reading scheme for devices. You need a customized class if you want to implement device reading from model subcircuits or to translate device parameters. - - See \NetlistSpiceReader for more details. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls) -> NetlistSpiceReaderDelegate: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetlistSpiceReaderDelegate: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetlistSpiceReaderDelegate: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetlistSpiceReaderDelegate) -> None: - r""" - @brief Assigns another object to self - """ - def control_statement(self, arg0: str) -> bool: - r""" - @hide - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetlistSpiceReaderDelegate: - r""" - @brief Creates a copy of self - """ - def element(self, arg0: Circuit, arg1: str, arg2: str, arg3: str, arg4: float, arg5: Sequence[Net], arg6: Dict[str, float]) -> bool: - r""" - @hide - """ - def error(self, msg: str) -> None: - r""" - @brief Issues an error with the given message. - Use this method to generate an error. - """ - def finish(self, arg0: Netlist) -> None: - r""" - @hide - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def parse_element(self, arg0: str, arg1: str) -> ParseElementData: - r""" - @hide - """ - def parse_element_components(self, s: str) -> ParseElementComponentsData: - r""" - @brief Parses a string into string and parameter components. - This method is provided to simplify the implementation of 'parse_element'. It takes a string and splits it into string arguments and parameter values. For example, 'a b c=6' renders two string arguments in 'nn' and one parameter ('C'->6.0). It returns data \ParseElementComponentsData object with the strings and parameters. - The parameter names are already translated to upper case. - - This method has been introduced in version 0.27.1 - """ - def start(self, arg0: Netlist) -> None: - r""" - @hide - """ - def translate_net_name(self, arg0: str) -> str: - r""" - @hide - """ - def value_from_string(self, s: str) -> Any: - r""" - @brief Translates a string into a value - This function simplifies the implementation of SPICE readers by providing a translation of a unit-annotated string into double values. For example, '1k' is translated to 1000.0. In addition, simple formula evaluation is supported, e.g '(1+3)*2' is translated into 8.0. - - This method has been introduced in version 0.27.1 - """ - def wants_subcircuit(self, arg0: str) -> bool: - r""" - @hide - """ - -class NetlistSpiceReader(NetlistReader): - r""" - @brief Implements a netlist Reader for the SPICE format. - Use the SPICE reader like this: - - @code - reader = RBA::NetlistSpiceReader::new - netlist = RBA::Netlist::new - netlist.read(path, reader) - @/code - - The translation of SPICE elements can be tailored by providing a \NetlistSpiceReaderDelegate class. This allows translating of device parameters and mapping of some subcircuits to devices. - - The following example is a delegate that turns subcircuits called HVNMOS and HVPMOS into MOS4 devices with the parameters scaled by 1.5: - - @code - class MyDelegate < RBA::NetlistSpiceReaderDelegate - - # says we want to catch these subcircuits as devices - def wants_subcircuit(name) - name == "HVNMOS" || name == "HVPMOS" - end - - # translate the element - def element(circuit, el, name, model, value, nets, params) - - if el != "X" - # all other elements are left to the standard implementation - return super - end - - if nets.size != 4 - error("Subcircuit #{model} needs four nodes") - end - - # provide a device class - cls = circuit.netlist.device_class_by_name(model) - if ! cls - cls = RBA::DeviceClassMOS4Transistor::new - cls.name = model - circuit.netlist.add(cls) - end - - # create a device - device = circuit.create_device(cls, name) - - # and configure the device - [ "S", "G", "D", "B" ].each_with_index do |t,index| - device.connect_terminal(t, nets[index]) - end - params.each do |p,value| - device.set_parameter(p, value * 1.5) - end - - end - - end - - # usage: - - mydelegate = MyDelegate::new - reader = RBA::NetlistSpiceReader::new(mydelegate) - - nl = RBA::Netlist::new - nl.read(input_file, reader) - @/code - - A somewhat contrived example for using the delegate to translate net names is this: - - @code - class MyDelegate < RBA::NetlistSpiceReaderDelegate - - # translates 'VDD' to 'VXX' and leave all other net names as is: - alias translate_net_name_org translate_net_name - def translate_net_name(n) - return n == "VDD" ? "VXX" : translate_net_name_org(n)} - end - - end - @/code - - This class has been introduced in version 0.26. It has been extended in version 0.27.1. - """ - @overload - @classmethod - def new(cls) -> NetlistSpiceReader: - r""" - @brief Creates a new reader. - """ - @overload - @classmethod - def new(cls, delegate: NetlistSpiceReaderDelegate) -> NetlistSpiceReader: - r""" - @brief Creates a new reader with a delegate. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a new reader. - """ - @overload - def __init__(self, delegate: NetlistSpiceReaderDelegate) -> None: - r""" - @brief Creates a new reader with a delegate. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceClassResistor(DeviceClass): - r""" - @brief A device class for a resistor. - This class describes a resistor. Resistors are defined by their combination behavior and the basic parameter 'R' which is the resistance in Ohm. - - A resistor has two terminals, A and B. - The parameters of a resistor are R (the value in Ohms), L and W (length and width in micrometers) and A and P (area and perimeter in square micrometers and micrometers respectively). - - This class has been introduced in version 0.26. - """ - PARAM_A: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter A - """ - PARAM_L: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter L - """ - PARAM_P: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter P - """ - PARAM_R: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter R - """ - PARAM_W: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter W - """ - TERMINAL_A: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal A - """ - TERMINAL_B: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal B - """ - def _assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> DeviceClassResistor: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceClassResistorWithBulk(DeviceClassResistor): - r""" - @brief A device class for a resistor with a bulk terminal (substrate, well). - This class is similar to \DeviceClassResistor, but provides an additional terminal (BULK) for the well or substrate the resistor is embedded in. - - The additional terminal is 'W' for the well/substrate terminal. - - This class has been introduced in version 0.26. - """ - TERMINAL_W: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal W (well, bulk) - """ - def _assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> DeviceClassResistorWithBulk: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceClassCapacitor(DeviceClass): - r""" - @brief A device class for a capacitor. - This describes a capacitor. Capacitors are defined by their combination behavior and the basic parameter 'C' which is the capacitance in Farad. - - A capacitor has two terminals, A and B. - The parameters of a capacitor are C (the value in Farad) and A and P (area and perimeter in square micrometers and micrometers respectively). - - This class has been introduced in version 0.26. - """ - PARAM_A: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter A - """ - PARAM_C: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter C - """ - PARAM_P: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter P - """ - TERMINAL_A: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal A - """ - TERMINAL_B: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal B - """ - def _assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> DeviceClassCapacitor: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceClassCapacitorWithBulk(DeviceClassCapacitor): - r""" - @brief A device class for a capacitor with a bulk terminal (substrate, well). - This class is similar to \DeviceClassCapacitor, but provides an additional terminal (BULK) for the well or substrate the capacitor is embedded in. - - The additional terminal is 'W' for the well/substrate terminal. - - This class has been introduced in version 0.26. - """ - TERMINAL_W: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal W (well, bulk) - """ - def _assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> DeviceClassCapacitorWithBulk: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceClassInductor(DeviceClass): - r""" - @brief A device class for an inductor. - This class describes an inductor. Inductors are defined by their combination behavior and the basic parameter 'L' which is the inductance in Henry. - - An inductor has two terminals, A and B. - - This class has been introduced in version 0.26. - """ - PARAM_L: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter L - """ - TERMINAL_A: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal A - """ - TERMINAL_B: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal B - """ - def _assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> DeviceClassInductor: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceClassDiode(DeviceClass): - r""" - @brief A device class for a diode. - This class describes a diode. - A diode has two terminals, A (anode) and C (cathode). - It has two parameters: The diode area in square micrometers (A) and the diode area perimeter in micrometers (P). - - Diodes only combine when parallel and in the same direction. In this case, their areas and perimeters are added. - This class has been introduced in version 0.26. - """ - PARAM_A: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter A - """ - PARAM_P: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter P - """ - TERMINAL_A: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal A - """ - TERMINAL_C: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal C - """ - def _assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> DeviceClassDiode: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceClassBJT3Transistor(DeviceClass): - r""" - @brief A device class for a bipolar transistor. - This class describes a bipolar transistor. Bipolar transistors have tree terminals: the collector (C), the base (B) and the emitter (E). - Multi-emitter transistors are resolved in individual devices. - The parameters are AE, AB and AC for the emitter, base and collector areas in square micrometers and PE, PB and PC for the emitter, base and collector perimeters in micrometers. - In addition, the emitter count (NE) is given. The emitter count is 1 always for a transistor extracted initially. Upon combination of devices, the emitter counts are added, thus forming multi-emitter devices. - - This class has been introduced in version 0.26. - """ - PARAM_AB: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter AB (base area) - """ - PARAM_AC: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter AC (collector area) - """ - PARAM_AE: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter AE (emitter area) - """ - PARAM_NE: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter NE (emitter count) - """ - PARAM_PB: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter PB (base perimeter) - """ - PARAM_PC: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter PC (collector perimeter) - """ - PARAM_PE: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter PE (emitter perimeter) - """ - TERMINAL_B: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal B (base) - """ - TERMINAL_C: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal C (collector) - """ - TERMINAL_E: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal E (emitter) - """ - def _assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> DeviceClassBJT3Transistor: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceClassBJT4Transistor(DeviceClassBJT3Transistor): - r""" - @brief A device class for a 4-terminal bipolar transistor. - This class describes a bipolar transistor with a substrate terminal. A device class for a bipolar transistor without a substrate terminal is \DeviceClassBJT3Transistor. - The additional terminal is 'S' for the substrate terminal. - BJT4 transistors combine in parallel if both substrate terminals are connected to the same net. - - This class has been introduced in version 0.26. - """ - TERMINAL_S: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal S - """ - def _assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> DeviceClassBJT4Transistor: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceClassMOS3Transistor(DeviceClass): - r""" - @brief A device class for a 3-terminal MOS transistor. - This class describes a MOS transistor without a bulk terminal. A device class for a MOS transistor with a bulk terminal is \DeviceClassMOS4Transistor. MOS transistors are defined by their combination behavior and the basic parameters. - - The parameters are L, W, AS, AD, PS and PD for the gate length and width in micrometers, source and drain area in square micrometers and the source and drain perimeter in micrometers. - - The terminals are S, G and D for source, gate and drain. - - MOS transistors combine in parallel mode, when both gate lengths are identical and their gates are connected (source and drain can be swapped). In this case, their widths and source and drain areas are added. - - This class has been introduced in version 0.26. - """ - PARAM_AD: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter AD - """ - PARAM_AS: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter AS - """ - PARAM_L: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter L - """ - PARAM_PD: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter PD - """ - PARAM_PS: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter PS - """ - PARAM_W: ClassVar[int] - r""" - @brief A constant giving the parameter ID for parameter W - """ - TERMINAL_D: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal D - """ - TERMINAL_G: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal G - """ - TERMINAL_S: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal S - """ - def _assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> DeviceClassMOS3Transistor: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def join_split_gates(self, circuit: Circuit) -> None: - r""" - @brief Joins source/drain nets from 'split gate' transistor strings on the given circuit - This method has been introduced in version 0.27.9 - """ - -class DeviceClassMOS4Transistor(DeviceClassMOS3Transistor): - r""" - @brief A device class for a 4-terminal MOS transistor. - This class describes a MOS transistor with a bulk terminal. A device class for a MOS transistor without a bulk terminal is \DeviceClassMOS3Transistor. MOS transistors are defined by their combination behavior and the basic parameters. - - The additional terminal is 'B' for the bulk terminal. - MOS4 transistors combine in parallel if both bulk terminals are connected to the same net. - - This class has been introduced in version 0.26. - """ - TERMINAL_B: ClassVar[int] - r""" - @brief A constant giving the terminal ID for terminal B - """ - def _assign(self, other: DeviceClass) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> DeviceClassMOS4Transistor: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceClassFactory: - r""" - @brief A factory for creating specific device classes for the standard device extractors - Use a reimplementation of this class to provide a device class generator for built-in device extractors such as \DeviceExtractorMOS3Transistor. The constructor of this extractor has a 'factory' parameter which takes an object of \DeviceClassFactory type. - - If such an object is provided, this factory is used to create the actual device class. The following code shows an example: - - @code - class MyClass < RBA::DeviceClassMOS3Transistor - ... overrides some methods ... - end - - class MyFactory < RBA::DeviceClassFactory - def create_class - MyClass.new - end - end - - extractor = RBA::DeviceExtractorMOS3Transistor::new("NMOS", false, MyFactory.new) - @/code - - When using a factory with a device extractor, make sure it creates a corresponding device class, e.g. for the \DeviceExtractorMOS3Transistor extractor create a device class derived from \DeviceClassMOS3Transistor. - - This class has been introduced in version 0.27.3. - """ - @classmethod - def new(cls) -> DeviceClassFactory: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> DeviceClassFactory: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DeviceClassFactory: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DeviceClassFactory) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DeviceClassFactory: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class NetlistDeviceExtractorError: - r""" - @brief An error that occurred during device extraction - The device extractor will keep errors that occurred during extraction of the devices. It does not by using this error class. - - An error is basically described by the cell/circuit it occurs in and the message. In addition, a geometry may be attached forming a marker that can be shown when the error is selected. The geometry is given as a \DPolygon object. If no geometry is specified, this polygon is empty. - - For categorization of the errors, a category name and description may be specified. If given, the errors will be shown in the specified category. The category description is optional. - - This class has been introduced in version 0.26. - """ - category_description: str - r""" - Getter: - @brief Gets the category description. - See \category_name= for details about categories. - Setter: - @brief Sets the category description. - See \category_name= for details about categories. - """ - category_name: str - r""" - Getter: - @brief Gets the category name. - See \category_name= for more details. - Setter: - @brief Sets the category name. - The category name is optional. If given, it specifies a formal category name. Errors with the same category name are shown in that category. If in addition a category description is specified (see \category_description), this description will be displayed as the title of. - """ - cell_name: str - r""" - Getter: - @brief Gets the cell name. - See \cell_name= for details about this attribute. - Setter: - @brief Sets the cell name. - The cell name is the name of the layout cell which was treated. This is also the name of the circuit the device should have appeared in (it may be dropped because of this error). If netlist hierarchy manipulation happens however, the circuit may not exist any longer or may be renamed. - """ - geometry: DPolygon - r""" - Getter: - @brief Gets the geometry. - See \geometry= for more details. - Setter: - @brief Sets the geometry. - The geometry is optional. If given, a marker will be shown when selecting this error. - """ - message: str - r""" - Getter: - @brief Gets the message text. - - Setter: - @brief Sets the message text. - """ - @classmethod - def new(cls) -> NetlistDeviceExtractorError: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetlistDeviceExtractorError: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetlistDeviceExtractorError: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetlistDeviceExtractorError) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetlistDeviceExtractorError: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class NetlistDeviceExtractorLayerDefinition: - r""" - @brief Describes a layer used in the device extraction - This read-only structure is used to describe a layer in the device extraction. - Every device has specific layers used in the device extraction process. - Layer definitions can be retrieved using \NetlistDeviceExtractor#each_layer. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls) -> NetlistDeviceExtractorLayerDefinition: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetlistDeviceExtractorLayerDefinition: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetlistDeviceExtractorLayerDefinition: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetlistDeviceExtractorLayerDefinition) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def description(self) -> str: - r""" - @brief Gets the description of the layer. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetlistDeviceExtractorLayerDefinition: - r""" - @brief Creates a copy of self - """ - def fallback_index(self) -> int: - r""" - @brief Gets the index of the fallback layer. - This is the index of the layer to be used when this layer isn't specified for input or (more important) output. - """ - def index(self) -> int: - r""" - @brief Gets the index of the layer. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def name(self) -> str: - r""" - @brief Gets the name of the layer. - """ - -class DeviceExtractorBase: - r""" - @brief The base class for all device extractors. - This is an abstract base class for device extractors. See \GenericDeviceExtractor for a generic class which you can reimplement to supply your own customized device extractor. In many cases using one of the preconfigured specific device extractors may be useful already and it's not required to implement a custom one. For an example about a preconfigured device extractor see \DeviceExtractorMOS3Transistor. - - This class cannot and should not be instantiated explicitly. Use one of the subclasses instead. - - This class has been introduced in version 0.26. - """ - name: str - r""" - Getter: - @brief Gets the name of the device extractor and the device class. - Setter: - @brief Sets the name of the device extractor and the device class. - """ - @classmethod - def new(cls) -> DeviceExtractorBase: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def device_class(self) -> DeviceClass: - r""" - @brief Gets the device class used during extraction - The attribute will hold the actual device class used in the device extraction. It is valid only after 'extract_devices'. - - This method has been added in version 0.27.3. - """ - def each_error(self) -> Iterator[NetlistDeviceExtractorError]: - r""" - @brief Iterates over all errors collected in the device extractor. - """ - def each_layer_definition(self) -> Iterator[NetlistDeviceExtractorLayerDefinition]: - r""" - @brief Iterates over all layer definitions. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def test_initialize(self, netlist: Netlist) -> None: - r""" - @hide - """ - -class GenericDeviceExtractor(DeviceExtractorBase): - r""" - @brief The basic class for implementing custom device extractors. - - This class serves as a base class for implementing customized device extractors. This class does not provide any extraction functionality, so you have to implement every detail. - - Device extraction requires a few definitions. The definitions are made in the reimplementation of the \setup - method. Required definitions to be made are: - - @ul - @li The name of the extractor. This will also be the name of the device class produced by the extractor. The name is set using \name=. @/li - @li The device class of the devices to produce. The device class is registered using \register_device_class. @/li - @li The layers used for the device extraction. These are input layers for the extraction as well as output layers for defining the terminals. Terminals are the points at which the nets connect to the devices. - Layers are defined using \define_layer. Initially, layers are abstract definitions with a name and a description. - Concrete layers will be given when defining the connectivity. @/li - @/ul - - When the device extraction is started, the device extraction algorithm will first ask the device extractor for the 'connectivity'. This is not a connectivity in a sense of electrical connections. The connectivity defines are logical compound that makes up the device. 'Connected' shapes are collected and presented to the device extractor. - The connectivity is obtained by calling \get_connectivity. This method must be implemented to produce the connectivity. - - Finally, the individual devices need to be extracted. Each cluster of connected shapes is presented to the device extractor. A cluster may include more than one device. It's the device extractor's responsibility to extract the devices from this cluster and deliver the devices through \create_device. In addition, terminals have to be defined, so the net extractor can connect to the devices. Terminal definitions are made through \define_terminal. The device extraction is implemented in the \extract_devices method. - - If errors occur during device extraction, the \error method may be used to issue such errors. Errors reported this way are kept in the error log. - - This class has been introduced in version 0.26. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create_device(self) -> Device: - r""" - @brief Creates a device. - The device object returned can be configured by the caller, e.g. set parameters. - It will be owned by the netlist and must not be deleted by the caller. - """ - def dbu(self) -> float: - r""" - @brief Gets the database unit - """ - def define_layer(self, name: str, description: str) -> NetlistDeviceExtractorLayerDefinition: - r""" - @brief Defines a layer. - @return The layer descriptor object created for this layer (use 'index' to get the layer's index) - Each call will define one more layer for the device extraction. - This method shall be used inside the implementation of \setup to define - the device layers. The actual geometries are later available to \extract_devices - in the order the layers are defined. - """ - def define_opt_layer(self, name: str, fallback: int, description: str) -> NetlistDeviceExtractorLayerDefinition: - r""" - @brief Defines a layer with a fallback layer. - @return The layer descriptor object created for this layer (use 'index' to get the layer's index) - As \define_layer, this method allows specification of device extraction layer. In addition to \define_layout, it features a fallback layer. If in the device extraction statement, the primary layer is not given, the fallback layer will be used. Hence, this layer is optional. The fallback layer is given by it's index and must be defined before the layer using the fallback layer is defined. For the index, 0 is the first layer defined, 1 the second and so forth. - """ - @overload - def define_terminal(self, device: Device, terminal_id: int, layer_index: int, point: Point) -> None: - r""" - @brief Defines a device terminal. - This method will define a terminal to the given device and the given terminal ID. - The terminal will be placed on the layer given by "layer_index". The layer index - is the index of the layer during layer definition. The first layer is 0, the second layer 1 etc. - - This version produces a point-like terminal. Note that the point is - specified in database units. - """ - @overload - def define_terminal(self, device: Device, terminal_id: int, layer_index: int, shape: Box) -> None: - r""" - @brief Defines a device terminal. - This method will define a terminal to the given device and the given terminal ID. - The terminal will be placed on the layer given by "layer_index". The layer index - is the index of the layer during layer definition. The first layer is 0, the second layer 1 etc. - - This version produces a terminal with a shape given by the box. Note that the box is - specified in database units. - """ - @overload - def define_terminal(self, device: Device, terminal_id: int, layer_index: int, shape: Polygon) -> None: - r""" - @brief Defines a device terminal. - This method will define a terminal to the given device and the given terminal ID. - The terminal will be placed on the layer given by "layer_index". The layer index - is the index of the layer during layer definition. The first layer is 0, the second layer 1 etc. - - This version produces a terminal with a shape given by the polygon. Note that the polygon is - specified in database units. - """ - @overload - def define_terminal(self, device: Device, terminal_name: str, layer_name: str, point: Point) -> None: - r""" - @brief Defines a device terminal using names for terminal and layer. - - This convenience version of the ID-based \define_terminal methods allows using names for terminal and layer. - It has been introduced in version 0.28. - """ - @overload - def define_terminal(self, device: Device, terminal_name: str, layer_name: str, shape: Box) -> None: - r""" - @brief Defines a device terminal using names for terminal and layer. - - This convenience version of the ID-based \define_terminal methods allows using names for terminal and layer. - It has been introduced in version 0.28. - """ - @overload - def define_terminal(self, device: Device, terminal_name: str, layer_name: str, shape: Polygon) -> None: - r""" - @brief Defines a device terminal using names for terminal and layer. - - This convenience version of the ID-based \define_terminal methods allows using names for terminal and layer. - It has been introduced in version 0.28. - """ - @overload - def error(self, message: str) -> None: - r""" - @brief Issues an error with the given message - """ - @overload - def error(self, message: str, geometry: DPolygon) -> None: - r""" - @brief Issues an error with the given message and micrometer-units polygon geometry - """ - @overload - def error(self, message: str, geometry: Polygon) -> None: - r""" - @brief Issues an error with the given message and database-unit polygon geometry - """ - @overload - def error(self, category_name: str, category_description: str, message: str) -> None: - r""" - @brief Issues an error with the given category name and description, message - """ - @overload - def error(self, category_name: str, category_description: str, message: str, geometry: DPolygon) -> None: - r""" - @brief Issues an error with the given category name and description, message and micrometer-units polygon geometry - """ - @overload - def error(self, category_name: str, category_description: str, message: str, geometry: Polygon) -> None: - r""" - @brief Issues an error with the given category name and description, message and database-unit polygon geometry - """ - def register_device_class(self, device_class: DeviceClass) -> None: - r""" - @brief Registers a device class. - The device class object will become owned by the netlist and must not be deleted by - the caller. The name of the device class will be changed to the name given to - the device extractor. - This method shall be used inside the implementation of \setup to register - the device classes. - """ - def sdbu(self) -> float: - r""" - @brief Gets the scaled database unit - Use this unit to compute device properties. It is the database unit multiplied with the - device scaling factor. - """ - -class DeviceExtractorMOS3Transistor(DeviceExtractorBase): - r""" - @brief A device extractor for a three-terminal MOS transistor - - This class supplies the generic extractor for a MOS device. - The device is defined by two basic input layers: the diffusion area - (source and drain) and the gate area. It requires a third layer - (poly) to put the gate terminals on. The separation between poly - and allows separating the device recognition layer (gate) from the - conductive layer. - - The device class produced by this extractor is \DeviceClassMOS3Transistor. - - The extractor delivers six parameters: - - @ul - @li 'L' - the gate length in micrometer units @/li - @li 'W' - the gate width in micrometer units @/li - @li 'AS' and 'AD' - the source and drain region areas in square micrometers @/li - @li 'PS' and 'PD' - the source and drain region perimeters in micrometer units @/li - @/ul - - The device layer names are: - - @ul - @li In strict mode: 'S' (source), 'D' (drain) and 'G' (gate). @/li - @li In non-strict mode: 'SD' (source and drain) and 'G' (gate). @/li - @/ul - - The terminals are output on these layers: - @ul - @li 'tS' - source. Default output is 'S' (strict mode) or 'SD' (otherwise). @/li - @li 'tD' - drain. Default output is 'D' (strict mode) or 'SD' (otherwise). @/li - @li 'tG' - gate. Default output is 'G'. @/li - @/ul - - The source/drain (diffusion) area is distributed on the number of gates connecting to - the particular source or drain area. - - This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorMOS3Transistor: - r""" - @brief Creates a new device extractor with the given name. - If \strict is true, the MOS device extraction will happen in strict mode. That is, source and drain are not interchangeable. - - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def __init__(self, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> None: - r""" - @brief Creates a new device extractor with the given name. - If \strict is true, the MOS device extraction will happen in strict mode. That is, source and drain are not interchangeable. - - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def strict(self) -> bool: - r""" - @brief Returns a value indicating whether extraction happens in strict mode. - """ - -class DeviceExtractorMOS4Transistor(DeviceExtractorBase): - r""" - @brief A device extractor for a four-terminal MOS transistor - - This class supplies the generic extractor for a MOS device. - It is based on the \DeviceExtractorMOS3Transistor class with the extension of a bulk terminal and corresponding bulk terminal output (annotation) layer. - - The parameters of a MOS4 device are the same than for MOS3 devices. For the device layers the bulk layer is added. - - @ul - @li 'B' (bulk) - currently this layer is not used and can be empty. @/li - @/ul - - The bulk terminals are output on this layer: - @ul - @li 'tB' - bulk terminal (a copy of the gate shape). Default output is 'B'. @/li - @/ul - - The bulk terminal layer can be empty. In this case, it needs - to be connected to a global net to establish the net connection. - - The device class produced by this extractor is \DeviceClassMOS4Transistor. - - This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorMOS4Transistor: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def __init__(self, name: str, strict: Optional[bool] = ..., factory: Optional[DeviceClassFactory] = ...) -> None: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceExtractorResistor(DeviceExtractorBase): - r""" - @brief A device extractor for a two-terminal resistor - - This class supplies the generic extractor for a resistor device. - The device is defined by two geometry layers: the resistor 'wire' and two contacts per wire. The contacts should be attached to the ends of the wire. The wire length and width is computed from the edge lengths between the contacts and along the contacts respectively. - - This simple computation is precise only when the resistor shape is a rectangle. - - Using the given sheet resistance, the resistance value is computed by 'R = L / W * sheet_rho'. - - The device class produced by this extractor is \DeviceClassResistor. - The extractor produces three parameters: - - @ul - @li 'R' - the resistance in Ohm @/li - @li 'A' - the resistor's area in square micrometer units @/li - @li 'P' - the resistor's perimeter in micrometer units @/li - @/ul - - The device layer names are: - - @ul - @li 'R' - resistor path. This is the geometry that defines the resistor's current path. @/li - @li 'C' - contacts. These areas form the contact regions at the ends of the resistor path. @/li - @/ul - - The terminals are output on these layers: - @ul - @li 'tA', 'tB' - the two terminals of the resistor. @/li - @/ul - - This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorResistor: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def __init__(self, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> None: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceExtractorResistorWithBulk(DeviceExtractorBase): - r""" - @brief A device extractor for a resistor with a bulk terminal - - This class supplies the generic extractor for a resistor device including a bulk terminal. - The device is defined the same way than devices are defined for \DeviceExtractorResistor. - - The device class produced by this extractor is \DeviceClassResistorWithBulk. - The extractor produces three parameters: - - @ul - @li 'R' - the resistance in Ohm @/li - @li 'A' - the resistor's area in square micrometer units @/li - @li 'P' - the resistor's perimeter in micrometer units @/li - @/ul - - The device layer names are: - - @ul - @li 'R' - resistor path. This is the geometry that defines the resistor's current path. @/li - @li 'C' - contacts. These areas form the contact regions at the ends of the resistor path. @/li - @li 'W' - well, bulk. Currently this layer is ignored for the extraction and can be empty. @/li - @/ul - - The terminals are output on these layers: - @ul - @li 'tA', 'tB' - the two terminals of the resistor. @/li - @li 'tW' - the bulk terminal (copy of the resistor area). @/li - @/ul - - The bulk terminal layer can be an empty layer representing the substrate. In this case, it needs to be connected globally. - - This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorResistorWithBulk: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def __init__(self, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> None: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceExtractorCapacitor(DeviceExtractorBase): - r""" - @brief A device extractor for a two-terminal capacitor - - This class supplies the generic extractor for a capacitor device. - The device is defined by two geometry layers forming the 'plates' of the capacitor. - The capacitance is computed from the overlapping area of the plates using 'C = A * area_cap' (area_cap is the capacitance per square micrometer area). - - Although 'area_cap' can be given in any unit, Farad should be preferred as this is the convention used for output into a netlist. - - The device class produced by this extractor is \DeviceClassCapacitor. - The extractor produces three parameters: - - @ul - @li 'C' - the capacitance @/li - @li 'A' - the capacitor's area in square micrometer units @/li - @li 'P' - the capacitor's perimeter in micrometer units @/li - @/ul - - The device layer names are: - - @ul - @li 'P1', 'P2' - the two plates. @/li - @/ul - - The terminals are output on these layers: - @ul - @li 'tA', 'tB' - the two terminals. Defaults to 'P1' and 'P2'. @/li - @/ul - - This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls, name: str, area_cap: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorCapacitor: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def __init__(self, name: str, area_cap: float, factory: Optional[DeviceClassFactory] = ...) -> None: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceExtractorCapacitorWithBulk(DeviceExtractorBase): - r""" - @brief A device extractor for a capacitor with a bulk terminal - - This class supplies the generic extractor for a capacitor device including a bulk terminal. - The device is defined the same way than devices are defined for \DeviceExtractorCapacitor. - - The device class produced by this extractor is \DeviceClassCapacitorWithBulk. - The extractor produces three parameters: - - @ul - @li 'C' - the capacitance @/li - @li 'A' - the capacitor's area in square micrometer units @/li - @li 'P' - the capacitor's perimeter in micrometer units @/li - @/ul - - The device layer names are: - - @ul - @li 'P1', 'P2' - the two plates. @/li - @li 'W' - well, bulk. Currently this layer is ignored for the extraction and can be empty. @/li - @/ul - - The terminals are output on these layers: - @ul - @li 'tA', 'tB' - the two terminals. Defaults to 'P1' and 'P2'. @/li - @li 'tW' - the bulk terminal (copy of the resistor area). @/li - @/ul - - The bulk terminal layer can be an empty layer representing the substrate. In this case, it needs to be connected globally. - - This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorCapacitorWithBulk: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def __init__(self, name: str, sheet_rho: float, factory: Optional[DeviceClassFactory] = ...) -> None: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceExtractorBJT3Transistor(DeviceExtractorBase): - r""" - @brief A device extractor for a bipolar transistor (BJT) - - This class supplies the generic extractor for a bipolar transistor device. - - Extraction of vertical and lateral transistors is supported through a generic geometry model: The basic area is the base area. A marker shape must be provided for this area. The emitter of the transistor is defined by emitter layer shapes inside the base area. Multiple emitter shapes can be present. In this case, multiple transistor devices sharing the same base and collector are generated. - Finally, a collector layer can be given. If non-empty, the parts inside the base region will define the collector terminals. If empty, the collector is formed by the substrate. In this case, the base region will be output to the 'tC' terminal output layer. This layer then needs to be connected to a global net to form the net connection. - - The device class produced by this extractor is \DeviceClassBJT3Transistor. - The extractor delivers these parameters: - - @ul - @li 'AE', 'AB' and 'AC' - the emitter, base and collector areas in square micrometer units @/li - @li 'PE', 'PB' and 'PC' - the emitter, base and collector perimeters in micrometer units @/li - @li 'NE' - emitter count (initially 1 but increases when devices are combined) @/li - @/ul - - The device layer names are: - - @ul - @li 'E' - emitter. @/li - @li 'B' - base. @/li - @li 'C' - collector. @/li - @/ul - - The terminals are output on these layers: - @ul - @li 'tE' - emitter. Default output is 'E'. @/li - @li 'tB' - base. Default output is 'B'. @/li - @li 'tC' - collector. Default output is 'C'. @/li - @/ul - - This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls, name: str, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorBJT3Transistor: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def __init__(self, name: str, factory: Optional[DeviceClassFactory] = ...) -> None: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceExtractorBJT4Transistor(DeviceExtractorBJT3Transistor): - r""" - @brief A device extractor for a four-terminal bipolar transistor (BJT) - - This class supplies the generic extractor for a bipolar transistor device. - It is based on the \DeviceExtractorBJT3Transistor class with the extension of a substrate terminal and corresponding substrate terminal output (annotation) layer. - - Two new layers are introduced: - - @ul - @li 'S' - the bulk (substrate) layer. Currently this layer is ignored and can be empty. @/li@li 'tS' - the bulk terminal output layer (defaults to 'S'). @/li@/ul - - The bulk terminal layer ('tS') can be an empty layer representing the wafer substrate. - In this use mode the substrate terminal shapes will be produced on the 'tS' layer. This - layer then needs to be connected to a global net to establish the net connection. - - The device class produced by this extractor is \DeviceClassBJT4Transistor. - The This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls, name: str, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorBJT4Transistor: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def __init__(self, name: str, factory: Optional[DeviceClassFactory] = ...) -> None: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class DeviceExtractorDiode(DeviceExtractorBase): - r""" - @brief A device extractor for a planar diode - - This class supplies the generic extractor for a planar diode. - The diode is defined by two layers whose overlap area forms - the diode. The p-type layer forms the anode, the n-type layer - the cathode. - - The device class produced by this extractor is \DeviceClassDiode. - The extractor extracts the two parameters of this class: - - @ul - @li 'A' - the diode area in square micrometer units. @/li - @li 'P' - the diode perimeter in micrometer units. @/li - @/ul - - The device layers are: - - @ul - @li 'P' - the p doped area. @/li - @li 'N' - the n doped area. @/li - @/ul - - The diode region is defined by the overlap of p and n regions. - - The terminal output layers are: - - @ul - @li 'tA' - anode. Defaults to 'P'. @/li - @li 'tC' - cathode. Defaults to 'N'. @/li - @/ul - - This class is a closed one and methods cannot be reimplemented. To reimplement specific methods, see \DeviceExtractor. - - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls, name: str, factory: Optional[DeviceClassFactory] = ...) -> DeviceExtractorDiode: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def __init__(self, name: str, factory: Optional[DeviceClassFactory] = ...) -> None: - r""" - @brief Creates a new device extractor with the given name - For the 'factory' parameter see \DeviceClassFactory. It has been added in version 0.27.3. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class Connectivity: - r""" - @brief This class specifies connections between different layers. - Connections are build using \connect. There are basically two flavours of connections: intra-layer and inter-layer. - - Intra-layer connections make nets begin propagated along different shapes on the same net. Without the intra-layer connections, nets are not propagated over shape boundaries. As this is usually intended, intra-layer connections should always be specified for each layer. - - Inter-layer connections connect shapes on different layers. Shapes which touch across layers will be connected if their layers are specified as being connected through inter-layer \connect. - - All layers are specified in terms of layer indexes. Layer indexes are layout layer indexes (see \Layout class). - - The connectivity object also manages the global nets. Global nets are substrate for example and they are propagated automatically from subcircuits to circuits. Global nets are defined by name and are managed through IDs. To get the name for a given ID, use \global_net_name. - This class has been introduced in version 0.26. - """ - @classmethod - def new(cls) -> Connectivity: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> Connectivity: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Connectivity: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Connectivity) -> None: - r""" - @brief Assigns another object to self - """ - @overload - def connect(self, layer: int) -> None: - r""" - @brief Specifies intra-layer connectivity. - """ - @overload - def connect(self, layer_a: int, layer_b: int) -> None: - r""" - @brief Specifies inter-layer connectivity. - """ - def connect_global(self, layer: int, global_net_name: str) -> int: - r""" - @brief Connects the given layer to the global net given by name. - Returns the ID of the global net. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> Connectivity: - r""" - @brief Creates a copy of self - """ - def global_net_id(self, global_net_name: str) -> int: - r""" - @brief Gets the ID for a given global net name. - """ - def global_net_name(self, global_net_id: int) -> str: - r""" - @brief Gets the name for a given global net ID. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class LayoutToNetlist: - r""" - @brief A generic framework for extracting netlists from layouts - - This class wraps various concepts from db::NetlistExtractor and db::NetlistDeviceExtractor - and more. It is supposed to provide a framework for extracting a netlist from a layout. - - The use model of this class consists of five steps which need to be executed in this order. - - @ul - @li Configuration: in this step, the LayoutToNetlist object is created and - if required, configured. Methods to be used in this step are \threads=, - \area_ratio= or \max_vertex_count=. The constructor for the LayoutToNetlist - object receives a \RecursiveShapeIterator object which basically supplies the - hierarchy and the layout taken as input. - @/li - @li Preparation - In this step, the device recognition and extraction layers are drawn from - the framework. Derived can now be computed using boolean operations. - Methods to use in this step are \make_layer and it's variants. - Layer preparation is not necessarily required to happen before all - other steps. Layers can be computed shortly before they are required. - @/li - @li Following the preparation, the devices can be extracted using \extract_devices. - This method needs to be called for each device extractor required. Each time, - a device extractor needs to be given plus a map of device layers. The device - layers are device extractor specific. Either original or derived layers - may be specified here. Layer preparation may happen between calls to \extract_devices. - @/li - @li Once the devices are derived, the netlist connectivity can be defined and the - netlist extracted. The connectivity is defined with \connect and it's - flavours. The actual netlist extraction happens with \extract_netlist. - @/li - @li After netlist extraction, the information is ready to be retrieved. - The produced netlist is available with \netlist. The Shapes of a - specific net are available with \shapes_of_net. \probe_net allows - finding a net by probing a specific location. - @/li - @/ul - - You can also use the extractor with an existing \DeepShapeStore object or even flat data. In this case, preparation means importing existing regions with the \register method. - If you want to use the \LayoutToNetlist object with flat data, use the 'LayoutToNetlist(topcell, dbu)' constructor. If you want to use it with hierarchical data and an existing DeepShapeStore object, use the 'LayoutToNetlist(dss)' constructor. - - This class has been introduced in version 0.26. - """ - class BuildNetHierarchyMode: - r""" - @brief This class represents the LayoutToNetlist::BuildNetHierarchyMode enum - This enum is used for \LayoutToNetlist#build_all_nets and \LayoutToNetlist#build_net. - """ - BNH_Disconnected: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to produce local nets without connections to subcircuits (used for the "hier_mode" parameter). - """ - BNH_Flatten: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to flatten the nets (used for the "hier_mode" parameter). - """ - BNH_SubcircuitCells: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to produce a hierarchy of subcircuit cells per net (used for the "hier_mode" parameter). - """ - @overload - @classmethod - def new(cls, i: int) -> LayoutToNetlist.BuildNetHierarchyMode: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> LayoutToNetlist.BuildNetHierarchyMode: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: LayoutToNetlist.BuildNetHierarchyMode) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - BNH_Disconnected: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to produce local nets without connections to subcircuits (used for the "hier_mode" parameter). - """ - BNH_Flatten: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to flatten the nets (used for the "hier_mode" parameter). - """ - BNH_SubcircuitCells: ClassVar[LayoutToNetlist.BuildNetHierarchyMode] - r""" - @brief This constant tells \build_net and \build_all_nets to produce a hierarchy of subcircuit cells per net (used for the "hier_mode" parameter). - """ - area_ratio: float - r""" - Getter: - @brief Gets the area_ratio parameter for the hierarchical network processor - See \area_ratio= for details about this attribute. - Setter: - @brief Sets the area_ratio parameter for the hierarchical network processor - This parameter controls splitting of large polygons in order to reduce the - error made by the bounding box approximation. - """ - description: str - r""" - Getter: - @brief Gets the description of the database - - Setter: - @brief Sets the description of the database - """ - device_scaling: float - r""" - Getter: - @brief Gets the device scaling factor - See \device_scaling= for details about this attribute. - Setter: - @brief Sets the device scaling factor - This factor will scale the physical properties of the extracted devices - accordingly. The scale factor applies an isotropic shrink (<1) or expansion (>1). - """ - generator: str - r""" - Getter: - @brief Gets the generator string. - The generator is the script that created this database. - - Setter: - @brief Sets the generator string. - """ - include_floating_subcircuits: bool - r""" - Getter: - @brief Gets a flag indicating whether to include floating subcircuits in the netlist. - See \include_floating_subcircuits= for details. - - This attribute has been introduced in version 0.27. - - Setter: - @brief Sets a flag indicating whether to include floating subcircuits in the netlist. - - With 'include_floating_subcircuits' set to true, subcircuits with no connection to their parent circuit are still included in the circuit as floating subcircuits. Specifically on flattening this means that these subcircuits are properly propagated to their parent instead of appearing as additional top circuits. - - This attribute has been introduced in version 0.27 and replaces the arguments of \extract_netlist. - """ - max_vertex_count: int - r""" - Getter: - See \max_vertex_count= for details about this attribute. - Setter: - @brief Sets the max_vertex_count parameter for the hierarchical network processor - This parameter controls splitting of large polygons in order to enhance performance - for very big polygons. - """ - name: str - r""" - Getter: - @brief Gets the name of the database - - Setter: - @brief Sets the name of the database - """ - original_file: str - r""" - Getter: - @brief Gets the original file name of the database - The original filename is the layout file from which the netlist DB was created. - Setter: - @brief Sets the original file name of the database - """ - threads: int - r""" - Getter: - @brief Gets the number of threads to use for operations which support multiple threads - - Setter: - @brief Sets the number of threads to use for operations which support multiple threads - """ - @overload - @classmethod - def new(cls) -> LayoutToNetlist: - r""" - @brief Creates a new and empty extractor object - The main objective for this constructor is to create an object suitable for reading an annotated netlist. - """ - @overload - @classmethod - def new(cls, dss: DeepShapeStore) -> LayoutToNetlist: - r""" - @brief Creates a new extractor object reusing an existing \DeepShapeStore object - This constructor can be used if there is a DSS object already from which the shapes can be taken. This version can only be used with \register to add layers (regions) inside the 'dss' object. - - The make_... methods will not create new layers as there is no particular place defined where to create the layers. - - The extractor will not take ownership of the dss object unless you call \keep_dss. - """ - @overload - @classmethod - def new(cls, iter: RecursiveShapeIterator) -> LayoutToNetlist: - r""" - @brief Creates a new extractor connected to an original layout - This constructor will attach the extractor to an original layout through the shape iterator. - """ - @overload - @classmethod - def new(cls, dss: DeepShapeStore, layout_index: int) -> LayoutToNetlist: - r""" - @brief Creates a new extractor object reusing an existing \DeepShapeStore object - This constructor can be used if there is a DSS object already from which the shapes can be taken. NOTE: in this case, the make_... functions will create new layers inside this DSS. To register existing layers (regions) use \register. - """ - @overload - @classmethod - def new(cls, topcell_name: str, dbu: float) -> LayoutToNetlist: - r""" - @brief Creates a new extractor object with a flat DSS - @param topcell_name The name of the top cell of the internal flat layout - @param dbu The database unit to use for the internal flat layout - - This constructor will create an extractor for flat extraction. Layers registered with \register will be flattened. New layers created with make_... will be flat layers. - - The database unit is mandatory because the physical parameter extraction for devices requires this unit for translation of layout to physical dimensions. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a new and empty extractor object - The main objective for this constructor is to create an object suitable for reading an annotated netlist. - """ - @overload - def __init__(self, dss: DeepShapeStore) -> None: - r""" - @brief Creates a new extractor object reusing an existing \DeepShapeStore object - This constructor can be used if there is a DSS object already from which the shapes can be taken. This version can only be used with \register to add layers (regions) inside the 'dss' object. - - The make_... methods will not create new layers as there is no particular place defined where to create the layers. - - The extractor will not take ownership of the dss object unless you call \keep_dss. - """ - @overload - def __init__(self, iter: RecursiveShapeIterator) -> None: - r""" - @brief Creates a new extractor connected to an original layout - This constructor will attach the extractor to an original layout through the shape iterator. - """ - @overload - def __init__(self, dss: DeepShapeStore, layout_index: int) -> None: - r""" - @brief Creates a new extractor object reusing an existing \DeepShapeStore object - This constructor can be used if there is a DSS object already from which the shapes can be taken. NOTE: in this case, the make_... functions will create new layers inside this DSS. To register existing layers (regions) use \register. - """ - @overload - def __init__(self, topcell_name: str, dbu: float) -> None: - r""" - @brief Creates a new extractor object with a flat DSS - @param topcell_name The name of the top cell of the internal flat layout - @param dbu The database unit to use for the internal flat layout - - This constructor will create an extractor for flat extraction. Layers registered with \register will be flattened. New layers created with make_... will be flat layers. - - The database unit is mandatory because the physical parameter extraction for devices requires this unit for translation of layout to physical dimensions. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - @overload - def antenna_check(self, gate: Region, metal: Region, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: - r""" - @brief Runs an antenna check on the extracted clusters - - The antenna check will traverse all clusters and run an antenna check - for all root clusters. The antenna ratio is defined by the total - area of all "metal" shapes divided by the total area of all "gate" shapes - on the cluster. Of all clusters where the antenna ratio is larger than - the limit ratio all metal shapes are copied to the output region as - error markers. - - The simple call is: - - @code - l2n = ... # a LayoutToNetlist object - l2n.extract_netlist - # check for antenna ratio 10.0 of metal vs. poly: - errors = l2n.antenna(poly, metal, 10.0) - @/code - - You can include diodes which rectify the antenna effect. Provide recognition layers for theses diodes and include them in the connections. Then specify the diode layers in the antenna call: - - @code - ... - # include diode_layer1: - errors = l2n.antenna(poly, metal, 10.0, [ diode_layer1 ]) - # include diode_layer1 and diode_layer2:errors = l2n.antenna(poly, metal, 10.0, [ diode_layer1, diode_layer2 ]) - @/code - - Diodes can be configured to partially reduce the antenna effect depending on their area. This will make the diode_layer1 increase the ratio by 50.0 per square micrometer area of the diode: - - @code - ... - # diode_layer1 increases the ratio by 50 per square micrometer area: - errors = l2n.antenna(poly, metal, 10.0 [ [ diode_layer, 50.0 ] ]) - @/code - - If 'texts' is non-nil, this text collection will receive labels explaining the error in terms of area values and relevant ratio. - - The 'texts' parameter has been added in version 0.27.11. - """ - @overload - def antenna_check(self, gate: Region, gate_perimeter_factor: float, metal: Region, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: - r""" - @brief Runs an antenna check on the extracted clusters taking the perimeter into account - - This version of the \antenna_check method allows taking the perimeter of gate or metal into account. The effective area is computed using: - - @code - Aeff = A + P * t - @/code - - Here Aeff is the area used in the check, A is the polygon area, P the perimeter and t the perimeter factor. This formula applies to gate polygon area/perimeter with 'gate_perimeter_factor' for t and metal polygon area/perimeter with 'metal_perimeter_factor'. The perimeter_factor has the dimension of micrometers and can be thought of as the width of the material. Essentially the side walls of the material are taking into account for the surface area as well. - - This variant has been introduced in version 0.26.6. - """ - @overload - def antenna_check(self, gate: Region, gate_area_factor: float, gate_perimeter_factor: float, metal: Region, metal_area_factor: float, metal_perimeter_factor: float, ratio: float, diodes: Optional[Sequence[Any]] = ..., texts: Optional[Texts] = ...) -> Region: - r""" - @brief Runs an antenna check on the extracted clusters taking the perimeter into account and providing an area factor - - This (most generic) version of the \antenna_check method allows taking the perimeter of gate or metal into account and also provides a scaling factor for the area part. - The effective area is computed using: - - @code - Aeff = A * f + P * t - @/code - - Here f is the area factor and t the perimeter factor. A is the polygon area and P the polygon perimeter. A use case for this variant is to set the area factor to zero. This way, only perimeter contributions are considered. - - This variant has been introduced in version 0.26.6. - """ - def build_all_nets(self, cmap: CellMapping, target: Layout, lmap: Dict[int, Region], net_cell_name_prefix: Optional[Any] = ..., netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: - r""" - @brief Builds a full hierarchical representation of the nets - - This method copies all nets into cells corresponding to the circuits. It uses the 'cmap' - object to determine the target cell (create it with "cell_mapping_into" or "const_cell_mapping_into"). - If no mapping is provided for a specific circuit cell, the nets are copied into the next mapped parent as many times as the circuit cell appears there (circuit flattening). - - The method has three net annotation modes: - @ul - @li No annotation (net_cell_name_prefix == nil and netname_prop == nil): the shapes will be put - into the target cell simply. @/li - @li Net name property (net_cell_name_prefix == nil and netname_prop != nil): the shapes will be - annotated with a property named with netname_prop and containing the net name string. @/li - @li Individual subcells per net (net_cell_name_prefix != 0): for each net, a subcell is created - and the net shapes will be put there (name of the subcell = net_cell_name_prefix + net name). - (this mode can be combined with netname_prop too). @/li - @/ul - - In addition, net hierarchy is covered in three ways: - @ul - @li No connection indicated (hier_mode == \BNH_Disconnected: the net shapes are simply put into their - respective circuits. The connections are not indicated. @/li - @li Subnet hierarchy (hier_mode == \BNH_SubcircuitCells): for each root net, a full hierarchy is built - to accommodate the subnets (see build_net in recursive mode). @/li - @li Flat (hier_mode == \BNH_Flatten): each net is flattened and put into the circuit it - belongs to. @/li - @/ul - - If a device cell name prefix is given, cells will be produced for each device abstract - using a name like device_cell_name_prefix + device name. Otherwise the device shapes are - treated as part of the net. - - @param cmap The mapping of internal layout to target layout for the circuit mapping - @param target The target layout - @param lmap Target layer indexes (keys) and net regions (values) - @param hier_mode See description of this method - @param netname_prop An (optional) property name to which to attach the net name - @param circuit_cell_name_prefix See method description - @param net_cell_name_prefix See method description - @param device_cell_name_prefix See above - """ - def build_net(self, net: Net, target: Layout, target_cell: Cell, lmap: Dict[int, Region], netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: - r""" - @brief Builds a net representation in the given layout and cell - - This method puts the shapes of a net into the given target cell using a variety of options - to represent the net name and the hierarchy of the net. - - If the netname_prop name is not nil, a property with the given name is created and assigned - the net name. - - Net hierarchy is covered in three ways: - @ul - @li No connection indicated (hier_mode == \BNH_Disconnected: the net shapes are simply put into their - respective circuits. The connections are not indicated. @/li - @li Subnet hierarchy (hier_mode == \BNH_SubcircuitCells): for each root net, a full hierarchy is built - to accommodate the subnets (see build_net in recursive mode). @/li - @li Flat (hier_mode == \BNH_Flatten): each net is flattened and put into the circuit it - belongs to. @/li - @/ul - If a device cell name prefix is given, cells will be produced for each device abstract - using a name like device_cell_name_prefix + device name. Otherwise the device shapes are - treated as part of the net. - - @param target The target layout - @param target_cell The target cell - @param lmap Target layer indexes (keys) and net regions (values) - @param hier_mode See description of this method - @param netname_prop An (optional) property name to which to attach the net name - @param cell_name_prefix Chooses recursive mode if non-null - @param device_cell_name_prefix See above - """ - def build_nets(self, nets: Sequence[Net], cmap: CellMapping, target: Layout, lmap: Dict[int, Region], net_cell_name_prefix: Optional[Any] = ..., netname_prop: Optional[Any] = ..., hier_mode: Optional[LayoutToNetlist.BuildNetHierarchyMode] = ..., circuit_cell_name_prefix: Optional[Any] = ..., device_cell_name_prefix: Optional[Any] = ...) -> None: - r""" - @brief Like \build_all_nets, but with the ability to select some nets. - """ - @overload - def cell_mapping_into(self, layout: Layout, cell: Cell, with_device_cells: Optional[bool] = ...) -> CellMapping: - r""" - @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. - If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. - Use this option, if you want to access device terminal shapes per device. - - CAUTION: this function may create new cells in 'layout'. Use \const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it. - """ - @overload - def cell_mapping_into(self, layout: Layout, cell: Cell, nets: Sequence[Net], with_device_cells: Optional[bool] = ...) -> CellMapping: - r""" - @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. - This version will only create cells which are required to represent the nets from the 'nets' argument. - - If 'with_device_cells' is true, cells will be produced for devices. These are cells not corresponding to circuits, so they are disabled normally. - Use this option, if you want to access device terminal shapes per device. - - CAUTION: this function may create new cells in 'layout'. Use \const_cell_mapping_into if you want to use the target layout's hierarchy and not modify it. - """ - def clear_join_net_names(self) -> None: - r""" - @brief Clears all implicit net joining expressions. - See \extract_netlist for more details about this feature. - - This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. - """ - def clear_join_nets(self) -> None: - r""" - @brief Clears all explicit net joining expressions. - See \extract_netlist for more details about this feature. - - Explicit net joining has been introduced in version 0.27. - """ - @overload - def connect(self, l: Region) -> None: - r""" - @brief Defines an intra-layer connection for the given layer. - The layer is either an original layer created with \make_includelayer and it's variants or - a derived layer. Certain limitations apply. It's safe to use - boolean operations for deriving layers. Other operations are applicable as long as they are - capable of delivering hierarchical layers. - """ - @overload - def connect(self, a: Region, b: Region) -> None: - r""" - @brief Defines an inter-layer connection for the given layers. - The conditions mentioned with intra-layer \connect apply for this method too. - """ - @overload - def connect(self, a: Region, b: Texts) -> None: - r""" - @brief Defines an inter-layer connection for the given layers. - The conditions mentioned with intra-layer \connect apply for this method too. - As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons. - - This variant has been introduced in version 0.27. - """ - @overload - def connect(self, a: Texts, b: Region) -> None: - r""" - @brief Defines an inter-layer connection for the given layers. - The conditions mentioned with intra-layer \connect apply for this method too. - As one argument is a (hierarchical) text collection, this method is used to attach net labels to polygons. - - This variant has been introduced in version 0.27. - """ - @overload - def connect_global(self, l: Region, global_net_name: str) -> int: - r""" - @brief Defines a connection of the given layer with a global net. - This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. - """ - @overload - def connect_global(self, l: Texts, global_net_name: str) -> int: - r""" - @brief Defines a connection of the given text layer with a global net. - This method returns the ID of the global net. Use \global_net_name to get the name back from the ID. - This variant has been introduced in version 0.27. - """ - def const_cell_mapping_into(self, layout: Layout, cell: Cell) -> CellMapping: - r""" - @brief Creates a cell mapping for copying shapes from the internal layout to the given target layout. - This version will not create new cells in the target layout. - If the required cells do not exist there yet, flatting will happen. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dss(self) -> DeepShapeStore: - r""" - @brief Gets a reference to the internal DSS object. - """ - def dump_joined_net_names(self) -> str: - r""" - @hide - """ - def dump_joined_net_names_per_cell(self) -> str: - r""" - @hide - """ - def dump_joined_nets(self) -> str: - r""" - @hide - """ - def dump_joined_nets_per_cell(self) -> str: - r""" - @hide - """ - def extract_devices(self, extractor: DeviceExtractorBase, layers: Dict[str, ShapeCollection]) -> None: - r""" - @brief Extracts devices - See the class description for more details. - This method will run device extraction for the given extractor. The layer map is specific - for the extractor and uses the region objects derived with \make_layer and it's variants. - - In addition, derived regions can be passed too. Certain limitations apply. It's safe to use - boolean operations for deriving layers. Other operations are applicable as long as they are - capable of delivering hierarchical layers. - - If errors occur, the device extractor will contain theses errors. - """ - def extract_netlist(self) -> None: - r""" - @brief Runs the netlist extraction - - See the class description for more details. - - This method has been made parameter-less in version 0.27. Use \include_floating_subcircuits= and \join_net_names as substitutes for the arguments of previous versions. - """ - def filename(self) -> str: - r""" - @brief Gets the file name of the database - The filename is the name under which the database is stored or empty if it is not associated with a file. - """ - def global_net_name(self, global_net_id: int) -> str: - r""" - @brief Gets the global net name for the given global net ID. - """ - def internal_layout(self) -> Layout: - r""" - @brief Gets the internal layout - Usually it should not be required to obtain the internal layout. If you need to do so, make sure not to modify the layout as - the functionality of the netlist extractor depends on it. - """ - def internal_top_cell(self) -> Cell: - r""" - @brief Gets the internal top cell - Usually it should not be required to obtain the internal cell. If you need to do so, make sure not to modify the cell as - the functionality of the netlist extractor depends on it. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_extracted(self) -> bool: - r""" - @brief Gets a value indicating whether the netlist has been extracted - - This method has been introduced in version 0.27.1. - """ - @overload - def is_persisted(self, layer: Region) -> bool: - r""" - @brief Returns true, if the given layer is a persisted region. - Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Named layers are persisted, unnamed layers are not. Only persisted, named layers can be put into \connect. - """ - @overload - def is_persisted(self, layer: Texts) -> bool: - r""" - @brief Returns true, if the given layer is a persisted texts collection. - Persisted layers are kept inside the LayoutToNetlist object and are not released if their object is destroyed. Named layers are persisted, unnamed layers are not. Only persisted, named layers can be put into \connect. - - The variant for Texts collections has been added in version 0.27. - """ - @overload - def join_net_names(self, pattern: str) -> None: - r""" - @brief Specifies another pattern for implicit joining of nets for the top level cell. - Use this method to register a pattern for net labels considered in implicit net joining. Implicit net joining allows connecting multiple parts of the same nets (e.g. supply rails) without need for a physical connection. The pattern specifies labels to look for. When parts are labelled with a name matching the expression, the parts carrying the same name are joined. - - This method adds a new pattern. Use \clear_join_net_names to clear the registered pattern. - - Each pattern is a glob expression. Valid glob expressions are: - @ul - @li "" no implicit connections.@/li - @li "*" to make all labels candidates for implicit connections.@/li - @li "VDD" to make all 'VDD'' nets candidates for implicit connections.@/li - @li "VDD" to make all 'VDD'+suffix nets candidates for implicit connections.@/li - @li "{VDD,VSS}" to all VDD and VSS nets candidates for implicit connections.@/li - @/ul - - Label matching is case sensitive. - - This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. - """ - @overload - def join_net_names(self, cell_pattern: str, pattern: str) -> None: - r""" - @brief Specifies another pattern for implicit joining of nets for the cells from the given cell pattern. - This method allows applying implicit net joining for specific cells, not only for the top cell. - - This method adds a new pattern. Use \clear_join_net_names to clear the registered pattern. - - This method has been introduced in version 0.27 and replaces the arguments of \extract_netlist. - """ - @overload - def join_nets(self, net_names: Sequence[str]) -> None: - r""" - @brief Specifies another name list for explicit joining of nets for the top level cell. - Use this method to join nets from the set of net names. All these nets will be connected together forming a single net. - Explicit joining will imply implicit joining for the involved nets - partial nets involved will be connected too (intra-net joining). - - This method adds a new name list. Use \clear_join_nets to clear the registered pattern. - - Explicit net joining has been introduced in version 0.27. - """ - @overload - def join_nets(self, cell_pattern: str, net_names: Sequence[str]) -> None: - r""" - @brief Specifies another name list for explicit joining of nets for the cells from the given cell pattern. - This method allows applying explicit net joining for specific cells, not only for the top cell. - - This method adds a new name list. Use \clear_join_nets to clear the registered pattern. - - Explicit net joining has been introduced in version 0.27. - """ - def keep_dss(self) -> None: - r""" - @brief Resumes ownership over the DSS object if created with an external one. - """ - def layer_by_index(self, index: int) -> Region: - r""" - @brief Gets a layer object for the given index. - Only named layers can be retrieved with this method. The returned object is a copy which represents the named layer. - """ - def layer_by_name(self, name: str) -> Region: - r""" - @brief Gets a layer object for the given name. - The returned object is a copy which represents the named layer. - """ - @overload - def layer_name(self, l: int) -> str: - r""" - @brief Gets the name of the given layer (by index) - """ - @overload - def layer_name(self, l: ShapeCollection) -> str: - r""" - @brief Gets the name of the given layer - """ - def layer_names(self) -> List[str]: - r""" - @brief Returns a list of names of the layer kept inside the LayoutToNetlist object. - """ - @overload - def layer_of(self, l: Region) -> int: - r""" - @brief Gets the internal layer for a given extraction layer - This method is required to derive the internal layer index - for example for - investigating the cluster tree. - """ - @overload - def layer_of(self, l: Texts) -> int: - r""" - @brief Gets the internal layer for a given text collection - This method is required to derive the internal layer index - for example for - investigating the cluster tree. - - The variant for Texts collections has been added in version 0.27. - """ - @overload - def make_layer(self, name: Optional[str] = ...) -> Region: - r""" - @brief Creates a new, empty hierarchical region - - The name is optional. If given, the layer will already be named accordingly (see \register). - """ - @overload - def make_layer(self, layer_index: int, name: Optional[str] = ...) -> Region: - r""" - @brief Creates a new hierarchical region representing an original layer - 'layer_index' is the layer index of the desired layer in the original layout. - This variant produces polygons and takes texts for net name annotation. - A variant not taking texts is \make_polygon_layer. A Variant only taking - texts is \make_text_layer. - - The name is optional. If given, the layer will already be named accordingly (see \register). - """ - def make_polygon_layer(self, layer_index: int, name: Optional[str] = ...) -> Region: - r""" - @brief Creates a new region representing an original layer taking polygons and texts - See \make_layer for details. - - The name is optional. If given, the layer will already be named accordingly (see \register). - """ - def make_text_layer(self, layer_index: int, name: Optional[str] = ...) -> Texts: - r""" - @brief Creates a new region representing an original layer taking texts only - See \make_layer for details. - - The name is optional. If given, the layer will already be named accordingly (see \register). - - Starting with version 0.27, this method returns a \Texts object. - """ - def netlist(self) -> Netlist: - r""" - @brief gets the netlist extracted (0 if no extraction happened yet) - """ - @overload - def probe_net(self, of_layer: Region, point: DPoint, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: - r""" - @brief Finds the net by probing a specific location on the given layer - - This method will find a net looking at the given layer at the specific position. - It will traverse the hierarchy below if no shape in the requested layer is found - in the specified location. The function will report the topmost net from far above the - hierarchy of circuits as possible. - - If \initial_circuit is given, the probing will start from this circuit and from the cell this circuit represents. By default, the probing will start from the top circuit. - - If no net is found at all, 0 is returned. - - It is recommended to use \probe_net on the netlist right after extraction. - Optimization functions such as \Netlist#purge will remove parts of the net which means - shape to net probing may no longer work for these nets. - - If non-null and an array, 'sc_path_out' will receive a list of \SubCircuits objects which lead to the net from the top circuit of the database. - - This variant accepts a micrometer-unit location. The location is given in the - coordinate space of the initial cell. - - The \sc_path_out and \initial_circuit parameters have been added in version 0.27. - """ - @overload - def probe_net(self, of_layer: Region, point: Point, sc_path_out: Optional[Sequence[SubCircuit]] = ..., initial_circuit: Optional[Circuit] = ...) -> Net: - r""" - @brief Finds the net by probing a specific location on the given layer - See the description of the other \probe_net variant. - This variant accepts a database-unit location. The location is given in the - coordinate space of the initial cell. - - The \sc_path_out and \initial_circuit parameters have been added in version 0.27. - """ - def read(self, path: str) -> None: - r""" - @brief Reads the extracted netlist from the file. - This method employs the native format of KLayout. - """ - def read_l2n(self, path: str) -> None: - r""" - @brief Reads the extracted netlist from the file. - This method employs the native format of KLayout. - """ - def register(self, l: ShapeCollection, n: str) -> None: - r""" - @brief Names the given layer - 'l' must be a hierarchical \Region or \Texts object derived with \make_layer, \make_text_layer or \make_polygon_layer or a region derived from those by boolean operations or other hierarchical operations. - - Naming a layer allows the system to indicate the layer in various contexts, i.e. when writing the data to a file. Named layers are also persisted inside the LayoutToNetlist object. They are not discarded when the Region object is destroyed. - - If required, the system will assign a name automatically. - This method has been generalized in version 0.27. - """ - def reset_extracted(self) -> None: - r""" - @brief Resets the extracted netlist and enables re-extraction - This method is implicitly called when using \connect or \connect_global after a netlist has been extracted. - This enables incremental connect with re-extraction. - - This method has been introduced in version 0.27.1. - """ - @overload - def shapes_of_net(self, net: Net, of_layer: Region, recursive: bool) -> Region: - r""" - @brief Returns all shapes of a specific net and layer. - If 'recursive'' is true, the returned region will contain the shapes of - all subcircuits too. - """ - @overload - def shapes_of_net(self, net: Net, of_layer: Region, recursive: bool, to: Shapes, propid: Optional[int] = ...) -> None: - r""" - @brief Sends all shapes of a specific net and layer to the given Shapes container. - If 'recursive'' is true, the returned region will contain the shapes of - all subcircuits too. - "prop_id" is an optional properties ID. If given, this property set will be attached to the shapes. - """ - def write(self, path: str, short_format: Optional[bool] = ...) -> None: - r""" - @brief Writes the extracted netlist to a file. - This method employs the native format of KLayout. - """ - def write_l2n(self, path: str, short_format: Optional[bool] = ...) -> None: - r""" - @brief Writes the extracted netlist to a file. - This method employs the native format of KLayout. - """ - -class DeepShapeStore: - r""" - @brief An opaque layout heap for the deep region processor - - This class is used for keeping intermediate, hierarchical data for the deep region processor. It is used in conjunction with the region constructor to create a deep (hierarchical) region. - @code - layout = ... # a layout - layer = ... # a layer - cell = ... # a cell (initial cell for the deep region) - dss = RBA::DeepShapeStore::new - region = RBA::Region::new(cell.begin(layer), dss) - @/code - - The DeepShapeStore object also supplies some configuration options for the operations acting on the deep regions. See for example \threads=. - - This class has been introduced in version 0.26. - """ - max_area_ratio: float - r""" - Getter: - @brief Gets the max. area ratio. - - Setter: - @brief Sets the max. area ratio for bounding box vs. polygon area - - This parameter is used to simplify complex polygons. It is used by - create_polygon_layer with the default parameters. It's also used by - boolean operations when they deliver their output. - """ - max_vertex_count: int - r""" - Getter: - @brief Gets the maximum vertex count. - - Setter: - @brief Sets the maximum vertex count default value - - This parameter is used to simplify complex polygons. It is used by - create_polygon_layer with the default parameters. It's also used by - boolean operations when they deliver their output. - """ - reject_odd_polygons: bool - r""" - Getter: - @brief Gets a flag indicating whether to reject odd polygons. - This attribute has been introduced in version 0.27. - Setter: - @brief Sets a flag indicating whether to reject odd polygons - - Some kind of 'odd' (e.g. non-orientable) polygons may spoil the functionality because they cannot be handled properly. By using this flag, the shape store we reject these kind of polygons. The default is 'accept' (without warning). - - This attribute has been introduced in version 0.27. - """ - text_enlargement: int - r""" - Getter: - @brief Gets the text enlargement value. - - Setter: - @brief Sets the text enlargement value - - If set to a non-negative value, text objects are converted to boxes with the - given enlargement (width = 2 * enlargement). The box centers are identical - to the original location of the text. - If this value is negative (the default), texts are ignored. - """ - text_property_name: Any - r""" - Getter: - @brief Gets the text property name. - - Setter: - @brief Sets the text property name. - - If set to a non-null variant, text strings are attached to the generated boxes - as properties with this particular name. This option has an effect only if the - text_enlargement property is not negative. - By default, the name is empty. - """ - threads: int - r""" - Getter: - @brief Gets the number of threads. - - Setter: - @brief Sets the number of threads to allocate for the hierarchical processor - """ - @classmethod - def instance_count(cls) -> int: - r""" - @hide - """ - @classmethod - def new(cls) -> DeepShapeStore: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def add_breakout_cell(self, layout_index: int, cell_index: Sequence[int]) -> None: - r""" - @brief Adds a cell indexe to the breakout cell list for the given layout inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def add_breakout_cells(self, pattern: str) -> None: - r""" - @brief Adds cells (given by a cell name pattern) to the breakout cell list to all layouts inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def add_breakout_cells(self, layout_index: int, cells: Sequence[int]) -> None: - r""" - @brief Adds cell indexes to the breakout cell list for the given layout inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def add_breakout_cells(self, layout_index: int, pattern: str) -> None: - r""" - @brief Adds cells (given by a cell name pattern) to the breakout cell list for the given layout inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def clear_breakout_cells(self) -> None: - r""" - @brief Clears the breakout cells - See the other variant of \clear_breakout_cells for details. - - This method has been added in version 0.26.1 - """ - @overload - def clear_breakout_cells(self, layout_index: int) -> None: - r""" - @brief Clears the breakout cells - Breakout cells are a feature by which hierarchy handling can be disabled for specific cells. If cells are specified as breakout cells, they don't interact with neighbor or parent cells, hence are virtually isolated. Breakout cells are useful to shortcut hierarchy evaluation for cells which are otherwise difficult to handle. An example are memory array cells with overlaps to their neighbors: a precise handling of such cells would generate variants and the boundary of the array. Although precise, this behavior leads to partial flattening and propagation of shapes. In consequence, this will also result in wrong device detection in LVS applications. In such cases, these array cells can be declared 'breakout cells' which makes them isolated entities and variant generation does not happen. - - See also \set_breakout_cells and \add_breakout_cells. - - This method has been added in version 0.26.1 - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_singular(self) -> bool: - r""" - @brief Gets a value indicating whether there is a single layout variant - - Specifically for network extraction, singular DSS objects are required. Multiple layouts may be present if different sources of layouts have been used. Such DSS objects are not usable for network extraction. - """ - def pop_state(self) -> None: - r""" - @brief Restores the store's state on the state state - This will restore the state pushed by \push_state. - - This method has been added in version 0.26.1 - """ - def push_state(self) -> None: - r""" - @brief Pushes the store's state on the state state - This will save the stores state (\threads, \max_vertex_count, \max_area_ratio, breakout cells ...) on the state stack. \pop_state can be used to restore the state. - - This method has been added in version 0.26.1 - """ - @overload - def set_breakout_cells(self, pattern: str) -> None: - r""" - @brief Sets the breakout cell list (as cell name pattern) for the all layouts inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def set_breakout_cells(self, layout_index: int, cells: Sequence[int]) -> None: - r""" - @brief Sets the breakout cell list (as cell indexes) for the given layout inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - @overload - def set_breakout_cells(self, layout_index: int, pattern: str) -> None: - r""" - @brief Sets the breakout cell list (as cell name pattern) for the given layout inside the store - See \clear_breakout_cells for an explanation of breakout cells. - - This method has been added in version 0.26.1 - """ - -class NetlistCompareLogger: - r""" - @brief A base class for netlist comparer event receivers - See \GenericNetlistCompareLogger for custom implementations of such receivers. - """ - @classmethod - def new(cls) -> NetlistCompareLogger: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class GenericNetlistCompareLogger(NetlistCompareLogger): - r""" - @brief An event receiver for the netlist compare feature. - The \NetlistComparer class will send compare events to a logger derived from this class. Use this class to implement your own logger class. You can override on of it's methods to receive certain kind of events. - This class has been introduced in version 0.26. - """ - class Severity: - r""" - @brief This class represents the log severity level for \GenericNetlistCompareLogger#log_entry. - This enum has been introduced in version 0.28. - """ - Error: ClassVar[GenericNetlistCompareLogger.Severity] - r""" - @brief An error - """ - Info: ClassVar[GenericNetlistCompareLogger.Severity] - r""" - @brief Information only - """ - NoSeverity: ClassVar[GenericNetlistCompareLogger.Severity] - r""" - @brief Unspecific severity - """ - Warning: ClassVar[GenericNetlistCompareLogger.Severity] - r""" - @brief A warning - """ - @overload - @classmethod - def new(cls, i: int) -> GenericNetlistCompareLogger.Severity: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> GenericNetlistCompareLogger.Severity: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: GenericNetlistCompareLogger.Severity) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class NetlistComparer: - r""" - @brief Compares two netlists - This class performs a comparison of two netlists. - It can be used with an event receiver (logger) to track the errors and net mismatches. Event receivers are derived from class \GenericNetlistCompareLogger. - The netlist comparer can be configured in different ways. Specific hints can be given for nets, device classes or circuits to improve efficiency and reliability of the graph equivalence deduction algorithm. For example, objects can be marked as equivalent using \same_nets, \same_circuits etc. The compare algorithm will then use these hints to derive further equivalences. This way, ambiguities can be resolved. - - Another configuration option relates to swappable pins of subcircuits. If pins are marked this way, the compare algorithm may swap them to achieve net matching. Swappable pins belong to an 'equivalence group' and can be defined with \equivalent_pins. - - This class has been introduced in version 0.26. - """ - dont_consider_net_names: bool - r""" - Getter: - @brief Gets a value indicating whether net names shall not be considered - See \dont_consider_net_names= for details. - Setter: - @brief Sets a value indicating whether net names shall not be considered - If this value is set to true, net names will not be considered when resolving ambiguities. - Not considering net names usually is more expensive. The default is 'false' indicating that - net names will be considered for ambiguity resolution. - - This property has been introduced in version 0.26.7. - """ - max_branch_complexity: int - r""" - Getter: - @brief Gets the maximum branch complexity - See \max_branch_complexity= for details. - Setter: - @brief Sets the maximum branch complexity - This value limits the maximum branch complexity of the backtracking algorithm. - The complexity is the accumulated number of branch options with ambiguous - net matches. Backtracking will stop when the maximum number of options - has been exceeded. - - By default, from version 0.27 on the complexity is unlimited and can be reduced in cases where runtimes need to be limited at the cost less elaborate matching evaluation. - - As the computational complexity is the square of the branch count, - this value should be adjusted carefully. - """ - max_depth: int - r""" - Getter: - @brief Gets the maximum search depth - See \max_depth= for details. - Setter: - @brief Sets the maximum search depth - This value limits the search depth of the backtracking algorithm to the - given number of jumps. - - By default, from version 0.27 on the depth is unlimited and can be reduced in cases where runtimes need to be limited at the cost less elaborate matching evaluation. - """ - @property - def max_resistance(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Excludes all resistor devices with a resistance values higher than the given threshold. - To reset this constraint, set this attribute to zero. - """ - @property - def min_capacitance(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Excludes all capacitor devices with a capacitance values less than the given threshold. - To reset this constraint, set this attribute to zero. - """ - with_log: bool - r""" - Getter: - @brief Gets a value indicating that log messages are generated. - See \with_log= for details about this flag. - - This attribute have been introduced in version 0.28. - - Setter: - @brief Sets a value indicating that log messages are generated. - Log messages may be expensive to compute, hence they can be turned off. - By default, log messages are generated. - - This attribute have been introduced in version 0.28. - """ - @overload - @classmethod - def new(cls) -> NetlistComparer: - r""" - @brief Creates a new comparer object. - See the class description for more details. - """ - @overload - @classmethod - def new(cls, logger: GenericNetlistCompareLogger) -> NetlistComparer: - r""" - @brief Creates a new comparer object. - The logger is a delegate or event receiver which the comparer will send compare events to. See the class description for more details. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a new comparer object. - See the class description for more details. - """ - @overload - def __init__(self, logger: GenericNetlistCompareLogger) -> None: - r""" - @brief Creates a new comparer object. - The logger is a delegate or event receiver which the comparer will send compare events to. See the class description for more details. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - @overload - def compare(self, netlist_a: Netlist, netlist_b: Netlist) -> bool: - r""" - @brief Compares two netlists. - This method will perform the actual netlist compare. It will return true if both netlists are identical. If the comparer has been configured with \same_nets or similar methods, the objects given there must be located inside 'circuit_a' and 'circuit_b' respectively. - """ - @overload - def compare(self, netlist_a: Netlist, netlist_b: Netlist, logger: NetlistCompareLogger) -> bool: - r""" - @brief Compares two netlists. - This method will perform the actual netlist compare using the given logger. It will return true if both netlists are identical. If the comparer has been configured with \same_nets or similar methods, the objects given there must be located inside 'circuit_a' and 'circuit_b' respectively. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - @overload - def equivalent_pins(self, circuit_b: Circuit, pin_ids: Sequence[int]) -> None: - r""" - @brief Marks several pins of the given circuit as equivalent (i.e. they can be swapped). - Only circuits from the second input can be given swappable pins. This will imply the same swappable pins on the equivalent circuit of the first input. This version is a generic variant of the two-pin version of this method. - """ - @overload - def equivalent_pins(self, circuit_b: Circuit, pin_id1: int, pin_id2: int) -> None: - r""" - @brief Marks two pins of the given circuit as equivalent (i.e. they can be swapped). - Only circuits from the second input can be given swappable pins. This will imply the same swappable pins on the equivalent circuit of the first input. To mark multiple pins as swappable, use the version that takes a list of pins. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def join_symmetric_nets(self, circuit: Circuit) -> None: - r""" - @brief Joins symmetric nodes in the given circuit. - - Nodes are symmetrical if swapping them would not modify the circuit. - Hence they will carry the same potential and can be connected (joined). - This will simplify the circuit and can be applied before device combination - to render a schematic-equivalent netlist in some cases (split gate option). - - This algorithm will apply the comparer's settings to the symmetry - condition (device filtering, device compare tolerances, device class - equivalence etc.). - - This method has been introduced in version 0.26.4. - """ - def same_circuits(self, circuit_a: Circuit, circuit_b: Circuit) -> None: - r""" - @brief Marks two circuits as identical. - This method makes a circuit circuit_a in netlist a identical to the corresponding - circuit circuit_b in netlist b (see \compare). By default circuits with the same name are identical. - """ - def same_device_classes(self, dev_cls_a: DeviceClass, dev_cls_b: DeviceClass) -> None: - r""" - @brief Marks two device classes as identical. - This makes a device class dev_cls_a in netlist a identical to the corresponding - device class dev_cls_b in netlist b (see \compare). - By default device classes with the same name are identical. - """ - @overload - def same_nets(self, net_a: Net, net_b: Net, must_match: Optional[bool] = ...) -> None: - r""" - @brief Marks two nets as identical. - This makes a net net_a in netlist a identical to the corresponding - net net_b in netlist b (see \compare). - Otherwise, the algorithm will try to identify nets according to their topology. This method can be used to supply hints to the compare algorithm. It will use these hints to derive further identities. - - If 'must_match' is true, the nets are required to match. If they don't, an error is reported. - - The 'must_match' optional argument has been added in version 0.27.3. - """ - @overload - def same_nets(self, circuit_a: Circuit, circuit_b: Circuit, net_a: Net, net_b: Net, must_match: Optional[bool] = ...) -> None: - r""" - @brief Marks two nets as identical. - This makes a net net_a in netlist a identical to the corresponding - net net_b in netlist b (see \compare). - Otherwise, the algorithm will try to identify nets according to their topology. This method can be used to supply hints to the compare algorithm. It will use these hints to derive further identities. - - If 'must_match' is true, the nets are required to match. If they don't, an error is reported. - - This variant allows specifying nil for the nets indicating the nets are mismatched by definition. with 'must_match' this will render a net mismatch error. - - This variant has been added in version 0.27.3. - """ - def unmatched_circuits_a(self, a: Netlist, b: Netlist) -> List[Circuit]: - r""" - @brief Returns a list of circuits in A for which there is not corresponding circuit in B - This list can be used to flatten these circuits so they do not participate in the compare process. - """ - def unmatched_circuits_b(self, a: Netlist, b: Netlist) -> List[Circuit]: - r""" - @brief Returns a list of circuits in B for which there is not corresponding circuit in A - This list can be used to flatten these circuits so they do not participate in the compare process. - """ - -class NetlistCrossReference(NetlistCompareLogger): - r""" - @brief Represents the identity mapping between the objects of two netlists. - - The NetlistCrossReference object is a container for the results of a netlist comparison. It implemented the \NetlistCompareLogger interface, hence can be used as output for a netlist compare operation (\NetlistComparer#compare). It's purpose is to store the results of the compare. It is used in this sense inside the \LayoutVsSchematic framework. - - The basic idea of the cross reference object is pairing: the netlist comparer will try to identify matching items and store them as pairs inside the cross reference object. If no match is found, a single-sided pair is generated: one item is nil in this case. - Beside the items, a status is kept which gives more details about success or failure of the match operation. - - Item pairing happens on different levels, reflecting the hierarchy of the netlists. On the top level there are circuits. Inside circuits nets, devices, subcircuits and pins are paired. Nets further contribute their connected items through terminals (for devices), pins (outgoing) and subcircuit pins. - - This class has been introduced in version 0.26. - """ - class NetPairData: - r""" - @brief A net match entry. - This object is used to describe the relationship of two nets in a netlist match. - - Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. - This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. - """ - def first(self) -> Net: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> Net: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - def status(self) -> NetlistCrossReference.Status: - r""" - @brief Gets the status of the relation. - This enum described the match status of the relation pair. - """ - class DevicePairData: - r""" - @brief A device match entry. - This object is used to describe the relationship of two devices in a netlist match. - - Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. - This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. - """ - def first(self) -> Device: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> Device: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - def status(self) -> NetlistCrossReference.Status: - r""" - @brief Gets the status of the relation. - This enum described the match status of the relation pair. - """ - class PinPairData: - r""" - @brief A pin match entry. - This object is used to describe the relationship of two circuit pins in a netlist match. - - Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. - This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. - """ - def first(self) -> Pin: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> Pin: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - def status(self) -> NetlistCrossReference.Status: - r""" - @brief Gets the status of the relation. - This enum described the match status of the relation pair. - """ - class SubCircuitPairData: - r""" - @brief A subcircuit match entry. - This object is used to describe the relationship of two subcircuits in a netlist match. - - Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. - This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. - """ - def first(self) -> SubCircuit: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> SubCircuit: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - def status(self) -> NetlistCrossReference.Status: - r""" - @brief Gets the status of the relation. - This enum described the match status of the relation pair. - """ - class CircuitPairData: - r""" - @brief A circuit match entry. - This object is used to describe the relationship of two circuits in a netlist match. - - Upon successful match, the \first and \second members are the matching objects and \status is 'Match'. - This object is also used to describe non-matches or match errors. In this case, \first or \second may be nil and \status further describes the case. - """ - def first(self) -> Circuit: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> Circuit: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - def status(self) -> NetlistCrossReference.Status: - r""" - @brief Gets the status of the relation. - This enum described the match status of the relation pair. - """ - class NetTerminalRefPair: - r""" - @brief A match entry for a net terminal pair. - This object is used to describe the matching terminal pairs or non-matching terminals on a net. - - Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. - """ - def first(self) -> NetTerminalRef: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> NetTerminalRef: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - class NetPinRefPair: - r""" - @brief A match entry for a net pin pair. - This object is used to describe the matching pin pairs or non-matching pins on a net. - - Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. - """ - def first(self) -> NetPinRef: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> NetPinRef: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - class NetSubcircuitPinRefPair: - r""" - @brief A match entry for a net subcircuit pin pair. - This object is used to describe the matching subcircuit pin pairs or non-matching subcircuit pins on a net. - - Upon successful match, the \first and \second members are the matching net objects.Otherwise, either \first or \second is nil and the other member is the object for which no match was found. - """ - def first(self) -> NetSubcircuitPinRef: - r""" - @brief Gets the first object of the relation pair. - The first object is usually the one obtained from the layout-derived netlist. This member can be nil if the pair is describing a non-matching reference object. In this case, the \second member is the reference object for which no match was found. - """ - def second(self) -> NetSubcircuitPinRef: - r""" - @brief Gets the second object of the relation pair. - The first object is usually the one obtained from the reference netlist. This member can be nil if the pair is describing a non-matching layout object. In this case, the \first member is the layout-derived object for which no match was found. - """ - class Status: - r""" - @brief This class represents the NetlistCrossReference::Status enum - """ - Match: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Match - An exact match exists if this code is present. - """ - MatchWithWarning: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::MatchWithWarning - If this code is present, a match was found but a warning is issued. For nets, this means that the choice is ambiguous and one, unspecific candidate has been chosen. For devices, this means a device match was established, but parameters or the device class are not matching exactly. - """ - Mismatch: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Mismatch - This code means there is a match candidate, but exact identity could not be confirmed. - """ - NoMatch: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::NoMatch - If this code is present, no match could be found. - There is also 'Mismatch' which means there is a candidate, but exact identity could not be confirmed. - """ - None_: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::None - No specific status is implied if this code is present. - """ - Skipped: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Skipped - On circuits this code means that a match has not been attempted because subcircuits of this circuits were not matched. As circuit matching happens bottom-up, all subcircuits must match at least with respect to their pins to allow any parent circuit to be matched. - """ - @overload - @classmethod - def new(cls, i: int) -> NetlistCrossReference.Status: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> NetlistCrossReference.Status: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: NetlistCrossReference.Status) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - Match: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Match - An exact match exists if this code is present. - """ - MatchWithWarning: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::MatchWithWarning - If this code is present, a match was found but a warning is issued. For nets, this means that the choice is ambiguous and one, unspecific candidate has been chosen. For devices, this means a device match was established, but parameters or the device class are not matching exactly. - """ - Mismatch: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Mismatch - This code means there is a match candidate, but exact identity could not be confirmed. - """ - NoMatch: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::NoMatch - If this code is present, no match could be found. - There is also 'Mismatch' which means there is a candidate, but exact identity could not be confirmed. - """ - None_: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::None - No specific status is implied if this code is present. - """ - Skipped: ClassVar[NetlistCrossReference.Status] - r""" - @brief Enum constant NetlistCrossReference::Skipped - On circuits this code means that a match has not been attempted because subcircuits of this circuits were not matched. As circuit matching happens bottom-up, all subcircuits must match at least with respect to their pins to allow any parent circuit to be matched. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def circuit_count(self) -> int: - r""" - @brief Gets the number of circuit pairs in the cross-reference object. - """ - def clear(self) -> None: - r""" - @hide - """ - def each_circuit_pair(self) -> Iterator[NetlistCrossReference.CircuitPairData]: - r""" - @brief Delivers the circuit pairs and their status. - See the class description for details. - """ - def each_device_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.DevicePairData]: - r""" - @brief Delivers the device pairs and their status for the given circuit pair. - See the class description for details. - """ - def each_net_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.NetPairData]: - r""" - @brief Delivers the net pairs and their status for the given circuit pair. - See the class description for details. - """ - def each_net_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetPinRefPair]: - r""" - @brief Delivers the pin pairs for the given net pair. - For the net pair, lists the pin pairs identified on this net. - """ - def each_net_subcircuit_pin_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetSubcircuitPinRefPair]: - r""" - @brief Delivers the subcircuit pin pairs for the given net pair. - For the net pair, lists the subcircuit pin pairs identified on this net. - """ - def each_net_terminal_pair(self, net_pair: NetlistCrossReference.NetPairData) -> Iterator[NetlistCrossReference.NetTerminalRefPair]: - r""" - @brief Delivers the device terminal pairs for the given net pair. - For the net pair, lists the device terminal pairs identified on this net. - """ - def each_pin_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.PinPairData]: - r""" - @brief Delivers the pin pairs and their status for the given circuit pair. - See the class description for details. - """ - def each_subcircuit_pair(self, circuit_pair: NetlistCrossReference.CircuitPairData) -> Iterator[NetlistCrossReference.SubCircuitPairData]: - r""" - @brief Delivers the subcircuit pairs and their status for the given circuit pair. - See the class description for details. - """ - def netlist_a(self) -> Netlist: - r""" - @brief Gets the first netlist which participated in the compare. - This member may be nil, if the respective netlist is no longer valid. In this case, the netlist cross-reference object cannot be used. - """ - def netlist_b(self) -> Netlist: - r""" - @brief Gets the second netlist which participated in the compare. - This member may be nil, if the respective netlist is no longer valid.In this case, the netlist cross-reference object cannot be used. - """ - def other_circuit_for(self, circuit: Circuit) -> Circuit: - r""" - @brief Gets the matching other circuit for a given primary circuit. - The return value will be nil if no match is found. Otherwise it is the 'b' circuit for circuits from the 'a' netlist and vice versa. - - This method has been introduced in version 0.27. - """ - def other_device_for(self, device: Device) -> Device: - r""" - @brief Gets the matching other device for a given primary device. - The return value will be nil if no match is found. Otherwise it is the 'b' device for devices from the 'a' netlist and vice versa. - - This method has been introduced in version 0.27. - """ - def other_net_for(self, net: Net) -> Net: - r""" - @brief Gets the matching other net for a given primary net. - The return value will be nil if no match is found. Otherwise it is the 'b' net for nets from the 'a' netlist and vice versa. - """ - def other_pin_for(self, pin: Pin) -> Pin: - r""" - @brief Gets the matching other pin for a given primary pin. - The return value will be nil if no match is found. Otherwise it is the 'b' pin for pins from the 'a' netlist and vice versa. - - This method has been introduced in version 0.27. - """ - def other_subcircuit_for(self, subcircuit: SubCircuit) -> SubCircuit: - r""" - @brief Gets the matching other subcircuit for a given primary subcircuit. - The return value will be nil if no match is found. Otherwise it is the 'b' subcircuit for subcircuits from the 'a' netlist and vice versa. - - This method has been introduced in version 0.27. - """ - -class LayoutVsSchematic(LayoutToNetlist): - r""" - @brief A generic framework for doing LVS (layout vs. schematic) - - This class extends the concept of the netlist extraction from a layout to LVS verification. It does so by adding these concepts to the \LayoutToNetlist class: - - @ul - @li A reference netlist. This will be the netlist against which the layout-derived netlist is compared against. See \reference and \reference=. - @/li - @li A compare step. During the compare the layout-derived netlist and the reference netlists are compared. The compare results are captured in the cross-reference object. See \compare and \NetlistComparer for the comparer object. - @/li - @li A cross-reference. This object (of class \NetlistCrossReference) will keep the relations between the objects of the two netlists. It also lists the differences between the netlists. See \xref about how to access this object.@/li - @/ul - - The LVS object can be persisted to and from a file in a specific format, so it is sometimes referred to as the "LVS database". - - LVS objects can be attached to layout views with \LayoutView#add_lvsdb so they become available in the netlist database browser. - - This class has been introduced in version 0.26. - """ - reference: Netlist - r""" - Getter: - @brief Gets the reference netlist. - - Setter: - @brief Sets the reference netlist. - This will set the reference netlist used inside \compare as the second netlist to compare against the layout-extracted netlist. - - The LVS object will take ownership over the netlist - i.e. if it goes out of scope, the reference netlist is deleted. - """ - @overload - @classmethod - def new(cls) -> LayoutVsSchematic: - r""" - @brief Creates a new LVS object - The main objective for this constructor is to create an object suitable for reading and writing LVS database files. - """ - @overload - @classmethod - def new(cls, dss: DeepShapeStore) -> LayoutVsSchematic: - r""" - @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object - See the corresponding constructor of the \LayoutToNetlist object for more details. - """ - @overload - @classmethod - def new(cls, iter: RecursiveShapeIterator) -> LayoutVsSchematic: - r""" - @brief Creates a new LVS object with the extractor connected to an original layout - This constructor will attach the extractor of the LVS object to an original layout through the shape iterator. - """ - @overload - @classmethod - def new(cls, dss: DeepShapeStore, layout_index: int) -> LayoutVsSchematic: - r""" - @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object - See the corresponding constructor of the \LayoutToNetlist object for more details. - """ - @overload - @classmethod - def new(cls, topcell_name: str, dbu: float) -> LayoutVsSchematic: - r""" - @brief Creates a new LVS object with the extractor object taking a flat DSS - See the corresponding constructor of the \LayoutToNetlist object for more details. - """ - @overload - def __init__(self) -> None: - r""" - @brief Creates a new LVS object - The main objective for this constructor is to create an object suitable for reading and writing LVS database files. - """ - @overload - def __init__(self, dss: DeepShapeStore) -> None: - r""" - @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object - See the corresponding constructor of the \LayoutToNetlist object for more details. - """ - @overload - def __init__(self, iter: RecursiveShapeIterator) -> None: - r""" - @brief Creates a new LVS object with the extractor connected to an original layout - This constructor will attach the extractor of the LVS object to an original layout through the shape iterator. - """ - @overload - def __init__(self, dss: DeepShapeStore, layout_index: int) -> None: - r""" - @brief Creates a new LVS object with the extractor object reusing an existing \DeepShapeStore object - See the corresponding constructor of the \LayoutToNetlist object for more details. - """ - @overload - def __init__(self, topcell_name: str, dbu: float) -> None: - r""" - @brief Creates a new LVS object with the extractor object taking a flat DSS - See the corresponding constructor of the \LayoutToNetlist object for more details. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def compare(self, comparer: NetlistComparer) -> bool: - r""" - @brief Compare the layout-extracted netlist against the reference netlist using the given netlist comparer. - """ - def read(self, path: str) -> None: - r""" - @brief Reads the LVS object from the file. - This method employs the native format of KLayout. - """ - def read_l2n(self, path: str) -> None: - r""" - @brief Reads the \LayoutToNetlist part of the object from a file. - This method employs the native format of KLayout. - """ - def write(self, path: str, short_format: Optional[bool] = ...) -> None: - r""" - @brief Writes the LVS object to a file. - This method employs the native format of KLayout. - """ - def write_l2n(self, path: str, short_format: Optional[bool] = ...) -> None: - r""" - @brief Writes the \LayoutToNetlist part of the object to a file. - This method employs the native format of KLayout. - """ - def xref(self) -> NetlistCrossReference: - r""" - @brief Gets the cross-reference object - The cross-reference object is created while comparing the layout-extracted netlist against the reference netlist - i.e. during \compare. Before \compare is called, this object is nil. - It holds the results of the comparison - a cross-reference between the nets and other objects in the match case and a listing of non-matching nets and other objects for the non-matching cases. - See \NetlistCrossReference for more details. - """ - -class Texts(ShapeCollection): - r""" - @brief Texts (a collection of texts) - - Text objects are useful as labels for net names, to identify certain regions and to specify specific locations in general. Text collections provide a way to store - also in a hierarchical fashion - and manipulate a collection of text objects. - - Text objects can be turned into polygons by creating small boxes around the texts (\polygons). Texts can also be turned into dot-like edges (\edges). Texts can be filtered by string, either by matching against a fixed string (\with_text) or a glob-style pattern (\with_match). - - Text collections can be filtered geometrically against a polygon \Region using \interacting or \non-interacting. Vice versa, texts can be used to select polygons from a \Region using \pull_interacting. - - Beside that, text collections can be transformed, flattened and combined, similar to \EdgePairs. - - This class has been introduced in version 0.27. - """ - @overload - @classmethod - def new(cls) -> Texts: - r""" - @brief Default constructor - - This constructor creates an empty text collection. - """ - @overload - @classmethod - def new(cls, array: Sequence[Text]) -> Texts: - r""" - @brief Constructor from an text array - - This constructor creates an text collection from an array of \Text objects. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator) -> Texts: - r""" - @brief Constructor from a hierarchical shape set - - This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. - Only texts are taken from the shape set and other shapes are ignored. - This method allows feeding the text collection from a hierarchy of cells. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::Texts::new(layout.begin_shapes(cell, layer)) - @/code - """ - @overload - @classmethod - def new(cls, shapes: Shapes) -> Texts: - r""" - @brief Shapes constructor - - This constructor creates an text collection from a \Shapes collection. - """ - @overload - @classmethod - def new(cls, text: Text) -> Texts: - r""" - @brief Constructor from a single edge pair object - - This constructor creates an text collection with a single text. - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> Texts: - r""" - @brief Creates a hierarchical text collection from an original layer - - This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. - This version will create a hierarchical text collection which supports hierarchical operations. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::Texts::new(layout.begin_shapes(cell, layer)) - @/code - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> Texts: - r""" - @brief Constructor from a hierarchical shape set with a transformation - - This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. - Only texts are taken from the shape set and other shapes are ignored. - The given transformation is applied to each text taken. - This method allows feeding the text collection from a hierarchy of cells. - The transformation is useful to scale to a specific database unit for example. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - """ - @overload - @classmethod - def new(cls, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> Texts: - r""" - @brief Creates a hierarchical text collection from an original layer with a transformation - - This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. - This version will create a hierarchical text collection which supports hierarchical operations. - The transformation is useful to scale to a specific database unit for example. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - """ - def __add__(self, other: Texts) -> Texts: - r""" - @brief Returns the combined text collection of self and the other one - - @return The resulting text collection - - This operator adds the texts of the other collection to self and returns a new combined set. - """ - def __and__(self, other: Region) -> Texts: - r""" - @brief Returns the texts from this text collection which are inside or on the edge of polygons from the given region - - @return A new text collection containing the texts inside or on the edge of polygons from the region - """ - def __copy__(self) -> Texts: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Texts: - r""" - @brief Creates a copy of self - """ - def __getitem__(self, n: int) -> Text: - r""" - @brief Returns the nth text - - This method returns nil if the index is out of range. It is available for flat texts only - i.e. those for which \has_valid_texts? is true. Use \flatten to explicitly flatten an text collection. - - The \each iterator is the more general approach to access the texts. - """ - def __iadd__(self, other: Texts) -> Texts: - r""" - @brief Adds the texts of the other text collection to self - - @return The text collection after modification (self) - - This operator adds the texts of the other collection to self. - """ - @overload - def __init__(self) -> None: - r""" - @brief Default constructor - - This constructor creates an empty text collection. - """ - @overload - def __init__(self, array: Sequence[Text]) -> None: - r""" - @brief Constructor from an text array - - This constructor creates an text collection from an array of \Text objects. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator) -> None: - r""" - @brief Constructor from a hierarchical shape set - - This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. - Only texts are taken from the shape set and other shapes are ignored. - This method allows feeding the text collection from a hierarchy of cells. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::Texts::new(layout.begin_shapes(cell, layer)) - @/code - """ - @overload - def __init__(self, shapes: Shapes) -> None: - r""" - @brief Shapes constructor - - This constructor creates an text collection from a \Shapes collection. - """ - @overload - def __init__(self, text: Text) -> None: - r""" - @brief Constructor from a single edge pair object - - This constructor creates an text collection with a single text. - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore) -> None: - r""" - @brief Creates a hierarchical text collection from an original layer - - This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. - This version will create a hierarchical text collection which supports hierarchical operations. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - r = RBA::Texts::new(layout.begin_shapes(cell, layer)) - @/code - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, trans: ICplxTrans) -> None: - r""" - @brief Constructor from a hierarchical shape set with a transformation - - This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. - Only texts are taken from the shape set and other shapes are ignored. - The given transformation is applied to each text taken. - This method allows feeding the text collection from a hierarchy of cells. - The transformation is useful to scale to a specific database unit for example. - - @code - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - """ - @overload - def __init__(self, shape_iterator: RecursiveShapeIterator, dss: DeepShapeStore, trans: ICplxTrans) -> None: - r""" - @brief Creates a hierarchical text collection from an original layer with a transformation - - This constructor creates a text collection from the shapes delivered by the given recursive shape iterator. - This version will create a hierarchical text collection which supports hierarchical operations. - The transformation is useful to scale to a specific database unit for example. - - @code - dss = RBA::DeepShapeStore::new - layout = ... # a layout - cell = ... # the index of the initial cell - layer = ... # the index of the layer from where to take the shapes from - dbu = 0.1 # the target database unit - r = RBA::Texts::new(layout.begin_shapes(cell, layer), RBA::ICplxTrans::new(layout.dbu / dbu)) - @/code - """ - def __iter__(self) -> Iterator[Text]: - r""" - @brief Returns each text of the text collection - """ - def __len__(self) -> int: - r""" - @brief Returns the (flat) number of texts in the text collection - - The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated. - - Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. - """ - def __str__(self) -> str: - r""" - @brief Converts the text collection to a string - The length of the output is limited to 20 texts to avoid giant strings on large collections. For full output use "to_s" with a maximum count parameter. - """ - def __sub__(self, other: Region) -> Texts: - r""" - @brief Returns the texts from this text collection which are not inside or on the edge of polygons from the given region - - @return A new text collection containing the texts not inside or on the edge of polygons from the region - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ShapeCollection) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> Box: - r""" - @brief Return the bounding box of the text collection - The bounding box is the box enclosing all origins of all texts. - """ - def clear(self) -> None: - r""" - @brief Clears the text collection - """ - def count(self) -> int: - r""" - @brief Returns the (flat) number of texts in the text collection - - The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated. - - Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. - """ - def create(self) -> None: - r""" - @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. - """ - def data_id(self) -> int: - r""" - @brief Returns the data ID (a unique identifier for the underlying data storage) - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def disable_progress(self) -> None: - r""" - @brief Disable progress reporting - Calling this method will disable progress reporting. See \enable_progress. - """ - def dup(self) -> Texts: - r""" - @brief Creates a copy of self - """ - def each(self) -> Iterator[Text]: - r""" - @brief Returns each text of the text collection - """ - def edges(self) -> Edges: - r""" - @brief Returns dot-like edges for the texts - @return An edge collection containing the individual, dot-like edges - """ - def enable_progress(self, label: str) -> None: - r""" - @brief Enable progress reporting - After calling this method, the text collection will report the progress through a progress bar while expensive operations are running. - The label is a text which is put in front of the progress bar. - Using a progress bar will imply a performance penalty of a few percent typically. - """ - @overload - def extents(self, d: Optional[int] = ...) -> Region: - r""" - @brief Returns a region with the enlarged bounding boxes of the texts - Text bounding boxes are point-like boxes which vanish unless an enlargement of >0 is specified. - The bounding box is centered at the text's location. - The boxes will not be merged, so it is possible to determine overlaps of these boxes for example. - """ - @overload - def extents(self, dx: int, dy: int) -> Region: - r""" - @brief Returns a region with the enlarged bounding boxes of the texts - This method acts like the other version of \extents, but allows giving different enlargements for x and y direction. - """ - def flatten(self) -> None: - r""" - @brief Explicitly flattens an text collection - - If the collection is already flat (i.e. \has_valid_texts? returns true), this method will not change the collection. - """ - def has_valid_texts(self) -> bool: - r""" - @brief Returns true if the text collection is flat and individual texts can be accessed randomly - """ - def hier_count(self) -> int: - r""" - @brief Returns the (hierarchical) number of texts in the text collection - - The count is computed 'hierarchical', i.e. texts inside a cell are counted once even if the cell is instantiated multiple times. - - This method has been introduced in version 0.27. - """ - @overload - def insert(self, text: Text) -> None: - r""" - @brief Inserts a text into the collection - """ - @overload - def insert(self, texts: Texts) -> None: - r""" - @brief Inserts all texts from the other text collection into this collection - """ - def insert_into(self, layout: Layout, cell_index: int, layer: int) -> None: - r""" - @brief Inserts this texts into the given layout, below the given cell and into the given layer. - If the text collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. - """ - def insert_into_as_polygons(self, layout: Layout, cell_index: int, layer: int, e: int) -> None: - r""" - @brief Inserts this texts into the given layout, below the given cell and into the given layer. - If the text collection is a hierarchical one, a suitable hierarchy will be built below the top cell or and existing hierarchy will be reused. - - The texts will be converted to polygons with the enlargement value given be 'e'. See \polygon or \extents for details. - """ - def interacting(self, other: Region) -> Texts: - r""" - @brief Returns the texts from this text collection which are inside or on the edge of polygons from the given region - - @return A new text collection containing the texts inside or on the edge of polygons from the region - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_deep(self) -> bool: - r""" - @brief Returns true if the edge pair collection is a deep (hierarchical) one - """ - def is_empty(self) -> bool: - r""" - @brief Returns true if the collection is empty - """ - @overload - def move(self, p: Vector) -> Texts: - r""" - @brief Moves the text collection - - Moves the texts by the given offset and returns the - moved text collection. The text collection is overwritten. - - @param p The distance to move the texts. - - @return The moved texts (self). - """ - @overload - def move(self, x: int, y: int) -> Texts: - r""" - @brief Moves the text collection - - Moves the edge pairs by the given offset and returns the - moved texts. The edge pair collection is overwritten. - - @param x The x distance to move the texts. - @param y The y distance to move the texts. - - @return The moved texts (self). - """ - @overload - def moved(self, p: Vector) -> Texts: - r""" - @brief Returns the moved text collection (does not modify self) - - Moves the texts by the given offset and returns the - moved texts. The text collection is not modified. - - @param p The distance to move the texts. - - @return The moved texts. - """ - @overload - def moved(self, x: int, y: int) -> Texts: - r""" - @brief Returns the moved edge pair collection (does not modify self) - - Moves the texts by the given offset and returns the - moved texts. The text collection is not modified. - - @param x The x distance to move the texts. - @param y The y distance to move the texts. - - @return The moved texts. - """ - def not_interacting(self, other: Region) -> Texts: - r""" - @brief Returns the texts from this text collection which are not inside or on the edge of polygons from the given region - - @return A new text collection containing the texts not inside or on the edge of polygons from the region - """ - def polygons(self, e: Optional[int] = ...) -> Region: - r""" - @brief Converts the edge pairs to polygons - This method creates polygons from the texts. This is equivalent to calling \extents. - """ - def pull_interacting(self, other: Region) -> Region: - r""" - @brief Returns all polygons of "other" which are including texts of this text set - The "pull_..." method is similar to "select_..." but works the opposite way: it selects shapes from the argument region rather than self. In a deep (hierarchical) context the output region will be hierarchically aligned with self, so the "pull_..." method provide a way for re-hierarchization. - - @return The region after the polygons have been selected (from other) - - Merged semantics applies for the polygon region. - """ - def select_interacting(self, other: Region) -> Texts: - r""" - @brief Selects the texts from this text collection which are inside or on the edge of polygons from the given region - - @return A text collection after the texts have been selected (self) - - In contrast to \interacting, this method will modify self. - """ - def select_not_interacting(self, other: Region) -> Texts: - r""" - @brief Selects the texts from this text collection which are not inside or on the edge of polygons from the given region - - @return A text collection after the texts have been selected (self) - - In contrast to \interacting, this method will modify self. - """ - def size(self) -> int: - r""" - @brief Returns the (flat) number of texts in the text collection - - The count is computed 'as if flat', i.e. texts inside a cell are multiplied by the number of times a cell is instantiated. - - Starting with version 0.27, the method is called 'count' for consistency with \Region. 'size' is still provided as an alias. - """ - def swap(self, other: Texts) -> None: - r""" - @brief Swap the contents of this collection with the contents of another collection - This method is useful to avoid excessive memory allocation in some cases. For managed memory languages such as Ruby, those cases will be rare. - """ - @overload - def to_s(self) -> str: - r""" - @brief Converts the text collection to a string - The length of the output is limited to 20 texts to avoid giant strings on large collections. For full output use "to_s" with a maximum count parameter. - """ - @overload - def to_s(self, max_count: int) -> str: - r""" - @brief Converts the text collection to a string - This version allows specification of the maximum number of texts contained in the string. - """ - @overload - def transform(self, t: ICplxTrans) -> Texts: - r""" - @brief Transform the text collection with a complex transformation (modifies self) - - Transforms the text collection with the given transformation. - This version modifies the text collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed text collection. - """ - @overload - def transform(self, t: Trans) -> Texts: - r""" - @brief Transform the text collection (modifies self) - - Transforms the text collection with the given transformation. - This version modifies the text collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed text collection. - """ - def transform_icplx(self, t: ICplxTrans) -> Texts: - r""" - @brief Transform the text collection with a complex transformation (modifies self) - - Transforms the text collection with the given transformation. - This version modifies the text collection and returns a reference to self. - - @param t The transformation to apply. - - @return The transformed text collection. - """ - @overload - def transformed(self, t: ICplxTrans) -> Texts: - r""" - @brief Transform the text collection with a complex transformation - - Transforms the text with the given complex transformation. - Does not modify the text collection but returns the transformed texts. - - @param t The transformation to apply. - - @return The transformed texts. - """ - @overload - def transformed(self, t: Trans) -> Texts: - r""" - @brief Transform the edge pair collection - - Transforms the texts with the given transformation. - Does not modify the edge pair collection but returns the transformed texts. - - @param t The transformation to apply. - - @return The transformed texts. - """ - def transformed_icplx(self, t: ICplxTrans) -> Texts: - r""" - @brief Transform the text collection with a complex transformation - - Transforms the text with the given complex transformation. - Does not modify the text collection but returns the transformed texts. - - @param t The transformation to apply. - - @return The transformed texts. - """ - def with_match(self, pattern: str, inverse: bool) -> Texts: - r""" - @brief Filter the text by glob pattern - "pattern" is a glob-style pattern (e.g. "A*" will select all texts starting with a capital "A"). - If "inverse" is false, this method returns the texts matching the pattern. - If "inverse" is true, this method returns the texts not matching the pattern. - """ - def with_text(self, text: str, inverse: bool) -> Texts: - r""" - @brief Filter the text by text string - If "inverse" is false, this method returns the texts with the given string. - If "inverse" is true, this method returns the texts not having the given string. - """ - -class ShapeCollection: - r""" - @brief A base class for the shape collections (\Region, \Edges, \EdgePairs and \Texts) - - This class has been introduced in version 0.27. - """ - @classmethod - def new(cls) -> ShapeCollection: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class LEFDEFReaderConfiguration: - r""" - @brief Detailed LEF/DEF reader options - This class is a aggregate belonging to the \LoadLayoutOptions class. It provides options for the LEF/DEF reader. These options have been placed into a separate class to account for their complexity. - This class specifically handles layer mapping. This is the process of generating layer names or GDS layer/datatypes from LEF/DEF layers and purpose combinations. There are basically two ways: to use a map file or to use pattern-based production rules. - - To use a layer map file, set the \map_file attribute to the name of the layer map file. The layer map file lists the GDS layer and datatype numbers to generate for the geometry. - - The pattern-based approach will use the layer name and attach a purpose-dependent suffix to it. Use the ..._suffix attributes to specify this suffix. For routing, the corresponding attribute is \routing_suffix for example. A purpose can also be mapped to a specific GDS datatype using the corresponding ..._datatype attributes. - The decorated or undecorated names are looked up in a layer mapping table in the next step. The layer mapping table is specified using the \layer_map attribute. This table can be used to map layer names to specific GDS layers by using entries of the form 'NAME: layer-number'. - - If a layer map file is present, the pattern-based attributes are ignored. - """ - blockages_datatype: int - r""" - Getter: - @brief Gets the blockage marker layer datatype value. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the blockage marker layer datatype value. - See \produce_via_geometry for details about the layer production rules. - """ - blockages_suffix: str - r""" - Getter: - @brief Gets the blockage marker layer name suffix. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the blockage marker layer name suffix. - See \produce_via_geometry for details about the layer production rules. - """ - cell_outline_layer: str - r""" - Getter: - @brief Gets the layer on which to produce the cell outline (diearea). - This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details. - The setter for this attribute is \cell_outline_layer=. See also \produce_cell_outlines. - Setter: - @brief Sets the layer on which to produce the cell outline (diearea). - See \cell_outline_layer for details. - """ - create_other_layers: bool - r""" - Getter: - @brief Gets a value indicating whether layers not mapped in the layer map shall be created too - See \layer_map for details. - Setter: - @brief Sets a value indicating whether layers not mapped in the layer map shall be created too - See \layer_map for details. - """ - dbu: float - r""" - Getter: - @brief Gets the database unit to use for producing the layout. - This value specifies the database to be used for the layout that is read. When a DEF file is specified with a different database unit, the layout is translated into this database unit. - - Setter: - @brief Sets the database unit to use for producing the layout. - See \dbu for details. - """ - fills_datatype: int - r""" - Getter: - @brief Gets the fill geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules. - - Fill support has been introduced in version 0.27. - Setter: - @brief Sets the fill geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules. - - Fill support has been introduced in version 0.27. - """ - fills_datatype_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - fills_suffix: str - r""" - Getter: - @brief Gets the fill geometry layer name suffix. - See \produce_via_geometry for details about the layer production rules. - - Fill support has been introduced in version 0.27. - Setter: - @brief Sets the fill geometry layer name suffix. - See \produce_via_geometry for details about the layer production rules. - - Fill support has been introduced in version 0.27. - """ - fills_suffix_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - instance_property_name: Any - r""" - Getter: - @brief Gets a value indicating whether and how to produce instance names as properties. - If set to a value not nil, instance names will be attached to the instances generated as user properties. - This attribute then specifies the user property name to be used for attaching the instance names. - If set to nil, no instance names will be produced. - - The corresponding setter is \instance_property_name=. - - This method has been introduced in version 0.26.4. - Setter: - @brief Sets a value indicating whether and how to produce instance names as properties. - See \instance_property_name for details. - - This method has been introduced in version 0.26.4. - """ - labels_datatype: int - r""" - Getter: - @brief Gets the labels layer datatype value. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the labels layer datatype value. - See \produce_via_geometry for details about the layer production rules. - """ - labels_suffix: str - r""" - Getter: - @brief Gets the label layer name suffix. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the label layer name suffix. - See \produce_via_geometry for details about the layer production rules. - """ - layer_map: LayerMap - r""" - Getter: - @brief Gets the layer map to be used for the LEF/DEF reader - @return A reference to the layer map - Because LEF/DEF layer mapping is substantially different than for normal layout files, the LEF/DEF reader employs a separate layer mapping table. The LEF/DEF specific layer mapping is stored within the LEF/DEF reader's configuration and can be accessed with this attribute. The layer mapping table of \LoadLayoutOptions will be ignored for the LEF/DEF reader. - - The setter is \layer_map=. \create_other_layers= is available to control whether layers not specified in the layer mapping table shall be created automatically. - Setter: - @brief Sets the layer map to be used for the LEF/DEF reader - See \layer_map for details. - """ - lef_files: List[str] - r""" - Getter: - @brief Gets the list technology LEF files to additionally import - Returns a list of path names for technology LEF files to read in addition to the primary file. Relative paths are resolved relative to the file to read or relative to the technology base path. - - The setter for this property is \lef_files=. - Setter: - @brief Sets the list technology LEF files to additionally import - See \lef_files for details. - """ - lef_labels_datatype: int - r""" - Getter: - @brief Gets the lef_labels layer datatype value. - See \produce_via_geometry for details about the layer production rules. - - This method has been introduced in version 0.27.2 - - Setter: - @brief Sets the lef_labels layer datatype value. - See \produce_via_geometry for details about the layer production rules. - - This method has been introduced in version 0.27.2 - """ - lef_labels_suffix: str - r""" - Getter: - @brief Gets the label layer name suffix. - See \produce_via_geometry for details about the layer production rules. - - This method has been introduced in version 0.27.2 - - Setter: - @brief Sets the label layer name suffix. - See \produce_via_geometry for details about the layer production rules. - - This method has been introduced in version 0.27.2 - """ - lef_pins_datatype: int - r""" - Getter: - @brief Gets the LEF pin geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the LEF pin geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules. - """ - lef_pins_datatype_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - lef_pins_suffix: str - r""" - Getter: - @brief Gets the LEF pin geometry layer name suffix. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the LEF pin geometry layer name suffix. - See \produce_via_geometry for details about the layer production rules. - """ - lef_pins_suffix_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - macro_layout_files: List[str] - r""" - Getter: - @brief Gets the list of layout files to read for substituting macros in DEF - These files play the same role than the macro layouts (see \macro_layouts), except that this property specifies a list of file names. The given files are loaded automatically to resolve macro layouts instead of LEF geometry. See \macro_resolution_mode for details when this happens. Relative paths are resolved relative to the DEF file to read or relative to the technology base path. - Macros in need for substitution are looked up in the layout files by searching for cells with the same name. The files are scanned in the order they are given in the file list. - The files from \macro_layout_files are scanned after the layout objects specified with \macro_layouts. - - The setter for this property is \macro_layout_files=. - - This property has been added in version 0.27.1. - - Setter: - @brief Sets the list of layout files to read for substituting macros in DEF - See \macro_layout_files for details. - - This property has been added in version 0.27.1. - """ - macro_layouts: List[Layout] - r""" - Getter: - @brief Gets the layout objects used for resolving LEF macros in the DEF reader. - The DEF reader can either use LEF geometry or use a separate source of layouts for the LEF macros. The \macro_resolution_mode controls whether to use LEF geometry. If LEF geometry is not used, the DEF reader will look up macro cells from the \macro_layouts and pull cell layouts from there. - - The LEF cells are looked up as cells by name from the macro layouts in the order these are given in this array. - - \macro_layout_files is another way of specifying such substitution layouts. This method accepts file names instead of layout objects. - - This property has been added in version 0.27. - - Setter: - @brief Sets the layout objects used for resolving LEF macros in the DEF reader. - See \macro_layouts for more details about this property. - - Layout objects specified in the array for this property are not owned by the \LEFDEFReaderConfiguration object. Be sure to keep some other reference to these Layout objects if you are storing away the LEF/DEF reader configuration object. - - This property has been added in version 0.27. - """ - macro_resolution_mode: int - r""" - Getter: - @brief Gets the macro resolution mode (LEF macros into DEF). - This property describes the way LEF macros are turned into layout cells when reading DEF. There are three modes available: - - @ul - @li 0: produce LEF geometry unless a FOREIGN cell is specified @/li - @li 1: produce LEF geometry always and ignore FOREIGN @/li - @li 2: Never produce LEF geometry and assume FOREIGN always @/li - @/ul - - If substitution layouts are specified with \macro_layouts, these are used to provide macro layouts in case no LEF geometry is taken. - - This property has been added in version 0.27. - - Setter: - @brief Sets the macro resolution mode (LEF macros into DEF). - See \macro_resolution_mode for details about this property. - - This property has been added in version 0.27. - """ - map_file: str - r""" - Getter: - @brief Gets the layer map file to use. - If a layer map file is given, the reader will pull the layer mapping from this file. The layer mapping rules specified in the reader options are ignored in this case. These are the name suffix rules for vias, blockages, routing, special routing, pins etc. and the corresponding datatype rules. The \layer_map attribute will also be ignored. - The layer map file path will be resolved relative to the technology base path if the LEF/DEF reader options are used in the context of a technology. - - This property has been added in version 0.27. - - Setter: - @brief Sets the layer map file to use. - See \map_file for details about this property. - - This property has been added in version 0.27. - """ - net_property_name: Any - r""" - Getter: - @brief Gets a value indicating whether and how to produce net names as properties. - If set to a value not nil, net names will be attached to the net shapes generated as user properties. - This attribute then specifies the user property name to be used for attaching the net names. - If set to nil, no net names will be produced. - - The corresponding setter is \net_property_name=. - Setter: - @brief Sets a value indicating whether and how to produce net names as properties. - See \net_property_name for details. - """ - obstructions_datatype: int - r""" - Getter: - @brief Gets the obstruction marker layer datatype value. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the obstruction marker layer datatype value. - See \produce_via_geometry for details about the layer production rules. - """ - obstructions_suffix: str - r""" - Getter: - @brief Gets the obstruction marker layer name suffix. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the obstruction marker layer name suffix. - See \produce_via_geometry for details about the layer production rules. - """ - @property - def paths_relative_to_cwd(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets a value indicating whether to use paths relative to cwd (true) or DEF file (false) for map or LEF files - This write-only attribute has been introduced in version 0.27.9. - """ - pin_property_name: Any - r""" - Getter: - @brief Gets a value indicating whether and how to produce pin names as properties. - If set to a value not nil, pin names will be attached to the pin shapes generated as user properties. - This attribute then specifies the user property name to be used for attaching the pin names. - If set to nil, no pin names will be produced. - - The corresponding setter is \pin_property_name=. - - This method has been introduced in version 0.26.4. - Setter: - @brief Sets a value indicating whether and how to produce pin names as properties. - See \pin_property_name for details. - - This method has been introduced in version 0.26.4. - """ - pins_datatype: int - r""" - Getter: - @brief Gets the pin geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the pin geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules. - """ - pins_datatype_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - pins_suffix: str - r""" - Getter: - @brief Gets the pin geometry layer name suffix. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the pin geometry layer name suffix. - See \produce_via_geometry for details about the layer production rules. - """ - pins_suffix_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - placement_blockage_layer: str - r""" - Getter: - @brief Gets the layer on which to produce the placement blockage. - This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details.The setter for this attribute is \placement_blockage_layer=. See also \produce_placement_blockages. - Setter: - @brief Sets the layer on which to produce the placement blockage. - See \placement_blockage_layer for details. - """ - produce_blockages: bool - r""" - Getter: - @brief Gets a value indicating whether routing blockage markers shall be produced. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets a value indicating whether routing blockage markers shall be produced. - See \produce_via_geometry for details about the layer production rules. - """ - produce_cell_outlines: bool - r""" - Getter: - @brief Gets a value indicating whether to produce cell outlines (diearea). - If set to true, cell outlines will be produced on the layer given by \cell_outline_layer. - Setter: - @brief Sets a value indicating whether to produce cell outlines (diearea). - See \produce_cell_outlines for details. - """ - produce_fills: bool - r""" - Getter: - @brief Gets a value indicating whether fill geometries shall be produced. - See \produce_via_geometry for details about the layer production rules. - - Fill support has been introduced in version 0.27. - Setter: - @brief Sets a value indicating whether fill geometries shall be produced. - See \produce_via_geometry for details about the layer production rules. - - Fill support has been introduced in version 0.27. - """ - produce_labels: bool - r""" - Getter: - @brief Gets a value indicating whether labels shall be produced. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets a value indicating whether labels shall be produced. - See \produce_via_geometry for details about the layer production rules. - """ - produce_lef_labels: bool - r""" - Getter: - @brief Gets a value indicating whether lef_labels shall be produced. - See \produce_via_geometry for details about the layer production rules. - - This method has been introduced in version 0.27.2 - - Setter: - @brief Sets a value indicating whether lef_labels shall be produced. - See \produce_via_geometry for details about the layer production rules. - - This method has been introduced in version 0.27.2 - """ - produce_lef_pins: bool - r""" - Getter: - @brief Gets a value indicating whether LEF pin geometries shall be produced. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets a value indicating whether LEF pin geometries shall be produced. - See \produce_via_geometry for details about the layer production rules. - """ - produce_obstructions: bool - r""" - Getter: - @brief Gets a value indicating whether obstruction markers shall be produced. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets a value indicating whether obstruction markers shall be produced. - See \produce_via_geometry for details about the layer production rules. - """ - produce_pins: bool - r""" - Getter: - @brief Gets a value indicating whether pin geometries shall be produced. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets a value indicating whether pin geometries shall be produced. - See \produce_via_geometry for details about the layer production rules. - """ - produce_placement_blockages: bool - r""" - Getter: - @brief Gets a value indicating whether to produce placement blockage regions. - If set to true, polygons will be produced representing the placement blockage region on the layer given by \placement_blockage_layer. - Setter: - @brief Sets a value indicating whether to produce placement blockage regions. - See \produce_placement_blockages for details. - """ - produce_regions: bool - r""" - Getter: - @brief Gets a value indicating whether to produce regions. - If set to true, polygons will be produced representing the regions on the layer given by \region_layer. - - The attribute has been introduced in version 0.27. - Setter: - @brief Sets a value indicating whether to produce regions. - See \produce_regions for details. - - The attribute has been introduced in version 0.27. - """ - produce_routing: bool - r""" - Getter: - @brief Gets a value indicating whether routing geometry shall be produced. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets a value indicating whether routing geometry shall be produced. - See \produce_via_geometry for details about the layer production rules. - """ - produce_special_routing: bool - r""" - Getter: - @brief Gets a value indicating whether special routing geometry shall be produced. - See \produce_via_geometry for details about the layer production rules. - - The differentiation between special and normal routing has been introduced in version 0.27. - Setter: - @brief Sets a value indicating whether special routing geometry shall be produced. - See \produce_via_geometry for details about the layer production rules. - The differentiation between special and normal routing has been introduced in version 0.27. - """ - produce_via_geometry: bool - r""" - Getter: - @brief Sets a value indicating whether via geometries shall be produced. - - If set to true, shapes will be produced for each via. The layer to be produced will be determined from the via layer's name using the suffix provided by \via_geometry_suffix. If there is a specific mapping in the layer mapping table for the via layer including the suffix, the layer/datatype will be taken from the layer mapping table. If there is a mapping to the undecorated via layer, the datatype will be substituted with the \via_geometry_datatype value. If no mapping is defined, a unique number will be assigned to the layer number and the datatype will be taken from the \via_geometry_datatype value. - - For example: the via layer is 'V1', \via_geometry_suffix is 'GEO' and \via_geometry_datatype is 1. Then: - - @ul - @li If there is a mapping for 'V1.GEO', the layer and datatype will be taken from there. @/li - @li If there is a mapping for 'V1', the layer will be taken from there and the datatype will be taken from \via_geometry_datatype. The name of the produced layer will be 'V1.GEO'. @/li - @li If there is no mapping for both, the layer number will be a unique value, the datatype will be taken from \via_geometry_datatype and the layer name will be 'V1.GEO'. @/li@/ul - - Setter: - @brief Sets a value indicating whether via geometries shall be produced. - See \produce_via_geometry for details. - """ - read_lef_with_def: bool - r""" - Getter: - @brief Gets a value indicating whether to read all LEF files in the same directory than the DEF file. - If this property is set to true (the default), the DEF reader will automatically consume all LEF files next to the DEF file in addition to the LEF files specified with \lef_files. If set to false, only the LEF files specified with \lef_files will be read. - - This property has been added in version 0.27. - - Setter: - @brief Sets a value indicating whether to read all LEF files in the same directory than the DEF file. - See \read_lef_with_def for details about this property. - - This property has been added in version 0.27. - """ - region_layer: str - r""" - Getter: - @brief Gets the layer on which to produce the regions. - This attribute is a string corresponding to the string representation of \LayerInfo. This string can be either a layer number, a layer/datatype pair, a name or a combination of both. See \LayerInfo for details.The setter for this attribute is \region_layer=. See also \produce_regions. - - The attribute has been introduced in version 0.27. - Setter: - @brief Sets the layer on which to produce the regions. - See \region_layer for details. - - The attribute has been introduced in version 0.27. - """ - routing_datatype: int - r""" - Getter: - @brief Gets the routing layer datatype value. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the routing layer datatype value. - See \produce_via_geometry for details about the layer production rules. - """ - routing_datatype_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - routing_suffix: str - r""" - Getter: - @brief Gets the routing layer name suffix. - See \produce_via_geometry for details about the layer production rules. - Setter: - @brief Sets the routing layer name suffix. - See \produce_via_geometry for details about the layer production rules. - """ - routing_suffix_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - separate_groups: bool - r""" - Getter: - @brief Gets a value indicating whether to create separate parent cells for individual groups. - If this property is set to true, instances belonging to different groups are separated by putting them into individual parent cells. These parent cells are named after the groups and are put into the master top cell. - If this property is set to false (the default), no such group parents will be formed. - This property has been added in version 0.27. - - Setter: - @brief Sets a value indicating whether to create separate parent cells for individual groups. - See \separate_groups for details about this property. - - This property has been added in version 0.27. - """ - special_routing_datatype: int - r""" - Getter: - @brief Gets the special routing layer datatype value. - See \produce_via_geometry for details about the layer production rules. - The differentiation between special and normal routing has been introduced in version 0.27. - Setter: - @brief Sets the special routing layer datatype value. - See \produce_via_geometry for details about the layer production rules. - The differentiation between special and normal routing has been introduced in version 0.27. - """ - special_routing_datatype_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - special_routing_suffix: str - r""" - Getter: - @brief Gets the special routing layer name suffix. - See \produce_via_geometry for details about the layer production rules. - The differentiation between special and normal routing has been introduced in version 0.27. - Setter: - @brief Sets the special routing layer name suffix. - See \produce_via_geometry for details about the layer production rules. - The differentiation between special and normal routing has been introduced in version 0.27. - """ - special_routing_suffix_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - via_cellname_prefix: str - r""" - Getter: - @brief Gets the via cellname prefix. - Vias are represented by cells. The cell name is formed by combining the via cell name prefix and the via name. - - This property has been added in version 0.27. - - Setter: - @brief Sets the via cellname prefix. - See \via_cellname_prefix for details about this property. - - This property has been added in version 0.27. - """ - via_geometry_datatype: int - r""" - Getter: - @brief Gets the via geometry layer datatype value. - See \produce_via_geometry for details about this property. - - Setter: - @brief Sets the via geometry layer datatype value. - See \produce_via_geometry for details about this property. - """ - via_geometry_datatype_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - via_geometry_suffix: str - r""" - Getter: - @brief Gets the via geometry layer name suffix. - See \produce_via_geometry for details about this property. - - Setter: - @brief Sets the via geometry layer name suffix. - See \produce_via_geometry for details about this property. - """ - via_geometry_suffix_str: str - r""" - Getter: - @hide - Setter: - @hide - """ - @classmethod - def new(cls) -> LEFDEFReaderConfiguration: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> LEFDEFReaderConfiguration: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> LEFDEFReaderConfiguration: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: LEFDEFReaderConfiguration) -> None: - r""" - @brief Assigns another object to self - """ - def clear_fill_datatypes_per_mask(self) -> None: - r""" - @brief Clears the fill layer datatypes per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_fills_suffixes_per_mask(self) -> None: - r""" - @brief Clears the fill layer name suffix per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_lef_pins_datatypes_per_mask(self) -> None: - r""" - @brief Clears the LEF pin layer datatypes per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_lef_pins_suffixes_per_mask(self) -> None: - r""" - @brief Clears the LEF pin layer name suffix per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_pin_datatypes_per_mask(self) -> None: - r""" - @brief Clears the pin layer datatypes per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_pins_suffixes_per_mask(self) -> None: - r""" - @brief Clears the pin layer name suffix per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_routing_datatypes_per_mask(self) -> None: - r""" - @brief Clears the routing layer datatypes per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_routing_suffixes_per_mask(self) -> None: - r""" - @brief Clears the routing layer name suffix per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_special_routing_datatypes_per_mask(self) -> None: - r""" - @brief Clears the special routing layer datatypes per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_special_routing_suffixes_per_mask(self) -> None: - r""" - @brief Clears the special routing layer name suffix per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_via_geometry_datatypes_per_mask(self) -> None: - r""" - @brief Clears the via geometry layer datatypes per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def clear_via_geometry_suffixes_per_mask(self) -> None: - r""" - @brief Clears the via geometry layer name suffix per mask. - See \produce_via_geometry for details about this property. - - - Mask specific rules have been introduced in version 0.27. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> LEFDEFReaderConfiguration: - r""" - @brief Creates a copy of self - """ - def fills_suffix_per_mask(self, mask: int) -> str: - r""" - @brief Gets the fill geometry layer name suffix per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def lef_pins_suffix_per_mask(self, mask: int) -> str: - r""" - @brief Gets the LEF pin geometry layer name suffix per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def pins_suffix_per_mask(self, mask: int) -> str: - r""" - @brief Gets the pin geometry layer name suffix per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def routing_suffix_per_mask(self, mask: int) -> str: - r""" - @brief Gets the routing geometry layer name suffix per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_fills_datatype_per_mask(self, mask: int, datatype: int) -> None: - r""" - @brief Sets the fill geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_fills_suffix_per_mask(self, mask: int, suffix: str) -> None: - r""" - @brief Sets the fill geometry layer name suffix per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_lef_pins_datatype_per_mask(self, mask: int, datatype: int) -> None: - r""" - @brief Sets the LEF pin geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_lef_pins_suffix_per_mask(self, mask: int, suffix: str) -> None: - r""" - @brief Sets the LEF pin geometry layer name suffix per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_pins_datatype_per_mask(self, mask: int, datatype: int) -> None: - r""" - @brief Sets the pin geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_pins_suffix_per_mask(self, mask: int, suffix: str) -> None: - r""" - @brief Sets the pin geometry layer name suffix per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_routing_datatype_per_mask(self, mask: int, datatype: int) -> None: - r""" - @brief Sets the routing geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_routing_suffix_per_mask(self, mask: int, suffix: str) -> None: - r""" - @brief Sets the routing geometry layer name suffix per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_special_routing_datatype_per_mask(self, mask: int, datatype: int) -> None: - r""" - @brief Sets the special routing geometry layer datatype value. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_special_routing_suffix_per_mask(self, mask: int, suffix: str) -> None: - r""" - @brief Sets the special routing geometry layer name suffix per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_via_geometry_datatype_per_mask(self, mask: int, datatype: int) -> None: - r""" - @brief Sets the via geometry layer datatype value. - See \produce_via_geometry for details about this property. - The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def set_via_geometry_suffix_per_mask(self, mask: int, suffix: str) -> None: - r""" - @brief Sets the via geometry layer name suffix per mask. - See \produce_via_geometry for details about this property. - The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def special_routing_suffix_per_mask(self, mask: int) -> str: - r""" - @brief Gets the special routing geometry layer name suffix per mask. - See \produce_via_geometry for details about the layer production rules.The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - def via_geometry_suffix_per_mask(self, mask: int) -> str: - r""" - @brief Gets the via geometry layer name suffix per mask. - See \produce_via_geometry for details about this property. - The mask number is a zero-based mask index (0: MASK 1, 1: MASK 2 ...). - - Mask specific rules have been introduced in version 0.27. - """ - -class NetTracerConnectivity: - r""" - @brief A connectivity description for the net tracer - - This object represents the technology description for the net tracer (represented by the \NetTracer class). - A technology description basically consists of connection declarations. - A connection is given by either two or three expressions describing two conductive materials. - With two expressions, the connection describes a transition from one material to another one. - With three expressions, the connection describes a transition from one material to another through a connection (a "via"). - - The conductive material is derived from original layers either directly or through boolean expressions. These expressions can include symbols which are defined through the \symbol method. - - For details about the expressions see the description of the net tracer feature. - - This class has been introduced in version 0.28 and replaces the 'NetTracerTechnology' class which has been generalized. - """ - description: str - r""" - Getter: - @brief Gets the description text of the connectivty definition - The description is an optional string giving a human-readable description for this definition. - Setter: - @brief Sets the description of the connectivty definition - """ - name: str - r""" - Getter: - @brief Gets the name of the connectivty definition - The name is an optional string defining the formal name for this definition. - - Setter: - @brief Sets the name of the connectivty definition - """ - @classmethod - def new(cls) -> NetTracerConnectivity: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetTracerConnectivity: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetTracerConnectivity: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetTracerConnectivity) -> None: - r""" - @brief Assigns another object to self - """ - @overload - def connection(self, a: str, b: str) -> None: - r""" - @brief Defines a connection between two materials - See the class description for details about this method. - """ - @overload - def connection(self, a: str, via: str, b: str) -> None: - r""" - @brief Defines a connection between materials through a via - See the class description for details about this method. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetTracerConnectivity: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def symbol(self, name: str, expr: str) -> None: - r""" - @brief Defines a symbol for use in the material expressions. - Defines a sub-expression to be used in further symbols or material expressions. For the detailed notation of the expression see the description of the net tracer feature. - """ - -class NetElement: - r""" - @brief A net element for the NetTracer net tracing facility - - This object represents a piece of a net extracted by the net tracer. See the description of \NetTracer for more details about the net tracer feature. - - The NetTracer object represents one shape of the net. The shape can be an original shape or a shape derived in a boolean operation. In the first case, the shape refers to a shape within a cell or a subcell of the original top cell. In the latter case, the shape is a synthesized one and outside the original layout hierarchy. - - In any case, the \shape method will deliver the shape and \trans the transformation of the shape into the original top cell. To obtain a flat representation of the net, the shapes need to be transformed by this transformation. - - \layer will give the layer the shape is located at, \cell_index will denote the cell that contains the shape. - - This class has been introduced in version 0.25. - """ - @classmethod - def new(cls) -> NetElement: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetElement: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetElement: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetElement) -> None: - r""" - @brief Assigns another object to self - """ - def bbox(self) -> Box: - r""" - @brief Delivers the bounding box of the shape as seen from the original top cell - """ - def cell_index(self) -> int: - r""" - @brief Gets the index of the cell the shape is inside - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetElement: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def layer(self) -> int: - r""" - @brief Gets the index of the layer the shape is on - """ - def shape(self) -> Shape: - r""" - @brief Gets the shape that makes up this net element - See the class description for more details about this attribute. - """ - def trans(self) -> ICplxTrans: - r""" - @brief Gets the transformation to apply for rendering the shape in the original top cell - See the class description for more details about this attribute. - """ - -class NetTracer: - r""" - @brief The net tracer feature - - The net tracer class provides an interface to the net tracer feature. It is accompanied by the \NetElement and \NetTracerTechnology classes. The latter will provide the technology definition for the net tracer while the \NetElement objects represent a piece of the net after it has been extracted. - - The technology definition is optional. The net tracer can be used with a predefined technology as well. The basic scheme of using the net tracer is to instantiate a net tracer object and run the extraction through the \NetTracer#trace method. After this method was executed successfully, the resulting net can be obtained from the net tracer object by iterating over the \NetElement objects of the net tracer. - - Here is some sample code: - - @code - ly = RBA::CellView::active.layout - - tracer = RBA::NetTracer::new - - tech = RBA::NetTracerConnectivity::new - tech.connection("1/0", "2/0", "3/0") - - tracer.trace(tech, ly, ly.top_cell, RBA::Point::new(7000, 1500), ly.find_layer(1, 0)) - - tracer.each_element do |e| - puts e.shape.polygon.transformed(e.trans) - end - @/code - - This class has been introduced in version 0.25. With version 0.28, the \NetTracerConnectivity class replaces the 'NetTracerTechnology' class. - """ - trace_depth: int - r""" - Getter: - @brief gets the trace depth - See \trace_depth= for a description of this property. - - This method has been introduced in version 0.26.4. - - Setter: - @brief Sets the trace depth (shape limit) - Set this value to limit the maximum number of shapes delivered. Upon reaching this count, the tracer will stop and report the net as 'incomplete' (see \incomplete?). - Setting a trace depth if 0 is equivalent to 'unlimited'. - The actual number of shapes delivered may be a little less than the depth because of internal marker shapes which are taken into account, but are not delivered. - - This method has been introduced in version 0.26.4. - """ - @classmethod - def new(cls) -> NetTracer: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetTracer: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetTracer: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetTracer) -> None: - r""" - @brief Assigns another object to self - """ - def clear(self) -> None: - r""" - @brief Clears the data from the last extraction - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetTracer: - r""" - @brief Creates a copy of self - """ - def each_element(self) -> Iterator[NetElement]: - r""" - @brief Iterates over the elements found during extraction - The elements are available only after the extraction has been performed. - """ - def incomplete(self) -> bool: - r""" - @brief Returns a value indicating whether the net is incomplete - A net may be incomplete if the extraction has been stopped by the user for example. This attribute is useful only after the extraction has been performed. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def name(self) -> str: - r""" - @brief Returns the name of the net found during extraction - The net name is extracted from labels found during the extraction. This attribute is useful only after the extraction has been performed. - """ - def num_elements(self) -> int: - r""" - @brief Returns the number of elements found during extraction - This attribute is useful only after the extraction has been performed. - """ - @overload - def trace(self, tech: NetTracerConnectivity, layout: Layout, cell: Cell, start_point: Point, start_layer: int) -> None: - r""" - @brief Runs a net extraction - - This method runs an extraction with the given parameters. - To make the extraction successful, a shape must be present at the given start point on the start layer. The start layer must be a valid layer mentioned within the technology specification. - - This version runs a single extraction - i.e. it will extract all elements connected to the given seed point. A path extraction version is provided as well which will extract one (the presumably shortest) path between two points. - - @param tech The connectivity definition - @param layout The layout on which to run the extraction - @param cell The cell on which to run the extraction (child cells will be included) - @param start_point The start point from which to start extraction of the net - @param start_layer The layer from which to start extraction - """ - @overload - def trace(self, tech: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int) -> None: - r""" - @brief Runs a net extraction taking a predefined technology - This method behaves identical as the version with a technology object, except that it will look for a technology with the given name to obtain the extraction setup. - The technology is looked up by technology name. A version of this method exists where it is possible to specify the name of the particular connectivity to use in case there are multiple definitions available. - """ - @overload - def trace(self, tech: str, connectivity_name: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int) -> None: - r""" - @brief Runs a net extraction taking a predefined technology - This method behaves identical as the version with a technology object, except that it will look for a technology with the given name to obtain the extraction setup. This version allows specifying the name of the connecvitiy setup. - - This method variant has been introduced in version 0.28. - """ - @overload - def trace(self, tech: NetTracerConnectivity, layout: Layout, cell: Cell, start_point: Point, start_layer: int, stop_point: Point, stop_layer: int) -> None: - r""" - @brief Runs a path extraction - - This method runs an path extraction with the given parameters. - To make the extraction successful, a shape must be present at the given start point on the start layer and at the given stop point at the given stop layer. The start and stop layers must be a valid layers mentioned within the technology specification. - - This version runs a path extraction and will deliver elements forming one path leading from the start to the end point. - - @param tech The connectivity definition - @param layout The layout on which to run the extraction - @param cell The cell on which to run the extraction (child cells will be included) - @param start_point The start point from which to start extraction of the net - @param start_layer The layer from which to start extraction - @param stop_point The stop point at which to stop extraction of the net - @param stop_layer The layer at which to stop extraction - """ - @overload - def trace(self, tech: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int, stop_point: Point, stop_layer: int) -> None: - r""" - @brief Runs a path extraction taking a predefined technology - This method behaves identical as the version with a technology object, except that it will look for a technology with the given name to obtain the extraction setup. - """ - @overload - def trace(self, tech: str, connectivity_name: str, layout: Layout, cell: Cell, start_point: Point, start_layer: int, stop_point: Point, stop_layer: int) -> None: - r""" - @brief Runs a path extraction taking a predefined technology - This method behaves identical as the version with a technology object, except that it will look for a technology with the given name to obtain the extraction setup.This version allows specifying the name of the connecvitiy setup. - - This method variant has been introduced in version 0.28. - """ - diff --git a/src/pymod/distutils_src/klayout/laycore.pyi b/src/pymod/distutils_src/klayout/laycore.pyi index c002720c6..83fd6ba69 100644 --- a/src/pymod/distutils_src/klayout/laycore.pyi +++ b/src/pymod/distutils_src/klayout/laycore.pyi @@ -3,78 +3,77 @@ from typing import overload import klayout.tl as tl import klayout.db as db import klayout.rdb as rdb -class PixelBuffer: +class AbstractMenu: r""" - @brief A simplistic pixel buffer representing an image of ARGB32 or RGB32 values + @brief An abstraction for the application menus - 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. + 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. - This class supports basic operations such as initialization, single-pixel access and I/O to PNG. + 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. - This class has been introduced in version 0.28. - """ - transparent: bool - r""" - Getter: - @brief Gets a flag indicating whether the pixel buffer supports an alpha channel + 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). - Setter: - @brief Sets a flag indicating whether the pixel buffer supports an alpha channel + Menu items and submenus are referred to by a "path". The path is a string with this interpretation: - By default, the pixel buffer does not support an alpha channel. + @ + @@@@ + @@@@ + @@@@ + @@@@ + @@@@ + @
"" @is the root@
"[.]" @is an element of the submenu given by . If is omitted, this refers to an element in the root@
"[.]end" @refers to the item past the last item of the submenu given by or root@
"[.]begin" @refers to the first item of the submenu given by or root@
"[.]#" @refers to the nth item of the submenu given by or root (n is an integer number)@
+ + 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 ":" to the item's name. + This specification can be used several times. + + Detached menus (i.e. for use in context menus) can be created as virtual top-level submenus + with a name of the form "@@". A special detached menu is "@toolbar" which represents the tool bar of the main window. + Menus 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. """ @classmethod - def from_png_data(cls, data: bytes) -> PixelBuffer: + def new(cls) -> AbstractMenu: r""" - @brief Reads the pixel buffer from a PNG byte stream - This method may not be available if PNG support is not compiled into KLayout. + @hide """ @classmethod - def from_qimage(cls, qimage: QtGui.QImage_Native) -> PixelBuffer: + def pack_key_binding(cls, path_to_keys: Dict[str, str]) -> str: r""" - @brief Creates a pixel buffer object from a QImage object + @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. """ @classmethod - def new(cls, width: int, height: int) -> PixelBuffer: + def pack_menu_items_hidden(cls, path_to_visibility: Dict[str, bool]) -> str: r""" - @brief Creates a pixel buffer object + @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. - @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. + This method has been introduced in version 0.26. """ @classmethod - def read_png(cls, file: str) -> PixelBuffer: + def unpack_key_binding(cls, s: str) -> Dict[str, str]: r""" - @brief Reads the pixel buffer from a PNG file - This method may not be available if PNG support is not compiled into KLayout. - """ - def __copy__(self) -> PixelBuffer: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> PixelBuffer: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Returns a value indicating whether self is identical to the other image - """ - def __init__(self, width: int, height: int) -> None: - r""" - @brief Creates a pixel buffer object + @brief Deserializes a key binding definition + This method is the reverse of \pack_key_binding. - @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. + This method has been introduced in version 0.26. """ - def __ne__(self, other: object) -> bool: + @classmethod + def unpack_menu_items_hidden(cls, s: str) -> Dict[str, bool]: r""" - @brief Returns a value indicating whether self is not identical to the other image + @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. + """ + def __init__(self) -> None: + r""" + @hide """ def _create(self) -> None: r""" @@ -113,7 +112,1293 @@ class PixelBuffer: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: PixelBuffer) -> None: + def action(self, path: str) -> ActionBase: + r""" + @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 + """ + def clear_menu(self, path: str) -> None: + r""" + @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. + """ + def create(self) -> None: + r""" + @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. + """ + def delete_item(self, path: str) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def group(self, group: str) -> List[str]: + r""" + @brief Gets the group members + + @param group The group name + @param A vector of all members (by path) of the group + """ + def insert_item(self, path: str, name: str, action: ActionBase) -> None: + r""" + @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 + """ + @overload + def insert_menu(self, path: str, name: str, action: ActionBase) -> None: + r""" + @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. + """ + @overload + def insert_menu(self, path: str, name: str, title: str) -> None: + r""" + @brief Inserts a new submenu before the item given by the path + + The title string optionally encodes the key shortcut and icon resource + in the form ["("")"]["<"">"]. + + @param path The path to the item before which to insert the submenu + @param name The name of the submenu to insert + @param title The title of the submenu to insert + """ + def insert_separator(self, path: str, name: str) -> None: + r""" + @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 + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_menu(self, path: str) -> bool: + r""" + @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 + """ + def is_separator(self, path: str) -> bool: + r""" + @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. + """ + def is_valid(self, path: str) -> bool: + r""" + @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 + """ + def items(self, path: str) -> List[str]: + r""" + @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 + """ + +class Action(ActionBase): + r""" + @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. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class ActionBase: + r""" + @hide + @alias Action + """ + NoKeyBound: ClassVar[str] + r""" + @brief Gets a shortcut value indicating that no shortcut shall be assigned + This method has been introduced in version 0.26. + """ + checkable: bool + r""" + Getter: + @brief Gets a value indicating whether the item is checkable + + Setter: + @brief Makes the item(s) checkable or not + + @param checkable true to make the item checkable + """ + checked: bool + r""" + Getter: + @brief Gets a value indicating whether the item is checked + + Setter: + @brief Checks or unchecks the item + + @param checked true to make the item checked + """ + @property + def icon(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @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. + """ + default_shortcut: str + r""" + Getter: + @brief Gets the default keyboard shortcut + @return The default keyboard shortcut as a string + + This attribute has been introduced in version 0.25. + + Setter: + @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: bool + r""" + Getter: + @brief Gets a value indicating whether the item is enabled + + Setter: + @brief Enables or disables the action + + @param enabled true to enable the item + """ + hidden: bool + r""" + Getter: + @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. + + Setter: + @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_text: str + r""" + Getter: + @brief Gets the icon's text + + Setter: + @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: None + r""" + Getter: + @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. + + Setter: + @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: None + r""" + Getter: + @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. + + Setter: + @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: bool + r""" + Getter: + @brief Gets a value indicating whether the item is a separator + This method has been introduced in version 0.25. + + Setter: + @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: str + r""" + Getter: + @brief Gets the keyboard shortcut + @return The keyboard shortcut as a string + + Setter: + @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: str + r""" + Getter: + @brief Gets the title + + @return The current title string + + Setter: + @brief Sets the title + + @param title The title string to set (just the title) + """ + tool_tip: str + r""" + Getter: + @brief Gets the tool tip text. + + This method has been added in version 0.22. + + Setter: + @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: bool + r""" + Getter: + @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?. + Setter: + @brief Sets the item's visibility + + @param visible true to make the item visible + """ + @classmethod + def new(cls) -> ActionBase: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def effective_shortcut(self) -> str: + r""" + @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. + """ + def is_checkable(self) -> bool: + r""" + @brief Gets a value indicating whether the item is checkable + """ + def is_checked(self) -> bool: + r""" + @brief Gets a value indicating whether the item is checked + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_effective_enabled(self) -> bool: + r""" + @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. + """ + def is_effective_visible(self) -> bool: + r""" + @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. + """ + def is_enabled(self) -> bool: + r""" + @brief Gets a value indicating whether the item is enabled + """ + def is_hidden(self) -> bool: + r""" + @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. + """ + def is_separator(self) -> bool: + r""" + @brief Gets a value indicating whether the item is a separator + This method has been introduced in version 0.25. + """ + def is_visible(self) -> bool: + r""" + @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?. + """ + def macro(self) -> Macro: + r""" + @brief Gets the macro associated with the action + If the action is associated with a macro, this method returns a reference to the \Macro object. Otherwise, this method returns nil. + + + This method has been added in version 0.25. + """ + def trigger(self) -> None: + r""" + @brief Triggers the action programmatically + """ + +class Annotation(BasicAnnotation): + r""" + @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: ClassVar[int] + r""" + @brief This code indicates automatic alignment. + This code makes the annotation align the label the way it thinks is best. + + This constant has been introduced in version 0.25. + """ + AlignBottom: ClassVar[int] + r""" + @brief This code indicates bottom alignment. + If used in a vertical context, this alignment code makes the label aligned at the bottom side - i.e. it will appear top of the reference point. + + This constant has been introduced in version 0.25. + """ + AlignCenter: ClassVar[int] + r""" + @brief This code indicates automatic alignment. + This code makes the annotation align the label centered. When used in a horizontal context, centering is in horizontal direction. If used in a vertical context, centering is in vertical direction. + + This constant has been introduced in version 0.25. + """ + AlignDown: ClassVar[int] + r""" + @brief This code indicates left or bottom alignment, depending on the context. + This code is equivalent to \AlignLeft and \AlignBottom. + + This constant has been introduced in version 0.25. + """ + AlignLeft: ClassVar[int] + r""" + @brief This code indicates left alignment. + If used in a horizontal context, this alignment code makes the label aligned at the left side - i.e. it will appear right of the reference point. + + This constant has been introduced in version 0.25. + """ + AlignRight: ClassVar[int] + r""" + @brief This code indicates right alignment. + If used in a horizontal context, this alignment code makes the label aligned at the right side - i.e. it will appear left of the reference point. + + This constant has been introduced in version 0.25. + """ + AlignTop: ClassVar[int] + r""" + @brief This code indicates top alignment. + If used in a vertical context, this alignment code makes the label aligned at the top side - i.e. it will appear bottom of the reference point. + + This constant has been introduced in version 0.25. + """ + AlignUp: ClassVar[int] + r""" + @brief This code indicates right or top alignment, depending on the context. + This code is equivalent to \AlignRight and \AlignTop. + + This constant has been introduced in version 0.25. + """ + AngleAny: ClassVar[int] + r""" + @brief Gets the any angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, all angles will be allowed. + """ + AngleDiagonal: ClassVar[int] + r""" + @brief Gets the diagonal angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only multiples of 45 degree are allowed. + """ + AngleGlobal: ClassVar[int] + r""" + @brief Gets the global angle code for use with the \angle_constraint method. + This code will tell the ruler or marker to use the angle constraint defined globally. + """ + AngleHorizontal: ClassVar[int] + r""" + @brief Gets the horizontal angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only horizontal rulers are allowed. + """ + AngleOrtho: ClassVar[int] + r""" + @brief Gets the ortho angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only multiples of 90 degree are allowed. + """ + AngleVertical: ClassVar[int] + r""" + @brief Gets the vertical angle code for use with the \angle_constraint method + If this value is specified for the angle constraint, only vertical rulers are allowed. + """ + OutlineAngle: ClassVar[int] + r""" + @brief Gets the angle measurement ruler outline code for use with the \outline method + When this outline style is specified, the ruler is drawn to indicate the angle between the first and last segment. + + This constant has been introduced in version 0.28. + """ + OutlineBox: ClassVar[int] + r""" + @brief Gets the box outline code for use with the \outline method + When this outline style is specified, a box is drawn with the corners specified by the start and end point. All box edges are drawn in the style specified with the \style attribute. + """ + OutlineDiag: ClassVar[int] + r""" + @brief Gets the diagonal output code for use with the \outline method + When this outline style is specified, a line connecting start and end points in the given style (ruler, arrow or plain line) is drawn. + """ + OutlineDiagXY: ClassVar[int] + r""" + @brief Gets the xy plus diagonal outline code for use with the \outline method + @brief outline_xy code used by the \outline method + When this outline style is specified, three lines are drawn: one horizontal from left to right and attached to the end of that a line from the bottom to the top. Another line is drawn connecting the start and end points directly. The lines are drawn in the specified style (see \style method). + """ + OutlineDiagYX: ClassVar[int] + r""" + @brief Gets the yx plus diagonal outline code for use with the \outline method + When this outline style is specified, three lines are drawn: one vertical from bottom to top and attached to the end of that a line from the left to the right. Another line is drawn connecting the start and end points directly. The lines are drawn in the specified style (see \style method). + """ + OutlineEllipse: ClassVar[int] + r""" + @brief Gets the ellipse outline code for use with the \outline method + When this outline style is specified, an ellipse is drawn with the extensions specified by the start and end point. The contour drawn as a line. + + This constant has been introduced in version 0.26. + """ + OutlineRadius: ClassVar[int] + r""" + @brief Gets the radius measurement ruler outline code for use with the \outline method + When this outline style is specified, the ruler is drawn to indicate a radius defined by at least three points of the ruler. + + This constant has been introduced in version 0.28. + """ + OutlineXY: ClassVar[int] + r""" + @brief Gets the xy outline code for use with the \outline method + When this outline style is specified, two lines are drawn: one horizontal from left to right and attached to the end of that a line from the bottom to the top. The lines are drawn in the specified style (see \style method). + """ + OutlineYX: ClassVar[int] + r""" + @brief Gets the yx outline code for use with the \outline method + When this outline style is specified, two lines are drawn: one vertical from bottom to top and attached to the end of that a line from the left to the right. The lines are drawn in the specified style (see \style method). + """ + PositionAuto: ClassVar[int] + r""" + @brief This code indicates automatic positioning. + The main label will be put either to p1 or p2, whichever the annotation considers best. + + This constant has been introduced in version 0.25. + """ + PositionCenter: ClassVar[int] + r""" + @brief This code indicates positioning of the main label at the mid point between p1 and p2. + The main label will be put to the center point. + + This constant has been introduced in version 0.25. + """ + PositionP1: ClassVar[int] + r""" + @brief This code indicates positioning of the main label at p1. + The main label will be put to p1. + + This constant has been introduced in version 0.25. + """ + PositionP2: ClassVar[int] + r""" + @brief This code indicates positioning of the main label at p2. + The main label will be put to p2. + + This constant has been introduced in version 0.25. + """ + RulerModeAutoMetric: ClassVar[int] + r""" + @brief Specifies auto-metric ruler mode for the \register_template method + In auto-metric mode, a ruler can be placed with a single click and p1/p2 will be determined from the neighborhood. + + This constant has been introduced in version 0.25 + """ + RulerModeNormal: ClassVar[int] + r""" + @brief Specifies normal ruler mode for the \register_template method + + This constant has been introduced in version 0.25 + """ + RulerModeSingleClick: ClassVar[int] + r""" + @brief Specifies single-click ruler mode for the \register_template method + In single click-mode, a ruler can be placed with a single click and p1 will be == p2. + + This constant has been introduced in version 0.25 + """ + RulerMultiSegment: ClassVar[int] + r""" + @brief Specifies multi-segment mode + In multi-segment mode, multiple segments can be created. The ruler is finished with a double click. + + This constant has been introduced in version 0.28 + """ + RulerThreeClicks: ClassVar[int] + r""" + @brief Specifies three-click ruler mode for the \register_template method + In this ruler mode, two segments are created for angle and circle radius measurements. Three mouse clicks are required. + + This constant has been introduced in version 0.28 + """ + StyleArrowBoth: ClassVar[int] + r""" + @brief Gets the both arrow ends style code for use the \style method + When this style is specified, a two-headed arrow is drawn. + """ + StyleArrowEnd: ClassVar[int] + r""" + @brief Gets the end arrow style code for use the \style method + When this style is specified, an arrow is drawn pointing from the start to the end point. + """ + StyleArrowStart: ClassVar[int] + r""" + @brief Gets the start arrow style code for use the \style method + When this style is specified, an arrow is drawn pointing from the end to the start point. + """ + StyleCrossBoth: ClassVar[int] + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a cross is drawn at both points. + + This constant has been added in version 0.26. + """ + StyleCrossEnd: ClassVar[int] + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a cross is drawn at the end point. + + This constant has been added in version 0.26. + """ + StyleCrossStart: ClassVar[int] + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a cross is drawn at the start point. + + This constant has been added in version 0.26. + """ + StyleLine: ClassVar[int] + r""" + @brief Gets the line style code for use with the \style method + When this style is specified, a plain line is drawn. + """ + StyleRuler: ClassVar[int] + r""" + @brief Gets the ruler style code for use the \style method + When this style is specified, the annotation will show a ruler with some ticks at distances indicating a decade of units and a suitable subdivision into minor ticks at intervals of 1, 2 or 5 units. + """ + angle_constraint: int + r""" + Getter: + @brief Returns the angle constraint attribute + See \angle_constraint= for a more detailed description. + Setter: + @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: str + r""" + Getter: + @brief Gets the category string + See \category= for details. + + This method has been introduced in version 0.25 + Setter: + @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: str + r""" + Getter: + @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. + Setter: + @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: str + r""" + Getter: + @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. + Setter: + @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: str + r""" + Getter: + @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. + Setter: + @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: int + r""" + Getter: + @brief Gets the position of the main label + See \main_position= for details. + + This method has been introduced in version 0.25 + Setter: + @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: int + r""" + Getter: + @brief Gets the horizontal alignment type of the main label + See \main_xalign= for details. + + This method has been introduced in version 0.25 + Setter: + @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: int + r""" + Getter: + @brief Gets the vertical alignment type of the main label + See \main_yalign= for details. + + This method has been introduced in version 0.25 + Setter: + @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: int + r""" + Getter: + @brief Returns the outline style of the annotation object + + Setter: + @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: db.DPoint + r""" + Getter: + @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 + + Setter: + @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: db.DPoint + r""" + Getter: + @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 + + Setter: + @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: List[db.DPoint] + r""" + Getter: + @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 + Setter: + @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: bool + r""" + Getter: + @brief Returns the 'snap to objects' attribute + + Setter: + @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: int + r""" + Getter: + @brief Returns the style of the annotation object + + Setter: + @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: int + r""" + Getter: + @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 + Setter: + @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: int + r""" + Getter: + @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 + Setter: + @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: int + r""" + Getter: + @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 + Setter: + @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: int + r""" + Getter: + @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 + Setter: + @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 + """ + @classmethod + def from_s(cls, s: str) -> Annotation: + r""" + @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. + """ + @classmethod + def register_template(cls, annotation: BasicAnnotation, title: str, mode: Optional[int] = ...) -> None: + r""" + @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. + """ + @classmethod + def unregister_templates(cls, category: str) -> None: + r""" + @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. + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Equality operator + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Inequality operator + """ + def __str__(self) -> str: + r""" + @brief Returns the string representation of the ruler + This method was introduced in version 0.19. + """ + def _assign(self, other: BasicAnnotation) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> Annotation: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def box(self) -> db.DBox: + r""" + @brief Gets the bounding box of the object (not including text) + @return The bounding box + """ + def delete(self) -> None: + r""" + @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. + """ + def detach(self) -> None: + r""" + @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. + """ + def id(self) -> int: + r""" + @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. + """ + def is_valid(self) -> bool: + r""" + @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. + """ + def seg_p1(self, segment_index: int) -> db.DPoint: + r""" + @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. + """ + def seg_p2(self, segment_index: int) -> db.DPoint: + r""" + @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. + """ + def segments(self) -> int: + r""" + @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. + """ + def text(self, index: Optional[int] = ...) -> str: + r""" + @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. + """ + def text_x(self, index: Optional[int] = ...) -> str: + r""" + @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. + """ + def text_y(self, index: Optional[int] = ...) -> str: + r""" + @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. + """ + def to_s(self) -> str: + r""" + @brief Returns the string representation of the ruler + This method was introduced in version 0.19. + """ + @overload + def transformed(self, t: db.DCplxTrans) -> Annotation: + r""" + @brief Transforms the ruler or marker with the given complex transformation + @param t The magnifying transformation to apply + @return The transformed object + + Starting with version 0.25, all overloads all available as 'transform'. + """ + @overload + def transformed(self, t: db.DTrans) -> Annotation: + r""" + @brief Transforms the ruler or marker with the given simple transformation + @param t The transformation to apply + @return The transformed object + """ + @overload + def transformed(self, t: db.ICplxTrans) -> Annotation: + r""" + @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'. + """ + @overload + def transformed_cplx(self, t: db.DCplxTrans) -> Annotation: + r""" + @brief Transforms the ruler or marker with the given complex transformation + @param t The magnifying transformation to apply + @return The transformed object + + Starting with version 0.25, all overloads all available as 'transform'. + """ + @overload + def transformed_cplx(self, t: db.ICplxTrans) -> Annotation: + r""" + @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'. + """ + +class BasicAnnotation: + r""" + @hide + @alias Annotation + """ + @classmethod + def new(cls) -> BasicAnnotation: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> BasicAnnotation: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> BasicAnnotation: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: BasicAnnotation) -> None: r""" @brief Assigns another object to self """ @@ -134,71 +1419,106 @@ class PixelBuffer: 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. """ - def diff(self, other: PixelBuffer) -> PixelBuffer: - r""" - @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. - """ - def dup(self) -> PixelBuffer: + def dup(self) -> BasicAnnotation: r""" @brief Creates a copy of self """ - @overload - def fill(self, color: int) -> None: - r""" - @brief Fills the pixel buffer with the given pixel value - """ - @overload - def fill(self, color: QtGui.QColor) -> None: - r""" - @brief Fills the pixel buffer with the given QColor - """ - def height(self) -> int: - r""" - @brief Gets the height of the pixel buffer in pixels - """ def is_const_object(self) -> bool: r""" @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. """ - def patch(self, other: PixelBuffer) -> None: - r""" - @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. - """ - def pixel(self, x: int, y: int) -> int: +class BasicImage: + r""" + @hide + @alias Image + """ + @classmethod + def new(cls) -> BasicImage: r""" - @brief Gets the value of the pixel at position x, y + @brief Creates a new object of this class """ - def set_pixel(self, x: int, y: int, c: int) -> None: + def __copy__(self) -> BasicImage: r""" - @brief Sets the value of the pixel at position x, y + @brief Creates a copy of self """ - def swap(self, other: PixelBuffer) -> None: + def __deepcopy__(self) -> BasicImage: r""" - @brief Swaps data with another PixelBuffer object + @brief Creates a copy of self """ - def to_png_data(self) -> bytes: + def __init__(self) -> None: r""" - @brief Converts the pixel buffer to a PNG byte stream - This method may not be available if PNG support is not compiled into KLayout. + @brief Creates a new object of this class """ - def to_qimage(self) -> QtGui.QImage_Native: + def _create(self) -> None: r""" - @brief Converts the pixel buffer to a \QImage object + @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. """ - def width(self) -> int: + def _destroy(self) -> None: r""" - @brief Gets the width of the pixel buffer in pixels + @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. """ - def write_png(self, file: str) -> None: + def _destroyed(self) -> bool: r""" - @brief Writes the pixel buffer to a PNG file - This method may not be available if PNG support is not compiled into KLayout. + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: BasicImage) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> BasicImage: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. """ class BitmapBuffer: @@ -219,11 +1539,6 @@ class BitmapBuffer: This method may not be available if PNG support is not compiled into KLayout. """ @classmethod - def from_qimage(cls, qimage: QtGui.QImage_Native) -> BitmapBuffer: - r""" - @brief Creates a pixel buffer object from a QImage object - """ - @classmethod def new(cls, width: int, height: int) -> BitmapBuffer: r""" @brief Creates a pixel buffer object @@ -357,10 +1672,6 @@ class BitmapBuffer: @brief Converts the pixel buffer to a PNG byte stream This method may not be available if PNG support is not compiled into KLayout. """ - def to_qimage(self) -> QtGui.QImage_Native: - r""" - @brief Converts the pixel buffer to a \QImage object - """ def width(self) -> int: r""" @brief Gets the width of the pixel buffer in pixels @@ -371,39 +1682,357 @@ class BitmapBuffer: This method may not be available if PNG support is not compiled into KLayout. """ -class MacroExecutionContext: +class BrowserDialog: r""" - @brief Support for various debugger features + @brief A HTML display and browser dialog - 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. + The browser dialog displays HTML code in a browser panel. The HTML code is delivered through a separate object of class \BrowserSource which acts as a "server" for a specific kind of URL scheme. Whenever the browser sees a URL starting with "int:" it will ask the connected BrowserSource object for the HTML code of that page using it's 'get' method. The task of the BrowserSource object is to format the data requested in HTML and deliver it. + + One use case for that class is the implementation of rich data browsers for structured information. In a simple scenario, the browser dialog can be instantiated with a static HTML page. In that case, only the content of that page is shown. + + Here's a simple example: + + @code + html = "Hello, world!" + RBA::BrowserDialog::new(html).exec + @/code + + And that is an example for the use case with a \BrowserSource as the "server": + + @code + class MySource < RBA::BrowserSource + def get(url) + if (url =~ /b.html$/) + return "The second page" + else + return "The first page with a link" + end + end + end + + source = MySource::new + RBA::BrowserDialog::new(source).exec + @/code + """ + @property + def caption(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the caption of the window + """ + @property + def home(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the browser's initial and current URL which is selected if the "home" location is chosen + The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". + """ + @property + def label(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the label text + + The label is shown left of the navigation buttons. + By default, no label is specified. + + This method has been introduced in version 0.23. + """ + @property + def source(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Connects to a source object + + Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, \home= should be called after the source was set. + """ + @overload + @classmethod + def new(cls, html: str) -> BrowserDialog: + r""" + @brief Creates a HTML browser window with a static HTML content + This method has been introduced in version 0.23. + """ + @overload + @classmethod + def new(cls, source: BrowserSource) -> BrowserDialog: + r""" + @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code + This method has been introduced in version 0.23. + """ + @overload + def __init__(self, html: str) -> None: + r""" + @brief Creates a HTML browser window with a static HTML content + This method has been introduced in version 0.23. + """ + @overload + def __init__(self, source: BrowserSource) -> None: + r""" + @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code + This method has been introduced in version 0.23. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def exec_(self) -> int: + r""" + @brief Executes the HTML browser dialog as a modal window + """ + def execute(self) -> int: + r""" + @brief Executes the HTML browser dialog as a modal window + """ + def hide(self) -> None: + r""" + @brief Hides the HTML browser window + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def load(self, url: str) -> None: + r""" + @brief Loads the given URL into the browser dialog + Typically the URL has the "int:" scheme so the HTML code is taken from the \BrowserSource object. + """ + def reload(self) -> None: + r""" + @brief Reloads the current page + """ + def resize(self, width: int, height: int) -> None: + r""" + @brief Sets the size of the dialog window + """ + def search(self, search_item: str) -> None: + r""" + @brief Issues a search request using the given search item and the search URL specified with \set_search_url + + See \set_search_url for a description of the search mechanism. + """ + def set_caption(self, caption: str) -> None: + r""" + @brief Sets the caption of the window + """ + def set_home(self, home_url: str) -> None: + r""" + @brief Sets the browser's initial and current URL which is selected if the "home" location is chosen + The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". + """ + def set_search_url(self, url: str, query_item: str) -> None: + r""" + @brief Enables the search field and specifies the search URL generated for a search + + If a search URL is set, the search box right to the navigation bar will be enabled. When a text is entered into the search box, the browser will navigate to an URL composed of the search URL, the search item and the search text, i.e. "myurl?item=search_text". + + This method has been introduced in version 0.23. + """ + def set_size(self, width: int, height: int) -> None: + r""" + @brief Sets the size of the dialog window + """ + def set_source(self, source: BrowserSource) -> None: + r""" + @brief Connects to a source object + + Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, \home= should be called after the source was set. + """ + def show(self) -> None: + r""" + @brief Shows the HTML browser window in a non-modal way + """ + +class BrowserSource: + r""" + @brief The BrowserDialog's source for "int" URL's + + The source object basically acts as a "server" for special URL's using "int" as the scheme. + Classes that want to implement such functionality must derive from BrowserSource and reimplement + the \get method. This method is supposed to deliver a HTML page for the given URL. + + Alternatively to implementing this functionality, a source object may be instantiated using the + constructor with a HTML code string. This will create a source object that simply displays the given string + as the initial and only page. """ @classmethod - def ignore_next_exception(cls) -> None: + def new(cls, arg0: str) -> BrowserSource: r""" - @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. + @brief Constructs a BrowserSource object with a default HTML string + + The default HTML string is sent when no specific implementation is provided. """ @classmethod - def new(cls) -> MacroExecutionContext: + def new_html(cls, arg0: str) -> BrowserSource: r""" - @brief Creates a new object of this class + @brief Constructs a BrowserSource object with a default HTML string + + The default HTML string is sent when no specific implementation is provided. """ - @classmethod - def remove_debugger_scope(cls) -> None: - r""" - @brief Removes a debugger scope previously set with \set_debugger_scope - """ - @classmethod - def set_debugger_scope(cls, filename: str) -> None: - r""" - @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. - """ - def __copy__(self) -> MacroExecutionContext: + def __copy__(self) -> BrowserSource: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> MacroExecutionContext: + def __deepcopy__(self) -> BrowserSource: + r""" + @brief Creates a copy of self + """ + def __init__(self, arg0: str) -> None: + r""" + @brief Constructs a BrowserSource object with a default HTML string + + The default HTML string is sent when no specific implementation is provided. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: BrowserSource) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> BrowserSource: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def next_topic(self, url: str) -> str: + r""" + @brief Gets the next topic URL from a given URL + An empty string will be returned if no next topic is available. + + This method has been introduced in version 0.28. + """ + def prev_topic(self, url: str) -> str: + r""" + @brief Gets the previous topic URL from a given URL + An empty string will be returned if no previous topic is available. + + This method has been introduced in version 0.28. + """ + +class BrowserSource_Native: + r""" + @hide + @alias BrowserSource + """ + @classmethod + def new(cls) -> BrowserSource_Native: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> BrowserSource_Native: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> BrowserSource_Native: r""" @brief Creates a copy of self """ @@ -448,7 +2077,7 @@ class MacroExecutionContext: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: MacroExecutionContext) -> None: + def assign(self, other: BrowserSource_Native) -> None: r""" @brief Assigns another object to self """ @@ -469,185 +2098,72 @@ class MacroExecutionContext: 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. """ - def dup(self) -> MacroExecutionContext: + def dup(self) -> BrowserSource_Native: r""" @brief Creates a copy of self """ + def get(self, arg0: str) -> str: + r""" + """ def is_const_object(self) -> bool: r""" @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. """ - -class MacroInterpreter: - r""" - @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: ClassVar[Macro.Format] - r""" - @brief The macro has macro (XML) format - """ - NoDebugger: ClassVar[Macro.Interpreter] - r""" - @brief Indicates no debugging for \debugger_scheme - """ - PlainTextFormat: ClassVar[Macro.Format] - r""" - @brief The macro has plain text format - """ - PlainTextWithHashAnnotationsFormat: ClassVar[Macro.Format] - r""" - @brief The macro has plain text format with special pseudo-comment annotations - """ - RubyDebugger: ClassVar[Macro.Interpreter] - r""" - @brief Indicates Ruby debugger for \debugger_scheme - """ - @property - def debugger_scheme(self) -> None: + def next_topic(self, url: str) -> str: r""" - WARNING: This variable can only be set, not retrieved. - @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. """ - @property - def description(self) -> None: + def prev_topic(self, url: str) -> str: r""" - WARNING: This variable can only be set, not retrieved. - @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. """ - @property - def storage_scheme(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @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. - """ - @property - def suffix(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @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. - """ - @property - def supports_include_expansion(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @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. - """ - @property - def syntax_scheme(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @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/.xml". - - 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. - """ +class ButtonState: + r""" + @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: ClassVar[int] + r""" + @brief Indicates that the Alt key is pressed + This constant is combined with other constants within \ButtonState + """ + ControlKey: ClassVar[int] + r""" + @brief Indicates that the Control key is pressed + This constant is combined with other constants within \ButtonState + """ + LeftButton: ClassVar[int] + r""" + @brief Indicates that the left mouse button is pressed + This constant is combined with other constants within \ButtonState + """ + MidButton: ClassVar[int] + r""" + @brief Indicates that the middle mouse button is pressed + This constant is combined with other constants within \ButtonState + """ + RightButton: ClassVar[int] + r""" + @brief Indicates that the right mouse button is pressed + This constant is combined with other constants within \ButtonState + """ + ShiftKey: ClassVar[int] + r""" + @brief Indicates that the Shift key is pressed + This constant is combined with other constants within \ButtonState + """ @classmethod - def new(cls) -> MacroInterpreter: + def new(cls) -> ButtonState: r""" @brief Creates a new object of this class """ - def __copy__(self) -> MacroInterpreter: + def __copy__(self) -> ButtonState: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> MacroInterpreter: + def __deepcopy__(self) -> ButtonState: r""" @brief Creates a copy of self """ @@ -692,7 +2208,7 @@ class MacroInterpreter: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: MacroInterpreter) -> None: + def assign(self, other: ButtonState) -> None: r""" @brief Assigns another object to self """ @@ -701,15 +2217,6 @@ class MacroInterpreter: @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. """ - def create_template(self, url: str) -> Macro: - r""" - @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. - """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -722,7 +2229,7 @@ class MacroInterpreter: 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. """ - def dup(self) -> MacroInterpreter: + def dup(self) -> ButtonState: r""" @brief Creates a copy of self """ @@ -732,493 +2239,1016 @@ class MacroInterpreter: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def register(self, name: str) -> None: - r""" - @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. - """ - -class Macro: +class CellView: r""" - @brief A macro class + @brief A class describing what is shown inside a layout view - 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: + 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 it's 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 it's 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 - path = "path-to-macro.lym" - RBA::Macro::new(path).run() + cv = RBA::CellView::active + cv.cell_name = "TOP2" @/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. + See @The Application API@ for more details about the cellview objects. """ - class Format: - r""" - @brief Specifies the format of a macro - This enum has been introduced in version 0.27.5. - """ - MacroFormat: ClassVar[Macro.Format] - r""" - @brief The macro has macro (XML) format - """ - PlainTextFormat: ClassVar[Macro.Format] - r""" - @brief The macro has plain text format - """ - PlainTextWithHashAnnotationsFormat: ClassVar[Macro.Format] - r""" - @brief The macro has plain text format with special pseudo-comment annotations - """ - @overload - @classmethod - def new(cls, i: int) -> Macro.Format: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> Macro.Format: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: Macro.Format) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - class Interpreter: - r""" - @brief Specifies the interpreter used for executing a macro - This enum has been introduced in version 0.27.5. - """ - DSLInterpreter: ClassVar[Macro.Interpreter] - r""" - @brief A domain-specific interpreter (DSL) - """ - None_: ClassVar[Macro.Interpreter] - r""" - @brief No specific interpreter - """ - Python: ClassVar[Macro.Interpreter] - r""" - @brief The interpreter is Python - """ - Ruby: ClassVar[Macro.Interpreter] - r""" - @brief The interpreter is Ruby - """ - Text: ClassVar[Macro.Interpreter] - r""" - @brief Plain text - """ - @overload - @classmethod - def new(cls, i: int) -> Macro.Interpreter: - r""" - @brief Creates an enum from an integer value - """ - @overload - @classmethod - def new(cls, s: str) -> Macro.Interpreter: - r""" - @brief Creates an enum from a string value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer value - """ - @overload - def __eq__(self, other: object) -> bool: - r""" - @brief Compares two enums - """ - @overload - def __init__(self, i: int) -> None: - r""" - @brief Creates an enum from an integer value - """ - @overload - def __init__(self, s: str) -> None: - r""" - @brief Creates an enum from a string value - """ - @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload - def __lt__(self, other: Macro.Interpreter) -> bool: - r""" - @brief Returns true if the first enum is less (in the enum symbol order) than the second - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares two enums for inequality - """ - @overload - def __ne__(self, other: object) -> bool: - r""" - @brief Compares an enum with an integer for inequality - """ - def __repr__(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def __str__(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - def inspect(self) -> str: - r""" - @brief Converts an enum to a visual string - """ - def to_i(self) -> int: - r""" - @brief Gets the integer value from the enum - """ - def to_s(self) -> str: - r""" - @brief Gets the symbolic string from an enum - """ - DSLInterpreter: ClassVar[Macro.Interpreter] - r""" - @brief A domain-specific interpreter (DSL) - """ - MacroFormat: ClassVar[Macro.Format] - r""" - @brief The macro has macro (XML) format - """ - None_: ClassVar[Macro.Interpreter] - r""" - @brief No specific interpreter - """ - PlainTextFormat: ClassVar[Macro.Format] - r""" - @brief The macro has plain text format - """ - PlainTextWithHashAnnotationsFormat: ClassVar[Macro.Format] - r""" - @brief The macro has plain text format with special pseudo-comment annotations - """ - Python: ClassVar[Macro.Interpreter] - r""" - @brief The interpreter is Python - """ - Ruby: ClassVar[Macro.Interpreter] - r""" - @brief The interpreter is Ruby - """ - Text: ClassVar[Macro.Interpreter] - r""" - @brief Plain text - """ - category: str + cell: db.Cell r""" Getter: - @brief Gets the category tags + @brief Gets the reference to the target cell currently addressed - 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. Setter: - @brief Sets the category tags string - See \category for details. + @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. """ - description: str + cell_index: int r""" Getter: - @brief Gets the description text + @brief Gets the target cell's index - 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". Setter: - @brief Sets the description text - @param description The description text. - See \description for details. + @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 it's index. """ - doc: str + cell_name: str r""" Getter: - @brief Gets the macro's documentation string - - This method has been introduced in version 0.27.5. + @brief Gets the name of the target cell currently addressed Setter: - @brief Sets the macro's documentation string + @brief Sets the cell by name - This method has been introduced in version 0.27.5. + 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. """ - dsl_interpreter: str + context_path: List[db.InstElement] r""" Getter: - @brief Gets the macro's DSL interpreter name (if interpreter is DSLInterpreter) - - This method has been introduced in version 0.27.5. - + @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. Setter: - @brief Sets the macro's DSL interpreter name (if interpreter is DSLInterpreter) + @brief Sets the context path explicitly - This method has been introduced in version 0.27.5. + This method assumes that the unspecific part of the path + is established already and that the context path starts + from the context cell. """ - epilog: str + name: str r""" Getter: - @brief Gets the epilog code + @brief Gets the unique name associated with the layout behind the cellview - The epilog is executed after the actual code is executed. Interpretation depends on the implementation of the DSL interpreter for DSL macros. Setter: - @brief Sets the epilog - See \epilog for details. + @brief sets the unique name associated with the layout behind the cellview + + this method has been introduced in version 0.25. """ - format: Macro.Format + on_technology_changed: None r""" Getter: - @brief Gets the macro's storage format + @brief An event indicating that the technology has changed + This event is triggered when the CellView is attached to a different technology. - This method has been introduced in version 0.27.5. + This event has been introduced in version 0.27. Setter: - @brief Sets the macro's storage format + @brief An event indicating that the technology has changed + This event is triggered when the CellView is attached to a different technology. - This method has been introduced in version 0.27.5. + This event has been introduced in version 0.27. """ - group_name: str + path: List[int] r""" Getter: - @brief Gets the menu group name + @brief Gets the cell's unspecific part of the path leading to the context cell - 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. Setter: - @brief Sets the menu group name - See \group_name for details. + @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. """ - interpreter: Macro.Interpreter + technology: str r""" Getter: - @brief Gets the macro's interpreter - - This method has been introduced in version 0.27.5. + @brief Returns the technology name for the layout behind the given cell view + This method has been added in version 0.23. Setter: - @brief Sets the macro's interpreter - - This method has been introduced in version 0.27.5. - """ - is_autorun: bool - r""" - Getter: - @brief Gets a flag indicating whether the macro is automatically executed on startup - - This method has been introduced in version 0.27.5. - - Setter: - @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: bool - r""" - Getter: - @brief Gets a flag indicating whether the macro is automatically executed early on startup - - This method has been introduced in version 0.27.5. - - Setter: - @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: str - r""" - Getter: - @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. - Setter: - @brief Sets the menu path - See \menu_path for details. - """ - prolog: str - r""" - Getter: - @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. - Setter: - @brief Sets the prolog - See \prolog for details. - """ - shortcut: str - r""" - Getter: - @brief Gets the macro's keyboard shortcut - - This method has been introduced in version 0.27.5. - - Setter: - @brief Sets the macro's keyboard shortcut - - This method has been introduced in version 0.27.5. - """ - show_in_menu: bool - r""" - Getter: - @brief Gets a value indicating whether the macro shall be shown in the menu - - Setter: - @brief Sets a value indicating whether the macro shall be shown in the menu - """ - text: str - r""" - Getter: - @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. - Setter: - @brief Sets the macro text - See \text for details. - """ - version: str - r""" - Getter: - @brief Gets the macro's version - - This method has been introduced in version 0.27.5. - - Setter: - @brief Sets the macro's version - - This method has been introduced in version 0.27.5. + @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. """ @classmethod - def macro_by_path(cls, path: str) -> Macro: + def active(cls) -> CellView: r""" - @brief Finds the macro by installation path + @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. - Returns nil if no macro with this path can be found. - - This method has been added in version 0.26. + This method has been introduced in version 0.23. """ @classmethod - def new(cls, path: str) -> Macro: + def new(cls) -> CellView: r""" - @brief Loads the macro from the given file path + @brief Creates a new object of this class + """ + def __copy__(self) -> CellView: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> CellView: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @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. + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - This constructor has been introduced in version 0.27.5. + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def ascend(self) -> None: + r""" + @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. + """ + def assign(self, other: CellView) -> None: + r""" + @brief Assigns another object to self + """ + def close(self) -> None: + r""" + @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. + """ + def context_dtrans(self) -> db.DCplxTrans: + r""" + @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. + """ + def context_trans(self) -> db.ICplxTrans: + r""" + @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. + """ + def create(self) -> None: + r""" + @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. + """ + def ctx_cell(self) -> db.Cell: + r""" + @brief Gets the reference to the context cell currently addressed + """ + def ctx_cell_index(self) -> int: + r""" + @brief Gets the context cell's index + """ + def descend(self, path: Sequence[db.InstElement]) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> CellView: + r""" + @brief Creates a copy of self + """ + def filename(self) -> str: + r""" + @brief Gets filename associated with the layout behind the cellview + """ + def hide_cell(self, cell: db.Cell) -> None: + r""" + @brief Hides the given cell + + This method has been added in version 0.25. + """ + def index(self) -> int: + r""" + @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. + """ + def is_cell_hidden(self, cell: db.Cell) -> bool: + r""" + @brief Returns true, if the given cell is hidden + + This method has been added in version 0.25. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_dirty(self) -> bool: + r""" + @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. + """ + def is_valid(self) -> bool: + r""" + @brief Returns true, if the cellview is valid + A cellview may become invalid if the corresponding tab is closed for example. + """ + def layout(self) -> db.Layout: + r""" + @brief Gets the reference to the layout object addressed by this view + """ + def reset_cell(self) -> None: + r""" + @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. + """ + def set_cell(self, cell_index: int) -> None: + r""" + @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 it's index. + """ + def set_cell_name(self, cell_name: str) -> None: + r""" + @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. + """ + def set_context_path(self, path: Sequence[db.InstElement]) -> None: + r""" + @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. + """ + def set_path(self, path: Sequence[int]) -> None: + r""" + @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. + """ + def show_all_cells(self) -> None: + r""" + @brief Makes all cells shown (cancel effects of \hide_cell) for the specified cell view + + This method has been added in version 0.25. + """ + def show_cell(self, cell: db.Cell) -> None: + r""" + @brief Shows the given cell (cancels the effect of \hide_cell) + + This method has been added in version 0.25. + """ + def view(self) -> LayoutView: + r""" + @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. + """ + +class Cursor: + r""" + @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: ClassVar[int] + r""" + @brief 'Arrow cursor' constant + """ + Blank: ClassVar[int] + r""" + @brief 'Blank cursor' constant + """ + Busy: ClassVar[int] + r""" + @brief 'Busy state cursor' constant + """ + ClosedHand: ClassVar[int] + r""" + @brief 'Closed hand cursor' constant + """ + Cross: ClassVar[int] + r""" + @brief 'Cross cursor' constant + """ + Forbidden: ClassVar[int] + r""" + @brief 'Forbidden area cursor' constant + """ + IBeam: ClassVar[int] + r""" + @brief 'I beam (text insert) cursor' constant + """ + None_: ClassVar[int] + r""" + @brief 'No cursor (default)' constant for \set_cursor (resets cursor to default) + """ + OpenHand: ClassVar[int] + r""" + @brief 'Open hand cursor' constant + """ + PointingHand: ClassVar[int] + r""" + @brief 'Pointing hand cursor' constant + """ + SizeAll: ClassVar[int] + r""" + @brief 'Size all directions cursor' constant + """ + SizeBDiag: ClassVar[int] + r""" + @brief 'Backward diagonal resize cursor' constant + """ + SizeFDiag: ClassVar[int] + r""" + @brief 'Forward diagonal resize cursor' constant + """ + SizeHor: ClassVar[int] + r""" + @brief 'Horizontal resize cursor' constant + """ + SizeVer: ClassVar[int] + r""" + @brief 'Vertical resize cursor' constant + """ + SplitH: ClassVar[int] + r""" + @brief 'split_horizontal cursor' constant + """ + SplitV: ClassVar[int] + r""" + @brief 'Split vertical cursor' constant + """ + UpArrow: ClassVar[int] + r""" + @brief 'Upward arrow cursor' constant + """ + Wait: ClassVar[int] + r""" + @brief 'Waiting cursor' constant + """ + WhatsThis: ClassVar[int] + r""" + @brief 'Question mark cursor' constant + """ + @classmethod + def new(cls) -> Cursor: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> Cursor: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Cursor: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Cursor) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> Cursor: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class Dispatcher: + r""" + @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. + """ + @classmethod + def instance(cls) -> Dispatcher: + r""" + @brief Gets the singleton instance of the Dispatcher object + + @return The instance """ @classmethod - def real_line(cls, path: str, line: int) -> int: + def new(cls) -> Dispatcher: r""" - @brief Gets the real line number for an include-encoded path and line number + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - 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 + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - @code - # Ruby - real_line = RBA::Macro::real_line(__FILE__, __LINE__) + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def clear_config(self) -> None: + r""" + @brief Clears the configuration parameters + """ + def commit_config(self) -> None: + r""" + @brief Commits the configuration settings - # Python - real_line = pya::Macro::real_line(__file__, __line__) - @/code + 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. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def get_config(self, name: str) -> Any: + r""" + @brief Gets the value of a local configuration parameter - 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. + @param name The name of the configuration parameter whose value shall be obtained (a string) - For Python there is no equivalent for __LINE__, so you always have to use: + @return The value of the parameter or nil if there is no such parameter + """ + def get_config_names(self) -> List[str]: + r""" + @brief Gets the configuration parameter names - @code - # Pythonimport inspect - real_line = pya.Macro.real_line(__file__, inspect.currentframe().f_back.f_lineno) - @/code + @return A list of configuration parameter names - This feature has been introduced in version 0.27. + This method returns the names of all known configuration parameters. These names can be used to get and set configuration parameter values. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def read_config(self, file_name: str) -> bool: + r""" + @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. + """ + def set_config(self, name: str, value: str) -> None: + r""" + @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. + """ + def write_config(self, file_name: str) -> bool: + r""" + @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. + """ + +class DoubleValue: + r""" + @brief Encapsulate a floating point value + @hide + This class is provided as a return value of \InputDialog::get_double. + By using an object rather than a pure value, an object with \has_value? = false can be returned indicating that + the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no + longer requires to use this class. + """ + @classmethod + def new(cls) -> DoubleValue: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> DoubleValue: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> DoubleValue: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: DoubleValue) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> DoubleValue: + r""" + @brief Creates a copy of self + """ + def has_value(self) -> bool: + r""" + @brief True, if a value is present + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def to_f(self) -> float: + r""" + @brief Get the actual value (a synonym for \value) + """ + def value(self) -> float: + r""" + @brief Get the actual value + """ + +class FileDialog: + r""" + @brief Various methods to request a file name + + This class provides some basic dialogs to select a file or directory. This functionality is provided through the static (class) methods ask_... + + Here are some examples: + + @code + # get an existing directory: + v = RBA::FileDialog::ask_existing_dir("Dialog Title", ".") + # get multiple files: + v = RBA::FileDialog::ask_open_file_names("Title", ".", "All files (*)") + # ask for one file name to save a file: + v = RBA::FileDialog::ask_save_file_name("Title", ".", "All files (*)") + @/code + + All these examples return the "nil" value if "Cancel" is pressed. + + If you have enabled the Qt binding, you can use \QFileDialog directly. + """ + @classmethod + def ask_existing_dir(cls, title: str, dir: str) -> Any: + r""" + @brief Open a dialog to select a directory + + @param title The title of the dialog + @param dir The directory selected initially + @return The directory path selected or "nil" if "Cancel" was pressed + + This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. """ @classmethod - def real_path(cls, path: str, line: int) -> str: + def ask_open_file_name(cls, title: str, dir: str, filter: str) -> Any: r""" - @brief Gets the real path for an include-encoded path and line number + @brief Select one file for opening - 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 + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return The path of the file selected or "nil" if "Cancel" was pressed - @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. + This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. """ - def __init__(self, path: str) -> None: + @classmethod + def ask_open_file_names(cls, title: str, dir: str, filter: str) -> Any: r""" - @brief Loads the macro from the given file path + @brief Select one or multiple files for opening - This constructor has been introduced in version 0.27.5. + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return An array with the file paths selected or "nil" if "Cancel" was pressed + + This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. + """ + @classmethod + def ask_save_file_name(cls, title: str, dir: str, filter: str) -> Any: + r""" + @brief Select one file for writing + + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return The path of the file chosen or "nil" if "Cancel" was pressed + + This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. + """ + @classmethod + def get_existing_dir(cls, title: str, dir: str) -> StringValue: + r""" + @brief Open a dialog to select a directory + + @param title The title of the dialog + @param dir The directory selected initially + @return A \StringValue object that contains the directory path selected or with has_value? = false if "Cancel" was pressed + + Starting with version 0.23 this method is deprecated. Use \ask_existing_dir instead. + """ + @classmethod + def get_open_file_name(cls, title: str, dir: str, filter: str) -> StringValue: + r""" + @brief Select one file for opening + + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return A \StringValue object that contains the files selected or with has_value? = false if "Cancel" was pressed + + Starting with version 0.23 this method is deprecated. Use \ask_open_file_name instead. + """ + @classmethod + def get_open_file_names(cls, title: str, dir: str, filter: str) -> StringListValue: + r""" + @brief Select one or multiple files for opening + + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return A \StringListValue object that contains the files selected or with has_value? = false if "Cancel" was pressed + + Starting with version 0.23 this method is deprecated. Use \ask_open_file_names instead. + """ + @classmethod + def get_save_file_name(cls, title: str, dir: str, filter: str) -> StringValue: + r""" + @brief Select one file for writing + + @param title The title of the dialog + @param dir The directory selected initially + @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" + @return A \StringValue object that contains the files selected or with has_value? = false if "Cancel" was pressed + + Starting with version 0.23 this method is deprecated. Use \ask_save_file_name instead. + """ + @classmethod + def new(cls) -> FileDialog: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> FileDialog: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> FileDialog: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: FileDialog) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> FileDialog: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class HelpDialog: + r""" + @brief The help dialog + + This class makes the help dialog available as an individual object. + + This class has been added in version 0.25. + """ + @classmethod + def new(cls, modal: bool) -> HelpDialog: + r""" + @brief Creates a new help dialog + If the modal flag is true, the dialog will be shown as a modal window. """ def _create(self) -> None: r""" @@ -1274,12 +3304,9 @@ class Macro: 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. """ - def interpreter_name(self) -> str: + def exec_(self) -> int: r""" - @brief Gets the macro interpreter name - This is the string version of \interpreter. - - This method has been introduced in version 0.27.5. + @brief Executes the dialog (shows it modally) """ def is_const_object(self) -> bool: r""" @@ -1287,45 +3314,1554 @@ class Macro: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def name(self) -> str: + def load(self, url: str) -> None: r""" - @brief Gets the name of the macro - - This attribute has been added in version 0.25. + @brief Loads the specified URL + This method will call the page with the given URL. """ - def path(self) -> str: + def search(self, topic: str) -> None: r""" - @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. + @brief Issues a search on the specified topic + This method will call the search page with the given topic. """ - def run(self) -> int: + def show(self) -> None: r""" - @brief Executes the macro - - This method has been introduced in version 0.27.5. + @brief Shows the dialog """ - def save_to(self, path: str) -> None: - r""" - @brief Saves the macro to the given file - This method has been introduced in version 0.27.5. +class HelpSource(BrowserSource_Native): + r""" + @brief A BrowserSource implementation delivering the help text for the help dialog + This class can be used together with a \BrowserPanel or \BrowserDialog object to implement custom help systems. + + The basic URL's served by this class are: "int:/index.xml" for the index page and "int:/search.xml?string=..." for the search topic retrieval. + + This class has been added in version 0.25. + """ + @classmethod + def create_index_file(cls, path: str) -> None: + r""" + @brief Reserved internal use """ - def sync_properties_with_text(self) -> None: + @classmethod + def plain(cls) -> HelpSource: r""" - @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. + @brief Reserved for internal use """ - def sync_text_with_properties(self) -> None: + def _assign(self, other: BrowserSource_Native) -> None: r""" - @brief Synchronizes the macro text with the properties + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> HelpSource: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - 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. + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - This method has been introduced in version 0.27.5. + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def get_option(self, key: str) -> Any: + r""" + @brief Reserved for internal use + """ + def parent_of(self, path: str) -> str: + r""" + @brief Reserved internal use + """ + def scan(self) -> None: + r""" + @brief Reserved internal use + """ + def set_option(self, key: str, value: Any) -> None: + r""" + @brief Reserved for internal use + """ + def title_for(self, path: str) -> str: + r""" + @brief Reserved internal use + """ + def urls(self) -> List[str]: + r""" + @brief Reserved for internal use + """ + +class Image(BasicImage): + r""" + @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. + """ + data_mapping: ImageDataMapping + r""" + Getter: + @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. + + Setter: + @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: List[bool] + r""" + Getter: + @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. + + Setter: + @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: db.Matrix3d + r""" + Getter: + @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. + Setter: + @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: float + r""" + Getter: + @brief Sets the maximum value + + See the \max_value method for the description of the maximum value property. + + Setter: + @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: float + r""" + Getter: + @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. + + Setter: + @brief Sets the minimum value + + See \min_value for the description of the minimum value property. + """ + pixel_height: float + r""" + Getter: + @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. + Setter: + @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: float + r""" + Getter: + @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. + Setter: + @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: db.DCplxTrans + r""" + Getter: + @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. + Setter: + @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: bool + r""" + Getter: + @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. + + Setter: + @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: int + r""" + Getter: + @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. + Setter: + @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. + """ + @classmethod + def from_s(cls, s: str) -> Image: + r""" + @brief Creates an image from the string returned by \to_s. + This method has been introduced in version 0.27. + """ + @overload + @classmethod + def new(cls) -> Image: + r""" + @brief Create a new image with the default attributes + This will create an empty image without data and no particular pixel width or related. + Use the \read_file or \set_data methods to set image properties and pixel values. + """ + @overload + @classmethod + def new(cls, filename: str) -> Image: + r""" + @brief Constructor from a image file + + This constructor creates an image object from a file (which can have any format supported by Qt) and + a unit transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel + will have a size of 1 (micron). + + @param filename The path to the image file to load. + """ + @overload + @classmethod + def new(cls, filename: str, trans: db.DCplxTrans) -> Image: + r""" + @brief Constructor from a image file + + This constructor creates an image object from a file (which can have any format supported by Qt) and + a transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel + will have a size of 1. The transformation describes how to transform this image into micron space. + + @param filename The path to the image file to load. + @param trans The transformation to apply to the image when displaying it. + """ + @overload + @classmethod + def new(cls, w: int, h: int, data: Sequence[float]) -> Image: + r""" + @brief Constructor for a monochrome 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. 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 d The data (see method description) + """ + @overload + @classmethod + def new(cls, w: int, h: int, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> Image: + r""" + @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 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 + """ + @overload + @classmethod + def new(cls, w: int, h: int, trans: db.DCplxTrans, data: Sequence[float]) -> Image: + r""" + @brief Constructor for a monochrome 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. 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 d The data (see method description) + """ + @overload + @classmethod + def new(cls, w: int, h: int, trans: db.DCplxTrans, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> Image: + r""" + @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 + """ + @classmethod + def read(cls, path: str) -> Image: + r""" + @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. + """ + @overload + def __init__(self) -> None: + r""" + @brief Create a new image with the default attributes + This will create an empty image without data and no particular pixel width or related. + Use the \read_file or \set_data methods to set image properties and pixel values. + """ + @overload + def __init__(self, filename: str) -> None: + r""" + @brief Constructor from a image file + + This constructor creates an image object from a file (which can have any format supported by Qt) and + a unit transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel + will have a size of 1 (micron). + + @param filename The path to the image file to load. + """ + @overload + def __init__(self, filename: str, trans: db.DCplxTrans) -> None: + r""" + @brief Constructor from a image file + + This constructor creates an image object from a file (which can have any format supported by Qt) and + a transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel + will have a size of 1. The transformation describes how to transform this image into micron space. + + @param filename The path to the image file to load. + @param trans The transformation to apply to the image when displaying it. + """ + @overload + def __init__(self, w: int, h: int, data: Sequence[float]) -> None: + r""" + @brief Constructor for a monochrome 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. 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 d The data (see method description) + """ + @overload + def __init__(self, w: int, h: int, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> None: + r""" + @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 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 + """ + @overload + def __init__(self, w: int, h: int, trans: db.DCplxTrans, data: Sequence[float]) -> None: + r""" + @brief Constructor for a monochrome 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. 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 d The data (see method description) + """ + @overload + def __init__(self, w: int, h: int, trans: db.DCplxTrans, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> None: + r""" + @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 + """ + def __str__(self) -> str: + r""" + @brief Converts the image to a string + The string returned can be used to create an image object using \from_s. + @return The string + """ + def _assign(self, other: BasicImage) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> Image: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def box(self) -> db.DBox: + r""" + @brief Gets the bounding box of the image + @return The bounding box + """ + def clear(self) -> None: + r""" + @brief Clears the image data (sets to 0 or black). + This method has been introduced in version 0.27. + """ + def data(self, channel: Optional[int] = ...) -> List[float]: + r""" + @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. + """ + def delete(self) -> None: + r""" + @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. + """ + def detach(self) -> None: + r""" + @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. + """ + def filename(self) -> str: + r""" + @brief Gets the name of the file loaded of an empty string if not file is loaded + @return The file name (path) + """ + @overload + def get_pixel(self, x: int, y: int) -> float: + r""" + @brief Gets one pixel (monochrome only) + + @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) + + If x or y value exceeds the image bounds, this method + returns 0.0. This method is valid for monochrome images only. For color images it will return 0.0 always. + Use \is_color? to decide whether the image is a color image or monochrome one. + """ + @overload + def get_pixel(self, x: int, y: int, component: int) -> float: + r""" + @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. + """ + def height(self) -> int: + r""" + @brief Gets the height of the image in pixels + @return The height in pixels + """ + def id(self) -> int: + r""" + @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. + """ + def is_color(self) -> bool: + r""" + @brief Returns true, if the image is a color image + @return True, if the image is a color image + """ + def is_empty(self) -> bool: + r""" + @brief Returns true, if the image does not contain any data (i.e. is default constructed) + @return True, if the image is empty + """ + def is_valid(self) -> bool: + r""" + @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. + """ + def is_visible(self) -> bool: + r""" + @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. + """ + def mask(self, x: int, y: int) -> bool: + r""" + @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. + """ + @overload + def set_data(self, w: int, h: int, d: Sequence[float]) -> None: + r""" + @brief Writes the image data field (monochrome) + @param w The width of the new data + @param h The height of the new data + @param d The (monochrome) data to load into the image + + See the constructor description for the data organisation in that field. + """ + @overload + def set_data(self, w: int, h: int, r: Sequence[float], g: Sequence[float], b: Sequence[float]) -> None: + r""" + @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. + """ + def set_mask(self, x: int, y: int, m: bool) -> None: + r""" + @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. + """ + @overload + def set_pixel(self, x: int, y: int, r: float, g: float, b: float) -> None: + r""" + @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. + """ + @overload + def set_pixel(self, x: int, y: int, v: float) -> None: + r""" + @brief Sets one pixel (monochrome) + + @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 v The value + + If the component index, x or y value exceeds the image bounds of the image is a color image, + this method does nothing. + """ + def to_s(self) -> str: + r""" + @brief Converts the image to a string + The string returned can be used to create an image object using \from_s. + @return The string + """ + @overload + def transformed(self, t: db.DCplxTrans) -> Image: + r""" + @brief Transforms the image with the given complex transformation + @param t The magnifying transformation to apply + @return The transformed object + """ + @overload + def transformed(self, t: db.DTrans) -> Image: + r""" + @brief Transforms the image with the given simple transformation + @param t The transformation to apply + @return The transformed object + """ + @overload + def transformed(self, t: db.Matrix3d) -> Image: + r""" + @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. + """ + def transformed_cplx(self, t: db.DCplxTrans) -> Image: + r""" + @brief Transforms the image with the given complex transformation + @param t The magnifying transformation to apply + @return The transformed object + """ + def transformed_matrix(self, t: db.Matrix3d) -> Image: + r""" + @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. + """ + def update(self) -> None: + r""" + @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. + """ + def width(self) -> int: + r""" + @brief Gets the width of the image in pixels + @return The width in pixels + """ + def write(self, path: str) -> None: + r""" + @brief Saves the image to KLayout's image format (.lyimg) + This method has been introduced in version 0.27. + """ + +class ImageDataMapping: + r""" + @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. + """ + blue_gain: float + r""" + Getter: + @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. + + Setter: + @brief Set the blue_gain + See \blue_gain for a description of this property. + """ + brightness: float + r""" + Getter: + @brief The brightness value + + The brightness is a double value between roughly -1.0 and 1.0. + Neutral (original) brightness is 0.0. + + Setter: + @brief Set the brightness + See \brightness for a description of this property. + """ + contrast: float + r""" + Getter: + @brief The contrast value + + The contrast is a double value between roughly -1.0 and 1.0. + Neutral (original) contrast is 0.0. + + Setter: + @brief Set the contrast + See \contrast for a description of this property. + """ + gamma: float + r""" + Getter: + @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. + + Setter: + @brief Set the gamma + See \gamma for a description of this property. + """ + green_gain: float + r""" + Getter: + @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. + + Setter: + @brief Set the green_gain + See \green_gain for a description of this property. + """ + red_gain: float + r""" + Getter: + @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. + + Setter: + @brief Set the red_gain + See \red_gain for a description of this property. + """ + @classmethod + def new(cls) -> ImageDataMapping: + r""" + @brief Create a new data mapping object with default settings + """ + def __copy__(self) -> ImageDataMapping: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> ImageDataMapping: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Create a new data mapping object with default settings + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def add_colormap_entry(self, value: float, color: int) -> None: + r""" + @brief Add a colormap entry for this data mapping object. + @param value The value at which the given color should be applied. + @param color The color to apply (a 32 bit RGB value). + + This settings establishes a color mapping for a given value in the monochrome channel. The color 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. + """ + @overload + def add_colormap_entry(self, value: float, lcolor: int, rcolor: int) -> None: + r""" + @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. + """ + def assign(self, other: ImageDataMapping) -> None: + r""" + @brief Assigns another object to self + """ + def clear_colormap(self) -> None: + r""" + @brief The the color map of this data mapping object. + """ + def colormap_color(self, n: int) -> int: + r""" + @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. + """ + def colormap_lcolor(self, n: int) -> int: + r""" + @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. + """ + def colormap_rcolor(self, n: int) -> int: + r""" + @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. + """ + def colormap_value(self, n: int) -> float: + r""" + @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). + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> ImageDataMapping: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def num_colormap_entries(self) -> int: + r""" + @brief Returns the current number of color map entries. + @return The number of entries. + """ + +class InputDialog: + r""" + @brief Various methods to open a dialog requesting data entry + This class provides some basic dialogs to enter a single value. Values can be strings floating-point values, integer values or an item from a list. + This functionality is provided through the static (class) methods ask_... + + Here are some examples: + + @code + # get a double value between -10 and 10 (initial value is 0): + v = RBA::InputDialog::ask_double_ex("Dialog Title", "Enter the value here:", 0, -10, 10, 1) + # get an item from a list: + v = RBA::InputDialog::ask_item("Dialog Title", "Select one:", [ "item 1", "item 2", "item 3" ], 1) + @/code + + All these examples return the "nil" value if "Cancel" is pressed. + + If you have enabled the Qt binding, you can use \QInputDialog directly. + """ + @classmethod + def ask_double(cls, title: str, label: str, value: float, digits: int) -> Any: + r""" + @brief Open an input dialog requesting a floating-point value + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param digits The number of digits allowed + @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_double_ex(cls, title: str, label: str, value: float, min: float, max: float, digits: int) -> Any: + r""" + @brief Open an input dialog requesting a floating-point value with enhanced capabilities + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param min The minimum value allowed + @param max The maximum value allowed + @param digits The number of digits allowed + @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_int(cls, title: str, label: str, value: int) -> Any: + r""" + @brief Open an input dialog requesting an integer value + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_int_ex(cls, title: str, label: str, value: int, min: int, max: int, step: int) -> Any: + r""" + @brief Open an input dialog requesting an integer value with enhanced capabilities + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param min The minimum value allowed + @param max The maximum value allowed + @param step The step size for the spin buttons + @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_item(cls, title: str, label: str, items: Sequence[str], value: int) -> Any: + r""" + @brief Open an input dialog requesting an item from a list + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param items The list of items to show in the selection element + @param selection The initial selection (index of the element selected initially) + @return The string of the item selected if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_string(cls, title: str, label: str, value: str) -> Any: + r""" + @brief Open an input dialog requesting a string + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return The string entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def ask_string_password(cls, title: str, label: str, value: str) -> Any: + r""" + @brief Open an input dialog requesting a string without showing the actual characters entered + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return The string entered if "Ok" was pressed or nil if "Cancel" was pressed + This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. + """ + @classmethod + def get_double(cls, title: str, label: str, value: float, digits: int) -> DoubleValue: + r""" + @brief Open an input dialog requesting a floating-point value + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param digits The number of digits allowed + @return A \DoubleValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_double_ex(cls, title: str, label: str, value: float, min: float, max: float, digits: int) -> DoubleValue: + r""" + @brief Open an input dialog requesting a floating-point value with enhanced capabilities + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param min The minimum value allowed + @param max The maximum value allowed + @param digits The number of digits allowed + @return A \DoubleValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_int(cls, title: str, label: str, value: int) -> IntValue: + r""" + @brief Open an input dialog requesting an integer value + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return A \IntValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_int_ex(cls, title: str, label: str, value: int, min: int, max: int, step: int) -> IntValue: + r""" + @brief Open an input dialog requesting an integer value with enhanced capabilities + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @param min The minimum value allowed + @param max The maximum value allowed + @param step The step size for the spin buttons + @return A \IntValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_item(cls, title: str, label: str, items: Sequence[str], value: int) -> StringValue: + r""" + @brief Open an input dialog requesting an item from a list + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param items The list of items to show in the selection element + @param selection The initial selection (index of the element selected initially) + @return A \StringValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_string(cls, title: str, label: str, value: str) -> StringValue: + r""" + @brief Open an input dialog requesting a string + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return A \StringValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def get_string_password(cls, title: str, label: str, value: str) -> StringValue: + r""" + @brief Open an input dialog requesting a string without showing the actual characters entered + @param title The title to display for the dialog + @param label The label text to display for the dialog + @param value The initial value for the input field + @return A \StringValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute + Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. + """ + @classmethod + def new(cls) -> InputDialog: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> InputDialog: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> InputDialog: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: InputDialog) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> InputDialog: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class IntValue: + r""" + @brief Encapsulate an integer value + @hide + This class is provided as a return value of \InputDialog::get_int. + By using an object rather than a pure value, an object with \has_value? = false can be returned indicating that + the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no + longer requires to use this class. + """ + @classmethod + def new(cls) -> IntValue: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> IntValue: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> IntValue: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: IntValue) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> IntValue: + r""" + @brief Creates a copy of self + """ + def has_value(self) -> bool: + r""" + @brief True, if a value is present + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def to_i(self) -> int: + r""" + @brief Get the actual value (a synonym for \value) + """ + def value(self) -> int: + r""" + @brief Get the actual value + """ + +class KeyCode: + r""" + @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: ClassVar[int] + r""" + @brief Indicates the Backspace key + """ + Backtab: ClassVar[int] + r""" + @brief Indicates the Backtab key + """ + Delete: ClassVar[int] + r""" + @brief Indicates the Delete key + """ + Down: ClassVar[int] + r""" + @brief Indicates the Down key + """ + End: ClassVar[int] + r""" + @brief Indicates the End key + """ + Enter: ClassVar[int] + r""" + @brief Indicates the Enter key + """ + Escape: ClassVar[int] + r""" + @brief Indicates the Escape key + """ + Home: ClassVar[int] + r""" + @brief Indicates the Home key + """ + Insert: ClassVar[int] + r""" + @brief Indicates the Insert key + """ + Left: ClassVar[int] + r""" + @brief Indicates the Left key + """ + PageDown: ClassVar[int] + r""" + @brief Indicates the PageDown key + """ + PageUp: ClassVar[int] + r""" + @brief Indicates the PageUp key + """ + Return: ClassVar[int] + r""" + @brief Indicates the Return key + """ + Right: ClassVar[int] + r""" + @brief Indicates the Right key + """ + Tab: ClassVar[int] + r""" + @brief Indicates the Tab key + """ + Up: ClassVar[int] + r""" + @brief Indicates the Up key + """ + @classmethod + def new(cls) -> KeyCode: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> KeyCode: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> KeyCode: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: KeyCode) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> KeyCode: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. """ class LayerProperties: @@ -2085,244 +5621,6 @@ class LayerProperties: This method has been introduced in version 0.19. """ -class LayerPropertiesNode(LayerProperties): - r""" - @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. - """ - def __eq__(self, other: object) -> bool: - r""" - @brief Equality - - @param other The other object to compare against - """ - def __ne__(self, other: object) -> bool: - r""" - @brief Inequality - - @param other The other object to compare against - """ - def _assign(self, other: LayerProperties) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> LayerPropertiesNode: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - @overload - def add_child(self) -> LayerPropertiesNodeRef: - r""" - @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 which is a freshly initialized one. - - The parameterless version of this method was introduced in version 0.25. - """ - @overload - def add_child(self, child: LayerProperties) -> LayerPropertiesNodeRef: - r""" - @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. - """ - def bbox(self) -> db.DBox: - r""" - @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 - """ - def clear_children(self) -> None: - r""" - @brief Clears all children - This method was introduced in version 0.22. - """ - def flat(self) -> LayerPropertiesNode: - r""" - @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. - """ - def has_children(self) -> bool: - r""" - @brief Test, if there are children - """ - def id(self) -> int: - r""" - @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 it's content. - """ - def list_index(self) -> int: - r""" - @brief Gets the index of the layer properties list that the node lives in - """ - def view(self) -> LayoutView: - r""" - @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. - """ - -class LayerPropertiesNodeRef(LayerPropertiesNode): - r""" - @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. - """ - def __copy__(self) -> LayerPropertiesNode: - r""" - @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. - """ - def __deepcopy__(self) -> LayerPropertiesNode: - r""" - @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. - """ - def _assign(self, other: LayerProperties) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> LayerPropertiesNodeRef: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - @overload - def assign(self, other: LayerProperties) -> None: - r""" - @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. - """ - @overload - def assign(self, other: LayerProperties) -> None: - r""" - @brief Assigns the contents of the 'other' object to self. - - This version accepts a \LayerPropertiesNode object and allows modification of the layer node's hierarchy. Assignment will reconfigure the layer node in the view. - """ - def delete(self) -> None: - r""" - @brief Erases the current node and all child nodes - - After erasing the node, the reference will become invalid. - """ - def dup(self) -> LayerPropertiesNode: - r""" - @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. - """ - def is_valid(self) -> bool: - r""" - @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. - """ - class LayerPropertiesIterator: r""" @brief Layer properties iterator @@ -2549,6 +5847,410 @@ class LayerPropertiesIterator: become a null iterator. """ +class LayerPropertiesNode(LayerProperties): + r""" + @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. + """ + expanded: bool + r""" + Getter: + @brief Gets a value indicating whether the layer tree node is expanded. + This predicate has been introduced in version 0.28.6. + Setter: + @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. + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Equality + + @param other The other object to compare against + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Inequality + + @param other The other object to compare against + """ + def _assign(self, other: LayerProperties) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> LayerPropertiesNode: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def add_child(self) -> LayerPropertiesNodeRef: + r""" + @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 which is a freshly initialized one. + + The parameterless version of this method was introduced in version 0.25. + """ + @overload + def add_child(self, child: LayerProperties) -> LayerPropertiesNodeRef: + r""" + @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. + """ + def bbox(self) -> db.DBox: + r""" + @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 + """ + def clear_children(self) -> None: + r""" + @brief Clears all children + This method was introduced in version 0.22. + """ + def flat(self) -> LayerPropertiesNode: + r""" + @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. + """ + def has_children(self) -> bool: + r""" + @brief Test, if there are children + """ + def id(self) -> int: + r""" + @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 it's content. + """ + def is_expanded(self) -> bool: + r""" + @brief Gets a value indicating whether the layer tree node is expanded. + This predicate has been introduced in version 0.28.6. + """ + def list_index(self) -> int: + r""" + @brief Gets the index of the layer properties list that the node lives in + """ + def view(self) -> LayoutView: + r""" + @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. + """ + +class LayerPropertiesNodeRef(LayerPropertiesNode): + r""" + @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. + """ + def __copy__(self) -> LayerPropertiesNode: + r""" + @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. + """ + def __deepcopy__(self) -> LayerPropertiesNode: + r""" + @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. + """ + def _assign(self, other: LayerProperties) -> None: + r""" + @brief Assigns another object to self + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _dup(self) -> LayerPropertiesNodeRef: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + @overload + def assign(self, other: LayerProperties) -> None: + r""" + @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. + """ + @overload + def assign(self, other: LayerProperties) -> None: + r""" + @brief Assigns the contents of the 'other' object to self. + + This version accepts a \LayerPropertiesNode object and allows modification of the layer node's hierarchy. Assignment will reconfigure the layer node in the view. + """ + def delete(self) -> None: + r""" + @brief Erases the current node and all child nodes + + After erasing the node, the reference will become invalid. + """ + def dup(self) -> LayerPropertiesNode: + r""" + @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. + """ + def is_valid(self) -> bool: + r""" + @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. + """ + +class LayoutView(LayoutViewBase): + r""" + @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. + """ + on_close: None + r""" + Getter: + @brief A event indicating that the view is about to close + + This event is triggered when the view is going to be closed entirely. + + It has been added in version 0.25. + Setter: + @brief A event indicating that the view is about to close + + This event is triggered when the view is going to be closed entirely. + + It has been added in version 0.25. + """ + on_hide: None + r""" + Getter: + @brief A event indicating that the view is going to become invisible + + It has been added in version 0.25. + Setter: + @brief A event indicating that the view is going to become invisible + + It has been added in version 0.25. + """ + on_show: None + r""" + Getter: + @brief A event indicating that the view is going to become visible + + It has been added in version 0.25. + Setter: + @brief A event indicating that the view is going to become visible + + It has been added in version 0.25. + """ + @classmethod + def current(cls) -> LayoutView: + r""" + @brief Returns the current view + The current view is the one that is shown in the current tab. Returns nil if no layout is loaded. + + This method has been introduced in version 0.23. + """ + @classmethod + def new(cls, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> LayoutView: + r""" + @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 from \LayoutViewBase + + This constructor has been introduced in version 0.25. + It has been enhanced with the arguments in version 0.27. + """ + def __init__(self, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> None: + r""" + @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 from \LayoutViewBase + + This constructor has been introduced in version 0.25. + It has been enhanced with the arguments in version 0.27. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def bookmark_view(self, name: str) -> None: + r""" + @brief Bookmarks the current view under the given name + + @param name The name under which to bookmark the current state + """ + def close(self) -> None: + r""" + @brief Closes the view + + This method has been added in version 0.27. + """ + def show_l2ndb(self, l2ndb_index: int, cv_index: int) -> None: + r""" + @brief Shows a netlist database in the marker browser on a certain layout + The netlist browser is opened showing the netlist database with the index given by "l2ndb_index". + It will be attached (i.e. navigate to) the layout with the given cellview index in "cv_index". + + This method has been added in version 0.26. + """ + def show_lvsdb(self, lvsdb_index: int, cv_index: int) -> None: + r""" + @brief Shows a netlist database in the marker browser on a certain layout + The netlist browser is opened showing the netlist database with the index given by "lvsdb_index". + It will be attached (i.e. navigate to) the layout with the given cellview index in "cv_index". + + This method has been added in version 0.26. + """ + def show_rdb(self, rdb_index: int, cv_index: int) -> None: + r""" + @brief Shows a report database in the marker browser on a certain layout + The marker browser is opened showing the report database with the index given by "rdb_index". + It will be attached (i.e. navigate to) the layout with the given cellview index in "cv_index". + """ + class LayoutViewBase: r""" @hide @@ -2591,12 +6293,12 @@ class LayoutViewBase: @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares two enums + @brief Compares an enum with an integer value """ @overload def __eq__(self, other: object) -> bool: r""" - @brief Compares an enum with an integer value + @brief Compares two enums """ @overload def __init__(self, i: int) -> None: @@ -2609,16 +6311,16 @@ class LayoutViewBase: @brief Creates an enum from a string value """ @overload - def __lt__(self, other: int) -> bool: - r""" - @brief Returns true if the enum is less (in the enum symbol order) than the integer value - """ - @overload def __lt__(self, other: LayoutViewBase.SelectionMode) -> bool: r""" @brief Returns true if the first enum is less (in the enum symbol order) than the second """ @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload def __ne__(self, other: object) -> bool: r""" @brief Compares an enum with an integer for inequality @@ -2766,15 +6468,6 @@ class LayoutViewBase: r""" @brief Removes from any existing selection """ - @property - def active_setview_index(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @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: LayerPropertiesIterator r""" Getter: @@ -2799,6 +6492,15 @@ class LayoutViewBase: @brief Sets the index of the currently selected layer properties tab This method has been introduced in version 0.21. """ + @property + def active_setview_index(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @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. + """ max_hier_levels: int r""" Getter: @@ -3260,16 +6962,6 @@ class LayoutViewBase: This method has been added in version 0.26. """ @overload - def add_line_style(self, name: str, string: str) -> int: - r""" - @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. - """ - @overload def add_line_style(self, name: str, data: int, bits: int) -> int: r""" @brief Adds a custom line style @@ -3280,6 +6972,16 @@ class LayoutViewBase: @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. """ + @overload + def add_line_style(self, name: str, string: str) -> int: + r""" + @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. + """ def add_lvsdb(self, db: db.LayoutVsSchematic) -> int: r""" @brief Adds the given database to the view @@ -3308,18 +7010,6 @@ class LayoutViewBase: This method has been added in version 0.26. """ @overload - def add_stipple(self, name: str, string: str) -> int: - r""" - @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. - """ - @overload def add_stipple(self, name: str, data: Sequence[int], bits: int) -> int: r""" @brief Adds a stipple pattern @@ -3331,6 +7021,18 @@ class LayoutViewBase: @param bits See above @return The index of the newly created stipple pattern, which can be used as the dither pattern index of \LayerProperties. """ + @overload + def add_stipple(self, name: str, string: str) -> int: + r""" + @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. + """ def annotation(self, id: int) -> Annotation: r""" @brief Gets the annotation given by an ID @@ -3576,14 +7278,6 @@ class LayoutViewBase: The name will be replaced by the file name when a file is loaded into the report database. """ @overload - def delete_layer(self, iter: LayerPropertiesIterator) -> None: - r""" - @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. - """ - @overload def delete_layer(self, index: int, iter: LayerPropertiesIterator) -> None: r""" @brief Deletes the layer properties node specified by the iterator @@ -3592,6 +7286,14 @@ class LayoutViewBase: 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. """ + @overload + def delete_layer(self, iter: LayerPropertiesIterator) -> None: + r""" + @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. + """ def delete_layer_list(self, index: int) -> None: r""" @brief Deletes the given properties list @@ -3599,6 +7301,14 @@ class LayoutViewBase: This method has been introduced in version 0.21. """ @overload + def delete_layers(self, index: int, iterators: Sequence[LayerPropertiesIterator]) -> None: + r""" + @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. + """ + @overload def delete_layers(self, iterators: Sequence[LayerPropertiesIterator]) -> None: r""" @brief Deletes the layer properties nodes specified by the iterator @@ -3607,14 +7317,6 @@ class LayoutViewBase: This method has been added in version 0.22. """ - @overload - def delete_layers(self, index: int, iterators: Sequence[LayerPropertiesIterator]) -> None: - r""" - @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. - """ def descend(self, path: Sequence[db.InstElement], index: int) -> None: r""" @brief Descends further into the hierarchy. @@ -3789,33 +7491,6 @@ class LayoutViewBase: @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. """ - def get_image(self, width: int, height: int) -> QtGui.QImage_Native: - r""" - @brief Gets the layout image as a \QImage - - @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. - """ - def get_image_with_options(self, width: int, height: int, linewidth: Optional[int] = ..., oversampling: Optional[int] = ..., resolution: Optional[float] = ..., target: Optional[db.DBox] = ..., monochrome: Optional[bool] = ...) -> QtGui.QImage_Native: - r""" - @brief Gets the layout image as a \QImage (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. - @param monochrome If true, monochrome images will be produced. - - 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.23.10. - """ def get_line_style(self, index: int) -> str: r""" @brief Gets the line style string for the style with the given index @@ -3866,12 +7541,6 @@ class LayoutViewBase: This method has been introduced in 0.28. """ - def get_screenshot(self) -> QtGui.QImage_Native: - r""" - @brief Gets a screenshot as a \QImage - - 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. - """ def get_screenshot_pixels(self) -> PixelBuffer: r""" @brief Gets a screenshot as a \PixelBuffer @@ -3964,22 +7633,22 @@ class LayoutViewBase: 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. """ @overload - def insert_layer(self, iter: LayerPropertiesIterator, node: Optional[LayerProperties] = ...) -> LayerPropertiesNodeRef: - r""" - @brief Inserts the given layer properties node into the list before the given position - - This method inserts the new properties node before the position given by "iter" and returns a const reference to the element created. 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. To add children to the node inserted, use iter.last_child as insertion point for the next insert operations. - - 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. - """ - @overload def insert_layer(self, index: int, iter: LayerPropertiesIterator, node: Optional[LayerProperties] = ...) -> LayerPropertiesNodeRef: r""" @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. + """ + @overload + def insert_layer(self, iter: LayerPropertiesIterator, node: Optional[LayerProperties] = ...) -> LayerPropertiesNodeRef: + r""" + @brief Inserts the given layer properties node into the list before the given position + + This method inserts the new properties node before the position given by "iter" and returns a const reference to the element created. 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. To add children to the node inserted, use iter.last_child as insertion point for the next insert operations. + 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. """ @@ -4084,11 +7753,12 @@ class LayoutViewBase: This method has been introduced in version 0.18. The 'add_cellview' argument has been made optional in version 0.28. """ @overload - def load_layout(self, filename: str, technology: str, add_cellview: Optional[bool] = ...) -> int: + def load_layout(self, filename: str, options: db.LoadLayoutOptions, technology: str, add_cellview: Optional[bool] = ...) -> int: r""" @brief Loads a (new) file into the layout view with the given technology Loads the file given by the "filename" parameter and associates it with the given technology. + The options specify various options for reading the file. The add_cellview param controls whether to create a new cellview (true) or clear all cellviews before (false). @@ -4097,12 +7767,11 @@ class LayoutViewBase: This version has been introduced in version 0.22. The 'add_cellview' argument has been made optional in version 0.28. """ @overload - def load_layout(self, filename: str, options: db.LoadLayoutOptions, technology: str, add_cellview: Optional[bool] = ...) -> int: + def load_layout(self, filename: str, technology: str, add_cellview: Optional[bool] = ...) -> int: r""" @brief Loads a (new) file into the layout view with the given technology Loads the file given by the "filename" parameter and associates it with the given technology. - The options specify various options for reading the file. The add_cellview param controls whether to create a new cellview (true) or clear all cellviews before (false). @@ -4285,18 +7954,18 @@ class LayoutViewBase: This method has been added in version 0.26. """ @overload - def replace_layer_node(self, iter: LayerPropertiesIterator, node: LayerProperties) -> None: - r""" - @brief Replaces the layer node at the position given by "iter" with a new one - - Since version 0.22, this method accepts LayerProperties and LayerPropertiesNode objects. A LayerPropertiesNode object can contain a hierarchy of further nodes. - """ - @overload def replace_layer_node(self, index: int, iter: LayerPropertiesIterator, node: LayerProperties) -> None: r""" @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. + """ + @overload + def replace_layer_node(self, iter: LayerPropertiesIterator, node: LayerProperties) -> None: + r""" + @brief Replaces the layer node at the position given by "iter" with a new one + Since version 0.22, this method accepts LayerProperties and LayerPropertiesNode objects. A LayerPropertiesNode object can contain a hierarchy of further nodes. """ def replace_lvsdb(self, db_index: int, db: db.LayoutVsSchematic) -> int: @@ -4332,20 +8001,6 @@ class LayoutViewBase: This method has been made available in all builds in 0.28. """ @overload - def save_as(self, index: int, filename: str, options: db.SaveLayoutOptions) -> None: - r""" - @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. - """ - @overload def save_as(self, index: int, filename: str, gzip: bool, options: db.SaveLayoutOptions) -> None: r""" @brief Saves a layout to the given stream file @@ -4360,6 +8015,20 @@ class LayoutViewBase: This method is deprecated starting from version 0.23. The compression mode is determined from the file name automatically and the \gzip parameter is ignored. """ + @overload + def save_as(self, index: int, filename: str, options: db.SaveLayoutOptions) -> None: + r""" + @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. + """ def save_image(self, filename: str, width: int, height: int) -> None: r""" @brief Saves the layout as an image to the given file @@ -4529,7 +8198,7 @@ class LayoutViewBase: r""" @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_move_event for example. + 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. """ @@ -4537,7 +8206,7 @@ class LayoutViewBase: r""" @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_move_event for example. + 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. """ @@ -4545,7 +8214,7 @@ class LayoutViewBase: r""" @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_move_event for example. + 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. """ @@ -4553,7 +8222,7 @@ class LayoutViewBase: r""" @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_move_event for example. + 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. """ @@ -4600,19 +8269,19 @@ class LayoutViewBase: This method has been introduced in version 0.21. """ @overload - def set_layer_properties(self, iter: LayerPropertiesIterator, props: LayerProperties) -> None: - r""" - @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". It will not change the hierarchy but just the properties of the given node. - """ - @overload def set_layer_properties(self, index: int, iter: LayerPropertiesIterator, props: LayerProperties) -> None: r""" @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. """ + @overload + def set_layer_properties(self, iter: LayerPropertiesIterator, props: LayerProperties) -> None: + r""" + @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". It will not change the hierarchy but just the properties of the given node. + """ def set_title(self, title: str) -> None: r""" @brief Sets the title of the view @@ -4737,7 +8406,7 @@ class LayoutViewBase: r""" @brief Unregisters the template or templates with the given category string on this particular view - See \Annotation#unregister_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. + 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. """ @@ -4800,5063 +8469,485 @@ class LayoutViewBase: @brief Zooms out somewhat """ -class CellView: +class Macro: r""" - @brief A class describing what is shown inside a layout view + @brief A macro class - 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 it's 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 it's 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: + 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 - cv = RBA::CellView::active - cv.cell_name = "TOP2" + path = "path-to-macro.lym" + RBA::Macro::new(path).run() @/code - See @The Application API@ for more details about the cellview objects. - """ - cell: db.Cell - r""" - Getter: - @brief Gets the reference to the target cell currently addressed - - Setter: - @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: int - r""" - Getter: - @brief Gets the target cell's index - - Setter: - @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 it's index. - """ - cell_name: str - r""" - Getter: - @brief Gets the name of the target cell currently addressed - - Setter: - @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: List[db.InstElement] - r""" - Getter: - @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. - Setter: - @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: str - r""" - Getter: - @brief Gets the unique name associated with the layout behind the cellview - - Setter: - @brief sets the unique name associated with the layout behind the cellview - - this method has been introduced in version 0.25. - """ - on_technology_changed: None - r""" - Getter: - @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. - - Setter: - @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: List[int] - r""" - Getter: - @brief Gets the cell's unspecific part of the path leading to the context cell - - Setter: - @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: str - r""" - Getter: - @brief Returns the technology name for the layout behind the given cell view - This method has been added in version 0.23. - - Setter: - @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. - """ - @classmethod - def active(cls) -> CellView: - r""" - @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. - """ - @classmethod - def new(cls) -> CellView: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> CellView: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> CellView: - r""" - @brief Creates a copy of self - """ - def __eq__(self, other: object) -> bool: - r""" - @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. - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def ascend(self) -> None: - r""" - @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. - """ - def assign(self, other: CellView) -> None: - r""" - @brief Assigns another object to self - """ - def close(self) -> None: - r""" - @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. - """ - def context_dtrans(self) -> db.DCplxTrans: - r""" - @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. - """ - def context_trans(self) -> db.ICplxTrans: - r""" - @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. - """ - def create(self) -> None: - r""" - @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. - """ - def ctx_cell(self) -> db.Cell: - r""" - @brief Gets the reference to the context cell currently addressed - """ - def ctx_cell_index(self) -> int: - r""" - @brief Gets the context cell's index - """ - def descend(self, path: Sequence[db.InstElement]) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> CellView: - r""" - @brief Creates a copy of self - """ - def filename(self) -> str: - r""" - @brief Gets filename associated with the layout behind the cellview - """ - def hide_cell(self, cell: db.Cell) -> None: - r""" - @brief Hides the given cell - - This method has been added in version 0.25. - """ - def index(self) -> int: - r""" - @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. - """ - def is_cell_hidden(self, cell: db.Cell) -> bool: - r""" - @brief Returns true, if the given cell is hidden - - This method has been added in version 0.25. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_dirty(self) -> bool: - r""" - @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. - """ - def is_valid(self) -> bool: - r""" - @brief Returns true, if the cellview is valid - A cellview may become invalid if the corresponding tab is closed for example. - """ - def layout(self) -> db.Layout: - r""" - @brief Gets the reference to the layout object addressed by this view - """ - def reset_cell(self) -> None: - r""" - @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. - """ - def set_cell(self, cell_index: int) -> None: - r""" - @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 it's index. - """ - def set_cell_name(self, cell_name: str) -> None: - r""" - @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. - """ - def set_context_path(self, path: Sequence[db.InstElement]) -> None: - r""" - @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. - """ - def set_path(self, path: Sequence[int]) -> None: - r""" - @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. - """ - def show_all_cells(self) -> None: - r""" - @brief Makes all cells shown (cancel effects of \hide_cell) for the specified cell view - - This method has been added in version 0.25. - """ - def show_cell(self, cell: db.Cell) -> None: - r""" - @brief Shows the given cell (cancels the effect of \hide_cell) - - This method has been added in version 0.25. - """ - def view(self) -> LayoutView: - r""" - @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. - """ - -class Marker: - r""" - @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. - """ - color: int - r""" - Getter: - @brief Gets the color of the marker - This value is valid only if \has_color? is true. - Setter: - @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: bool - r""" - Getter: - @brief Gets a value indicating whether the marker can be hidden - See \dismissable= for a description of this predicate. - Setter: - @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: int - r""" - Getter: - @brief Gets the stipple pattern index - See \dither_pattern= for a description of the stipple pattern index. - Setter: - @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: int - r""" - Getter: - @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. - - Setter: - @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: int - r""" - Getter: - @brief Gets the halo flag - See \halo= for a description of the halo flag. - Setter: - @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: int - r""" - Getter: - @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. - Setter: - @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: int - r""" - Getter: - @brief Gets the line width of the marker - See \line_width= for a description of the line width. - Setter: - @brief Sets the line width of the marker - This is the width of the line drawn for the outline of the marker. - """ - vertex_size: int - r""" - Getter: - @brief Gets the vertex size of the marker - See \vertex_size= for a description. - Setter: - @brief Sets the vertex size of the marker - This is the size of the rectangles drawn for the vertices object. - """ - @classmethod - def new(cls, view: LayoutViewBase) -> Marker: - r""" - @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. - """ - def __init__(self, view: LayoutViewBase) -> None: - r""" - @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. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def has_color(self) -> bool: - r""" - @brief Returns a value indicating whether the marker has a specific color - """ - def has_frame_color(self) -> bool: - r""" - @brief Returns a value indicating whether the marker has a specific frame color - The set method has been added in version 0.20. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def reset_color(self) -> None: - r""" - @brief Resets the color of the marker - See \set_color for a description of the color property of the marker. - """ - def reset_frame_color(self) -> None: - r""" - @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. - """ - @overload - def set(self, box: db.DBox) -> None: - r""" - @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. - """ - @overload - def set(self, edge: db.DEdge) -> None: - r""" - @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. - """ - @overload - def set(self, path: db.DPath) -> None: - r""" - @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. - """ - @overload - def set(self, polygon: db.DPolygon) -> None: - r""" - @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. - """ - @overload - def set(self, text: db.DText) -> None: - r""" - @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. - """ - def set_box(self, box: db.DBox) -> None: - r""" - @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. - """ - def set_edge(self, edge: db.DEdge) -> None: - r""" - @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. - """ - def set_path(self, path: db.DPath) -> None: - r""" - @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. - """ - def set_polygon(self, polygon: db.DPolygon) -> None: - r""" - @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. - """ - def set_text(self, text: db.DText) -> None: - r""" - @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. - """ - -class AbstractMenu: - r""" - @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 . If is omitted, this refers to an element in the root@
"[.]end" @refers to the item past the last item of the submenu given by or root@
"[.]begin" @refers to the first item of the submenu given by or root@
"[.]#" @refers to the nth item of the submenu given by or root (n is an integer number)@
- - 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 ":" to the item's name. - This specification can be used several times. - - Detached menus (i.e. for use in context menus) can be created as virtual top-level submenus - with a name of the form "@@". A special detached menu is "@toolbar" which represents the tool bar of the main window. - Menus 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. - """ - @classmethod - def new(cls) -> AbstractMenu: - r""" - @hide - """ - @classmethod - def pack_key_binding(cls, path_to_keys: Dict[str, str]) -> str: - r""" - @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. - """ - @classmethod - def pack_menu_items_hidden(cls, path_to_visibility: Dict[str, bool]) -> str: - r""" - @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. - """ - @classmethod - def unpack_key_binding(cls, s: str) -> Dict[str, str]: - r""" - @brief Deserializes a key binding definition - This method is the reverse of \pack_key_binding. - - This method has been introduced in version 0.26. - """ - @classmethod - def unpack_menu_items_hidden(cls, s: str) -> Dict[str, bool]: - r""" - @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. - """ - def __init__(self) -> None: - r""" - @hide - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def action(self, path: str) -> ActionBase: - r""" - @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 - """ - def clear_menu(self, path: str) -> None: - r""" - @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. - """ - def create(self) -> None: - r""" - @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. - """ - def delete_item(self, path: str) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def group(self, group: str) -> List[str]: - r""" - @brief Gets the group members - - @param group The group name - @param A vector of all members (by path) of the group - """ - def insert_item(self, path: str, name: str, action: ActionBase) -> None: - r""" - @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 - """ - @overload - def insert_menu(self, path: str, name: str, action: ActionBase) -> None: - r""" - @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. - """ - @overload - def insert_menu(self, path: str, name: str, title: str) -> None: - r""" - @brief Inserts a new submenu before the item given by the path - - The title string optionally encodes the key shortcut and icon resource - in the form ["("")"]["<"">"]. - - @param path The path to the item before which to insert the submenu - @param name The name of the submenu to insert - @param title The title of the submenu to insert - """ - def insert_separator(self, path: str, name: str) -> None: - r""" - @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 - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_menu(self, path: str) -> bool: - r""" - @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 - """ - def is_separator(self, path: str) -> bool: - r""" - @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. - """ - def is_valid(self, path: str) -> bool: - r""" - @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 - """ - def items(self, path: str) -> List[str]: - r""" - @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 - """ - -class ActionBase: - r""" - @hide - @alias Action - """ - NoKeyBound: ClassVar[str] - r""" - @brief Gets a shortcut value indicating that no shortcut shall be assigned - This method has been introduced in version 0.26. - """ - checkable: bool - r""" - Getter: - @brief Gets a value indicating whether the item is checkable - - Setter: - @brief Makes the item(s) checkable or not - - @param checkable true to make the item checkable - """ - checked: bool - r""" - Getter: - @brief Gets a value indicating whether the item is checked - - Setter: - @brief Checks or unchecks the item - - @param checked true to make the item checked - """ - default_shortcut: str - r""" - Getter: - @brief Gets the default keyboard shortcut - @return The default keyboard shortcut as a string - - This attribute has been introduced in version 0.25. - - Setter: - @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: bool - r""" - Getter: - @brief Gets a value indicating whether the item is enabled - - Setter: - @brief Enables or disables the action - - @param enabled true to enable the item - """ - hidden: bool - r""" - Getter: - @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. - - Setter: - @brief Sets a value that makes the item hidden always - See \is_hidden? for details. - - This attribute has been introduced in version 0.25 - """ - @property - def icon(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the icon to the given \QIcon object - - @param qicon The QIcon object - - This variant has been added in version 0.28. - """ - icon_text: str - r""" - Getter: - @brief Gets the icon's text - - Setter: - @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: None - r""" - Getter: - @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. - - Setter: - @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: None - r""" - Getter: - @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. - - Setter: - @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: bool - r""" - Getter: - @brief Gets a value indicating whether the item is a separator - This method has been introduced in version 0.25. - - Setter: - @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: str - r""" - Getter: - @brief Gets the keyboard shortcut - @return The keyboard shortcut as a string - - Setter: - @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: str - r""" - Getter: - @brief Gets the title - - @return The current title string - - Setter: - @brief Sets the title - - @param title The title string to set (just the title) - """ - tool_tip: str - r""" - Getter: - @brief Gets the tool tip text. - - This method has been added in version 0.22. - - Setter: - @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: bool - r""" - Getter: - @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?. - Setter: - @brief Sets the item's visibility - - @param visible true to make the item visible - """ - @classmethod - def new(cls) -> ActionBase: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def effective_shortcut(self) -> str: - r""" - @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. - """ - def is_checkable(self) -> bool: - r""" - @brief Gets a value indicating whether the item is checkable - """ - def is_checked(self) -> bool: - r""" - @brief Gets a value indicating whether the item is checked - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_effective_enabled(self) -> bool: - r""" - @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. - """ - def is_effective_visible(self) -> bool: - r""" - @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. - """ - def is_enabled(self) -> bool: - r""" - @brief Gets a value indicating whether the item is enabled - """ - def is_hidden(self) -> bool: - r""" - @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. - """ - def is_separator(self) -> bool: - r""" - @brief Gets a value indicating whether the item is a separator - This method has been introduced in version 0.25. - """ - def is_visible(self) -> bool: - r""" - @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?. - """ - def macro(self) -> Macro: - r""" - @brief Gets the macro associated with the action - If the action is associated with a macro, this method returns a reference to the \Macro object. Otherwise, this method returns nil. - - - This method has been added in version 0.25. - """ - def trigger(self) -> None: - r""" - @brief Triggers the action programmatically - """ - -class Action(ActionBase): - r""" - @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. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class PluginFactory: - r""" - @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. - """ - @property - def has_tool_entry(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @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. - """ - @classmethod - def new(cls) -> PluginFactory: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def add_config_menu_item(self, menu_name: str, insert_pos: str, title: str, cname: str, cvalue: str) -> None: - r""" - @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. - """ - @overload - def add_menu_entry(self, menu_name: str, insert_pos: str) -> None: - r""" - @brief Specifies a separator - Call this method in the factory constructor to build the menu items that this plugin shall create. - This specific call inserts a separator at the given position (insert_pos). The position uses abstract menu item paths and "menu_name" names the component that will be created. See \AbstractMenu for a description of the path. - """ - @overload - def add_menu_entry(self, symbol: str, menu_name: str, insert_pos: str, title: str) -> None: - r""" - @brief Specifies a menu item - Call this method in the factory constructor to build the menu items that this plugin shall create. - This specific call inserts a menu item at the specified position (insert_pos). The position uses abstract menu item paths and "menu_name" names the component that will be created. See \AbstractMenu for a description of the path. - When the menu item is selected "symbol" is the string that is sent to the \menu_activated callback (either the global one for the factory ot the one of the per-view plugin instance). - - @param symbol The string to send to the plugin if the menu is triggered - @param menu_name The name of entry to create at the given position - @param insert_pos The position where to create the entry - @param title The title string for the item. The title can contain a keyboard shortcut in round braces after the title text, i.e. "My Menu Item(F12)" - """ - @overload - def add_menu_entry(self, symbol: str, menu_name: str, insert_pos: str, title: str, sub_menu: bool) -> None: - r""" - @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. - """ - def add_menu_item_clone(self, symbol: str, menu_name: str, insert_pos: str, copy_from: str) -> None: - r""" - @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. - """ - def add_option(self, name: str, default_value: str) -> None: - r""" - @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. - - """ - def add_submenu(self, menu_name: str, insert_pos: str, title: str) -> None: - r""" - @brief Specifies a menu item or sub-menu - - This method has been introduced in version 0.27. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - @overload - def register(self, position: int, name: str, title: str) -> None: - r""" - @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. - - 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. - """ - @overload - def register(self, position: int, name: str, title: str, icon: str) -> None: - r""" - @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. - """ - -class Plugin: - r""" - @brief The plugin object - - This class provides the actual plugin implementation. Each view gets it's 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. - """ - @classmethod - def new(cls) -> Plugin: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def grab_mouse(self) -> None: - r""" - @brief Redirects mouse events to this plugin, even if the plugin is not active. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def set_cursor(self, cursor_type: int) -> None: - r""" - @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. - """ - def ungrab_mouse(self) -> None: - r""" - @brief Removes a mouse grab registered with \grab_mouse. - """ - -class Cursor: - r""" - @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: ClassVar[int] - r""" - @brief 'Arrow cursor' constant - """ - Blank: ClassVar[int] - r""" - @brief 'Blank cursor' constant - """ - Busy: ClassVar[int] - r""" - @brief 'Busy state cursor' constant - """ - ClosedHand: ClassVar[int] - r""" - @brief 'Closed hand cursor' constant - """ - Cross: ClassVar[int] - r""" - @brief 'Cross cursor' constant - """ - Forbidden: ClassVar[int] - r""" - @brief 'Forbidden area cursor' constant - """ - IBeam: ClassVar[int] - r""" - @brief 'I beam (text insert) cursor' constant - """ - None_: ClassVar[int] - r""" - @brief 'No cursor (default)' constant for \set_cursor (resets cursor to default) - """ - OpenHand: ClassVar[int] - r""" - @brief 'Open hand cursor' constant - """ - PointingHand: ClassVar[int] - r""" - @brief 'Pointing hand cursor' constant - """ - SizeAll: ClassVar[int] - r""" - @brief 'Size all directions cursor' constant - """ - SizeBDiag: ClassVar[int] - r""" - @brief 'Backward diagonal resize cursor' constant - """ - SizeFDiag: ClassVar[int] - r""" - @brief 'Forward diagonal resize cursor' constant - """ - SizeHor: ClassVar[int] - r""" - @brief 'Horizontal resize cursor' constant - """ - SizeVer: ClassVar[int] - r""" - @brief 'Vertical resize cursor' constant - """ - SplitH: ClassVar[int] - r""" - @brief 'split_horizontal cursor' constant - """ - SplitV: ClassVar[int] - r""" - @brief 'Split vertical cursor' constant - """ - UpArrow: ClassVar[int] - r""" - @brief 'Upward arrow cursor' constant - """ - Wait: ClassVar[int] - r""" - @brief 'Waiting cursor' constant - """ - WhatsThis: ClassVar[int] - r""" - @brief 'Question mark cursor' constant - """ - @classmethod - def new(cls) -> Cursor: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> Cursor: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Cursor: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Cursor) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> Cursor: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class ButtonState: - r""" - @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: ClassVar[int] - r""" - @brief Indicates that the Alt key is pressed - This constant is combined with other constants within \ButtonState - """ - ControlKey: ClassVar[int] - r""" - @brief Indicates that the Control key is pressed - This constant is combined with other constants within \ButtonState - """ - LeftButton: ClassVar[int] - r""" - @brief Indicates that the left mouse button is pressed - This constant is combined with other constants within \ButtonState - """ - MidButton: ClassVar[int] - r""" - @brief Indicates that the middle mouse button is pressed - This constant is combined with other constants within \ButtonState - """ - RightButton: ClassVar[int] - r""" - @brief Indicates that the right mouse button is pressed - This constant is combined with other constants within \ButtonState - """ - ShiftKey: ClassVar[int] - r""" - @brief Indicates that the Shift key is pressed - This constant is combined with other constants within \ButtonState - """ - @classmethod - def new(cls) -> ButtonState: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> ButtonState: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> ButtonState: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ButtonState) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> ButtonState: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class KeyCode: - r""" - @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: ClassVar[int] - r""" - @brief Indicates the Backspace key - """ - Backtab: ClassVar[int] - r""" - @brief Indicates the Backtab key - """ - Delete: ClassVar[int] - r""" - @brief Indicates the Delete key - """ - Down: ClassVar[int] - r""" - @brief Indicates the Down key - """ - End: ClassVar[int] - r""" - @brief Indicates the End key - """ - Enter: ClassVar[int] - r""" - @brief Indicates the Enter key - """ - Escape: ClassVar[int] - r""" - @brief Indicates the Escape key - """ - Home: ClassVar[int] - r""" - @brief Indicates the Home key - """ - Insert: ClassVar[int] - r""" - @brief Indicates the Insert key - """ - Left: ClassVar[int] - r""" - @brief Indicates the Left key - """ - PageDown: ClassVar[int] - r""" - @brief Indicates the PageDown key - """ - PageUp: ClassVar[int] - r""" - @brief Indicates the PageUp key - """ - Return: ClassVar[int] - r""" - @brief Indicates the Return key - """ - Right: ClassVar[int] - r""" - @brief Indicates the Right key - """ - Tab: ClassVar[int] - r""" - @brief Indicates the Tab key - """ - Up: ClassVar[int] - r""" - @brief Indicates the Up key - """ - @classmethod - def new(cls) -> KeyCode: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> KeyCode: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> KeyCode: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: KeyCode) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> KeyCode: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class Dispatcher: - r""" - @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. - """ - @classmethod - def instance(cls) -> Dispatcher: - r""" - @brief Gets the singleton instance of the Dispatcher object - - @return The instance - """ - @classmethod - def new(cls) -> Dispatcher: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def clear_config(self) -> None: - r""" - @brief Clears the configuration parameters - """ - def commit_config(self) -> None: - r""" - @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. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def get_config(self, name: str) -> Any: - r""" - @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 - """ - def get_config_names(self) -> List[str]: - r""" - @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. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def read_config(self, file_name: str) -> bool: - r""" - @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. - """ - def set_config(self, name: str, value: str) -> None: - r""" - @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. - """ - def write_config(self, file_name: str) -> bool: - r""" - @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. - """ - -class DoubleValue: - r""" - @brief Encapsulate a floating point value - @hide - This class is provided as a return value of \InputDialog::get_double. - By using an object rather than a pure value, an object with \has_value? = false can be returned indicating that - the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no - longer requires to use this class. - """ - @classmethod - def new(cls) -> DoubleValue: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> DoubleValue: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> DoubleValue: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: DoubleValue) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> DoubleValue: - r""" - @brief Creates a copy of self - """ - def has_value(self) -> bool: - r""" - @brief True, if a value is present - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def to_f(self) -> float: - r""" - @brief Get the actual value (a synonym for \value) - """ - def value(self) -> float: - r""" - @brief Get the actual value - """ - -class IntValue: - r""" - @brief Encapsulate an integer value - @hide - This class is provided as a return value of \InputDialog::get_int. - By using an object rather than a pure value, an object with \has_value? = false can be returned indicating that - the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no - longer requires to use this class. - """ - @classmethod - def new(cls) -> IntValue: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> IntValue: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> IntValue: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: IntValue) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> IntValue: - r""" - @brief Creates a copy of self - """ - def has_value(self) -> bool: - r""" - @brief True, if a value is present - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def to_i(self) -> int: - r""" - @brief Get the actual value (a synonym for \value) - """ - def value(self) -> int: - r""" - @brief Get the actual value - """ - -class StringValue: - r""" - @brief Encapsulate a string value - @hide - This class is provided as a return value of \InputDialog::get_string, \InputDialog::get_item and \FileDialog. - By using an object rather than a pure value, an object with \has_value? = false can be returned indicating that - the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no - longer requires to use this class. - """ - @classmethod - def new(cls) -> StringValue: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> StringValue: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> StringValue: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def __str__(self) -> str: - r""" - @brief Get the actual value (a synonym for \value) - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: StringValue) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> StringValue: - r""" - @brief Creates a copy of self - """ - def has_value(self) -> bool: - r""" - @brief True, if a value is present - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def to_s(self) -> str: - r""" - @brief Get the actual value (a synonym for \value) - """ - def value(self) -> str: - r""" - @brief Get the actual value - """ - -class StringListValue: - r""" - @brief Encapsulate a string list - @hide - This class is provided as a return value of \FileDialog. - By using an object rather than a pure string list, an object with \has_value? = false can be returned indicating that - the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no - longer requires to use this class. - """ - @classmethod - def new(cls) -> StringListValue: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> StringListValue: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> StringListValue: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: StringListValue) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> StringListValue: - r""" - @brief Creates a copy of self - """ - def has_value(self) -> bool: - r""" - @brief True, if a value is present - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def value(self) -> List[str]: - r""" - @brief Get the actual value (a list of strings) - """ - -class BrowserDialog(QDialog_Native): - r""" - @brief A HTML display and browser dialog - - The browser dialog displays HTML code in a browser panel. The HTML code is delivered through a separate object of class \BrowserSource which acts as a "server" for a specific kind of URL scheme. Whenever the browser sees a URL starting with "int:" it will ask the connected BrowserSource object for the HTML code of that page using it's 'get' method. The task of the BrowserSource object is to format the data requested in HTML and deliver it. - - One use case for that class is the implementation of rich data browsers for structured information. In a simple scenario, the browser dialog can be instantiated with a static HTML page. In that case, only the content of that page is shown. - - Here's a simple example: - - @code - html = "Hello, world!" - RBA::BrowserDialog::new(html).exec - @/code - - And that is an example for the use case with a \BrowserSource as the "server": - - @code - class MySource < RBA::BrowserSource - def get(url) - if (url =~ /b.html$/) - return "The second page" - else - return "The first page with a link" - end - end - end - - source = MySource::new - RBA::BrowserDialog::new(source).exec - @/code - """ - @property - def caption(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the caption of the window - """ - @property - def home(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the browser's initial and current URL which is selected if the "home" location is chosen - The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". - """ - @property - def label(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the label text - - The label is shown left of the navigation buttons. - By default, no label is specified. - - This method has been introduced in version 0.23. - """ - @property - def source(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Connects to a source object - - Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, \home= should be called after the source was set. - """ - @overload - @classmethod - def new(cls, html: str) -> BrowserDialog: - r""" - @brief Creates a HTML browser window with a static HTML content - This method has been introduced in version 0.23. - """ - @overload - @classmethod - def new(cls, source: BrowserSource) -> BrowserDialog: - r""" - @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code - This method has been introduced in version 0.23. - """ - @overload - @classmethod - def new(cls, parent: QtWidgets.QWidget_Native, html: str) -> BrowserDialog: - r""" - @brief Creates a HTML browser window with a static HTML content - This method variant with a parent argument has been introduced in version 0.24.2. - """ - @overload - @classmethod - def new(cls, parent: QtWidgets.QWidget_Native, source: BrowserSource) -> BrowserDialog: - r""" - @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code - This method variant with a parent argument has been introduced in version 0.24.2. - """ - @overload - def __init__(self, html: str) -> None: - r""" - @brief Creates a HTML browser window with a static HTML content - This method has been introduced in version 0.23. - """ - @overload - def __init__(self, source: BrowserSource) -> None: - r""" - @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code - This method has been introduced in version 0.23. - """ - @overload - def __init__(self, parent: QtWidgets.QWidget_Native, html: str) -> None: - r""" - @brief Creates a HTML browser window with a static HTML content - This method variant with a parent argument has been introduced in version 0.24.2. - """ - @overload - def __init__(self, parent: QtWidgets.QWidget_Native, source: BrowserSource) -> None: - r""" - @brief Creates a HTML browser window with a \BrowserSource as the source of HTML code - This method variant with a parent argument has been introduced in version 0.24.2. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def exec_(self) -> int: - r""" - @brief Executes the HTML browser dialog as a modal window - """ - def execute(self) -> int: - r""" - @brief Executes the HTML browser dialog as a modal window - """ - def load(self, url: str) -> None: - r""" - @brief Loads the given URL into the browser dialog - Typically the URL has the "int:" scheme so the HTML code is taken from the \BrowserSource object. - """ - def reload(self) -> None: - r""" - @brief Reloads the current page - """ - def resize(self, width: int, height: int) -> None: - r""" - @brief Sets the size of the dialog window - """ - def search(self, search_item: str) -> None: - r""" - @brief Issues a search request using the given search item and the search URL specified with \set_search_url - - See \set_search_url for a description of the search mechanism. - """ - def set_caption(self, caption: str) -> None: - r""" - @brief Sets the caption of the window - """ - def set_home(self, home_url: str) -> None: - r""" - @brief Sets the browser's initial and current URL which is selected if the "home" location is chosen - The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". - """ - def set_search_url(self, url: str, query_item: str) -> None: - r""" - @brief Enables the search field and specifies the search URL generated for a search - - If a search URL is set, the search box right to the navigation bar will be enabled. When a text is entered into the search box, the browser will navigate to an URL composed of the search URL, the search item and the search text, i.e. "myurl?item=search_text". - - This method has been introduced in version 0.23. - """ - def set_size(self, width: int, height: int) -> None: - r""" - @brief Sets the size of the dialog window - """ - def set_source(self, source: BrowserSource) -> None: - r""" - @brief Connects to a source object - - Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, \home= should be called after the source was set. - """ - -class BrowserSource_Native: - r""" - @hide - @alias BrowserSource - """ - @classmethod - def new(cls) -> BrowserSource_Native: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> BrowserSource_Native: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> BrowserSource_Native: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: BrowserSource_Native) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> BrowserSource_Native: - r""" - @brief Creates a copy of self - """ - def get(self, arg0: str) -> str: - r""" - """ - def get_image(self, url: str) -> QtGui.QImage_Native: - r""" - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def next_topic(self, url: str) -> str: - r""" - """ - def prev_topic(self, url: str) -> str: - r""" - """ - -class BrowserSource: - r""" - @brief The BrowserDialog's source for "int" URL's - - The source object basically acts as a "server" for special URL's using "int" as the scheme. - Classes that want to implement such functionality must derive from BrowserSource and reimplement - the \get method. This method is supposed to deliver a HTML page for the given URL. - - Alternatively to implementing this functionality, a source object may be instantiated using the - constructor with a HTML code string. This will create a source object that simply displays the given string - as the initial and only page. - """ - @classmethod - def new(cls, arg0: str) -> BrowserSource: - r""" - @brief Constructs a BrowserSource object with a default HTML string - - The default HTML string is sent when no specific implementation is provided. - """ - @classmethod - def new_html(cls, arg0: str) -> BrowserSource: - r""" - @brief Constructs a BrowserSource object with a default HTML string - - The default HTML string is sent when no specific implementation is provided. - """ - def __copy__(self) -> BrowserSource: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> BrowserSource: - r""" - @brief Creates a copy of self - """ - def __init__(self, arg0: str) -> None: - r""" - @brief Constructs a BrowserSource object with a default HTML string - - The default HTML string is sent when no specific implementation is provided. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: BrowserSource) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> BrowserSource: - r""" - @brief Creates a copy of self - """ - def get_image(self, url: str) -> QtGui.QImage_Native: - r""" - @brief Gets the image object for a specific URL - - This method has been introduced in version 0.28. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def next_topic(self, url: str) -> str: - r""" - @brief Gets the next topic URL from a given URL - An empty string will be returned if no next topic is available. - - This method has been introduced in version 0.28. - """ - def prev_topic(self, url: str) -> str: - r""" - @brief Gets the previous topic URL from a given URL - An empty string will be returned if no previous topic is available. - - This method has been introduced in version 0.28. - """ - -class BrowserPanel(QWidget_Native): - r""" - @brief A HTML display and browser widget - - This widget provides the functionality of \BrowserDialog within a widget. It can be embedded into other dialogs. For details about the use model of this class see \BrowserDialog. - - This class has been introduced in version 0.25. - """ - @property - def home(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the browser widget's initial and current URL which is selected if the "home" location is chosen - The home URL is the one shown initially and the one which is selected when the "home" button is pressed. The default location is "int:/index.html". - """ - @property - def label(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the label text - - The label is shown left of the navigation buttons. - By default, no label is specified. - """ - @property - def source(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Connects to a source object - - Setting the source should be the first thing done after the BrowserDialog object is created. It will not have any effect after the browser has loaded the first page. In particular, \home= should be called after the source was set. - """ - @overload - @classmethod - def new(cls, parent: QtWidgets.QWidget_Native) -> BrowserPanel: - r""" - @brief Creates a HTML browser widget - """ - @overload - @classmethod - def new(cls, parent: QtWidgets.QWidget_Native, source: BrowserSource_Native) -> BrowserPanel: - r""" - @brief Creates a HTML browser widget with a \BrowserSource as the source of HTML code - """ - @overload - def __init__(self, parent: QtWidgets.QWidget_Native) -> None: - r""" - @brief Creates a HTML browser widget - """ - @overload - def __init__(self, parent: QtWidgets.QWidget_Native, source: BrowserSource_Native) -> None: - r""" - @brief Creates a HTML browser widget with a \BrowserSource as the source of HTML code - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def load(self, url: str) -> None: - r""" - @brief Loads the given URL into the browser widget - Typically the URL has the "int:" scheme so the HTML code is taken from the \BrowserSource object. - """ - def reload(self) -> None: - r""" - @brief Reloads the current page - """ - def search(self, search_item: str) -> None: - r""" - @brief Issues a search request using the given search item and the search URL specified with \set_search_url - - See \search_url= for a description of the search mechanism. - """ - def set_search_url(self, url: str, query_item: str) -> None: - r""" - @brief Enables the search field and specifies the search URL generated for a search - - If a search URL is set, the search box right to the navigation bar will be enabled. When a text is entered into the search box, the browser will navigate to an URL composed of the search URL, the search item and the search text, i.e. "myurl?item=search_text". - """ - def url(self) -> str: - r""" - @brief Gets the URL currently shown - """ - -class InputDialog: - r""" - @brief Various methods to open a dialog requesting data entry - This class provides some basic dialogs to enter a single value. Values can be strings floating-point values, integer values or an item from a list. - This functionality is provided through the static (class) methods ask_... - - Here are some examples: - - @code - # get a double value between -10 and 10 (initial value is 0): - v = RBA::InputDialog::ask_double_ex("Dialog Title", "Enter the value here:", 0, -10, 10, 1) - # get an item from a list: - v = RBA::InputDialog::ask_item("Dialog Title", "Select one:", [ "item 1", "item 2", "item 3" ], 1) - @/code - - All these examples return the "nil" value if "Cancel" is pressed. - - If you have enabled the Qt binding, you can use \QInputDialog directly. - """ - @classmethod - def ask_double(cls, title: str, label: str, value: float, digits: int) -> Any: - r""" - @brief Open an input dialog requesting a floating-point value - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @param digits The number of digits allowed - @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed - This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. - """ - @classmethod - def ask_double_ex(cls, title: str, label: str, value: float, min: float, max: float, digits: int) -> Any: - r""" - @brief Open an input dialog requesting a floating-point value with enhanced capabilities - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @param min The minimum value allowed - @param max The maximum value allowed - @param digits The number of digits allowed - @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed - This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. - """ - @classmethod - def ask_int(cls, title: str, label: str, value: int) -> Any: - r""" - @brief Open an input dialog requesting an integer value - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed - This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. - """ - @classmethod - def ask_int_ex(cls, title: str, label: str, value: int, min: int, max: int, step: int) -> Any: - r""" - @brief Open an input dialog requesting an integer value with enhanced capabilities - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @param min The minimum value allowed - @param max The maximum value allowed - @param step The step size for the spin buttons - @return The value entered if "Ok" was pressed or nil if "Cancel" was pressed - This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. - """ - @classmethod - def ask_item(cls, title: str, label: str, items: Sequence[str], value: int) -> Any: - r""" - @brief Open an input dialog requesting an item from a list - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param items The list of items to show in the selection element - @param selection The initial selection (index of the element selected initially) - @return The string of the item selected if "Ok" was pressed or nil if "Cancel" was pressed - This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. - """ - @classmethod - def ask_string(cls, title: str, label: str, value: str) -> Any: - r""" - @brief Open an input dialog requesting a string - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @return The string entered if "Ok" was pressed or nil if "Cancel" was pressed - This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. - """ - @classmethod - def ask_string_password(cls, title: str, label: str, value: str) -> Any: - r""" - @brief Open an input dialog requesting a string without showing the actual characters entered - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @return The string entered if "Ok" was pressed or nil if "Cancel" was pressed - This method has been introduced in 0.22 and is somewhat easier to use than the get_.. equivalent. - """ - @classmethod - def get_double(cls, title: str, label: str, value: float, digits: int) -> DoubleValue: - r""" - @brief Open an input dialog requesting a floating-point value - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @param digits The number of digits allowed - @return A \DoubleValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute - Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. - """ - @classmethod - def get_double_ex(cls, title: str, label: str, value: float, min: float, max: float, digits: int) -> DoubleValue: - r""" - @brief Open an input dialog requesting a floating-point value with enhanced capabilities - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @param min The minimum value allowed - @param max The maximum value allowed - @param digits The number of digits allowed - @return A \DoubleValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute - Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. - """ - @classmethod - def get_int(cls, title: str, label: str, value: int) -> IntValue: - r""" - @brief Open an input dialog requesting an integer value - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @return A \IntValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute - Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. - """ - @classmethod - def get_int_ex(cls, title: str, label: str, value: int, min: int, max: int, step: int) -> IntValue: - r""" - @brief Open an input dialog requesting an integer value with enhanced capabilities - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @param min The minimum value allowed - @param max The maximum value allowed - @param step The step size for the spin buttons - @return A \IntValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute - Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. - """ - @classmethod - def get_item(cls, title: str, label: str, items: Sequence[str], value: int) -> StringValue: - r""" - @brief Open an input dialog requesting an item from a list - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param items The list of items to show in the selection element - @param selection The initial selection (index of the element selected initially) - @return A \StringValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute - Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. - """ - @classmethod - def get_string(cls, title: str, label: str, value: str) -> StringValue: - r""" - @brief Open an input dialog requesting a string - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @return A \StringValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute - Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. - """ - @classmethod - def get_string_password(cls, title: str, label: str, value: str) -> StringValue: - r""" - @brief Open an input dialog requesting a string without showing the actual characters entered - @param title The title to display for the dialog - @param label The label text to display for the dialog - @param value The initial value for the input field - @return A \StringValue object with has_value? set to true, if "Ok" was pressed and the value given in it's value attribute - Starting from 0.22, this method is deprecated and it is recommended to use the ask_... equivalent. - """ - @classmethod - def new(cls) -> InputDialog: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> InputDialog: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> InputDialog: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: InputDialog) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> InputDialog: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class FileDialog: - r""" - @brief Various methods to request a file name - - This class provides some basic dialogs to select a file or directory. This functionality is provided through the static (class) methods ask_... - - Here are some examples: - - @code - # get an existing directory: - v = RBA::FileDialog::ask_existing_dir("Dialog Title", ".") - # get multiple files: - v = RBA::FileDialog::ask_open_file_names("Title", ".", "All files (*)") - # ask for one file name to save a file: - v = RBA::FileDialog::ask_save_file_name("Title", ".", "All files (*)") - @/code - - All these examples return the "nil" value if "Cancel" is pressed. - - If you have enabled the Qt binding, you can use \QFileDialog directly. - """ - @classmethod - def ask_existing_dir(cls, title: str, dir: str) -> Any: - r""" - @brief Open a dialog to select a directory - - @param title The title of the dialog - @param dir The directory selected initially - @return The directory path selected or "nil" if "Cancel" was pressed - - This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. - """ - @classmethod - def ask_open_file_name(cls, title: str, dir: str, filter: str) -> Any: - r""" - @brief Select one file for opening - - @param title The title of the dialog - @param dir The directory selected initially - @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" - @return The path of the file selected or "nil" if "Cancel" was pressed - - This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. - """ - @classmethod - def ask_open_file_names(cls, title: str, dir: str, filter: str) -> Any: - r""" - @brief Select one or multiple files for opening - - @param title The title of the dialog - @param dir The directory selected initially - @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" - @return An array with the file paths selected or "nil" if "Cancel" was pressed - - This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. - """ - @classmethod - def ask_save_file_name(cls, title: str, dir: str, filter: str) -> Any: - r""" - @brief Select one file for writing - - @param title The title of the dialog - @param dir The directory selected initially - @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" - @return The path of the file chosen or "nil" if "Cancel" was pressed - - This method has been introduced in version 0.23. It is somewhat easier to use than the get_... equivalent. - """ - @classmethod - def get_existing_dir(cls, title: str, dir: str) -> StringValue: - r""" - @brief Open a dialog to select a directory - - @param title The title of the dialog - @param dir The directory selected initially - @return A \StringValue object that contains the directory path selected or with has_value? = false if "Cancel" was pressed - - Starting with version 0.23 this method is deprecated. Use \ask_existing_dir instead. - """ - @classmethod - def get_open_file_name(cls, title: str, dir: str, filter: str) -> StringValue: - r""" - @brief Select one file for opening - - @param title The title of the dialog - @param dir The directory selected initially - @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" - @return A \StringValue object that contains the files selected or with has_value? = false if "Cancel" was pressed - - Starting with version 0.23 this method is deprecated. Use \ask_open_file_name instead. - """ - @classmethod - def get_open_file_names(cls, title: str, dir: str, filter: str) -> StringListValue: - r""" - @brief Select one or multiple files for opening - - @param title The title of the dialog - @param dir The directory selected initially - @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" - @return A \StringListValue object that contains the files selected or with has_value? = false if "Cancel" was pressed - - Starting with version 0.23 this method is deprecated. Use \ask_open_file_names instead. - """ - @classmethod - def get_save_file_name(cls, title: str, dir: str, filter: str) -> StringValue: - r""" - @brief Select one file for writing - - @param title The title of the dialog - @param dir The directory selected initially - @param filter The filters available, for example "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" - @return A \StringValue object that contains the files selected or with has_value? = false if "Cancel" was pressed - - Starting with version 0.23 this method is deprecated. Use \ask_save_file_name instead. - """ - @classmethod - def new(cls) -> FileDialog: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> FileDialog: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> FileDialog: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: FileDialog) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> FileDialog: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class MessageBox(QMainWindow_Native): - r""" - @brief Various methods to display message boxes - This class provides some basic message boxes. This functionality is provided through the static (class) methods \warning, \question and so on. - - Here is some example: - - @code - # issue a warning and ask whether to continue: - v = RBA::MessageBox::warning("Dialog Title", "Something happened. Continue?", RBA::MessageBox::Yes + RBA::MessageBox::No) - if v == RBA::MessageBox::Yes - ... continue ... - end - @/code - - If you have enabled the Qt binding, you can use \QMessageBox directly. - """ - Abort: ClassVar[int] - r""" - @brief A constant describing the 'Abort' button - """ - Cancel: ClassVar[int] - r""" - @brief A constant describing the 'Cancel' button - """ - Ignore: ClassVar[int] - r""" - @brief A constant describing the 'Ignore' button - """ - No: ClassVar[int] - r""" - @brief A constant describing the 'No' button - """ - Ok: ClassVar[int] - r""" - @brief A constant describing the 'Ok' button - """ - Retry: ClassVar[int] - r""" - @brief A constant describing the 'Retry' button - """ - Yes: ClassVar[int] - r""" - @brief A constant describing the 'Yes' button - """ - @classmethod - def b_abort(cls) -> int: - r""" - @brief A constant describing the 'Abort' button - """ - @classmethod - def b_cancel(cls) -> int: - r""" - @brief A constant describing the 'Cancel' button - """ - @classmethod - def b_ignore(cls) -> int: - r""" - @brief A constant describing the 'Ignore' button - """ - @classmethod - def b_no(cls) -> int: - r""" - @brief A constant describing the 'No' button - """ - @classmethod - def b_ok(cls) -> int: - r""" - @brief A constant describing the 'Ok' button - """ - @classmethod - def b_retry(cls) -> int: - r""" - @brief A constant describing the 'Retry' button - """ - @classmethod - def b_yes(cls) -> int: - r""" - @brief A constant describing the 'Yes' button - """ - @classmethod - def critical(cls, title: str, text: str, buttons: int) -> int: - r""" - @brief Open a critical (error) message box - @param title The title of the window - @param text The text to show - @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box - @return The button constant describing the button that was pressed - """ - @classmethod - def info(cls, title: str, text: str, buttons: int) -> int: - r""" - @brief Open a information message box - @param title The title of the window - @param text The text to show - @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box - @return The button constant describing the button that was pressed - """ - @classmethod - def question(cls, title: str, text: str, buttons: int) -> int: - r""" - @brief Open a question message box - @param title The title of the window - @param text The text to show - @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box - @return The button constant describing the button that was pressed - """ - @classmethod - def warning(cls, title: str, text: str, buttons: int) -> int: - r""" - @brief Open a warning message box - @param title The title of the window - @param text The text to show - @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box - @return The button constant describing the button that was pressed - """ - def __copy__(self) -> MessageBox: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> MessageBox: - r""" - @brief Creates a copy of self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: QObject_Native) -> None: - r""" - @brief Assigns another object to self - """ - def dup(self) -> MessageBox: - r""" - @brief Creates a copy of self - """ - -class NetlistObjectPath: - r""" - @brief An object describing the instantiation of a netlist object. - This class describes the instantiation of a net or a device or a circuit in terms of a root circuit and a subcircuit chain leading to the indicated object. - - See \net= or \device= for the indicated object, \path= for the subcircuit chain. - - This class has been introduced in version 0.27. - """ - device: db.Device - r""" - Getter: - @brief Gets the device the path points to. - - Setter: - @brief Sets the device the path points to. - If the path describes the location of a device, this member will indicate it. - The other way to describe a final object is \net=. If neither a device nor net is given, the path describes a circuit and how it is referenced from the root. - """ - net: db.Net - r""" - Getter: - @brief Gets the net the path points to. - - Setter: - @brief Sets the net the path points to. - If the path describes the location of a net, this member will indicate it. - The other way to describe a final object is \device=. If neither a device nor net is given, the path describes a circuit and how it is referenced from the root. - """ - path: List[db.SubCircuit] - r""" - Getter: - @brief Gets the path. - - Setter: - @brief Sets the path. - The path is a list of subcircuits leading from the root to the final object. The final (net, device) object is located in the circuit called by the last subcircuit of the subcircuit chain. If the subcircuit list is empty, the final object is located inside the root object. - """ - root: db.Circuit - r""" - Getter: - @brief Gets the root circuit of the path. - - Setter: - @brief Sets the root circuit of the path. - The root circuit is the circuit from which the path starts. - """ - @classmethod - def new(cls) -> NetlistObjectPath: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetlistObjectPath: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetlistObjectPath: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetlistObjectPath) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetlistObjectPath: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_null(self) -> bool: - r""" - @brief Returns a value indicating whether the path is an empty one. - """ - -class NetlistObjectsPath: - r""" - @brief An object describing the instantiation of a single netlist object or a pair of those. - This class is basically a pair of netlist object paths (see \NetlistObjectPath). When derived from a single netlist view, only the first path is valid and will point to the selected object (a net, a device or a circuit). The second path is null. - - If the path is derived from a paired netlist view (a LVS report view), the first path corresponds to the object in the layout netlist, the second one to the object in the schematic netlist. - If the selected object isn't a matched one, either the first or second path may be a null or a partial path without a final net or device object or a partial path. - - This class has been introduced in version 0.27. - """ - @classmethod - def new(cls) -> NetlistObjectsPath: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> NetlistObjectsPath: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> NetlistObjectsPath: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: NetlistObjectsPath) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> NetlistObjectsPath: - r""" - @brief Creates a copy of self - """ - def first(self) -> NetlistObjectPath: - r""" - @brief Gets the first object's path. - In cases of paired netlists (LVS database), the first path points to the layout netlist object. - For the single netlist, the first path is the only path supplied. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def second(self) -> NetlistObjectPath: - r""" - @brief Gets the second object's path. - In cases of paired netlists (LVS database), the first path points to the schematic netlist object. - For the single netlist, the second path is always a null path. - """ - -class NetlistBrowserDialog: - r""" - @brief Represents the netlist browser dialog. - This dialog is a part of the \LayoutView class and can be obtained through \LayoutView#netlist_browser. - This interface allows to interact with the browser - mainly to get information about state changes. - - This class has been introduced in version 0.27. - """ - on_current_db_changed: None - r""" - Getter: - @brief This event is triggered when the current database is changed. - The current database can be obtained with \db. - Setter: - @brief This event is triggered when the current database is changed. - The current database can be obtained with \db. - """ - on_probe: None - r""" - Getter: - @brief This event is triggered when a net is probed. - The first path will indicate the location of the probed net in terms of two paths: one describing the instantiation of the net in layout space and one in schematic space. Both objects are \NetlistObjectPath objects which hold the root circuit, the chain of subcircuits leading to the circuit containing the net and the net itself. - Setter: - @brief This event is triggered when a net is probed. - The first path will indicate the location of the probed net in terms of two paths: one describing the instantiation of the net in layout space and one in schematic space. Both objects are \NetlistObjectPath objects which hold the root circuit, the chain of subcircuits leading to the circuit containing the net and the net itself. - """ - on_selection_changed: None - r""" - Getter: - @brief This event is triggered when the selection changed. - The selection can be obtained with \current_path_first, \current_path_second, \selected_nets, \selected_devices, \selected_subcircuits and \selected_circuits. - Setter: - @brief This event is triggered when the selection changed. - The selection can be obtained with \current_path_first, \current_path_second, \selected_nets, \selected_devices, \selected_subcircuits and \selected_circuits. - """ - @classmethod - def new(cls) -> NetlistBrowserDialog: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def current_path(self) -> NetlistObjectsPath: - r""" - @brief Gets the path of the current object as a path pair (combines layout and schematic object paths in case of a LVS database view). - """ - def current_path_first(self) -> NetlistObjectPath: - r""" - @brief Gets the path of the current object on the first (layout in case of LVS database) side. - """ - def current_path_second(self) -> NetlistObjectPath: - r""" - @brief Gets the path of the current object on the second (schematic in case of LVS database) side. - """ - def db(self) -> db.LayoutToNetlist: - r""" - @brief Gets the database the browser is connected to. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def selected_paths(self) -> List[NetlistObjectsPath]: - r""" - @brief Gets the nets currently selected objects (paths) in the netlist database browser. - The result is an array of path pairs. See \NetlistObjectsPath for details about these pairs. - """ - -class LayoutViewWidget(QFrame_Native): - r""" - This object produces a widget which embeds a LayoutView. This widget can be used inside Qt widget hierarchies. - To access the \LayoutView object within, use \view. - - This class has been introduced in version 0.28. - """ - @classmethod - def new(cls, parent: QtWidgets.QWidget_Native, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> LayoutViewWidget: - r""" - @brief Creates a standalone view widget - - @param parent The parent widget in which to embed the view - @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 from \LayoutViewBase - - This constructor has been introduced in version 0.25. - It has been enhanced with the arguments in version 0.27. - """ - def __init__(self, parent: QtWidgets.QWidget_Native, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> None: - r""" - @brief Creates a standalone view widget - - @param parent The parent widget in which to embed the view - @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 from \LayoutViewBase - - This constructor has been introduced in version 0.25. - It has been enhanced with the arguments in version 0.27. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def bookmarks_frame(self) -> QtWidgets.QWidget_Native: - r""" - @brief Gets the bookmarks side widget - For details about side widgets see \layer_control_frame. - - This method has been introduced in version 0.27 - """ - def hierarchy_control_frame(self) -> QtWidgets.QWidget_Native: - r""" - @brief Gets the cell view (hierarchy view) side widget - For details about side widgets see \layer_control_frame. - - This method has been introduced in version 0.27 - """ - def layer_control_frame(self) -> QtWidgets.QWidget_Native: - r""" - @brief Gets the layer control side widget - A 'side widget' is a widget attached to the view. It does not have a parent, so you can embed it into a different context. Please note that with embedding through 'setParent' it will be destroyed when your parent widget gets destroyed. It will be lost then to the view. - - The side widget can be configured through the views configuration interface. - - This method has been introduced in version 0.27 - """ - def layer_toolbox_frame(self) -> QtWidgets.QWidget_Native: - r""" - @brief Gets the layer toolbox side widget - A 'side widget' is a widget attached to the view. It does not have a parent, so you can embed it into a different context. Please note that with embedding through 'setParent' it will be destroyed when your parent widget gets destroyed. It will be lost then to the view. - - The side widget can be configured through the views configuration interface. - - This method has been introduced in version 0.28 - """ - def libraries_frame(self) -> QtWidgets.QWidget_Native: - r""" - @brief Gets the library view side widget - For details about side widgets see \layer_control_frame. - - This method has been introduced in version 0.27 - """ - def view(self) -> LayoutView: - r""" - @brief Gets the embedded view object. - """ - -class LayoutView(LayoutViewBase): - r""" - @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. - """ - on_close: None - r""" - Getter: - @brief A event indicating that the view is about to close - - This event is triggered when the view is going to be closed entirely. - - It has been added in version 0.25. - Setter: - @brief A event indicating that the view is about to close - - This event is triggered when the view is going to be closed entirely. - - It has been added in version 0.25. - """ - on_hide: None - r""" - Getter: - @brief A event indicating that the view is going to become invisible - - It has been added in version 0.25. - Setter: - @brief A event indicating that the view is going to become invisible - - It has been added in version 0.25. - """ - on_show: None - r""" - Getter: - @brief A event indicating that the view is going to become visible - - It has been added in version 0.25. - Setter: - @brief A event indicating that the view is going to become visible - - It has been added in version 0.25. - """ - @classmethod - def current(cls) -> LayoutView: - r""" - @brief Returns the current view - The current view is the one that is shown in the current tab. Returns nil if no layout is loaded. - - This method has been introduced in version 0.23. - """ - @classmethod - def new(cls, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> LayoutView: - r""" - @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 from \LayoutViewBase - - This constructor has been introduced in version 0.25. - It has been enhanced with the arguments in version 0.27. - """ - def __init__(self, editable: Optional[bool] = ..., manager: Optional[db.Manager] = ..., options: Optional[int] = ...) -> None: - r""" - @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 from \LayoutViewBase - - This constructor has been introduced in version 0.25. - It has been enhanced with the arguments in version 0.27. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def bookmark_view(self, name: str) -> None: - r""" - @brief Bookmarks the current view under the given name - - @param name The name under which to bookmark the current state - """ - def close(self) -> None: - r""" - @brief Closes the view - - This method has been added in version 0.27. - """ - def show_l2ndb(self, l2ndb_index: int, cv_index: int) -> None: - r""" - @brief Shows a netlist database in the marker browser on a certain layout - The netlist browser is opened showing the netlist database with the index given by "l2ndb_index". - It will be attached (i.e. navigate to) the layout with the given cellview index in "cv_index". - - This method has been added in version 0.26. - """ - def show_lvsdb(self, lvsdb_index: int, cv_index: int) -> None: - r""" - @brief Shows a netlist database in the marker browser on a certain layout - The netlist browser is opened showing the netlist database with the index given by "lvsdb_index". - It will be attached (i.e. navigate to) the layout with the given cellview index in "cv_index". - - This method has been added in version 0.26. - """ - def show_rdb(self, rdb_index: int, cv_index: int) -> None: - r""" - @brief Shows a report database in the marker browser on a certain layout - The marker browser is opened showing the report database with the index given by "rdb_index". - It will be attached (i.e. navigate to) the layout with the given cellview index in "cv_index". - """ - -class BasicAnnotation: - r""" - @hide - @alias Annotation - """ - @classmethod - def new(cls) -> BasicAnnotation: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> BasicAnnotation: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> BasicAnnotation: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: BasicAnnotation) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> BasicAnnotation: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class Annotation(BasicAnnotation): - r""" - @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: ClassVar[int] - r""" - @brief This code indicates automatic alignment. - This code makes the annotation align the label the way it thinks is best. - - This constant has been introduced in version 0.25. - """ - AlignBottom: ClassVar[int] - r""" - @brief This code indicates bottom alignment. - If used in a vertical context, this alignment code makes the label aligned at the bottom side - i.e. it will appear top of the reference point. - - This constant has been introduced in version 0.25. - """ - AlignCenter: ClassVar[int] - r""" - @brief This code indicates automatic alignment. - This code makes the annotation align the label centered. When used in a horizontal context, centering is in horizontal direction. If used in a vertical context, centering is in vertical direction. - - This constant has been introduced in version 0.25. - """ - AlignDown: ClassVar[int] - r""" - @brief This code indicates left or bottom alignment, depending on the context. - This code is equivalent to \AlignLeft and \AlignBottom. - - This constant has been introduced in version 0.25. - """ - AlignLeft: ClassVar[int] - r""" - @brief This code indicates left alignment. - If used in a horizontal context, this alignment code makes the label aligned at the left side - i.e. it will appear right of the reference point. - - This constant has been introduced in version 0.25. - """ - AlignRight: ClassVar[int] - r""" - @brief This code indicates right alignment. - If used in a horizontal context, this alignment code makes the label aligned at the right side - i.e. it will appear left of the reference point. - - This constant has been introduced in version 0.25. - """ - AlignTop: ClassVar[int] - r""" - @brief This code indicates top alignment. - If used in a vertical context, this alignment code makes the label aligned at the top side - i.e. it will appear bottom of the reference point. - - This constant has been introduced in version 0.25. - """ - AlignUp: ClassVar[int] - r""" - @brief This code indicates right or top alignment, depending on the context. - This code is equivalent to \AlignRight and \AlignTop. - - This constant has been introduced in version 0.25. - """ - AngleAny: ClassVar[int] - r""" - @brief Gets the any angle code for use with the \angle_constraint method - If this value is specified for the angle constraint, all angles will be allowed. - """ - AngleDiagonal: ClassVar[int] - r""" - @brief Gets the diagonal angle code for use with the \angle_constraint method - If this value is specified for the angle constraint, only multiples of 45 degree are allowed. - """ - AngleGlobal: ClassVar[int] - r""" - @brief Gets the global angle code for use with the \angle_constraint method. - This code will tell the ruler or marker to use the angle constraint defined globally. - """ - AngleHorizontal: ClassVar[int] - r""" - @brief Gets the horizontal angle code for use with the \angle_constraint method - If this value is specified for the angle constraint, only horizontal rulers are allowed. - """ - AngleOrtho: ClassVar[int] - r""" - @brief Gets the ortho angle code for use with the \angle_constraint method - If this value is specified for the angle constraint, only multiples of 90 degree are allowed. - """ - AngleVertical: ClassVar[int] - r""" - @brief Gets the vertical angle code for use with the \angle_constraint method - If this value is specified for the angle constraint, only vertical rulers are allowed. - """ - OutlineAngle: ClassVar[int] - r""" - @brief Gets the angle measurement ruler outline code for use with the \outline method - When this outline style is specified, the ruler is drawn to indicate the angle between the first and last segment. - - This constant has been introduced in version 0.28. - """ - OutlineBox: ClassVar[int] - r""" - @brief Gets the box outline code for use with the \outline method - When this outline style is specified, a box is drawn with the corners specified by the start and end point. All box edges are drawn in the style specified with the \style attribute. - """ - OutlineDiag: ClassVar[int] - r""" - @brief Gets the diagonal output code for use with the \outline method - When this outline style is specified, a line connecting start and end points in the given style (ruler, arrow or plain line) is drawn. - """ - OutlineDiagXY: ClassVar[int] - r""" - @brief Gets the xy plus diagonal outline code for use with the \outline method - @brief outline_xy code used by the \outline method - When this outline style is specified, three lines are drawn: one horizontal from left to right and attached to the end of that a line from the bottom to the top. Another line is drawn connecting the start and end points directly. The lines are drawn in the specified style (see \style method). - """ - OutlineDiagYX: ClassVar[int] - r""" - @brief Gets the yx plus diagonal outline code for use with the \outline method - When this outline style is specified, three lines are drawn: one vertical from bottom to top and attached to the end of that a line from the left to the right. Another line is drawn connecting the start and end points directly. The lines are drawn in the specified style (see \style method). - """ - OutlineEllipse: ClassVar[int] - r""" - @brief Gets the ellipse outline code for use with the \outline method - When this outline style is specified, an ellipse is drawn with the extensions specified by the start and end point. The contour drawn as a line. - - This constant has been introduced in version 0.26. - """ - OutlineRadius: ClassVar[int] - r""" - @brief Gets the radius measurement ruler outline code for use with the \outline method - When this outline style is specified, the ruler is drawn to indicate a radius defined by at least three points of the ruler. - - This constant has been introduced in version 0.28. - """ - OutlineXY: ClassVar[int] - r""" - @brief Gets the xy outline code for use with the \outline method - When this outline style is specified, two lines are drawn: one horizontal from left to right and attached to the end of that a line from the bottom to the top. The lines are drawn in the specified style (see \style method). - """ - OutlineYX: ClassVar[int] - r""" - @brief Gets the yx outline code for use with the \outline method - When this outline style is specified, two lines are drawn: one vertical from bottom to top and attached to the end of that a line from the left to the right. The lines are drawn in the specified style (see \style method). - """ - PositionAuto: ClassVar[int] - r""" - @brief This code indicates automatic positioning. - The main label will be put either to p1 or p2, whichever the annotation considers best. - - This constant has been introduced in version 0.25. - """ - PositionCenter: ClassVar[int] - r""" - @brief This code indicates positioning of the main label at the mid point between p1 and p2. - The main label will be put to the center point. - - This constant has been introduced in version 0.25. - """ - PositionP1: ClassVar[int] - r""" - @brief This code indicates positioning of the main label at p1. - The main label will be put to p1. - - This constant has been introduced in version 0.25. - """ - PositionP2: ClassVar[int] - r""" - @brief This code indicates positioning of the main label at p2. - The main label will be put to p2. - - This constant has been introduced in version 0.25. - """ - RulerModeAutoMetric: ClassVar[int] - r""" - @brief Specifies auto-metric ruler mode for the \register_template method - In auto-metric mode, a ruler can be placed with a single click and p1/p2 will be determined from the neighborhood. - - This constant has been introduced in version 0.25 - """ - RulerModeNormal: ClassVar[int] - r""" - @brief Specifies normal ruler mode for the \register_template method - - This constant has been introduced in version 0.25 - """ - RulerModeSingleClick: ClassVar[int] - r""" - @brief Specifies single-click ruler mode for the \register_template method - In single click-mode, a ruler can be placed with a single click and p1 will be == p2. - - This constant has been introduced in version 0.25 - """ - RulerMultiSegment: ClassVar[int] - r""" - @brief Specifies multi-segment mode - In multi-segment mode, multiple segments can be created. The ruler is finished with a double click. - - This constant has been introduced in version 0.28 - """ - RulerThreeClicks: ClassVar[int] - r""" - @brief Specifies three-click ruler mode for the \register_template method - In this ruler mode, two segments are created for angle and circle radius measurements. Three mouse clicks are required. - - This constant has been introduced in version 0.28 - """ - StyleArrowBoth: ClassVar[int] - r""" - @brief Gets the both arrow ends style code for use the \style method - When this style is specified, a two-headed arrow is drawn. - """ - StyleArrowEnd: ClassVar[int] - r""" - @brief Gets the end arrow style code for use the \style method - When this style is specified, an arrow is drawn pointing from the start to the end point. - """ - StyleArrowStart: ClassVar[int] - r""" - @brief Gets the start arrow style code for use the \style method - When this style is specified, an arrow is drawn pointing from the end to the start point. - """ - StyleCrossBoth: ClassVar[int] - r""" - @brief Gets the line style code for use with the \style method - When this style is specified, a cross is drawn at both points. - - This constant has been added in version 0.26. - """ - StyleCrossEnd: ClassVar[int] - r""" - @brief Gets the line style code for use with the \style method - When this style is specified, a cross is drawn at the end point. - - This constant has been added in version 0.26. - """ - StyleCrossStart: ClassVar[int] - r""" - @brief Gets the line style code for use with the \style method - When this style is specified, a cross is drawn at the start point. - - This constant has been added in version 0.26. - """ - StyleLine: ClassVar[int] - r""" - @brief Gets the line style code for use with the \style method - When this style is specified, a plain line is drawn. - """ - StyleRuler: ClassVar[int] - r""" - @brief Gets the ruler style code for use the \style method - When this style is specified, the annotation will show a ruler with some ticks at distances indicating a decade of units and a suitable subdivision into minor ticks at intervals of 1, 2 or 5 units. - """ - angle_constraint: int - r""" - Getter: - @brief Returns the angle constraint attribute - See \angle_constraint= for a more detailed description. - Setter: - @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. + 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. + """ + class Format: + r""" + @brief Specifies the format of a macro + This enum has been introduced in version 0.27.5. + """ + MacroFormat: ClassVar[Macro.Format] + r""" + @brief The macro has macro (XML) format + """ + PlainTextFormat: ClassVar[Macro.Format] + r""" + @brief The macro has plain text format + """ + PlainTextWithHashAnnotationsFormat: ClassVar[Macro.Format] + r""" + @brief The macro has plain text format with special pseudo-comment annotations + """ + @overload + @classmethod + def new(cls, i: int) -> Macro.Format: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> Macro.Format: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: Macro.Format) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + class Interpreter: + r""" + @brief Specifies the interpreter used for executing a macro + This enum has been introduced in version 0.27.5. + """ + DSLInterpreter: ClassVar[Macro.Interpreter] + r""" + @brief A domain-specific interpreter (DSL) + """ + None_: ClassVar[Macro.Interpreter] + r""" + @brief No specific interpreter + """ + Python: ClassVar[Macro.Interpreter] + r""" + @brief The interpreter is Python + """ + Ruby: ClassVar[Macro.Interpreter] + r""" + @brief The interpreter is Ruby + """ + Text: ClassVar[Macro.Interpreter] + r""" + @brief Plain text + """ + @overload + @classmethod + def new(cls, i: int) -> Macro.Interpreter: + r""" + @brief Creates an enum from an integer value + """ + @overload + @classmethod + def new(cls, s: str) -> Macro.Interpreter: + r""" + @brief Creates an enum from a string value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer value + """ + @overload + def __eq__(self, other: object) -> bool: + r""" + @brief Compares two enums + """ + @overload + def __init__(self, i: int) -> None: + r""" + @brief Creates an enum from an integer value + """ + @overload + def __init__(self, s: str) -> None: + r""" + @brief Creates an enum from a string value + """ + @overload + def __lt__(self, other: Macro.Interpreter) -> bool: + r""" + @brief Returns true if the first enum is less (in the enum symbol order) than the second + """ + @overload + def __lt__(self, other: int) -> bool: + r""" + @brief Returns true if the enum is less (in the enum symbol order) than the integer value + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares an enum with an integer for inequality + """ + @overload + def __ne__(self, other: object) -> bool: + r""" + @brief Compares two enums for inequality + """ + def __repr__(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def __str__(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + def inspect(self) -> str: + r""" + @brief Converts an enum to a visual string + """ + def to_i(self) -> int: + r""" + @brief Gets the integer value from the enum + """ + def to_s(self) -> str: + r""" + @brief Gets the symbolic string from an enum + """ + DSLInterpreter: ClassVar[Macro.Interpreter] + r""" + @brief A domain-specific interpreter (DSL) + """ + MacroFormat: ClassVar[Macro.Format] + r""" + @brief The macro has macro (XML) format + """ + None_: ClassVar[Macro.Interpreter] + r""" + @brief No specific interpreter + """ + PlainTextFormat: ClassVar[Macro.Format] + r""" + @brief The macro has plain text format + """ + PlainTextWithHashAnnotationsFormat: ClassVar[Macro.Format] + r""" + @brief The macro has plain text format with special pseudo-comment annotations + """ + Python: ClassVar[Macro.Interpreter] + r""" + @brief The interpreter is Python + """ + Ruby: ClassVar[Macro.Interpreter] + r""" + @brief The interpreter is Ruby + """ + Text: ClassVar[Macro.Interpreter] + r""" + @brief Plain text """ category: str r""" Getter: - @brief Gets the category string - See \category= for details. + @brief Gets the category tags - This method has been introduced in version 0.25 + 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. Setter: - @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 + @brief Sets the category tags string + See \category for details. """ - fmt: str + description: str r""" Getter: - @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 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". Setter: - @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. + @brief Sets the description text + @param description The description text. + See \description for details. """ - fmt_x: str + doc: str r""" Getter: - @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 Gets the macro's documentation string + + This method has been introduced in version 0.27.5. + Setter: - @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. + @brief Sets the macro's documentation string + + This method has been introduced in version 0.27.5. """ - fmt_y: str + dsl_interpreter: str r""" Getter: - @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 Gets the macro's DSL interpreter name (if interpreter is DSLInterpreter) + + This method has been introduced in version 0.27.5. + Setter: - @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. + @brief Sets the macro's DSL interpreter name (if interpreter is DSLInterpreter) + + This method has been introduced in version 0.27.5. """ - main_position: int + epilog: str r""" Getter: - @brief Gets the position of the main label - See \main_position= for details. + @brief Gets the epilog code - This method has been introduced in version 0.25 + The epilog is executed after the actual code is executed. Interpretation depends on the implementation of the DSL interpreter for DSL macros. Setter: - @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 + @brief Sets the epilog + See \epilog for details. """ - main_xalign: int + format: Macro.Format r""" Getter: - @brief Gets the horizontal alignment type of the main label - See \main_xalign= for details. + @brief Gets the macro's storage format + + This method has been introduced in version 0.27.5. - This method has been introduced in version 0.25 Setter: - @brief Sets the horizontal alignment type of the main label - This method accepts one of the Align... constants. + @brief Sets the macro's storage format - This method has been introduced in version 0.25 + This method has been introduced in version 0.27.5. """ - main_yalign: int + group_name: str r""" Getter: - @brief Gets the vertical alignment type of the main label - See \main_yalign= for details. + @brief Gets the menu group name - This method has been introduced in version 0.25 + 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. Setter: - @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 + @brief Sets the menu group name + See \group_name for details. """ - outline: int + interpreter: Macro.Interpreter r""" Getter: - @brief Returns the outline style of the annotation object + @brief Gets the macro's interpreter + + This method has been introduced in version 0.27.5. Setter: - @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. + @brief Sets the macro's interpreter + + This method has been introduced in version 0.27.5. """ - p1: db.DPoint + is_autorun: bool r""" Getter: - @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. + @brief Gets a flag indicating whether the macro is automatically executed on startup - 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 + This method has been introduced in version 0.27.5. Setter: - @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. + @brief Sets a flag indicating whether the macro is automatically executed on startup - This method is provided for backward compatibility. Starting with version 0.28, rulers can be multi-segmented. Use \points= to specify the ruler segments. + This method has been introduced in version 0.27.5. """ - p2: db.DPoint + is_autorun_early: bool r""" Getter: - @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. + @brief Gets a flag indicating whether the macro is automatically executed early on startup - 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 + This method has been introduced in version 0.27.5. Setter: - @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. + @brief Sets a flag indicating whether the macro is automatically executed early on startup - This method is provided for backward compatibility. Starting with version 0.28, rulers can be multi-segmented. Use \points= to specify the ruler segments. + This method has been introduced in version 0.27.5. """ - points: List[db.DPoint] + menu_path: str r""" Getter: - @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. + @brief Gets the menu path - 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 + If a menu path is specified and \show_in_menu? is true, the macro will appear in the menu at the specified position. Setter: - @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. + @brief Sets the menu path + See \menu_path for details. """ - snap: bool + prolog: str r""" Getter: - @brief Returns the 'snap to objects' attribute + @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. Setter: - @brief Sets the 'snap to objects' attribute - If this attribute is set to true, the ruler or marker snaps to other objects when moved. + @brief Sets the prolog + See \prolog for details. """ - style: int + shortcut: str r""" Getter: - @brief Returns the style of the annotation object + @brief Gets the macro's keyboard shortcut + + This method has been introduced in version 0.27.5. Setter: - @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. + @brief Sets the macro's keyboard shortcut + + This method has been introduced in version 0.27.5. """ - xlabel_xalign: int + show_in_menu: bool r""" Getter: - @brief Gets the horizontal alignment type of the x axis label - See \xlabel_xalign= for details. + @brief Gets a value indicating whether the macro shall be shown in the menu - This method has been introduced in version 0.25 Setter: - @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 + @brief Sets a value indicating whether the macro shall be shown in the menu """ - xlabel_yalign: int + text: str r""" Getter: - @brief Gets the vertical alignment type of the x axis label - See \xlabel_yalign= for details. + @brief Gets the macro text - This method has been introduced in version 0.25 + The text is the code executed by the macro interpreter. Depending on the DSL interpreter, the text can be any kind of code. Setter: - @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 + @brief Sets the macro text + See \text for details. """ - ylabel_xalign: int + version: str r""" Getter: - @brief Gets the horizontal alignment type of the y axis label - See \ylabel_xalign= for details. + @brief Gets the macro's version + + This method has been introduced in version 0.27.5. - This method has been introduced in version 0.25 Setter: - @brief Sets the horizontal alignment type of the y axis label - This method accepts one of the Align... constants. + @brief Sets the macro's version - This method has been introduced in version 0.25 - """ - ylabel_yalign: int - r""" - Getter: - @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 - Setter: - @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 + This method has been introduced in version 0.27.5. """ @classmethod - def from_s(cls, s: str) -> Annotation: + def macro_by_path(cls, path: str) -> Macro: r""" - @brief Creates a ruler from a string representation - This function creates a ruler from the string returned by \to_s. + @brief Finds the macro by installation path - This method was introduced in version 0.28. + Returns nil if no macro with this path can be found. + + This method has been added in version 0.26. """ @classmethod - def register_template(cls, annotation: BasicAnnotation, title: str, mode: Optional[int] = ...) -> None: + def new(cls, path: str) -> Macro: r""" - @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) + @brief Loads the macro from the given file path - 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. + This constructor has been introduced in version 0.27.5. """ @classmethod - def unregister_templates(cls, category: str) -> None: + def real_line(cls, path: str, line: int) -> int: r""" - @brief Unregisters the template or templates with the given category string globally + @brief Gets the real line number for an include-encoded path and line number - This method will remove all templates with the given category string. If the category string is empty, all templates are removed. + 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 - NOTE: this setting is persisted and the the application configuration is updated. + @code + # Ruby + real_line = RBA::Macro::real_line(__FILE__, __LINE__) - This method has been added in version 0.28. + # 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. """ - def __eq__(self, other: object) -> bool: + @classmethod + def real_path(cls, path: str, line: int) -> str: r""" - @brief Equality operator + @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. """ - def __ne__(self, other: object) -> bool: + def __init__(self, path: str) -> None: r""" - @brief Inequality operator - """ - def __str__(self) -> str: - r""" - @brief Returns the string representation of the ruler - This method was introduced in version 0.19. - """ - def _assign(self, other: BasicAnnotation) -> None: - r""" - @brief Assigns another object to self + @brief Loads the macro from the given file path + + This constructor has been introduced in version 0.27.5. """ def _create(self) -> None: r""" @@ -9875,10 +8966,6 @@ class Annotation(BasicAnnotation): 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. """ - def _dup(self) -> Annotation: - r""" - @brief Creates a copy of self - """ def _is_const_object(self) -> bool: r""" @brief Returns a value indicating whether the reference is a const reference @@ -9899,758 +8986,354 @@ class Annotation(BasicAnnotation): Usually it's not required to call this method. It has been introduced in version 0.24. """ - def box(self) -> db.DBox: + def create(self) -> None: r""" - @brief Gets the bounding box of the object (not including text) - @return The bounding box + @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. """ - def delete(self) -> None: + def destroy(self) -> None: r""" - @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. + @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. """ - def detach(self) -> None: + def destroyed(self) -> bool: r""" - @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. + @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. + """ + def interpreter_name(self) -> str: + r""" + @brief Gets the macro interpreter name + This is the string version of \interpreter. - This method has been introduced in version 0.25. + This method has been introduced in version 0.27.5. """ - def id(self) -> int: + def is_const_object(self) -> bool: r""" - @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). + @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. + """ + def name(self) -> str: + r""" + @brief Gets the name of the macro - This method was introduced in version 0.24. + This attribute has been added in version 0.25. """ - def is_valid(self) -> bool: + def path(self) -> str: r""" - @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. + @brief Gets the path of the macro - This method was introduced in version 0.25. + 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. """ - def seg_p1(self, segment_index: int) -> db.DPoint: + def run(self) -> int: r""" - @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. + @brief Executes the macro - This method has been introduced in version 0.28. + This method has been introduced in version 0.27.5. """ - def seg_p2(self, segment_index: int) -> db.DPoint: + def save_to(self, path: str) -> None: r""" - @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. + @brief Saves the macro to the given file - This method has been introduced in version 0.28. + This method has been introduced in version 0.27.5. """ - def segments(self) -> int: + def sync_properties_with_text(self) -> None: r""" - @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. + @brief Synchronizes the macro properties with the text - This method has been introduced in version 0.28. - """ - def text(self, index: Optional[int] = ...) -> str: - r""" - @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. - """ - def text_x(self, index: Optional[int] = ...) -> str: - r""" - @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. - """ - def text_y(self, index: Optional[int] = ...) -> str: - r""" - @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. - """ - def to_s(self) -> str: - r""" - @brief Returns the string representation of the ruler - This method was introduced in version 0.19. - """ - @overload - def transformed(self, t: db.DCplxTrans) -> Annotation: - r""" - @brief Transforms the ruler or marker with the given complex transformation - @param t The magnifying transformation to apply - @return The transformed object + This method performs the reverse process of \sync_text_with_properties. - Starting with version 0.25, all overloads all available as 'transform'. + This method has been introduced in version 0.27.5. """ - @overload - def transformed(self, t: db.DTrans) -> Annotation: + def sync_text_with_properties(self) -> None: r""" - @brief Transforms the ruler or marker with the given simple transformation - @param t The transformation to apply - @return The transformed object - """ - @overload - def transformed(self, t: db.ICplxTrans) -> Annotation: - r""" - @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) + @brief Synchronizes the macro text with the properties - This method has been introduced in version 0.18. + 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. - Starting with version 0.25, all overloads all available as 'transform'. - """ - @overload - def transformed_cplx(self, t: db.DCplxTrans) -> Annotation: - r""" - @brief Transforms the ruler or marker with the given complex transformation - @param t The magnifying transformation to apply - @return The transformed object - - Starting with version 0.25, all overloads all available as 'transform'. - """ - @overload - def transformed_cplx(self, t: db.ICplxTrans) -> Annotation: - r""" - @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'. + This method has been introduced in version 0.27.5. """ -class ObjectInstPath: +class MacroExecutionContext: r""" - @brief A class describing a selected shape or instance + @brief Support for various debugger features - 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. + 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. + """ + @classmethod + def ignore_next_exception(cls) -> None: + r""" + @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. + """ + @classmethod + def new(cls) -> MacroExecutionContext: + r""" + @brief Creates a new object of this class + """ + @classmethod + def remove_debugger_scope(cls) -> None: + r""" + @brief Removes a debugger scope previously set with \set_debugger_scope + """ + @classmethod + def set_debugger_scope(cls, filename: str) -> None: + r""" + @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. + """ + def __copy__(self) -> MacroExecutionContext: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> MacroExecutionContext: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - 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. + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - The \cv_index attribute specifies the cellview the selection applies to. Use \LayoutView#cellview to obtain the \CellView object from the index. + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: MacroExecutionContext) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> MacroExecutionContext: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ - 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. +class MacroInterpreter: + r""" + @brief A custom interpreter for a DSL (domain specific language) - 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: + 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 - mw = RBA::Application::instance::main_window - view = mw.current_view + class SimpleExecutable < RBA::Excutable - 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 + # Constructor + def initialize(macro) + \@macro = macro end - view.object_selection = sel + # Implements the execute method + def execute + eval(\@macro.text, nil, \@macro.path) + nil + end - ensure - view.commit 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 - 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. + 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. """ - cv_index: int + MacroFormat: ClassVar[Macro.Format] r""" - Getter: - @brief Gets the cellview index that describes which cell view the shape or instance is located in - - Setter: - @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. + @brief The macro has macro (XML) format """ - layer: Any + NoDebugger: ClassVar[Macro.Interpreter] r""" - Getter: - @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. - Setter: - @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. + @brief Indicates no debugging for \debugger_scheme """ - path: List[db.InstElement] + PlainTextFormat: ClassVar[Macro.Format] r""" - Getter: - @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. - - Setter: - @brief Sets the instantiation path - - This method was introduced in version 0.26. + @brief The macro has plain text format """ - seq: int + PlainTextWithHashAnnotationsFormat: ClassVar[Macro.Format] r""" - Getter: - @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). - - Setter: - @brief Sets the sequence number - - See \seq for a description of this property. - - This method was introduced in version 0.24. + @brief The macro has plain text format with special pseudo-comment annotations """ - shape: Any + RubyDebugger: ClassVar[Macro.Interpreter] r""" - Getter: - @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. - Setter: - @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. + @brief Indicates Ruby debugger for \debugger_scheme """ - top: int - r""" - Getter: - @brief Gets the cell index of the top cell the selection applies to + @property + def debugger_scheme(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the debugger scheme (which debugger to use for the DSL macro) - 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 not instantiation path is set. + The value can be one of the constants \RubyDebugger or \NoDebugger. - This method has been introduced in version 0.24. - Setter: - @brief Sets the cell index of the top cell the selection applies to + Use this attribute setter in the initializer before registering the interpreter. - See \top_cell for a description of this property. + 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. + """ + @property + def description(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets a description string - This method has been introduced in version 0.24. - """ + 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. + """ + @property + def storage_scheme(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @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. + """ + @property + def suffix(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @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. + """ + @property + def supports_include_expansion(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @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. + """ + @property + def syntax_scheme(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @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/.xml". + + 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. + """ @classmethod - def new(cls, si: db.RecursiveShapeIterator, cv_index: int) -> ObjectInstPath: - r""" - @brief Creates a new path object from a \RecursiveShapeIterator - Use this constructor to quickly turn a recursive shape iterator delivery into a shape selection. - """ - def __copy__(self) -> ObjectInstPath: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> ObjectInstPath: - r""" - @brief Creates a copy of self - """ - def __eq__(self, b: object) -> bool: - r""" - @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. - """ - def __init__(self, si: db.RecursiveShapeIterator, cv_index: int) -> None: - r""" - @brief Creates a new path object from a \RecursiveShapeIterator - Use this constructor to quickly turn a recursive shape iterator delivery into a shape selection. - """ - def __lt__(self, b: ObjectInstPath) -> bool: - r""" - @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. - """ - def __ne__(self, b: object) -> bool: - r""" - @brief Inequality of two ObjectInstPath objects - See the comments on the == operator. - - This method has been introduced with version 0.24. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def append_path(self, element: db.InstElement) -> None: - r""" - @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. - """ - def assign(self, other: ObjectInstPath) -> None: - r""" - @brief Assigns another object to self - """ - def cell_index(self) -> int: - r""" - @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. - """ - def clear_path(self) -> None: - r""" - @brief Clears the instantiation path - - This method was introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dtrans(self) -> db.DCplxTrans: - r""" - @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. - """ - def dup(self) -> ObjectInstPath: - r""" - @brief Creates a copy of self - """ - def each_inst(self) -> Iterator[db.InstElement]: - r""" - @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. - """ - def inst(self) -> db.Instance: - r""" - @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. - """ - def is_cell_inst(self) -> bool: - r""" - @brief True, if this selection represents a cell instance - - If this attribute is true, the shape reference and layer are not valid. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_valid(self, view: LayoutViewBase) -> bool: - r""" - @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. - """ - def layout(self) -> db.Layout: - r""" - @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. - """ - def path_length(self) -> int: - r""" - @brief Returns the length of the path (number of elements delivered by \each_inst) - - This method has been added in version 0.16. - """ - def path_nth(self, n: int) -> db.InstElement: - r""" - @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. - """ - def source(self) -> int: - r""" - @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. - """ - def source_dtrans(self) -> db.DCplxTrans: - r""" - @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. - """ - def source_trans(self) -> db.ICplxTrans: - r""" - @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. - """ - def trans(self) -> db.ICplxTrans: - r""" - @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. - """ - -class ImageDataMapping: - r""" - @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. - """ - blue_gain: float - r""" - Getter: - @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. - - Setter: - @brief Set the blue_gain - See \blue_gain for a description of this property. - """ - brightness: float - r""" - Getter: - @brief The brightness value - - The brightness is a double value between roughly -1.0 and 1.0. - Neutral (original) brightness is 0.0. - - Setter: - @brief Set the brightness - See \brightness for a description of this property. - """ - contrast: float - r""" - Getter: - @brief The contrast value - - The contrast is a double value between roughly -1.0 and 1.0. - Neutral (original) contrast is 0.0. - - Setter: - @brief Set the contrast - See \contrast for a description of this property. - """ - gamma: float - r""" - Getter: - @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. - - Setter: - @brief Set the gamma - See \gamma for a description of this property. - """ - green_gain: float - r""" - Getter: - @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. - - Setter: - @brief Set the green_gain - See \green_gain for a description of this property. - """ - red_gain: float - r""" - Getter: - @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. - - Setter: - @brief Set the red_gain - See \red_gain for a description of this property. - """ - @classmethod - def new(cls) -> ImageDataMapping: - r""" - @brief Create a new data mapping object with default settings - """ - def __copy__(self) -> ImageDataMapping: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> ImageDataMapping: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Create a new data mapping object with default settings - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - @overload - def add_colormap_entry(self, value: float, color: int) -> None: - r""" - @brief Add a colormap entry for this data mapping object. - @param value The value at which the given color should be applied. - @param color The color to apply (a 32 bit RGB value). - - This settings establishes a color mapping for a given value in the monochrome channel. The color 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. - """ - @overload - def add_colormap_entry(self, value: float, lcolor: int, rcolor: int) -> None: - r""" - @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. - """ - def assign(self, other: ImageDataMapping) -> None: - r""" - @brief Assigns another object to self - """ - def clear_colormap(self) -> None: - r""" - @brief The the color map of this data mapping object. - """ - def colormap_color(self, n: int) -> int: - r""" - @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. - """ - def colormap_lcolor(self, n: int) -> int: - r""" - @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. - """ - def colormap_rcolor(self, n: int) -> int: - r""" - @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. - """ - def colormap_value(self, n: int) -> float: - r""" - @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). - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> ImageDataMapping: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def num_colormap_entries(self) -> int: - r""" - @brief Returns the current number of color map entries. - @return The number of entries. - """ - -class BasicImage: - r""" - @hide - @alias Image - """ - @classmethod - def new(cls) -> BasicImage: + def new(cls) -> MacroInterpreter: r""" @brief Creates a new object of this class """ - def __copy__(self) -> BasicImage: + def __copy__(self) -> MacroInterpreter: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> BasicImage: + def __deepcopy__(self) -> MacroInterpreter: r""" @brief Creates a copy of self """ @@ -10695,7 +9378,7 @@ class BasicImage: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: BasicImage) -> None: + def assign(self, other: MacroInterpreter) -> None: r""" @brief Assigns another object to self """ @@ -10704,6 +9387,15 @@ class BasicImage: @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. """ + def create_template(self, url: str) -> Macro: + r""" + @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. + """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -10716,7 +9408,7 @@ class BasicImage: 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. """ - def dup(self) -> BasicImage: + def dup(self) -> MacroInterpreter: r""" @brief Creates a copy of self """ @@ -10726,851 +9418,15 @@ class BasicImage: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - -class Image(BasicImage): - r""" - @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. - """ - data_mapping: ImageDataMapping - r""" - Getter: - @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. - - Setter: - @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: List[bool] - r""" - Getter: - @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. - - Setter: - @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: db.Matrix3d - r""" - Getter: - @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. - Setter: - @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: float - r""" - Getter: - @brief Sets the maximum value - - See the \max_value method for the description of the maximum value property. - - Setter: - @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: float - r""" - Getter: - @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. - - Setter: - @brief Sets the minimum value - - See \min_value for the description of the minimum value property. - """ - pixel_height: float - r""" - Getter: - @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. - Setter: - @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: float - r""" - Getter: - @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. - Setter: - @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: db.DCplxTrans - r""" - Getter: - @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. - Setter: - @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: bool - r""" - Getter: - @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. - - Setter: - @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: int - r""" - Getter: - @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. - Setter: - @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. - """ - @classmethod - def from_s(cls, s: str) -> Image: - r""" - @brief Creates an image from the string returned by \to_s. - This method has been introduced in version 0.27. - """ - @overload - @classmethod - def new(cls) -> Image: - r""" - @brief Create a new image with the default attributes - This will create an empty image without data and no particular pixel width or related. - Use the \read_file or \set_data methods to set image properties and pixel values. - """ - @overload - @classmethod - def new(cls, filename: str) -> Image: - r""" - @brief Constructor from a image file - - This constructor creates an image object from a file (which can have any format supported by Qt) and - a unit transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel - will have a size of 1 (micron). - - @param filename The path to the image file to load. - """ - @overload - @classmethod - def new(cls, filename: str, trans: db.DCplxTrans) -> Image: - r""" - @brief Constructor from a image file - - This constructor creates an image object from a file (which can have any format supported by Qt) and - a transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel - will have a size of 1. The transformation describes how to transform this image into micron space. - - @param filename The path to the image file to load. - @param trans The transformation to apply to the image when displaying it. - """ - @overload - @classmethod - def new(cls, w: int, h: int, data: Sequence[float]) -> Image: - r""" - @brief Constructor for a monochrome 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. 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 d The data (see method description) - """ - @overload - @classmethod - def new(cls, w: int, h: int, trans: db.DCplxTrans, data: Sequence[float]) -> Image: - r""" - @brief Constructor for a monochrome 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. 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 d The data (see method description) - """ - @overload - @classmethod - def new(cls, w: int, h: int, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> Image: - r""" - @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 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 - """ - @overload - @classmethod - def new(cls, w: int, h: int, trans: db.DCplxTrans, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> Image: + def register(self, name: str) -> None: r""" - @brief Constructor for a color image with the given pixel values + @brief Registers the macro interpreter + @param name The interpreter name. This is an arbitrary string which should be unique. - 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 - """ - @classmethod - def read(cls, path: str) -> Image: - r""" - @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. - """ - @overload - def __init__(self) -> None: - r""" - @brief Create a new image with the default attributes - This will create an empty image without data and no particular pixel width or related. - Use the \read_file or \set_data methods to set image properties and pixel values. - """ - @overload - def __init__(self, filename: str) -> None: - r""" - @brief Constructor from a image file - - This constructor creates an image object from a file (which can have any format supported by Qt) and - a unit transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel - will have a size of 1 (micron). - - @param filename The path to the image file to load. - """ - @overload - def __init__(self, filename: str, trans: db.DCplxTrans) -> None: - r""" - @brief Constructor from a image file - - This constructor creates an image object from a file (which can have any format supported by Qt) and - a transformation. The image will originally be put to position 0,0 (lower left corner) and each pixel - will have a size of 1. The transformation describes how to transform this image into micron space. - - @param filename The path to the image file to load. - @param trans The transformation to apply to the image when displaying it. - """ - @overload - def __init__(self, w: int, h: int, data: Sequence[float]) -> None: - r""" - @brief Constructor for a monochrome 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. 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 d The data (see method description) - """ - @overload - def __init__(self, w: int, h: int, trans: db.DCplxTrans, data: Sequence[float]) -> None: - r""" - @brief Constructor for a monochrome 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. 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 d The data (see method description) - """ - @overload - def __init__(self, w: int, h: int, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> None: - r""" - @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 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 - """ - @overload - def __init__(self, w: int, h: int, trans: db.DCplxTrans, red: Sequence[float], green: Sequence[float], blue: Sequence[float]) -> None: - r""" - @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 - """ - def __str__(self) -> str: - r""" - @brief Converts the image to a string - The string returned can be used to create an image object using \from_s. - @return The string - """ - def _assign(self, other: BasicImage) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> Image: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def box(self) -> db.DBox: - r""" - @brief Gets the bounding box of the image - @return The bounding box - """ - def clear(self) -> None: - r""" - @brief Clears the image data (sets to 0 or black). - This method has been introduced in version 0.27. - """ - def data(self, channel: Optional[int] = ...) -> List[float]: - r""" - @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. - """ - def delete(self) -> None: - r""" - @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. - """ - def detach(self) -> None: - r""" - @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. - """ - def filename(self) -> str: - r""" - @brief Gets the name of the file loaded of an empty string if not file is loaded - @return The file name (path) - """ - @overload - def get_pixel(self, x: int, y: int) -> float: - r""" - @brief Gets one pixel (monochrome only) - - @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) - - If x or y value exceeds the image bounds, this method - returns 0.0. This method is valid for monochrome images only. For color images it will return 0.0 always. - Use \is_color? to decide whether the image is a color image or monochrome one. - """ - @overload - def get_pixel(self, x: int, y: int, component: int) -> float: - r""" - @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. - """ - def height(self) -> int: - r""" - @brief Gets the height of the image in pixels - @return The height in pixels - """ - def id(self) -> int: - r""" - @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. - """ - def is_color(self) -> bool: - r""" - @brief Returns true, if the image is a color image - @return True, if the image is a color image - """ - def is_empty(self) -> bool: - r""" - @brief Returns true, if the image does not contain any data (i.e. is default constructed) - @return True, if the image is empty - """ - def is_valid(self) -> bool: - r""" - @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. - """ - def is_visible(self) -> bool: - r""" - @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. - """ - def mask(self, x: int, y: int) -> bool: - r""" - @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. - """ - @overload - def set_data(self, w: int, h: int, d: Sequence[float]) -> None: - r""" - @brief Writes the image data field (monochrome) - @param w The width of the new data - @param h The height of the new data - @param d The (monochrome) data to load into the image - - See the constructor description for the data organisation in that field. - """ - @overload - def set_data(self, w: int, h: int, r: Sequence[float], g: Sequence[float], b: Sequence[float]) -> None: - r""" - @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. - """ - def set_mask(self, x: int, y: int, m: bool) -> None: - r""" - @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. - """ - @overload - def set_pixel(self, x: int, y: int, v: float) -> None: - r""" - @brief Sets one pixel (monochrome) - - @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 v The value - - If the component index, x or y value exceeds the image bounds of the image is a color image, - this method does nothing. - """ - @overload - def set_pixel(self, x: int, y: int, r: float, g: float, b: float) -> None: - r""" - @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. - """ - def to_s(self) -> str: - r""" - @brief Converts the image to a string - The string returned can be used to create an image object using \from_s. - @return The string - """ - @overload - def transformed(self, t: db.DCplxTrans) -> Image: - r""" - @brief Transforms the image with the given complex transformation - @param t The magnifying transformation to apply - @return The transformed object - """ - @overload - def transformed(self, t: db.DTrans) -> Image: - r""" - @brief Transforms the image with the given simple transformation - @param t The transformation to apply - @return The transformed object - """ - @overload - def transformed(self, t: db.Matrix3d) -> Image: - r""" - @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. - """ - def transformed_cplx(self, t: db.DCplxTrans) -> Image: - r""" - @brief Transforms the image with the given complex transformation - @param t The magnifying transformation to apply - @return The transformed object - """ - def transformed_matrix(self, t: db.Matrix3d) -> Image: - r""" - @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. - """ - def update(self) -> None: - r""" - @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. - """ - def width(self) -> int: - r""" - @brief Gets the width of the image in pixels - @return The width in pixels - """ - def write(self, path: str) -> None: - r""" - @brief Saves the image to KLayout's image format (.lyimg) - This method has been introduced in version 0.27. - """ - -class HelpDialog(QDialog_Native): - r""" - @brief The help dialog - - This class makes the help dialog available as an individual object. - - This class has been added in version 0.25. - """ - @overload - @classmethod - def new(cls, modal: bool) -> HelpDialog: - r""" - @brief Creates a new help dialog - If the modal flag is true, the dialog will be shown as a modal window. - """ - @overload - @classmethod - def new(cls, parent: QtWidgets.QWidget_Native, modal: bool) -> HelpDialog: - r""" - @brief Creates a new help dialog - If the modal flag is true, the dialog will be shown as a modal window. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def load(self, url: str) -> None: - r""" - @brief Loads the specified URL - This method will call the page with the given URL. - """ - def search(self, topic: str) -> None: - r""" - @brief Issues a search on the specified topic - This method will call the search page with the given topic. - """ - -class HelpSource(BrowserSource_Native): - r""" - @brief A BrowserSource implementation delivering the help text for the help dialog - This class can be used together with a \BrowserPanel or \BrowserDialog object to implement custom help systems. - - The basic URL's served by this class are: "int:/index.xml" for the index page and "int:/search.xml?string=..." for the search topic retrieval. - - This class has been added in version 0.25. - """ - @classmethod - def create_index_file(cls, path: str) -> None: - r""" - @brief Reserved internal use - """ - @classmethod - def plain(cls) -> HelpSource: - r""" - @brief Reserved for internal use - """ - def _assign(self, other: BrowserSource_Native) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> HelpSource: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def get_dom(self, path: str) -> QtXml.QDomDocument: - r""" - @brief Reserved for internal use - """ - def get_option(self, key: str) -> Any: - r""" - @brief Reserved for internal use - """ - def parent_of(self, path: str) -> str: - r""" - @brief Reserved internal use - """ - def scan(self) -> None: - r""" - @brief Reserved internal use - """ - def set_option(self, key: str, value: Any) -> None: - r""" - @brief Reserved for internal use - """ - def title_for(self, path: str) -> str: - r""" - @brief Reserved internal use - """ - def urls(self) -> List[str]: - r""" - @brief Reserved for internal use + 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. """ -class MainWindow(QMainWindow_Native): +class MainWindow: r""" @brief The main application window and central controller object @@ -11593,6 +9449,16 @@ class MainWindow(QMainWindow_Native): This method was renamed from select_view to current_view_index= in version 0.25. The old name is still available, but deprecated. """ + @property + def synchronous(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Puts the main window into synchronous mode + + @param sync_mode 'true' if the application should behave synchronously + + In synchronous mode, an application is allowed to block on redraw. While redrawing, no user interactions are possible. Although this is not desirable for smooth operation, it can be beneficial for test or automation purposes, i.e. if a screenshot needs to be produced once the application has finished drawing. + """ initial_technology: str r""" Getter: @@ -11660,16 +9526,6 @@ class MainWindow(QMainWindow_Native): Before version 0.25 this event was based on the observer pattern obsolete now. The corresponding methods (add_new_view_observer/remove_new_view_observer) have been removed in 0.25. """ - @property - def synchronous(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Puts the main window into synchronous mode - - @param sync_mode 'true' if the application should behave synchronously - - In synchronous mode, an application is allowed to block on redraw. While redrawing, no user interactions are possible. Although this is not desirable for smooth operation, it can be beneficial for test or automation purposes, i.e. if a screenshot needs to be produced once the application has finished drawing. - """ @classmethod def instance(cls) -> MainWindow: r""" @@ -11685,6 +9541,15 @@ class MainWindow(QMainWindow_Native): This method has been introduced in version 0.27. """ + @classmethod + def new(cls) -> MainWindow: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ def _create(self) -> None: r""" @brief Ensures the C++ object is created @@ -12150,12 +10015,6 @@ class MainWindow(QMainWindow_Native): This method is deprecated in version 0.27. Use "call_menu('cm_navigator_close')" instead. """ - def cm_navigator_freeze(self) -> None: - r""" - @brief 'cm_navigator_freeze' action. - This method is deprecated in version 0.27. - Use "call_menu('cm_navigator_freeze')" instead. - """ def cm_new_cell(self) -> None: r""" @brief 'cm_new_cell' action. @@ -12348,6 +10207,12 @@ class MainWindow(QMainWindow_Native): This method is deprecated in version 0.27. Use "call_menu('cm_screenshot')" instead. """ + def cm_screenshot_to_clipboard(self) -> None: + r""" + @brief 'cm_screenshot_to_clipboard' action. + This method is deprecated in version 0.27. + Use "call_menu('cm_screenshot_to_clipboard')" instead. + """ def cm_sel_flip_x(self) -> None: r""" @brief 'cm_sel_flip_x' action. @@ -12481,6 +10346,11 @@ class MainWindow(QMainWindow_Native): This method has been introduced in version 0.27. """ + def create(self) -> None: + r""" + @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. + """ @overload def create_layout(self, mode: int) -> CellView: r""" @@ -12528,6 +10398,18 @@ class MainWindow(QMainWindow_Native): @return A reference to a \LayoutView object representing the current view. """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ def dispatcher(self) -> Dispatcher: r""" @brief Gets the dispatcher interface (the plugin root configuration space) @@ -12610,6 +10492,12 @@ class MainWindow(QMainWindow_Native): This method has been added in version 0.25. """ + def is_const_object(self) -> bool: + r""" + @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. + """ @overload def load_layout(self, filename: str, mode: Optional[int] = ...) -> CellView: r""" @@ -12643,24 +10531,6 @@ class MainWindow(QMainWindow_Native): Starting with version 0.25, this method returns a cellview object that can be modified to configure the cellview. The 'mode' argument has been made optional in version 0.28. """ @overload - def load_layout(self, filename: str, tech: str, mode: Optional[int] = ...) -> CellView: - r""" - @brief Loads a new layout and associate it with the given technology - - @param filename The name of the file to load - @param tech The name of the technology to use for that layout. - @param mode An integer value of 0, 1 or 2 that determines how the file is loaded - @return The cellview into which the layout was loaded - - Loads the given file into the current view, replacing the current layouts (mode 0), into a new view (mode 1) or adding the layout to the current view (mode 2). - In mode 1, the new view is made the current one. - - If the technology name is not a valid technology name, the default technology will be used. The 'mode' argument has been made optional in version 0.28. - - This version was introduced in version 0.22. - Starting with version 0.25, this method returns a cellview object that can be modified to configure the cellview. - """ - @overload def load_layout(self, filename: str, options: db.LoadLayoutOptions, tech: str, mode: Optional[int] = ...) -> CellView: r""" @brief Loads a new layout with the given options and associate it with the given technology @@ -12679,6 +10549,24 @@ class MainWindow(QMainWindow_Native): This version was introduced in version 0.22. Starting with version 0.25, this method returns a cellview object that can be modified to configure the cellview. The 'mode' argument has been made optional in version 0.28. """ + @overload + def load_layout(self, filename: str, tech: str, mode: Optional[int] = ...) -> CellView: + r""" + @brief Loads a new layout and associate it with the given technology + + @param filename The name of the file to load + @param tech The name of the technology to use for that layout. + @param mode An integer value of 0, 1 or 2 that determines how the file is loaded + @return The cellview into which the layout was loaded + + Loads the given file into the current view, replacing the current layouts (mode 0), into a new view (mode 1) or adding the layout to the current view (mode 2). + In mode 1, the new view is made the current one. + + If the technology name is not a valid technology name, the default technology will be used. The 'mode' argument has been made optional in version 0.28. + + This version was introduced in version 0.22. + Starting with version 0.25, this method returns a cellview object that can be modified to configure the cellview. + """ def manager(self) -> db.Manager: r""" @brief Gets the \Manager object of this window @@ -12831,3 +10719,1923 @@ class MainWindow(QMainWindow_Native): This method has been introduced in version 0.27. """ +class Marker: + r""" + @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. + """ + color: int + r""" + Getter: + @brief Gets the color of the marker + This value is valid only if \has_color? is true. + Setter: + @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: bool + r""" + Getter: + @brief Gets a value indicating whether the marker can be hidden + See \dismissable= for a description of this predicate. + Setter: + @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: int + r""" + Getter: + @brief Gets the stipple pattern index + See \dither_pattern= for a description of the stipple pattern index. + Setter: + @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: int + r""" + Getter: + @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. + + Setter: + @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: int + r""" + Getter: + @brief Gets the halo flag + See \halo= for a description of the halo flag. + Setter: + @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: int + r""" + Getter: + @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. + Setter: + @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: int + r""" + Getter: + @brief Gets the line width of the marker + See \line_width= for a description of the line width. + Setter: + @brief Sets the line width of the marker + This is the width of the line drawn for the outline of the marker. + """ + vertex_size: int + r""" + Getter: + @brief Gets the vertex size of the marker + See \vertex_size= for a description. + Setter: + @brief Sets the vertex size of the marker + This is the size of the rectangles drawn for the vertices object. + """ + @classmethod + def new(cls, view: LayoutViewBase) -> Marker: + r""" + @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. + """ + def __init__(self, view: LayoutViewBase) -> None: + r""" + @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. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def has_color(self) -> bool: + r""" + @brief Returns a value indicating whether the marker has a specific color + """ + def has_frame_color(self) -> bool: + r""" + @brief Returns a value indicating whether the marker has a specific frame color + The set method has been added in version 0.20. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def reset_color(self) -> None: + r""" + @brief Resets the color of the marker + See \set_color for a description of the color property of the marker. + """ + def reset_frame_color(self) -> None: + r""" + @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. + """ + @overload + def set(self, box: db.DBox) -> None: + r""" + @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. + """ + @overload + def set(self, edge: db.DEdge) -> None: + r""" + @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. + """ + @overload + def set(self, path: db.DPath) -> None: + r""" + @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. + """ + @overload + def set(self, polygon: db.DPolygon) -> None: + r""" + @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. + """ + @overload + def set(self, text: db.DText) -> None: + r""" + @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. + """ + def set_box(self, box: db.DBox) -> None: + r""" + @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. + """ + def set_edge(self, edge: db.DEdge) -> None: + r""" + @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. + """ + def set_path(self, path: db.DPath) -> None: + r""" + @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. + """ + def set_polygon(self, polygon: db.DPolygon) -> None: + r""" + @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. + """ + def set_text(self, text: db.DText) -> None: + r""" + @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. + """ + +class MessageBox: + r""" + @brief Various methods to display message boxes + This class provides some basic message boxes. This functionality is provided through the static (class) methods \warning, \question and so on. + + Here is some example: + + @code + # issue a warning and ask whether to continue: + v = RBA::MessageBox::warning("Dialog Title", "Something happened. Continue?", RBA::MessageBox::Yes + RBA::MessageBox::No) + if v == RBA::MessageBox::Yes + ... continue ... + end + @/code + + If you have enabled the Qt binding, you can use \QMessageBox directly. + """ + Abort: ClassVar[int] + r""" + @brief A constant describing the 'Abort' button + """ + Cancel: ClassVar[int] + r""" + @brief A constant describing the 'Cancel' button + """ + Ignore: ClassVar[int] + r""" + @brief A constant describing the 'Ignore' button + """ + No: ClassVar[int] + r""" + @brief A constant describing the 'No' button + """ + Ok: ClassVar[int] + r""" + @brief A constant describing the 'Ok' button + """ + Retry: ClassVar[int] + r""" + @brief A constant describing the 'Retry' button + """ + Yes: ClassVar[int] + r""" + @brief A constant describing the 'Yes' button + """ + @classmethod + def b_abort(cls) -> int: + r""" + @brief A constant describing the 'Abort' button + """ + @classmethod + def b_cancel(cls) -> int: + r""" + @brief A constant describing the 'Cancel' button + """ + @classmethod + def b_ignore(cls) -> int: + r""" + @brief A constant describing the 'Ignore' button + """ + @classmethod + def b_no(cls) -> int: + r""" + @brief A constant describing the 'No' button + """ + @classmethod + def b_ok(cls) -> int: + r""" + @brief A constant describing the 'Ok' button + """ + @classmethod + def b_retry(cls) -> int: + r""" + @brief A constant describing the 'Retry' button + """ + @classmethod + def b_yes(cls) -> int: + r""" + @brief A constant describing the 'Yes' button + """ + @classmethod + def critical(cls, title: str, text: str, buttons: int) -> int: + r""" + @brief Open a critical (error) message box + @param title The title of the window + @param text The text to show + @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box + @return The button constant describing the button that was pressed + """ + @classmethod + def info(cls, title: str, text: str, buttons: int) -> int: + r""" + @brief Open a information message box + @param title The title of the window + @param text The text to show + @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box + @return The button constant describing the button that was pressed + """ + @classmethod + def new(cls) -> MessageBox: + r""" + @brief Creates a new object of this class + """ + @classmethod + def question(cls, title: str, text: str, buttons: int) -> int: + r""" + @brief Open a question message box + @param title The title of the window + @param text The text to show + @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box + @return The button constant describing the button that was pressed + """ + @classmethod + def warning(cls, title: str, text: str, buttons: int) -> int: + r""" + @brief Open a warning message box + @param title The title of the window + @param text The text to show + @param buttons A combination (+) of button constants (\Ok and so on) describing the buttons to show for the message box + @return The button constant describing the button that was pressed + """ + def __copy__(self) -> MessageBox: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> MessageBox: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: MessageBox) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> MessageBox: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class NetlistBrowserDialog: + r""" + @brief Represents the netlist browser dialog. + This dialog is a part of the \LayoutView class and can be obtained through \LayoutView#netlist_browser. + This interface allows to interact with the browser - mainly to get information about state changes. + + This class has been introduced in version 0.27. + """ + on_current_db_changed: None + r""" + Getter: + @brief This event is triggered when the current database is changed. + The current database can be obtained with \db. + Setter: + @brief This event is triggered when the current database is changed. + The current database can be obtained with \db. + """ + on_probe: None + r""" + Getter: + @brief This event is triggered when a net is probed. + The first path will indicate the location of the probed net in terms of two paths: one describing the instantiation of the net in layout space and one in schematic space. Both objects are \NetlistObjectPath objects which hold the root circuit, the chain of subcircuits leading to the circuit containing the net and the net itself. + Setter: + @brief This event is triggered when a net is probed. + The first path will indicate the location of the probed net in terms of two paths: one describing the instantiation of the net in layout space and one in schematic space. Both objects are \NetlistObjectPath objects which hold the root circuit, the chain of subcircuits leading to the circuit containing the net and the net itself. + """ + on_selection_changed: None + r""" + Getter: + @brief This event is triggered when the selection changed. + The selection can be obtained with \current_path_first, \current_path_second, \selected_nets, \selected_devices, \selected_subcircuits and \selected_circuits. + Setter: + @brief This event is triggered when the selection changed. + The selection can be obtained with \current_path_first, \current_path_second, \selected_nets, \selected_devices, \selected_subcircuits and \selected_circuits. + """ + @classmethod + def new(cls) -> NetlistBrowserDialog: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def current_path(self) -> NetlistObjectsPath: + r""" + @brief Gets the path of the current object as a path pair (combines layout and schematic object paths in case of a LVS database view). + """ + def current_path_first(self) -> NetlistObjectPath: + r""" + @brief Gets the path of the current object on the first (layout in case of LVS database) side. + """ + def current_path_second(self) -> NetlistObjectPath: + r""" + @brief Gets the path of the current object on the second (schematic in case of LVS database) side. + """ + def db(self) -> db.LayoutToNetlist: + r""" + @brief Gets the database the browser is connected to. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def selected_paths(self) -> List[NetlistObjectsPath]: + r""" + @brief Gets the nets currently selected objects (paths) in the netlist database browser. + The result is an array of path pairs. See \NetlistObjectsPath for details about these pairs. + """ + +class NetlistObjectPath: + r""" + @brief An object describing the instantiation of a netlist object. + This class describes the instantiation of a net or a device or a circuit in terms of a root circuit and a subcircuit chain leading to the indicated object. + + See \net= or \device= for the indicated object, \path= for the subcircuit chain. + + This class has been introduced in version 0.27. + """ + device: db.Device + r""" + Getter: + @brief Gets the device the path points to. + + Setter: + @brief Sets the device the path points to. + If the path describes the location of a device, this member will indicate it. + The other way to describe a final object is \net=. If neither a device nor net is given, the path describes a circuit and how it is referenced from the root. + """ + net: db.Net + r""" + Getter: + @brief Gets the net the path points to. + + Setter: + @brief Sets the net the path points to. + If the path describes the location of a net, this member will indicate it. + The other way to describe a final object is \device=. If neither a device nor net is given, the path describes a circuit and how it is referenced from the root. + """ + path: List[db.SubCircuit] + r""" + Getter: + @brief Gets the path. + + Setter: + @brief Sets the path. + The path is a list of subcircuits leading from the root to the final object. The final (net, device) object is located in the circuit called by the last subcircuit of the subcircuit chain. If the subcircuit list is empty, the final object is located inside the root object. + """ + root: db.Circuit + r""" + Getter: + @brief Gets the root circuit of the path. + + Setter: + @brief Sets the root circuit of the path. + The root circuit is the circuit from which the path starts. + """ + @classmethod + def new(cls) -> NetlistObjectPath: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetlistObjectPath: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetlistObjectPath: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistObjectPath) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetlistObjectPath: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_null(self) -> bool: + r""" + @brief Returns a value indicating whether the path is an empty one. + """ + +class NetlistObjectsPath: + r""" + @brief An object describing the instantiation of a single netlist object or a pair of those. + This class is basically a pair of netlist object paths (see \NetlistObjectPath). When derived from a single netlist view, only the first path is valid and will point to the selected object (a net, a device or a circuit). The second path is null. + + If the path is derived from a paired netlist view (a LVS report view), the first path corresponds to the object in the layout netlist, the second one to the object in the schematic netlist. + If the selected object isn't a matched one, either the first or second path may be a null or a partial path without a final net or device object or a partial path. + + This class has been introduced in version 0.27. + """ + @classmethod + def new(cls) -> NetlistObjectsPath: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> NetlistObjectsPath: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> NetlistObjectsPath: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: NetlistObjectsPath) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> NetlistObjectsPath: + r""" + @brief Creates a copy of self + """ + def first(self) -> NetlistObjectPath: + r""" + @brief Gets the first object's path. + In cases of paired netlists (LVS database), the first path points to the layout netlist object. + For the single netlist, the first path is the only path supplied. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def second(self) -> NetlistObjectPath: + r""" + @brief Gets the second object's path. + In cases of paired netlists (LVS database), the first path points to the schematic netlist object. + For the single netlist, the second path is always a null path. + """ + +class ObjectInstPath: + r""" + @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. + """ + cv_index: int + r""" + Getter: + @brief Gets the cellview index that describes which cell view the shape or instance is located in + + Setter: + @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: Any + r""" + Getter: + @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. + Setter: + @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: List[db.InstElement] + r""" + Getter: + @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. + + Setter: + @brief Sets the instantiation path + + This method was introduced in version 0.26. + """ + seq: int + r""" + Getter: + @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). + + Setter: + @brief Sets the sequence number + + See \seq for a description of this property. + + This method was introduced in version 0.24. + """ + shape: Any + r""" + Getter: + @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. + Setter: + @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: int + r""" + Getter: + @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 not instantiation path is set. + + This method has been introduced in version 0.24. + Setter: + @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. + """ + @classmethod + def new(cls, si: db.RecursiveShapeIterator, cv_index: int) -> ObjectInstPath: + r""" + @brief Creates a new path object from a \RecursiveShapeIterator + Use this constructor to quickly turn a recursive shape iterator delivery into a shape selection. + """ + def __copy__(self) -> ObjectInstPath: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> ObjectInstPath: + r""" + @brief Creates a copy of self + """ + def __eq__(self, b: object) -> bool: + r""" + @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. + """ + def __init__(self, si: db.RecursiveShapeIterator, cv_index: int) -> None: + r""" + @brief Creates a new path object from a \RecursiveShapeIterator + Use this constructor to quickly turn a recursive shape iterator delivery into a shape selection. + """ + def __lt__(self, b: ObjectInstPath) -> bool: + r""" + @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. + """ + def __ne__(self, b: object) -> bool: + r""" + @brief Inequality of two ObjectInstPath objects + See the comments on the == operator. + + This method has been introduced with version 0.24. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def append_path(self, element: db.InstElement) -> None: + r""" + @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. + """ + def assign(self, other: ObjectInstPath) -> None: + r""" + @brief Assigns another object to self + """ + def cell_index(self) -> int: + r""" + @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. + """ + def clear_path(self) -> None: + r""" + @brief Clears the instantiation path + + This method was introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dtrans(self) -> db.DCplxTrans: + r""" + @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. + """ + def dup(self) -> ObjectInstPath: + r""" + @brief Creates a copy of self + """ + def each_inst(self) -> Iterator[db.InstElement]: + r""" + @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. + """ + def inst(self) -> db.Instance: + r""" + @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. + """ + def is_cell_inst(self) -> bool: + r""" + @brief True, if this selection represents a cell instance + + If this attribute is true, the shape reference and layer are not valid. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_valid(self, view: LayoutViewBase) -> bool: + r""" + @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. + """ + def layout(self) -> db.Layout: + r""" + @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. + """ + def path_length(self) -> int: + r""" + @brief Returns the length of the path (number of elements delivered by \each_inst) + + This method has been added in version 0.16. + """ + def path_nth(self, n: int) -> db.InstElement: + r""" + @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. + """ + def source(self) -> int: + r""" + @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. + """ + def source_dtrans(self) -> db.DCplxTrans: + r""" + @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. + """ + def source_trans(self) -> db.ICplxTrans: + r""" + @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. + """ + def trans(self) -> db.ICplxTrans: + r""" + @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. + """ + +class PixelBuffer: + r""" + @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. + """ + transparent: bool + r""" + Getter: + @brief Gets a flag indicating whether the pixel buffer supports an alpha channel + + Setter: + @brief Sets a flag indicating whether the pixel buffer supports an alpha channel + + By default, the pixel buffer does not support an alpha channel. + """ + @classmethod + def from_png_data(cls, data: bytes) -> PixelBuffer: + r""" + @brief Reads the pixel buffer from a PNG byte stream + This method may not be available if PNG support is not compiled into KLayout. + """ + @classmethod + def new(cls, width: int, height: int) -> PixelBuffer: + r""" + @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. + """ + @classmethod + def read_png(cls, file: str) -> PixelBuffer: + r""" + @brief Reads the pixel buffer from a PNG file + This method may not be available if PNG support is not compiled into KLayout. + """ + def __copy__(self) -> PixelBuffer: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> PixelBuffer: + r""" + @brief Creates a copy of self + """ + def __eq__(self, other: object) -> bool: + r""" + @brief Returns a value indicating whether self is identical to the other image + """ + def __init__(self, width: int, height: int) -> None: + r""" + @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. + """ + def __ne__(self, other: object) -> bool: + r""" + @brief Returns a value indicating whether self is not identical to the other image + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: PixelBuffer) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def diff(self, other: PixelBuffer) -> PixelBuffer: + r""" + @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. + """ + def dup(self) -> PixelBuffer: + r""" + @brief Creates a copy of self + """ + def fill(self, color: int) -> None: + r""" + @brief Fills the pixel buffer with the given pixel value + """ + def height(self) -> int: + r""" + @brief Gets the height of the pixel buffer in pixels + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def patch(self, other: PixelBuffer) -> None: + r""" + @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. + """ + def pixel(self, x: int, y: int) -> int: + r""" + @brief Gets the value of the pixel at position x, y + """ + def set_pixel(self, x: int, y: int, c: int) -> None: + r""" + @brief Sets the value of the pixel at position x, y + """ + def swap(self, other: PixelBuffer) -> None: + r""" + @brief Swaps data with another PixelBuffer object + """ + def to_png_data(self) -> bytes: + r""" + @brief Converts the pixel buffer to a PNG byte stream + This method may not be available if PNG support is not compiled into KLayout. + """ + def width(self) -> int: + r""" + @brief Gets the width of the pixel buffer in pixels + """ + def write_png(self, file: str) -> None: + r""" + @brief Writes the pixel buffer to a PNG file + This method may not be available if PNG support is not compiled into KLayout. + """ + +class Plugin: + r""" + @brief The plugin object + + This class provides the actual plugin implementation. Each view gets it's 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. + """ + @classmethod + def new(cls) -> Plugin: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def grab_mouse(self) -> None: + r""" + @brief Redirects mouse events to this plugin, even if the plugin is not active. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def set_cursor(self, cursor_type: int) -> None: + r""" + @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. + """ + def ungrab_mouse(self) -> None: + r""" + @brief Removes a mouse grab registered with \grab_mouse. + """ + +class PluginFactory: + r""" + @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. + """ + @property + def has_tool_entry(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @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. + """ + @classmethod + def new(cls) -> PluginFactory: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_config_menu_item(self, menu_name: str, insert_pos: str, title: str, cname: str, cvalue: str) -> None: + r""" + @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. + """ + @overload + def add_menu_entry(self, menu_name: str, insert_pos: str) -> None: + r""" + @brief Specifies a separator + Call this method in the factory constructor to build the menu items that this plugin shall create. + This specific call inserts a separator at the given position (insert_pos). The position uses abstract menu item paths and "menu_name" names the component that will be created. See \AbstractMenu for a description of the path. + """ + @overload + def add_menu_entry(self, symbol: str, menu_name: str, insert_pos: str, title: str) -> None: + r""" + @brief Specifies a menu item + Call this method in the factory constructor to build the menu items that this plugin shall create. + This specific call inserts a menu item at the specified position (insert_pos). The position uses abstract menu item paths and "menu_name" names the component that will be created. See \AbstractMenu for a description of the path. + When the menu item is selected "symbol" is the string that is sent to the \menu_activated callback (either the global one for the factory ot the one of the per-view plugin instance). + + @param symbol The string to send to the plugin if the menu is triggered + @param menu_name The name of entry to create at the given position + @param insert_pos The position where to create the entry + @param title The title string for the item. The title can contain a keyboard shortcut in round braces after the title text, i.e. "My Menu Item(F12)" + """ + @overload + def add_menu_entry(self, symbol: str, menu_name: str, insert_pos: str, title: str, sub_menu: bool) -> None: + r""" + @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. + """ + def add_menu_item_clone(self, symbol: str, menu_name: str, insert_pos: str, copy_from: str) -> None: + r""" + @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. + """ + def add_option(self, name: str, default_value: str) -> None: + r""" + @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. + + """ + def add_submenu(self, menu_name: str, insert_pos: str, title: str) -> None: + r""" + @brief Specifies a menu item or sub-menu + + This method has been introduced in version 0.27. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + @overload + def register(self, position: int, name: str, title: str) -> None: + r""" + @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. + + 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. + """ + @overload + def register(self, position: int, name: str, title: str, icon: str) -> None: + r""" + @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. + """ + +class StringListValue: + r""" + @brief Encapsulate a string list + @hide + This class is provided as a return value of \FileDialog. + By using an object rather than a pure string list, an object with \has_value? = false can be returned indicating that + the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no + longer requires to use this class. + """ + @classmethod + def new(cls) -> StringListValue: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> StringListValue: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> StringListValue: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: StringListValue) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> StringListValue: + r""" + @brief Creates a copy of self + """ + def has_value(self) -> bool: + r""" + @brief True, if a value is present + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def value(self) -> List[str]: + r""" + @brief Get the actual value (a list of strings) + """ + +class StringValue: + r""" + @brief Encapsulate a string value + @hide + This class is provided as a return value of \InputDialog::get_string, \InputDialog::get_item and \FileDialog. + By using an object rather than a pure value, an object with \has_value? = false can be returned indicating that + the "Cancel" button was pressed. Starting with version 0.22, the InputDialog class offers new method which do no + longer requires to use this class. + """ + @classmethod + def new(cls) -> StringValue: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> StringValue: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> StringValue: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def __str__(self) -> str: + r""" + @brief Get the actual value (a synonym for \value) + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: StringValue) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> StringValue: + r""" + @brief Creates a copy of self + """ + def has_value(self) -> bool: + r""" + @brief True, if a value is present + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def to_s(self) -> str: + r""" + @brief Get the actual value (a synonym for \value) + """ + def value(self) -> str: + r""" + @brief Get the actual value + """ + diff --git a/src/pymod/distutils_src/klayout/rdbcore.pyi b/src/pymod/distutils_src/klayout/rdbcore.pyi index 39e5c6dbc..2a9b7fc41 100644 --- a/src/pymod/distutils_src/klayout/rdbcore.pyi +++ b/src/pymod/distutils_src/klayout/rdbcore.pyi @@ -2,252 +2,6 @@ from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional from typing import overload import klayout.tl as tl import klayout.db as db -class RdbReference: - r""" - @brief A cell reference inside the report database - This class describes a cell reference. Such reference object can be attached to cells to describe instantiations of them in parent cells. Not necessarily all instantiations of a cell in the layout database are represented by references and in some cases there might even be no references at all. The references are merely a hint how a marker must be displayed in the context of any other, potentially parent, cell in the layout database. - """ - parent_cell_id: int - r""" - Getter: - @brief Gets parent cell ID for this reference - @return The parent cell ID - - Setter: - @brief Sets the parent cell ID for this reference - """ - trans: db.DCplxTrans - r""" - Getter: - @brief Gets the transformation for this reference - The transformation describes the transformation of the child cell into the parent cell. In that sense that is the usual transformation of a cell reference. - @return The transformation - - Setter: - @brief Sets the transformation for this reference - """ - @classmethod - def new(cls, trans: db.DCplxTrans, parent_cell_id: int) -> RdbReference: - r""" - @brief Creates a reference with a given transformation and parent cell ID - """ - def __copy__(self) -> RdbReference: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> RdbReference: - r""" - @brief Creates a copy of self - """ - def __init__(self, trans: db.DCplxTrans, parent_cell_id: int) -> None: - r""" - @brief Creates a reference with a given transformation and parent cell ID - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: RdbReference) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def database(self) -> ReportDatabase: - r""" - @brief Gets the database object that category is associated with - - This method has been introduced in version 0.23. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> RdbReference: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class RdbCell: - r""" - @brief A cell inside the report database - This class represents a cell in the report database. There is not necessarily a 1:1 correspondence of RDB cells and layout database cells. Cells have an ID, a name, optionally a variant name and a set of references which describe at least one example instantiation in some parent cell. The references do not necessarily map to references or cover all references in the layout database. - """ - @classmethod - def new(cls) -> RdbCell: - r""" - @brief Creates a new object of this class - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def add_reference(self, ref: RdbReference) -> None: - r""" - @brief Adds a reference to the references of this cell - @param ref The reference to add. - """ - def clear_references(self) -> None: - r""" - @brief Removes all references from this cell - """ - def create(self) -> None: - r""" - @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. - """ - def database(self) -> ReportDatabase: - r""" - @brief Gets the database object that category is associated with - - This method has been introduced in version 0.23. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def each_item(self) -> Iterator[RdbItem]: - r""" - @brief Iterates over all items inside the database which are associated with this cell - - This method has been introduced in version 0.23. - """ - def each_reference(self) -> Iterator[RdbReference]: - r""" - @brief Iterates over all references - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def name(self) -> str: - r""" - @brief Gets the cell name - The cell name is an string that identifies the category in the database. Additionally, a cell may carry a variant identifier which is a string that uniquely identifies a cell in the context of it's variants. The "qualified name" contains both the cell name and the variant name. Cell names are also used to identify report database cell's with layout cells. @return The cell name - """ - def num_items(self) -> int: - r""" - @brief Gets the number of items for this cell - """ - def num_items_visited(self) -> int: - r""" - @brief Gets the number of visited items for this cell - """ - def qname(self) -> str: - r""" - @brief Gets the cell's qualified name - The qualified name is a combination of the cell name and optionally the variant name. It is used to identify the cell by name in a unique way. - @return The qualified name - """ - def rdb_id(self) -> int: - r""" - @brief Gets the cell ID - The cell ID is an integer that uniquely identifies the cell. It is used for referring to a cell in \RdbItem for example. - @return The cell ID - """ - def variant(self) -> str: - r""" - @brief Gets the cell variant name - A variant name additionally identifies the cell when multiple cells with the same name are present. A variant name is either assigned automatically or set when creating a cell. @return The cell variant name - """ - class RdbCategory: r""" @brief A category inside the report database @@ -443,6 +197,373 @@ class RdbCategory: This method has been introduced in version 0.23. The flat mode argument has been added in version 0.26. The 'with_properties' argument has been added in version 0.28. """ +class RdbCell: + r""" + @brief A cell inside the report database + This class represents a cell in the report database. There is not necessarily a 1:1 correspondence of RDB cells and layout database cells. Cells have an ID, a name, optionally a variant name and a set of references which describe at least one example instantiation in some parent cell. The references do not necessarily map to references or cover all references in the layout database. + """ + @classmethod + def new(cls) -> RdbCell: + r""" + @brief Creates a new object of this class + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_reference(self, ref: RdbReference) -> None: + r""" + @brief Adds a reference to the references of this cell + @param ref The reference to add. + """ + def clear_references(self) -> None: + r""" + @brief Removes all references from this cell + """ + def create(self) -> None: + r""" + @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. + """ + def database(self) -> ReportDatabase: + r""" + @brief Gets the database object that category is associated with + + This method has been introduced in version 0.23. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def each_item(self) -> Iterator[RdbItem]: + r""" + @brief Iterates over all items inside the database which are associated with this cell + + This method has been introduced in version 0.23. + """ + def each_reference(self) -> Iterator[RdbReference]: + r""" + @brief Iterates over all references + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def name(self) -> str: + r""" + @brief Gets the cell name + The cell name is an string that identifies the category in the database. Additionally, a cell may carry a variant identifier which is a string that uniquely identifies a cell in the context of it's variants. The "qualified name" contains both the cell name and the variant name. Cell names are also used to identify report database cell's with layout cells. @return The cell name + """ + def num_items(self) -> int: + r""" + @brief Gets the number of items for this cell + """ + def num_items_visited(self) -> int: + r""" + @brief Gets the number of visited items for this cell + """ + def qname(self) -> str: + r""" + @brief Gets the cell's qualified name + The qualified name is a combination of the cell name and optionally the variant name. It is used to identify the cell by name in a unique way. + @return The qualified name + """ + def rdb_id(self) -> int: + r""" + @brief Gets the cell ID + The cell ID is an integer that uniquely identifies the cell. It is used for referring to a cell in \RdbItem for example. + @return The cell ID + """ + def variant(self) -> str: + r""" + @brief Gets the cell variant name + A variant name additionally identifies the cell when multiple cells with the same name are present. A variant name is either assigned automatically or set when creating a cell. @return The cell variant name + """ + +class RdbItem: + r""" + @brief An item inside the report database + An item is the basic information entity in the RDB. It is associated with a cell and a category. It can be assigned values which encapsulate other objects such as strings and geometrical objects. In addition, items can be assigned an image (i.e. a screenshot image) and tags which are basically boolean flags that can be defined freely. + """ + @property + def image(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the attached image from a PixelBuffer object + + This method has been added in version 0.28. + """ + image_str: str + r""" + Getter: + @brief Gets the image associated with this item as a string + @return A base64-encoded image file (in PNG format) + + Setter: + @brief Sets the image from a string + @param image A base64-encoded image file (preferably in PNG format) + """ + tags_str: str + r""" + Getter: + @brief Returns a string listing all tags of this item + @return A comma-separated list of tags + + Setter: + @brief Sets the tags from a string + @param tags A comma-separated list of tags + """ + @classmethod + def new(cls) -> RdbItem: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> RdbItem: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> RdbItem: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def add_tag(self, tag_id: int) -> None: + r""" + @brief Adds a tag with the given id to the item + Each tag can be added once to the item. The tags of an item thus form a set. If a tag with that ID already exists, this method does nothing. + """ + @overload + def add_value(self, shape: db.Shape, trans: db.CplxTrans) -> None: + r""" + @brief Adds a geometrical value object from a shape + @param value The shape object from which to take the geometrical object. + @param trans The transformation to apply. + + The transformation can be used to convert database units to micron units. + + This method has been introduced in version 0.25.3. + """ + @overload + def add_value(self, value: RdbItemValue) -> None: + r""" + @brief Adds a value object to the values of this item + @param value The value to add. + """ + @overload + def add_value(self, value: db.DBox) -> None: + r""" + @brief Adds a box object to the values of this item + @param value The box to add. + This method has been introduced in version 0.25 as a convenience method. + """ + @overload + def add_value(self, value: db.DEdge) -> None: + r""" + @brief Adds an edge object to the values of this item + @param value The edge to add. + This method has been introduced in version 0.25 as a convenience method. + """ + @overload + def add_value(self, value: db.DEdgePair) -> None: + r""" + @brief Adds an edge pair object to the values of this item + @param value The edge pair to add. + This method has been introduced in version 0.25 as a convenience method. + """ + @overload + def add_value(self, value: db.DPolygon) -> None: + r""" + @brief Adds a polygon object to the values of this item + @param value The polygon to add. + This method has been introduced in version 0.25 as a convenience method. + """ + @overload + def add_value(self, value: float) -> None: + r""" + @brief Adds a numeric value to the values of this item + @param value The value to add. + This method has been introduced in version 0.25 as a convenience method. + """ + @overload + def add_value(self, value: str) -> None: + r""" + @brief Adds a string object to the values of this item + @param value The string to add. + This method has been introduced in version 0.25 as a convenience method. + """ + def assign(self, other: RdbItem) -> None: + r""" + @brief Assigns another object to self + """ + def category_id(self) -> int: + r""" + @brief Gets the category ID + Returns the ID of the category that this item is associated with. + @return The category ID + """ + def cell_id(self) -> int: + r""" + @brief Gets the cell ID + Returns the ID of the cell that this item is associated with. + @return The cell ID + """ + def clear_values(self) -> None: + r""" + @brief Removes all values from this item + """ + def create(self) -> None: + r""" + @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. + """ + def database(self) -> ReportDatabase: + r""" + @brief Gets the database object that item is associated with + + This method has been introduced in version 0.23. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> RdbItem: + r""" + @brief Creates a copy of self + """ + def each_value(self) -> Iterator[RdbItemValue]: + r""" + @brief Iterates over all values + """ + def has_image(self) -> bool: + r""" + @brief Gets a value indicating that the item has an image attached + See \image_str how to obtain the image. + + This method has been introduced in version 0.28. + """ + def has_tag(self, tag_id: int) -> bool: + r""" + @brief Returns a value indicating whether the item has a tag with the given ID + @return True, if the item has a tag with the given ID + """ + def image_pixels(self) -> lay.PixelBuffer: + r""" + @brief Gets the attached image as a PixelBuffer object + + This method has been added in version 0.28. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_visited(self) -> bool: + r""" + @brief Gets a value indicating whether the item was already visited + @return True, if the item has been visited already + """ + def remove_tag(self, tag_id: int) -> None: + r""" + @brief Remove the tag with the given id from the item + If a tag with that ID does not exists on this item, this method does nothing. + """ + class RdbItemValue: r""" @brief A value object inside the report database @@ -741,55 +862,46 @@ class RdbItemValue: @return The string """ -class RdbItem: +class RdbReference: r""" - @brief An item inside the report database - An item is the basic information entity in the RDB. It is associated with a cell and a category. It can be assigned values which encapsulate other objects such as strings and geometrical objects. In addition, items can be assigned an image (i.e. a screenshot image) and tags which are basically boolean flags that can be defined freely. + @brief A cell reference inside the report database + This class describes a cell reference. Such reference object can be attached to cells to describe instantiations of them in parent cells. Not necessarily all instantiations of a cell in the layout database are represented by references and in some cases there might even be no references at all. The references are merely a hint how a marker must be displayed in the context of any other, potentially parent, cell in the layout database. """ - @property - def image(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the attached image from a PixelBuffer object - - This method has been added in version 0.28. - """ - image_str: str + parent_cell_id: int r""" Getter: - @brief Gets the image associated with this item as a string - @return A base64-encoded image file (in PNG format) + @brief Gets parent cell ID for this reference + @return The parent cell ID Setter: - @brief Sets the image from a string - @param image A base64-encoded image file (preferably in PNG format) + @brief Sets the parent cell ID for this reference """ - tags_str: str + trans: db.DCplxTrans r""" Getter: - @brief Returns a string listing all tags of this item - @return A comma-separated list of tags + @brief Gets the transformation for this reference + The transformation describes the transformation of the child cell into the parent cell. In that sense that is the usual transformation of a cell reference. + @return The transformation Setter: - @brief Sets the tags from a string - @param tags A comma-separated list of tags + @brief Sets the transformation for this reference """ @classmethod - def new(cls) -> RdbItem: + def new(cls, trans: db.DCplxTrans, parent_cell_id: int) -> RdbReference: r""" - @brief Creates a new object of this class + @brief Creates a reference with a given transformation and parent cell ID """ - def __copy__(self) -> RdbItem: + def __copy__(self) -> RdbReference: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> RdbItem: + def __deepcopy__(self) -> RdbReference: r""" @brief Creates a copy of self """ - def __init__(self) -> None: + def __init__(self, trans: db.DCplxTrans, parent_cell_id: int) -> None: r""" - @brief Creates a new object of this class + @brief Creates a reference with a given transformation and parent cell ID """ def _create(self) -> None: r""" @@ -828,90 +940,10 @@ class RdbItem: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def add_tag(self, tag_id: int) -> None: - r""" - @brief Adds a tag with the given id to the item - Each tag can be added once to the item. The tags of an item thus form a set. If a tag with that ID already exists, this method does nothing. - """ - @overload - def add_value(self, value: float) -> None: - r""" - @brief Adds a numeric value to the values of this item - @param value The value to add. - This method has been introduced in version 0.25 as a convenience method. - """ - @overload - def add_value(self, value: RdbItemValue) -> None: - r""" - @brief Adds a value object to the values of this item - @param value The value to add. - """ - @overload - def add_value(self, value: db.DBox) -> None: - r""" - @brief Adds a box object to the values of this item - @param value The box to add. - This method has been introduced in version 0.25 as a convenience method. - """ - @overload - def add_value(self, value: db.DEdge) -> None: - r""" - @brief Adds an edge object to the values of this item - @param value The edge to add. - This method has been introduced in version 0.25 as a convenience method. - """ - @overload - def add_value(self, value: db.DEdgePair) -> None: - r""" - @brief Adds an edge pair object to the values of this item - @param value The edge pair to add. - This method has been introduced in version 0.25 as a convenience method. - """ - @overload - def add_value(self, value: db.DPolygon) -> None: - r""" - @brief Adds a polygon object to the values of this item - @param value The polygon to add. - This method has been introduced in version 0.25 as a convenience method. - """ - @overload - def add_value(self, value: str) -> None: - r""" - @brief Adds a string object to the values of this item - @param value The string to add. - This method has been introduced in version 0.25 as a convenience method. - """ - @overload - def add_value(self, shape: db.Shape, trans: db.CplxTrans) -> None: - r""" - @brief Adds a geometrical value object from a shape - @param value The shape object from which to take the geometrical object. - @param trans The transformation to apply. - - The transformation can be used to convert database units to micron units. - - This method has been introduced in version 0.25.3. - """ - def assign(self, other: RdbItem) -> None: + def assign(self, other: RdbReference) -> None: r""" @brief Assigns another object to self """ - def category_id(self) -> int: - r""" - @brief Gets the category ID - Returns the ID of the category that this item is associated with. - @return The category ID - """ - def cell_id(self) -> int: - r""" - @brief Gets the cell ID - Returns the ID of the cell that this item is associated with. - @return The cell ID - """ - def clear_values(self) -> None: - r""" - @brief Removes all values from this item - """ def create(self) -> None: r""" @brief Ensures the C++ object is created @@ -919,7 +951,7 @@ class RdbItem: """ def database(self) -> ReportDatabase: r""" - @brief Gets the database object that item is associated with + @brief Gets the database object that category is associated with This method has been introduced in version 0.23. """ @@ -935,48 +967,16 @@ class RdbItem: 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. """ - def dup(self) -> RdbItem: + def dup(self) -> RdbReference: r""" @brief Creates a copy of self """ - def each_value(self) -> Iterator[RdbItemValue]: - r""" - @brief Iterates over all values - """ - def has_image(self) -> bool: - r""" - @brief Gets a value indicating that the item has an image attached - See \image_str how to obtain the image. - - This method has been introduced in version 0.28. - """ - def has_tag(self, tag_id: int) -> bool: - r""" - @brief Returns a value indicating whether the item has a tag with the given ID - @return True, if the item has a tag with the given ID - """ - def image_pixels(self) -> lay.PixelBuffer: - r""" - @brief Gets the attached image as a PixelBuffer object - - This method has been added in version 0.28. - """ def is_const_object(self) -> bool: r""" @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. """ - def is_visited(self) -> bool: - r""" - @brief Gets a value indicating whether the item was already visited - @return True, if the item has been visited already - """ - def remove_tag(self, tag_id: int) -> None: - r""" - @brief Remove the tag with the given id from the item - If a tag with that ID does not exists on this item, this method does nothing. - """ class ReportDatabase: r""" diff --git a/src/pymod/distutils_src/klayout/tlcore.pyi b/src/pymod/distutils_src/klayout/tlcore.pyi index c9d67ac96..fb1b74b09 100644 --- a/src/pymod/distutils_src/klayout/tlcore.pyi +++ b/src/pymod/distutils_src/klayout/tlcore.pyi @@ -1,254 +1,99 @@ from typing import Any, ClassVar, Dict, Sequence, List, Iterator, Optional from typing import overload -class EmptyClass: +class AbsoluteProgress(Progress): r""" - """ - @classmethod - def new(cls) -> EmptyClass: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> EmptyClass: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> EmptyClass: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + @brief A progress reporter counting progress in absolute units - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + An absolute progress reporter counts from 0 upwards without a known limit. A unit value is used to convert the value to a bar value. One unit corresponds to 1% on the bar. + For formatted output, a format string can be specified as well as a unit value by which the current value is divided before it is formatted. - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: EmptyClass) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> EmptyClass: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ + The progress can be configured to have a description text, a title and a format. + The "inc" method increments the value, the "set" or "value=" methods set the value to a specific value. -class Value: - r""" - @brief Encapsulates a value (preferably a plain data type) in an object - This class is provided to 'box' a value (encapsulate the value in an object). This class is required to interface to pointer or reference types in a method call. By using that class, the method can alter the value and thus implement 'out parameter' semantics. The value may be 'nil' which acts as a null pointer in pointer type arguments. - This class has been introduced in version 0.22. - """ - value: Any - r""" - Getter: - @brief Gets the actual value. + While one of these three methods is called, they will run the event loop in regular intervals. That makes the application respond to mouse clicks, specifically the Cancel button on the progress bar. If that button is clicked, an exception will be raised by these methods. - Setter: - @brief Set the actual value. - """ - @overload - @classmethod - def new(cls) -> Value: - r""" - @brief Constructs a nil object. - """ - @overload - @classmethod - def new(cls, value: Any) -> Value: - r""" - @brief Constructs a non-nil object with the given value. - This constructor has been introduced in version 0.22. - """ - def __copy__(self) -> Value: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> Value: - r""" - @brief Creates a copy of self - """ - @overload - def __init__(self) -> None: - r""" - @brief Constructs a nil object. - """ - @overload - def __init__(self, value: Any) -> None: - r""" - @brief Constructs a non-nil object with the given value. - This constructor has been introduced in version 0.22. - """ - def __str__(self) -> str: - r""" - @brief Convert this object to a string - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + The progress object must be destroyed explicitly in order to remove the progress status bar. - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Value) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> Value: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def to_s(self) -> str: - r""" - @brief Convert this object to a string - """ - -class Interpreter: - r""" - @brief A generalization of script interpreters - The main purpose of this class is to provide cross-language call options. Using the Python interpreter, it is possible to execute Python code from Ruby for example. - - The following example shows how to use the interpreter class to execute Python code from Ruby and how to pass values from Ruby to Python and back using the \Value wrapper object: + The following sample code creates a progress bar which displays the current count as "Megabytes". + For the progress bar, one percent corresponds to 16 kByte: @code - pya = RBA::Interpreter::python_interpreter - out_param = RBA::Value::new(17) - pya.define_variable("out_param", out_param) - pya.eval_string(< Interpreter: + @property + def format(self) -> None: r""" - @brief Creates a new object of this class + WARNING: This variable can only be set, not retrieved. + @brief sets the output format (sprintf notation) for the progress text """ - @classmethod - def python_interpreter(cls) -> Interpreter: + @property + def format_unit(self) -> None: r""" - @brief Gets the instance of the Python interpreter + WARNING: This variable can only be set, not retrieved. + @brief Sets the format unit + + This is the unit used for formatted output. + The current count is divided by the format unit to render + the value passed to the format string. """ - @classmethod - def ruby_interpreter(cls) -> Interpreter: + @property + def unit(self) -> None: r""" - @brief Gets the instance of the Ruby interpreter + WARNING: This variable can only be set, not retrieved. + @brief Sets the unit + + Specifies the count value corresponding to 1 percent on the progress bar. By default, the current value divided by the unit is used to create the formatted value from the output string. Another attribute is provided (\format_unit=) to specify a separate unit for that purpose. """ - def __init__(self) -> None: + @property + def value(self) -> None: r""" - @brief Creates a new object of this class + WARNING: This variable can only be set, not retrieved. + @brief Sets the progress value + """ + @overload + @classmethod + def new(cls, desc: str) -> AbsoluteProgress: + r""" + @brief Creates an absolute progress reporter with the given description + """ + @overload + @classmethod + def new(cls, desc: str, yield_interval: int) -> AbsoluteProgress: + r""" + @brief Creates an absolute progress reporter with the given description + + The yield interval specifies, how often the event loop will be triggered. When the yield interval is 10 for example, the event loop will be executed every tenth call of \inc or \set. + """ + def __copy__(self) -> AbsoluteProgress: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> AbsoluteProgress: + r""" + @brief Creates a copy of self + """ + @overload + def __init__(self, desc: str) -> None: + r""" + @brief Creates an absolute progress reporter with the given description + """ + @overload + def __init__(self, desc: str, yield_interval: int) -> None: + r""" + @brief Creates an absolute progress reporter with the given description + + The yield interval specifies, how often the event loop will be triggered. When the yield interval is 10 for example, the event loop will be executed every tenth call of \inc or \set. """ def _create(self) -> None: r""" @@ -287,48 +132,97 @@ class Interpreter: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def create(self) -> None: + def assign(self, other: Progress) -> None: + r""" + @brief Assigns another object to self + """ + def dup(self) -> AbsoluteProgress: + r""" + @brief Creates a copy of self + """ + def inc(self) -> AbsoluteProgress: + r""" + @brief Increments the progress value + """ + def set(self, value: int, force_yield: bool) -> None: + r""" + @brief Sets the progress value + + This method is equivalent to \value=, but it allows forcing the event loop to be triggered. + If "force_yield" is true, the event loop will be triggered always, irregardless of the yield interval specified in the constructor. + """ + +class AbstractProgress(Progress): + r""" + @brief The abstract progress reporter + + The abstract progress reporter acts as a 'bracket' for a sequence of operations which are connected logically. For example, a DRC script consists of multiple operations. An abstract progress reportert is instantiated during the run time of the DRC script. This way, the application leaves the UI open while the DRC executes and log messages can be collected. + + The abstract progress does not have a value. + + This class has been introduced in version 0.27. + """ + @classmethod + def new(cls, desc: str) -> AbstractProgress: + r""" + @brief Creates an abstract progress reporter with the given description + """ + def __copy__(self) -> AbstractProgress: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> AbstractProgress: + r""" + @brief Creates a copy of self + """ + def __init__(self, desc: str) -> None: + r""" + @brief Creates an abstract progress reporter with the given description + """ + def _create(self) -> None: r""" @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. """ - def define_variable(self, name: str, value: Any) -> None: - r""" - @brief Defines a (global) variable with the given name and value - You can use the \Value class to provide 'out' or 'inout' parameters which can be modified by code executed inside the interpreter and read back by the caller. - """ - def destroy(self) -> None: + def _destroy(self) -> None: r""" @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. """ - def destroyed(self) -> bool: + def _destroyed(self) -> bool: r""" @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. """ - def eval_expr(self, string: str, filename: Optional[str] = ..., line: Optional[int] = ...) -> Any: - r""" - @brief Executes the expression inside the given string and returns the result value - Use 'filename' and 'line' to indicate the original source for the error messages. - """ - def eval_string(self, string: str, filename: Optional[str] = ..., line: Optional[int] = ...) -> None: - r""" - @brief Executes the code inside the given string - Use 'filename' and 'line' to indicate the original source for the error messages. - """ - def is_const_object(self) -> bool: + def _is_const_object(self) -> bool: r""" @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. """ - def load_file(self, path: str) -> None: + def _manage(self) -> None: r""" - @brief Loads the given file into the interpreter - This will execute the code inside the file. + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Progress) -> None: + r""" + @brief Assigns another object to self + """ + def dup(self) -> AbstractProgress: + r""" + @brief Creates a copy of self """ class ArgType: @@ -567,20 +461,147 @@ class ArgType: @brief Return the basic type (see t_.. constants) """ -class MethodOverload: +class Class: r""" @hide """ @classmethod - def new(cls) -> MethodOverload: + def each_class(cls) -> Iterator[Class]: + r""" + @brief Iterate over all classes + """ + @classmethod + def new(cls) -> Class: r""" @brief Creates a new object of this class """ - def __copy__(self) -> MethodOverload: + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def base(self) -> Class: + r""" + @brief The base class or nil if the class does not have a base class + + This method has been introduced in version 0.22. + """ + def can_copy(self) -> bool: + r""" + @brief True if the class offers assignment + """ + def can_destroy(self) -> bool: + r""" + @brief True if the class offers a destroy method + + This method has been introduced in version 0.22. + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def doc(self) -> str: + r""" + @brief The documentation string for this class + """ + def each_child_class(self) -> Iterator[Class]: + r""" + @brief Iterate over all child classes defined within this class + """ + def each_method(self) -> Iterator[Method]: + r""" + @brief Iterate over all methods of this class + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def module(self) -> str: + r""" + @brief The name of module where the class lives + """ + def name(self) -> str: + r""" + @brief The name of the class + """ + def parent(self) -> Class: + r""" + @brief The parent of the class + """ + def python_methods(self, static: bool) -> List[PythonFunction]: + r""" + @brief Gets the Python methods (static or non-static) + """ + def python_properties(self, static: bool) -> List[PythonGetterSetterPair]: + r""" + @brief Gets the Python properties (static or non-static) as a list of getter/setter pairs + Note that if a getter or setter is not available the list of Python functions for this part is empty. + """ + +class EmptyClass: + r""" + """ + @classmethod + def new(cls) -> EmptyClass: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> EmptyClass: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> MethodOverload: + def __deepcopy__(self) -> EmptyClass: r""" @brief Creates a copy of self """ @@ -625,7 +646,7 @@ class MethodOverload: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: MethodOverload) -> None: + def assign(self, other: EmptyClass) -> None: r""" @brief Assigns another object to self """ @@ -634,10 +655,6 @@ class MethodOverload: @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. """ - def deprecated(self) -> bool: - r""" - @brief A value indicating that this overload is deprecated - """ def destroy(self) -> None: r""" @brief Explicitly destroys the object @@ -650,7 +667,7 @@ class MethodOverload: 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. """ - def dup(self) -> MethodOverload: + def dup(self) -> EmptyClass: r""" @brief Creates a copy of self """ @@ -660,22 +677,725 @@ class MethodOverload: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def is_getter(self) -> bool: + +class Executable(ExecutableBase): + r""" + @brief A generic executable object + This object is a delegate for implementing the actual function of some generic executable function. In addition to the plain execution, if offers a post-mortem cleanup callback which is always executed, even if execute's implementation is cancelled in the debugger. + + Parameters are kept as a generic key/value map. + + This class has been introduced in version 0.27. + """ + def _assign(self, other: ExecutableBase) -> None: r""" - @brief A value indicating that this overload is a property getter + @brief Assigns another object to self """ - def is_predicate(self) -> bool: + def _create(self) -> None: r""" - @brief A value indicating that this overload is a predicate + @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. """ - def is_setter(self) -> bool: + def _destroy(self) -> None: r""" - @brief A value indicating that this overload is a property setter + @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. """ - def name(self) -> str: + def _destroyed(self) -> bool: r""" - @brief The name of this overload - This is the raw, unadorned name. I.e. no question mark suffix for predicates, no equal character suffix for setters etc. + @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. + """ + def _dup(self) -> Executable: + r""" + @brief Creates a copy of self + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + +class ExecutableBase: + r""" + @hide + @alias Executable + """ + @classmethod + def new(cls) -> ExecutableBase: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> ExecutableBase: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> ExecutableBase: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: ExecutableBase) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> ExecutableBase: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + +class Expression(ExpressionContext): + r""" + @brief Evaluation of Expressions + + This class allows evaluation of expressions. Expressions are used in many places throughout KLayout and provide computation features for various applications. Having a script language, there is no real use for expressions inside a script client. This class is provided mainly for testing purposes. + + An expression is 'compiled' into an Expression object and can be evaluated multiple times. + + This class has been introduced in version 0.25. In version 0.26 it was separated into execution and context. + """ + @property + def text(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the given text as the expression. + """ + @classmethod + def _class_eval(cls, expr: str) -> Any: + r""" + @brief A convience function to evaluate the given expression and directly return the result + This is a static method that does not require instantiation of the expression object first. + """ + @classmethod + def eval(cls, expr: str) -> Any: + r""" + @brief A convience function to evaluate the given expression and directly return the result + This is a static method that does not require instantiation of the expression object first. + """ + @overload + @classmethod + def new(cls, expr: str) -> Expression: + r""" + @brief Creates an expression evaluator + """ + @overload + @classmethod + def new(cls, expr: str, variables: Dict[str, Any]) -> Expression: + r""" + @brief Creates an expression evaluator + This version of the constructor takes a hash of variables available to the expressions. + """ + @overload + def __init__(self, expr: str) -> None: + r""" + @brief Creates an expression evaluator + """ + @overload + def __init__(self, expr: str, variables: Dict[str, Any]) -> None: + r""" + @brief Creates an expression evaluator + This version of the constructor takes a hash of variables available to the expressions. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _inst_eval(self) -> Any: + r""" + @brief Evaluates the current expression and returns the result + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def eval(self) -> Any: + r""" + @brief Evaluates the current expression and returns the result + """ + +class ExpressionContext: + r""" + @brief Represents the context of an expression evaluation + + The context provides a variable namespace for the expression evaluation. + + This class has been introduced in version 0.26 when \Expression was separated into the execution and context part. + """ + @classmethod + def global_var(cls, name: str, value: Any) -> None: + r""" + @brief Defines a global variable with the given name and value + """ + @classmethod + def new(cls) -> ExpressionContext: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> ExpressionContext: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> ExpressionContext: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: ExpressionContext) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> ExpressionContext: + r""" + @brief Creates a copy of self + """ + def eval(self, expr: str) -> Any: + r""" + @brief Compiles and evaluates the given expression in this context + This method has been introduced in version 0.26. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def var(self, name: str, value: Any) -> None: + r""" + @brief Defines a variable with the given name and value + """ + +class GlobPattern: + r""" + @brief A glob pattern matcher + This class is provided to make KLayout's glob pattern matching available to scripts too. The intention is to provide an implementation which is compatible with KLayout's pattern syntax. + + This class has been introduced in version 0.26. + """ + case_sensitive: bool + r""" + Getter: + @brief Gets a value indicating whether the glob pattern match is case sensitive. + Setter: + @brief Sets a value indicating whether the glob pattern match is case sensitive. + """ + head_match: bool + r""" + Getter: + @brief Gets a value indicating whether trailing characters are allowed. + + Setter: + @brief Sets a value indicating whether trailing characters are allowed. + If this predicate is false, the glob pattern needs to match the full subject string. If true, the match function will ignore trailing characters and return true if the front part of the subject string matches. + """ + @classmethod + def new(cls, pattern: str) -> GlobPattern: + r""" + @brief Creates a new glob pattern match object + """ + def __copy__(self) -> GlobPattern: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> GlobPattern: + r""" + @brief Creates a copy of self + """ + def __init__(self, pattern: str) -> None: + r""" + @brief Creates a new glob pattern match object + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: GlobPattern) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> GlobPattern: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def match(self, subject: str) -> Any: + r""" + @brief Matches the subject string against the pattern. + Returns nil if the subject string does not match the pattern. Otherwise returns a list with the substrings captured in round brackets. + """ + +class Interpreter: + r""" + @brief A generalization of script interpreters + The main purpose of this class is to provide cross-language call options. Using the Python interpreter, it is possible to execute Python code from Ruby for example. + + The following example shows how to use the interpreter class to execute Python code from Ruby and how to pass values from Ruby to Python and back using the \Value wrapper object: + + @code + pya = RBA::Interpreter::python_interpreter + out_param = RBA::Value::new(17) + pya.define_variable("out_param", out_param) + pya.eval_string(< Interpreter: + r""" + @brief Creates a new object of this class + """ + @classmethod + def python_interpreter(cls) -> Interpreter: + r""" + @brief Gets the instance of the Python interpreter + """ + @classmethod + def ruby_interpreter(cls) -> Interpreter: + r""" + @brief Gets the instance of the Ruby interpreter + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def define_variable(self, name: str, value: Any) -> None: + r""" + @brief Defines a (global) variable with the given name and value + You can use the \Value class to provide 'out' or 'inout' parameters which can be modified by code executed inside the interpreter and read back by the caller. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def eval_expr(self, string: str, filename: Optional[str] = ..., line: Optional[int] = ...) -> Any: + r""" + @brief Executes the expression inside the given string and returns the result value + Use 'filename' and 'line' to indicate the original source for the error messages. + """ + def eval_string(self, string: str, filename: Optional[str] = ..., line: Optional[int] = ...) -> None: + r""" + @brief Executes the code inside the given string + Use 'filename' and 'line' to indicate the original source for the error messages. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def load_file(self, path: str) -> None: + r""" + @brief Loads the given file into the interpreter + This will execute the code inside the file. + """ + +class Logger: + r""" + @brief A logger + + The logger outputs messages to the log channels. If the log viewer is open, the log messages will be shown in the logger view. Otherwise they will be printed to the terminal on Linux for example. + + A code example: + + @code + RBA::Logger::error("An error message") + RBA::Logger::warn("A warning") + @/code + + This class has been introduced in version 0.23. + """ + verbosity: ClassVar[int] + r""" + @brief Returns the verbosity level + + The verbosity level is defined by the application (see -d command line option for example). Level 0 is silent, levels 10, 20, 30 etc. denote levels with increasing verbosity. 11, 21, 31 .. are sublevels which also enable timing logs in addition to messages. + """ + @classmethod + def error(cls, msg: str) -> None: + r""" + @brief Writes the given string to the error channel + + The error channel is formatted as an error (i.e. red in the logger window) and output unconditionally. + """ + @classmethod + def info(cls, msg: str) -> None: + r""" + @brief Writes the given string to the info channel + + The info channel is printed as neutral messages unconditionally. + """ + @classmethod + def log(cls, msg: str) -> None: + r""" + @brief Writes the given string to the log channel + + Log messages are printed as neutral messages and are output only if the verbosity is above 0. + """ + @classmethod + def new(cls) -> Logger: + r""" + @brief Creates a new object of this class + """ + @classmethod + def warn(cls, msg: str) -> None: + r""" + @brief Writes the given string to the warning channel + + The warning channel is formatted as a warning (i.e. blue in the logger window) and output unconditionally. + """ + def __copy__(self) -> Logger: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Logger: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Logger) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> Logger: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. """ class Method: @@ -846,17 +1566,145 @@ class Method: @brief The return type of this method """ -class Class: +class MethodOverload: r""" @hide """ @classmethod - def each_class(cls) -> Iterator[Class]: + def new(cls) -> MethodOverload: r""" - @brief Iterate over all classes + @brief Creates a new object of this class """ + def __copy__(self) -> MethodOverload: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> MethodOverload: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: MethodOverload) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def deprecated(self) -> bool: + r""" + @brief A value indicating that this overload is deprecated + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> MethodOverload: + r""" + @brief Creates a copy of self + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def is_getter(self) -> bool: + r""" + @brief A value indicating that this overload is a property getter + """ + def is_predicate(self) -> bool: + r""" + @brief A value indicating that this overload is a predicate + """ + def is_setter(self) -> bool: + r""" + @brief A value indicating that this overload is a property setter + """ + def name(self) -> str: + r""" + @brief The name of this overload + This is the raw, unadorned name. I.e. no question mark suffix for predicates, no equal character suffix for setters etc. + """ + +class Progress: + r""" + @brief A progress reporter + + This is the base class for all progress reporter objects. Progress reporter objects are used to report the progress of some operation and to allow aborting an operation. Progress reporter objects must be triggered periodically, i.e. a value must be set. On the display side, a progress bar usually is used to represent the progress of an operation. + + Actual implementations of the progress reporter class are \RelativeProgress and \AbsoluteProgress. + + This class has been introduced in version 0.23. + """ + @property + def title(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the title text of the progress object + + Initially the title is equal to the description. + """ + desc: str + r""" + Getter: + @brief Gets the description text of the progress object + + Setter: + @brief Sets the description text of the progress object + """ @classmethod - def new(cls) -> Class: + def new(cls) -> Progress: r""" @brief Creates a new object of this class """ @@ -901,22 +1749,6 @@ class Class: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def base(self) -> Class: - r""" - @brief The base class or nil if the class does not have a base class - - This method has been introduced in version 0.22. - """ - def can_copy(self) -> bool: - r""" - @brief True if the class offers assignment - """ - def can_destroy(self) -> bool: - r""" - @brief True if the class offers a destroy method - - This method has been introduced in version 0.22. - """ def create(self) -> None: r""" @brief Ensures the C++ object is created @@ -934,105 +1766,27 @@ class Class: 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. """ - def doc(self) -> str: - r""" - @brief The documentation string for this class - """ - def each_child_class(self) -> Iterator[Class]: - r""" - @brief Iterate over all child classes defined within this class - """ - def each_method(self) -> Iterator[Method]: - r""" - @brief Iterate over all methods of this class - """ def is_const_object(self) -> bool: r""" @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. """ - def module(self) -> str: - r""" - @brief The name of module where the class lives - """ - def name(self) -> str: - r""" - @brief The name of the class - """ - def parent(self) -> Class: - r""" - @brief The parent of the class - """ - def python_methods(self, static: bool) -> List[PythonFunction]: - r""" - @brief Gets the Python methods (static or non-static) - """ - def python_properties(self, static: bool) -> List[PythonGetterSetterPair]: - r""" - @brief Gets the Python properties (static or non-static) as a list of getter/setter pairs - Note that if a getter or setter is not available the list of Python functions for this part is empty. - """ -class Logger: +class PythonFunction: r""" - @brief A logger - - The logger outputs messages to the log channels. If the log viewer is open, the log messages will be shown in the logger view. Otherwise they will be printed to the terminal on Linux for example. - - A code example: - - @code - RBA::Logger::error("An error message") - RBA::Logger::warn("A warning") - @/code - - This class has been introduced in version 0.23. - """ - verbosity: ClassVar[int] - r""" - @brief Returns the verbosity level - - The verbosity level is defined by the application (see -d command line option for example). Level 0 is silent, levels 10, 20, 30 etc. denote levels with increasing verbosity. 11, 21, 31 .. are sublevels which also enable timing logs in addition to messages. + @hide """ @classmethod - def error(cls, msg: str) -> None: - r""" - @brief Writes the given string to the error channel - - The error channel is formatted as an error (i.e. red in the logger window) and output unconditionally. - """ - @classmethod - def info(cls, msg: str) -> None: - r""" - @brief Writes the given string to the info channel - - The info channel is printed as neutral messages unconditionally. - """ - @classmethod - def log(cls, msg: str) -> None: - r""" - @brief Writes the given string to the log channel - - Log messages are printed as neutral messages and are output only if the verbosity is above 0. - """ - @classmethod - def new(cls) -> Logger: + def new(cls) -> PythonFunction: r""" @brief Creates a new object of this class """ - @classmethod - def warn(cls, msg: str) -> None: - r""" - @brief Writes the given string to the warning channel - - The warning channel is formatted as a warning (i.e. blue in the logger window) and output unconditionally. - """ - def __copy__(self) -> Logger: + def __copy__(self) -> PythonFunction: r""" @brief Creates a copy of self """ - def __deepcopy__(self) -> Logger: + def __deepcopy__(self) -> PythonFunction: r""" @brief Creates a copy of self """ @@ -1077,7 +1831,7 @@ class Logger: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def assign(self, other: Logger) -> None: + def assign(self, other: PythonFunction) -> None: r""" @brief Assigns another object to self """ @@ -1098,7 +1852,7 @@ class Logger: 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. """ - def dup(self) -> Logger: + def dup(self) -> PythonFunction: r""" @brief Creates a copy of self """ @@ -1108,6 +1862,369 @@ class Logger: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ + def is_protected(self) -> bool: + r""" + @brief Gets a value indicating whether this function is protected + """ + def is_static(self) -> bool: + r""" + @brief Gets the value indicating whether this Python function is 'static' (class function) + """ + def methods(self) -> List[Method]: + r""" + @brief Gets the list of methods bound to this Python function + """ + def name(self) -> str: + r""" + @brief Gets the name of this Python function + """ + +class PythonGetterSetterPair: + r""" + @hide + """ + @classmethod + def new(cls) -> PythonGetterSetterPair: + r""" + @brief Creates a new object of this class + """ + def __copy__(self) -> PythonGetterSetterPair: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> PythonGetterSetterPair: + r""" + @brief Creates a copy of self + """ + def __init__(self) -> None: + r""" + @brief Creates a new object of this class + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: PythonGetterSetterPair) -> None: + r""" + @brief Assigns another object to self + """ + def create(self) -> None: + r""" + @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. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def dup(self) -> PythonGetterSetterPair: + r""" + @brief Creates a copy of self + """ + def getter(self) -> PythonFunction: + r""" + @brief Gets the getter function + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def setter(self) -> PythonFunction: + r""" + @brief Gets the setter function + """ + +class Recipe: + r""" + @brief A facility for providing reproducible recipes + The idea of this facility is to provide a service by which an object + can be reproduced in a parametrized way. The intended use case is a + DRC report for example, where the DRC script is the generator. + + In this use case, the DRC engine will register a recipe. It will + put the serialized version of the recipe into the DRC report. If the + user requests a re-run of the DRC, the recipe will be called and + the implementation is supposed to deliver a new database. + + To register a recipe, reimplement the Recipe class and create an + instance. To serialize a recipe, use "generator", to execute the + recipe, use "make". + + Parameters are kept as a generic key/value map. + + This class has been introduced in version 0.26. + """ + @classmethod + def make(cls, generator: str, add_params: Optional[Dict[str, Any]] = ...) -> Any: + r""" + @brief Executes the recipe given by the generator string. + The generator string is the one delivered with \generator. + Additional parameters can be passed in "add_params". They have lower priority than the parameters kept inside the generator string. + """ + @classmethod + def new(cls, name: str, description: Optional[str] = ...) -> Recipe: + r""" + @brief Creates a new recipe object with the given name and (optional) description + """ + def __init__(self, name: str, description: Optional[str] = ...) -> None: + r""" + @brief Creates a new recipe object with the given name and (optional) description + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def create(self) -> None: + r""" + @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. + """ + def description(self) -> str: + r""" + @brief Gets the description of the recipe. + """ + def destroy(self) -> None: + r""" + @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. + """ + def destroyed(self) -> bool: + r""" + @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. + """ + def generator(self, params: Dict[str, Any]) -> str: + r""" + @brief Delivers the generator string from the given parameters. + The generator string can be used with \make to re-run the recipe. + """ + def is_const_object(self) -> bool: + r""" + @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. + """ + def name(self) -> str: + r""" + @brief Gets the name of the recipe. + """ + +class RelativeProgress(Progress): + r""" + @brief A progress reporter counting progress in relative units + + A relative progress reporter counts from 0 to some maximum value representing 0 to 100 percent completion of a task. The progress can be configured to have a description text, a title and a format. + The "inc" method increments the value, the "set" or "value=" methods set the value to a specific value. + + While one of these three methods is called, they will run the event loop in regular intervals. That makes the application respond to mouse clicks, specifically the Cancel button on the progress bar. If that button is clicked, an exception will be raised by these methods. + + The progress object must be destroyed explicitly in order to remove the progress status bar. + + A code example: + + @code + p = RBA::RelativeProgress::new("test", 10000000) + begin + 10000000.times { p.inc } + ensure + p.destroy + end + @/code + + This class has been introduced in version 0.23. + """ + @property + def format(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief sets the output format (sprintf notation) for the progress text + """ + @property + def value(self) -> None: + r""" + WARNING: This variable can only be set, not retrieved. + @brief Sets the progress value + """ + @overload + @classmethod + def new(cls, desc: str, max_value: int) -> RelativeProgress: + r""" + @brief Creates a relative progress reporter with the given description and maximum value + + The reported progress will be 0 to 100% for values between 0 and the maximum value. + The values are always integers. Double values cannot be used property. + """ + @overload + @classmethod + def new(cls, desc: str, max_value: int, yield_interval: int) -> RelativeProgress: + r""" + @brief Creates a relative progress reporter with the given description and maximum value + + The reported progress will be 0 to 100% for values between 0 and the maximum value. + The values are always integers. Double values cannot be used property. + + The yield interval specifies, how often the event loop will be triggered. When the yield interval is 10 for example, the event loop will be executed every tenth call of \inc or \set. + """ + def __copy__(self) -> RelativeProgress: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> RelativeProgress: + r""" + @brief Creates a copy of self + """ + @overload + def __init__(self, desc: str, max_value: int) -> None: + r""" + @brief Creates a relative progress reporter with the given description and maximum value + + The reported progress will be 0 to 100% for values between 0 and the maximum value. + The values are always integers. Double values cannot be used property. + """ + @overload + def __init__(self, desc: str, max_value: int, yield_interval: int) -> None: + r""" + @brief Creates a relative progress reporter with the given description and maximum value + + The reported progress will be 0 to 100% for values between 0 and the maximum value. + The values are always integers. Double values cannot be used property. + + The yield interval specifies, how often the event loop will be triggered. When the yield interval is 10 for example, the event loop will be executed every tenth call of \inc or \set. + """ + def _create(self) -> None: + r""" + @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. + """ + def _destroy(self) -> None: + r""" + @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. + """ + def _destroyed(self) -> bool: + r""" + @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. + """ + def _is_const_object(self) -> bool: + r""" + @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. + """ + def _manage(self) -> None: + r""" + @brief Marks the object as managed by the script side. + After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def _unmanage(self) -> None: + r""" + @brief Marks the object as no longer owned by the script side. + Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. + + Usually it's not required to call this method. It has been introduced in version 0.24. + """ + def assign(self, other: Progress) -> None: + r""" + @brief Assigns another object to self + """ + def dup(self) -> RelativeProgress: + r""" + @brief Creates a copy of self + """ + def inc(self) -> RelativeProgress: + r""" + @brief Increments the progress value + """ + def set(self, value: int, force_yield: bool) -> None: + r""" + @brief Sets the progress value + + This method is equivalent to \value=, but it allows forcing the event loop to be triggered. + If "force_yield" is true, the event loop will be triggered always, irregardless of the yield interval specified in the constructor. + """ class Timer: r""" @@ -1249,40 +2366,55 @@ class Timer: This method has been introduced in version 0.26. """ -class Progress: +class Value: r""" - @brief A progress reporter - - This is the base class for all progress reporter objects. Progress reporter objects are used to report the progress of some operation and to allow aborting an operation. Progress reporter objects must be triggered periodically, i.e. a value must be set. On the display side, a progress bar usually is used to represent the progress of an operation. - - Actual implementations of the progress reporter class are \RelativeProgress and \AbsoluteProgress. - - This class has been introduced in version 0.23. + @brief Encapsulates a value (preferably a plain data type) in an object + This class is provided to 'box' a value (encapsulate the value in an object). This class is required to interface to pointer or reference types in a method call. By using that class, the method can alter the value and thus implement 'out parameter' semantics. The value may be 'nil' which acts as a null pointer in pointer type arguments. + This class has been introduced in version 0.22. """ - desc: str + value: Any r""" Getter: - @brief Gets the description text of the progress object + @brief Gets the actual value. Setter: - @brief Sets the description text of the progress object + @brief Set the actual value. """ - @property - def title(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the title text of the progress object - - Initially the title is equal to the description. - """ + @overload @classmethod - def new(cls) -> Progress: + def new(cls) -> Value: r""" - @brief Creates a new object of this class + @brief Constructs a nil object. """ + @overload + @classmethod + def new(cls, value: Any) -> Value: + r""" + @brief Constructs a non-nil object with the given value. + This constructor has been introduced in version 0.22. + """ + def __copy__(self) -> Value: + r""" + @brief Creates a copy of self + """ + def __deepcopy__(self) -> Value: + r""" + @brief Creates a copy of self + """ + @overload def __init__(self) -> None: r""" - @brief Creates a new object of this class + @brief Constructs a nil object. + """ + @overload + def __init__(self, value: Any) -> None: + r""" + @brief Constructs a non-nil object with the given value. + This constructor has been introduced in version 0.22. + """ + def __str__(self) -> str: + r""" + @brief Convert this object to a string """ def _create(self) -> None: r""" @@ -1321,462 +2453,7 @@ class Progress: Usually it's not required to call this method. It has been introduced in version 0.24. """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class AbstractProgress(Progress): - r""" - @brief The abstract progress reporter - - The abstract progress reporter acts as a 'bracket' for a sequence of operations which are connected logically. For example, a DRC script consists of multiple operations. An abstract progress reportert is instantiated during the run time of the DRC script. This way, the application leaves the UI open while the DRC executes and log messages can be collected. - - The abstract progress does not have a value. - - This class has been introduced in version 0.27. - """ - @classmethod - def new(cls, desc: str) -> AbstractProgress: - r""" - @brief Creates an abstract progress reporter with the given description - """ - def __copy__(self) -> AbstractProgress: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> AbstractProgress: - r""" - @brief Creates a copy of self - """ - def __init__(self, desc: str) -> None: - r""" - @brief Creates an abstract progress reporter with the given description - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Progress) -> None: - r""" - @brief Assigns another object to self - """ - def dup(self) -> AbstractProgress: - r""" - @brief Creates a copy of self - """ - -class RelativeProgress(Progress): - r""" - @brief A progress reporter counting progress in relative units - - A relative progress reporter counts from 0 to some maximum value representing 0 to 100 percent completion of a task. The progress can be configured to have a description text, a title and a format. - The "inc" method increments the value, the "set" or "value=" methods set the value to a specific value. - - While one of these three methods is called, they will run the event loop in regular intervals. That makes the application respond to mouse clicks, specifically the Cancel button on the progress bar. If that button is clicked, an exception will be raised by these methods. - - The progress object must be destroyed explicitly in order to remove the progress status bar. - - A code example: - - @code - p = RBA::RelativeProgress::new("test", 10000000) - begin - 10000000.times { p.inc } - ensure - p.destroy - end - @/code - - This class has been introduced in version 0.23. - """ - @property - def format(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief sets the output format (sprintf notation) for the progress text - """ - @property - def value(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the progress value - """ - @overload - @classmethod - def new(cls, desc: str, max_value: int) -> RelativeProgress: - r""" - @brief Creates a relative progress reporter with the given description and maximum value - - The reported progress will be 0 to 100% for values between 0 and the maximum value. - The values are always integers. Double values cannot be used property. - """ - @overload - @classmethod - def new(cls, desc: str, max_value: int, yield_interval: int) -> RelativeProgress: - r""" - @brief Creates a relative progress reporter with the given description and maximum value - - The reported progress will be 0 to 100% for values between 0 and the maximum value. - The values are always integers. Double values cannot be used property. - - The yield interval specifies, how often the event loop will be triggered. When the yield interval is 10 for example, the event loop will be executed every tenth call of \inc or \set. - """ - def __copy__(self) -> RelativeProgress: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> RelativeProgress: - r""" - @brief Creates a copy of self - """ - @overload - def __init__(self, desc: str, max_value: int) -> None: - r""" - @brief Creates a relative progress reporter with the given description and maximum value - - The reported progress will be 0 to 100% for values between 0 and the maximum value. - The values are always integers. Double values cannot be used property. - """ - @overload - def __init__(self, desc: str, max_value: int, yield_interval: int) -> None: - r""" - @brief Creates a relative progress reporter with the given description and maximum value - - The reported progress will be 0 to 100% for values between 0 and the maximum value. - The values are always integers. Double values cannot be used property. - - The yield interval specifies, how often the event loop will be triggered. When the yield interval is 10 for example, the event loop will be executed every tenth call of \inc or \set. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Progress) -> None: - r""" - @brief Assigns another object to self - """ - def dup(self) -> RelativeProgress: - r""" - @brief Creates a copy of self - """ - def inc(self) -> RelativeProgress: - r""" - @brief Increments the progress value - """ - def set(self, value: int, force_yield: bool) -> None: - r""" - @brief Sets the progress value - - This method is equivalent to \value=, but it allows forcing the event loop to be triggered. - If "force_yield" is true, the event loop will be triggered always, irregardless of the yield interval specified in the constructor. - """ - -class AbsoluteProgress(Progress): - r""" - @brief A progress reporter counting progress in absolute units - - An absolute progress reporter counts from 0 upwards without a known limit. A unit value is used to convert the value to a bar value. One unit corresponds to 1% on the bar. - For formatted output, a format string can be specified as well as a unit value by which the current value is divided before it is formatted. - - The progress can be configured to have a description text, a title and a format. - The "inc" method increments the value, the "set" or "value=" methods set the value to a specific value. - - While one of these three methods is called, they will run the event loop in regular intervals. That makes the application respond to mouse clicks, specifically the Cancel button on the progress bar. If that button is clicked, an exception will be raised by these methods. - - The progress object must be destroyed explicitly in order to remove the progress status bar. - - The following sample code creates a progress bar which displays the current count as "Megabytes". - For the progress bar, one percent corresponds to 16 kByte: - - @code - p = RBA::AbsoluteProgress::new("test") - p.format = "%.2f MBytes" - p.unit = 1024*16 - p.format_unit = 1024*1024 - begin - 10000000.times { p.inc } - ensure - p.destroy - end - @/code - - This class has been introduced in version 0.23. - """ - @property - def format(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief sets the output format (sprintf notation) for the progress text - """ - @property - def format_unit(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the format unit - - This is the unit used for formatted output. - The current count is divided by the format unit to render - the value passed to the format string. - """ - @property - def unit(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the unit - - Specifies the count value corresponding to 1 percent on the progress bar. By default, the current value divided by the unit is used to create the formatted value from the output string. Another attribute is provided (\format_unit=) to specify a separate unit for that purpose. - """ - @property - def value(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the progress value - """ - @overload - @classmethod - def new(cls, desc: str) -> AbsoluteProgress: - r""" - @brief Creates an absolute progress reporter with the given description - """ - @overload - @classmethod - def new(cls, desc: str, yield_interval: int) -> AbsoluteProgress: - r""" - @brief Creates an absolute progress reporter with the given description - - The yield interval specifies, how often the event loop will be triggered. When the yield interval is 10 for example, the event loop will be executed every tenth call of \inc or \set. - """ - def __copy__(self) -> AbsoluteProgress: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> AbsoluteProgress: - r""" - @brief Creates a copy of self - """ - @overload - def __init__(self, desc: str) -> None: - r""" - @brief Creates an absolute progress reporter with the given description - """ - @overload - def __init__(self, desc: str, yield_interval: int) -> None: - r""" - @brief Creates an absolute progress reporter with the given description - - The yield interval specifies, how often the event loop will be triggered. When the yield interval is 10 for example, the event loop will be executed every tenth call of \inc or \set. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: Progress) -> None: - r""" - @brief Assigns another object to self - """ - def dup(self) -> AbsoluteProgress: - r""" - @brief Creates a copy of self - """ - def inc(self) -> AbsoluteProgress: - r""" - @brief Increments the progress value - """ - def set(self, value: int, force_yield: bool) -> None: - r""" - @brief Sets the progress value - - This method is equivalent to \value=, but it allows forcing the event loop to be triggered. - If "force_yield" is true, the event loop will be triggered always, irregardless of the yield interval specified in the constructor. - """ - -class ExpressionContext: - r""" - @brief Represents the context of an expression evaluation - - The context provides a variable namespace for the expression evaluation. - - This class has been introduced in version 0.26 when \Expression was separated into the execution and context part. - """ - @classmethod - def global_var(cls, name: str, value: Any) -> None: - r""" - @brief Defines a global variable with the given name and value - """ - @classmethod - def new(cls) -> ExpressionContext: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> ExpressionContext: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> ExpressionContext: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ExpressionContext) -> None: + def assign(self, other: Value) -> None: r""" @brief Assigns another object to self """ @@ -1797,223 +2474,7 @@ class ExpressionContext: 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. """ - def dup(self) -> ExpressionContext: - r""" - @brief Creates a copy of self - """ - def eval(self, expr: str) -> Any: - r""" - @brief Compiles and evaluates the given expression in this context - This method has been introduced in version 0.26. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def var(self, name: str, value: Any) -> None: - r""" - @brief Defines a variable with the given name and value - """ - -class Expression(ExpressionContext): - r""" - @brief Evaluation of Expressions - - This class allows evaluation of expressions. Expressions are used in many places throughout KLayout and provide computation features for various applications. Having a script language, there is no real use for expressions inside a script client. This class is provided mainly for testing purposes. - - An expression is 'compiled' into an Expression object and can be evaluated multiple times. - - This class has been introduced in version 0.25. In version 0.26 it was separated into execution and context. - """ - @property - def text(self) -> None: - r""" - WARNING: This variable can only be set, not retrieved. - @brief Sets the given text as the expression. - """ - @classmethod - def _class_eval(cls, expr: str) -> Any: - r""" - @brief A convience function to evaluate the given expression and directly return the result - This is a static method that does not require instantiation of the expression object first. - """ - @classmethod - def eval(cls, expr: str) -> Any: - r""" - @brief A convience function to evaluate the given expression and directly return the result - This is a static method that does not require instantiation of the expression object first. - """ - @overload - @classmethod - def new(cls, expr: str) -> Expression: - r""" - @brief Creates an expression evaluator - """ - @overload - @classmethod - def new(cls, expr: str, variables: Dict[str, Any]) -> Expression: - r""" - @brief Creates an expression evaluator - This version of the constructor takes a hash of variables available to the expressions. - """ - @overload - def __init__(self, expr: str) -> None: - r""" - @brief Creates an expression evaluator - """ - @overload - def __init__(self, expr: str, variables: Dict[str, Any]) -> None: - r""" - @brief Creates an expression evaluator - This version of the constructor takes a hash of variables available to the expressions. - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _inst_eval(self) -> Any: - r""" - @brief Evaluates the current expression and returns the result - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def eval(self) -> Any: - r""" - @brief Evaluates the current expression and returns the result - """ - -class GlobPattern: - r""" - @brief A glob pattern matcher - This class is provided to make KLayout's glob pattern matching available to scripts too. The intention is to provide an implementation which is compatible with KLayout's pattern syntax. - - This class has been introduced in version 0.26. - """ - case_sensitive: bool - r""" - Getter: - @brief Gets a value indicating whether the glob pattern match is case sensitive. - Setter: - @brief Sets a value indicating whether the glob pattern match is case sensitive. - """ - head_match: bool - r""" - Getter: - @brief Gets a value indicating whether trailing characters are allowed. - - Setter: - @brief Sets a value indicating whether trailing characters are allowed. - If this predicate is false, the glob pattern needs to match the full subject string. If true, the match function will ignore trailing characters and return true if the front part of the subject string matches. - """ - @classmethod - def new(cls, pattern: str) -> GlobPattern: - r""" - @brief Creates a new glob pattern match object - """ - def __copy__(self) -> GlobPattern: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> GlobPattern: - r""" - @brief Creates a copy of self - """ - def __init__(self, pattern: str) -> None: - r""" - @brief Creates a new glob pattern match object - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: GlobPattern) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> GlobPattern: + def dup(self) -> Value: r""" @brief Creates a copy of self """ @@ -2023,469 +2484,8 @@ class GlobPattern: This method returns true, if self is a const reference. In that case, only const methods may be called on self. """ - def match(self, subject: str) -> Any: + def to_s(self) -> str: r""" - @brief Matches the subject string against the pattern. - Returns nil if the subject string does not match the pattern. Otherwise returns a list with the substrings captured in round brackets. - """ - -class ExecutableBase: - r""" - @hide - @alias Executable - """ - @classmethod - def new(cls) -> ExecutableBase: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> ExecutableBase: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> ExecutableBase: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: ExecutableBase) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> ExecutableBase: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - -class Executable(ExecutableBase): - r""" - @brief A generic executable object - This object is a delegate for implementing the actual function of some generic executable function. In addition to the plain execution, if offers a post-mortem cleanup callback which is always executed, even if execute's implementation is cancelled in the debugger. - - Parameters are kept as a generic key/value map. - - This class has been introduced in version 0.27. - """ - def _assign(self, other: ExecutableBase) -> None: - r""" - @brief Assigns another object to self - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _dup(self) -> Executable: - r""" - @brief Creates a copy of self - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - -class Recipe: - r""" - @brief A facility for providing reproducible recipes - The idea of this facility is to provide a service by which an object - can be reproduced in a parametrized way. The intended use case is a - DRC report for example, where the DRC script is the generator. - - In this use case, the DRC engine will register a recipe. It will - put the serialized version of the recipe into the DRC report. If the - user requests a re-run of the DRC, the recipe will be called and - the implementation is supposed to deliver a new database. - - To register a recipe, reimplement the Recipe class and create an - instance. To serialize a recipe, use "generator", to execute the - recipe, use "make". - - Parameters are kept as a generic key/value map. - - This class has been introduced in version 0.26. - """ - @classmethod - def make(cls, generator: str, add_params: Optional[Dict[str, Any]] = ...) -> Any: - r""" - @brief Executes the recipe given by the generator string. - The generator string is the one delivered with \generator. - Additional parameters can be passed in "add_params". They have lower priority than the parameters kept inside the generator string. - """ - @classmethod - def new(cls, name: str, description: Optional[str] = ...) -> Recipe: - r""" - @brief Creates a new recipe object with the given name and (optional) description - """ - def __init__(self, name: str, description: Optional[str] = ...) -> None: - r""" - @brief Creates a new recipe object with the given name and (optional) description - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def create(self) -> None: - r""" - @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. - """ - def description(self) -> str: - r""" - @brief Gets the description of the recipe. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def generator(self, params: Dict[str, Any]) -> str: - r""" - @brief Delivers the generator string from the given parameters. - The generator string can be used with \make to re-run the recipe. - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def name(self) -> str: - r""" - @brief Gets the name of the recipe. - """ - -class PythonGetterSetterPair: - r""" - @hide - """ - @classmethod - def new(cls) -> PythonGetterSetterPair: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> PythonGetterSetterPair: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> PythonGetterSetterPair: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: PythonGetterSetterPair) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> PythonGetterSetterPair: - r""" - @brief Creates a copy of self - """ - def getter(self) -> PythonFunction: - r""" - @brief Gets the getter function - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def setter(self) -> PythonFunction: - r""" - @brief Gets the setter function - """ - -class PythonFunction: - r""" - @hide - """ - @classmethod - def new(cls) -> PythonFunction: - r""" - @brief Creates a new object of this class - """ - def __copy__(self) -> PythonFunction: - r""" - @brief Creates a copy of self - """ - def __deepcopy__(self) -> PythonFunction: - r""" - @brief Creates a copy of self - """ - def __init__(self) -> None: - r""" - @brief Creates a new object of this class - """ - def _create(self) -> None: - r""" - @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. - """ - def _destroy(self) -> None: - r""" - @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. - """ - def _destroyed(self) -> bool: - r""" - @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. - """ - def _is_const_object(self) -> bool: - r""" - @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. - """ - def _manage(self) -> None: - r""" - @brief Marks the object as managed by the script side. - After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def _unmanage(self) -> None: - r""" - @brief Marks the object as no longer owned by the script side. - Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. - - Usually it's not required to call this method. It has been introduced in version 0.24. - """ - def assign(self, other: PythonFunction) -> None: - r""" - @brief Assigns another object to self - """ - def create(self) -> None: - r""" - @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. - """ - def destroy(self) -> None: - r""" - @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. - """ - def destroyed(self) -> bool: - r""" - @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. - """ - def dup(self) -> PythonFunction: - r""" - @brief Creates a copy of self - """ - def is_const_object(self) -> bool: - r""" - @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. - """ - def is_protected(self) -> bool: - r""" - @brief Gets a value indicating whether this function is protected - """ - def is_static(self) -> bool: - r""" - @brief Gets the value indicating whether this Python function is 'static' (class function) - """ - def methods(self) -> List[Method]: - r""" - @brief Gets the list of methods bound to this Python function - """ - def name(self) -> str: - r""" - @brief Gets the name of this Python function + @brief Convert this object to a string """ diff --git a/src/pymod/pymod.pri b/src/pymod/pymod.pri index b4ea54c5a..defe86092 100644 --- a/src/pymod/pymod.pri +++ b/src/pymod/pymod.pri @@ -54,11 +54,26 @@ INSTALLS = lib_target msvc { QMAKE_POST_LINK += && $(COPY) $$shell_path($$PWD/distutils_src/klayout/$$PYI) $$shell_path($$DESTDIR_PYMOD) } else { - QMAKE_POST_LINK += && $(MKDIR) $$DESTDIR_PYMOD/$$REALMODULE && $(COPY) $$PWD/distutils_src/klayout/$$PYI $$DESTDIR_PYMOD + QMAKE_POST_LINK += && $(MKDIR) $$DESTDIR_PYMOD && $(COPY) $$PWD/distutils_src/klayout/$$PYI $$DESTDIR_PYMOD } POST_TARGETDEPS += $$PWD/distutils_src/klayout/$$PYI + # INSTALLS needs to be inside a lib or app templates. + modpyi_target.path = $$PREFIX/pymod/klayout + # This would be nice: + # init_target.files += $$DESTDIR_PYMOD/$$REALMODULE/* + # but some Qt versions need this explicitly: + msvc { + modpyi_target.extra = $(INSTALL_PROGRAM) $$shell_path($$DESTDIR_PYMOD/$$PYI) $$shell_path($(INSTALLROOT)$$PREFIX/pymod/klayout) + } else { + modpyi_target.extra = $(INSTALL_PROGRAM) $$DESTDIR_PYMOD/$$PYI $(INSTALLROOT)$$PREFIX/pymod/klayout + } + + # Not yet. As long as .pyi files are not generated automatically, + # this does not make much sense: + # INSTALLS += modpyi_target + } !equals(REALMODULE, "") {