Notation used in Ruby API documentation
Module: db
Description: 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.
new Edge ptr | new | (const DEdge dedge) | Creates an integer coordinate edge from a floating-point coordinate edge |
new Edge ptr | new | Default constructor: creates a degenerated edge 0,0 to 0,0 | |
new Edge ptr | new | (int x1, int y1, int x2, int y2) | Constructor with two coordinates given as single values |
new Edge ptr | new | (const Point p1, const Point p2) | Constructor with two points |
[const] | bool | != | (const Edge e) | Inequality test |
[const] | Edge | * | (double scale_factor) | Scale edge |
[const] | bool | < | (const Edge e) | Less operator |
[const] | bool | == | (const Edge e) | Equality test |
[const] | Edge ptr | _const_cast | Returns a non-const reference to self. | |
void | _create | Ensures the C++ object is created | ||
void | _destroy | Explicitly destroys the object | ||
[const] | bool | _destroyed? | Returns a value indicating whether the object was already destroyed | |
[const] | bool | _is_const_object? | Returns a value indicating whether the reference is a const reference | |
void | _manage | Marks the object as managed by the script side. | ||
void | _unmanage | Marks the object as no longer owned by the script side. | ||
void | assign | (const Edge other) | Assigns another object to self | |
[const] | Box | bbox | Return the bounding box of the edge. | |
[const] | variant | clipped | (const Box box) | Returns the edge clipped at the given box |
[const] | variant | clipped_line | (const Box box) | Returns the line through the edge clipped at the given box |
[const] | bool | coincident? | (const Edge e) | Coincidence check. |
[const] | bool | contains? | (const Point p) | Tests whether a point is on an edge. |
[const] | bool | contains_excl? | (const Point p) | Tests whether a point is on an edge excluding the endpoints. |
[const] | bool | crossed_by? | (const Edge e) | Checks, if the line given by self is crossed by the edge e |
[const] | Point | crossing_point | (const Edge e) | Returns the crossing point on two edges. |
[const] | variant | cut_point | (const Edge e) | Returns the intersection point of the lines through the two edges. |
[const] | Vector | d | Gets the edge extension as a vector. | |
[const] | int | distance | (const Point p) | Gets the distance of the point from the line through the edge. |
[const] | unsigned int | distance_abs | (const Point p) | Absolute distance between the edge and a point. |
[const] | new Edge ptr | dup | Creates a copy of self | |
[const] | int | dx | The horizontal extend of the edge. | |
[const] | unsigned int | dx_abs | The absolute value of the horizontal extend of the edge. | |
[const] | int | dy | The vertical extend of the edge. | |
[const] | unsigned int | dy_abs | The absolute value of the vertical extend of the edge. | |
Edge | enlarge | (const Vector p) | Enlarges the edge. | |
[const] | Edge | enlarged | (const Vector p) | Returns the enlarged edge (does not modify self) |
unsigned int | euclidian_distance | (const Point p) | Gets the distance of the point from the the edge. | |
Edge | extend | (int d) | Extends the edge (modifies self) | |
[const] | Edge | extended | (int d) | Returns the extended edge (does not modify self) |
[const] | unsigned long | hash | Computes a hash value | |
[const] | variant | intersection_point | (const Edge e) | Returns the intersection point of two edges. |
[const] | bool | intersects? | (const Edge e) | Intersection test. |
[const] | bool | is_degenerate? | Test for degenerated edge | |
[const] | bool | is_parallel? | (const Edge e) | Test for being parallel |
[const] | unsigned int | length | The length of the edge | |
Edge | move | (const Vector p) | Moves the edge. | |
Edge | move | (int dx, int dy) | Moves the edge. | |
[const] | Edge | moved | (const Vector p) | Returns the moved edge (does not modify self) |
[const] | Edge | moved | (int dx, int dy) | Returns the moved edge (does not modify self) |
[const] | unsigned int | ortho_length | The orthogonal length of the edge ("manhattan-length") | |
[const] | Point | p1 | The first point. | |
void | p1= | (const Point point) | Sets the first point. | |
[const] | Point | p2 | The second point. | |
void | p2= | (const Point point) | Sets the second point. | |
Edge | shift | (int d) | Shifts the edge (modifies self) | |
[const] | Edge | shifted | (int d) | Returns the shifted edge (does not modify self) |
[const] | int | side_of | (const Point p) | Indicates at which side the point is located relative to the edge. |
[const] | long | sq_length | The square of the length of the edge | |
Edge | swap_points | Swap the points of the edge | ||
[const] | Edge | swapped_points | Returns an edge in which both points are swapped | |
[const] | DEdge | to_dtype | (double dbu = 1) | Converts the edge to a floating-point coordinate edge |
[const] | string | to_s | (double dbu = 0) | Returns a string representing the edge |
[const] | Edge | transformed | (const ICplxTrans t) | Transform the edge. |
[const] | Edge | transformed | (const Trans t) | Transform the edge. |
[const] | DEdge | transformed | (const CplxTrans t) | Transform the edge. |
[const] | int | x1 | Shortcut for p1.x | |
void | x1= | (int coord) | Sets p1.x | |
[const] | int | x2 | Shortcut for p2.x | |
void | x2= | (int coord) | Sets p2.x | |
[const] | int | y1 | Shortcut for p1.y | |
void | y1= | (int coord) | Sets p1.y | |
[const] | int | y2 | Shortcut for p2.y | |
void | y2= | (int coord) | Sets p2.y |
new Edge ptr | from_s | (string s) | Creates an object from a string |
void | create | Use of this method is deprecated. Use _create instead | ||
void | destroy | Use of this method is deprecated. Use _destroy instead | ||
[const] | bool | destroyed? | Use of this method is deprecated. Use _destroyed? instead | |
[static] | new Edge ptr | from_dedge | (const DEdge dedge) | Use of this method is deprecated. Use new instead |
[const] | bool | intersect? | (const Edge e) | Use of this method is deprecated. Use intersects? instead |
[const] | bool | is_const_object? | Use of this method is deprecated. Use _is_const_object? instead | |
[static] | new Edge ptr | new_pp | (const Point p1, const Point p2) | Use of this method is deprecated. Use new instead |
[static] | new Edge ptr | new_xyxy | (int x1, int y1, int x2, int y2) | Use of this method is deprecated. Use new instead |
[const] | DEdge | transformed_cplx | (const CplxTrans t) | Use of this method is deprecated. Use transformed instead |
!= | Signature: [const] bool != (const Edge e) Description: Inequality test
| |||||
* | Signature: [const] Edge * (double scale_factor) Description: Scale edge
The * operator scales self with the given factor. This method has been introduced in version 0.22. Python specific notes: | |||||
< | Signature: [const] bool < (const Edge e) Description: Less operator
| |||||
== | Signature: [const] bool == (const Edge e) Description: Equality test
| |||||
_const_cast | Signature: [const] Edge ptr _const_cast Description: Returns a non-const reference to self. Basically, this method allows turning a const object reference to a non-const one. This method is provided as last resort to remove the constness from an object. Usually there is a good reason for a const object reference, so using this method may have undesired side effects. This method has been introduced in version 0.29.6. | |||||
_create | Signature: void _create Description: Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. | |||||
_destroy | Signature: void _destroy Description: Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing. | |||||
_destroyed? | Signature: [const] bool _destroyed? Description: Returns a value indicating whether the object was already destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. | |||||
_is_const_object? | Signature: [const] bool _is_const_object? Description: Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self. | |||||
_manage | Signature: void _manage Description: Marks the object as managed by the script side. After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. Usually it's not required to call this method. It has been introduced in version 0.24. | |||||
_unmanage | Signature: void _unmanage Description: Marks the object as no longer owned by the script side. Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. Usually it's not required to call this method. It has been introduced in version 0.24. | |||||
assign | Signature: void assign (const Edge other) Description: Assigns another object to self | |||||
bbox | Signature: [const] Box bbox Description: Return the bounding box of the edge. | |||||
clipped | Signature: [const] variant clipped (const Box box) Description: Returns the edge clipped at the given box
This method has been introduced in version 0.26.2. | |||||
clipped_line | Signature: [const] variant clipped_line (const Box box) Description: Returns the line through the edge clipped at the given 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. | |||||
coincident? | Signature: [const] bool coincident? (const Edge e) Description: 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. | |||||
contains? | Signature: [const] bool contains? (const Point p) Description: Tests 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. | |||||
contains_excl? | Signature: [const] bool contains_excl? (const Point p) Description: Tests 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. | |||||
create | Signature: void create Description: Ensures the C++ object is created Use of this method is deprecated. Use _create instead Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. | |||||
crossed_by? | Signature: [const] bool crossed_by? (const Edge e) Description: Checks, if the line given by self is crossed by the edge e
self if considered an infinite line. This predicate renders true if the edge e is cut by this line. In other words: this method returns true if e.p1 is in one semispace of self while e.p2 is in the other or one of them is exactly on self. | |||||
crossing_point | Signature: [const] Point crossing_point (const Edge e) Description: Returns the crossing point on two edges.
This method delivers the point where the given line (self) crosses the edge given by the argument "e". self is considered infinitely long and is required to cut through the edge "e". If self does not cut this line, the result is undefined. See crossed_by? for a description of the crossing predicate. This method has been introduced in version 0.19. | |||||
cut_point | Signature: [const] variant cut_point (const Edge e) Description: 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. This method has been introduced in version 0.27.1. | |||||
d | Signature: [const] Vector d Description: Gets the edge extension as a vector. This method is equivalent to p2 - p1. This method has been introduced in version 0.26.2. | |||||
destroy | Signature: void destroy Description: Explicitly destroys the object Use of this method is deprecated. Use _destroy instead Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing. | |||||
destroyed? | Signature: [const] bool destroyed? Description: Returns a value indicating whether the object was already destroyed Use of this method is deprecated. Use _destroyed? instead This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself. | |||||
distance | Signature: [const] int distance (const Point p) Description: Gets the distance of the point from the line through the edge.
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. This method considers the edge to define an infinite line running through it. distance returns the distance of 'p' to this line. A similar method is euclidian_distance, but the latter regards the edge a finite set of points between the endpoints. | |||||
distance_abs | Signature: [const] unsigned int distance_abs (const Point p) Description: Absolute distance between the edge and a point.
Returns the distance between the edge and the point. | |||||
dup | Signature: [const] new Edge ptr dup Description: Creates a copy of self Python specific notes: | |||||
dx | Signature: [const] int dx Description: The horizontal extend of the edge. | |||||
dx_abs | Signature: [const] unsigned int dx_abs Description: The absolute value of the horizontal extend of the edge. | |||||
dy | Signature: [const] int dy Description: The vertical extend of the edge. | |||||
dy_abs | Signature: [const] unsigned int dy_abs Description: The absolute value of the vertical extend of the edge. | |||||
enlarge | Signature: Edge enlarge (const Vector p) Description: 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. | |||||
enlarged | Signature: [const] Edge enlarged (const Vector p) Description: 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. | |||||
euclidian_distance | Signature: unsigned int euclidian_distance (const Point p) Description: Gets the distance of the point from the the edge.
Returns the minimum distance of the point to any point on the edge. Unlike distance, the edge is considered a finite set of points between the endpoints. The result is also not signed like it is the case for distance. This method has been introduced in version 0.28.14. | |||||
extend | Signature: Edge extend (int d) Description: 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. | |||||
extended | Signature: [const] Edge extended (int d) Description: 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. | |||||
from_dedge | Signature: [static] new Edge ptr from_dedge (const DEdge dedge) Description: Creates an integer coordinate edge from a floating-point coordinate edge Use of this method is deprecated. Use new instead This constructor has been introduced in version 0.25 and replaces the previous static method 'from_dedge'. Python specific notes: | |||||
from_s | Signature: [static] new Edge ptr from_s (string s) Description: 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. | |||||
hash | Signature: [const] unsigned long hash Description: 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. Python specific notes: | |||||
intersect? | Signature: [const] bool intersect? (const Edge e) Description: Intersection test.
Use of this method is deprecated. Use intersects? instead Returns true if the edges intersect. Two edges intersect if they share at least one point. If the edges coincide, they also intersect. If one of the edges is degenerate (both points are identical), that point is required to sit exaclty on the other edge. If both edges are degenerate, their points are required to be identical. The 'intersects' (with an 's') synonym has been introduced in version 0.28.12. | |||||
intersection_point | Signature: [const] variant intersection_point (const Edge e) Description: Returns the intersection point of two edges.
This method delivers the intersection point. If the edges do not intersect, the result will be nil. This method has been introduced in version 0.19. From version 0.26.2, this method will return nil in case of non-intersection. | |||||
intersects? | Signature: [const] bool intersects? (const Edge e) Description: 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. If one of the edges is degenerate (both points are identical), that point is required to sit exaclty on the other edge. If both edges are degenerate, their points are required to be identical. The 'intersects' (with an 's') synonym has been introduced in version 0.28.12. | |||||
is_const_object? | Signature: [const] bool is_const_object? Description: Returns a value indicating whether the reference is a const reference Use of this method is deprecated. Use _is_const_object? instead This method returns true, if self is a const reference. In that case, only const methods may be called on self. | |||||
is_degenerate? | Signature: [const] bool is_degenerate? Description: Test for degenerated edge An edge is degenerate, if both end and start point are identical. | |||||
is_parallel? | Signature: [const] bool is_parallel? (const Edge e) Description: Test for being parallel
| |||||
length | Signature: [const] unsigned int length Description: The length of the edge | |||||
move | (1) Signature: Edge move (const Vector p) Description: Moves the edge.
Moves the edge by the given offset and returns the moved edge. The edge is overwritten. | |||||
(2) Signature: Edge move (int dx, int dy) Description: Moves the edge.
Moves the edge by the given offset and returns the moved edge. The edge is overwritten. This version has been added in version 0.23. | ||||||
moved | (1) Signature: [const] Edge moved (const Vector p) Description: 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. | |||||
(2) Signature: [const] Edge moved (int dx, int dy) Description: 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. This version has been added in version 0.23. | ||||||
new | (1) Signature: [static] new Edge ptr new (const DEdge dedge) Description: 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'. Python specific notes: | |||||
(2) Signature: [static] new Edge ptr new Description: Default constructor: creates a degenerated edge 0,0 to 0,0 Python specific notes: | ||||||
(3) Signature: [static] new Edge ptr new (int x1, int y1, int x2, int y2) Description: Constructor with two coordinates given as single values Two points are given to create a new edge. Python specific notes: | ||||||
(4) Signature: [static] new Edge ptr new (const Point p1, const Point p2) Description: Constructor with two points Two points are given to create a new edge. Python specific notes: | ||||||
new_pp | Signature: [static] new Edge ptr new_pp (const Point p1, const Point p2) Description: Constructor with two points Use of this method is deprecated. Use new instead Two points are given to create a new edge. Python specific notes: | |||||
new_xyxy | Signature: [static] new Edge ptr new_xyxy (int x1, int y1, int x2, int y2) Description: Constructor with two coordinates given as single values Use of this method is deprecated. Use new instead Two points are given to create a new edge. Python specific notes: | |||||
ortho_length | Signature: [const] unsigned int ortho_length Description: The orthogonal length of the edge ("manhattan-length")
| |||||
p1 | Signature: [const] Point p1 Description: The first point. Python specific notes: | |||||
p1= | Signature: void p1= (const Point point) Description: Sets the first point. This method has been added in version 0.23. Python specific notes: | |||||
p2 | Signature: [const] Point p2 Description: The second point. Python specific notes: | |||||
p2= | Signature: void p2= (const Point point) Description: Sets the second point. This method has been added in version 0.23. Python specific notes: | |||||
shift | Signature: Edge shift (int d) Description: 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. | |||||
shifted | Signature: [const] Edge shifted (int d) Description: 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. | |||||
side_of | Signature: [const] int side_of (const Point p) Description: 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. | |||||
sq_length | Signature: [const] long sq_length Description: The square of the length of the edge | |||||
swap_points | Signature: Edge swap_points Description: 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. | |||||
swapped_points | Signature: [const] Edge swapped_points Description: 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. | |||||
to_dtype | Signature: [const] DEdge to_dtype (double dbu = 1) Description: 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. | |||||
to_s | Signature: [const] string to_s (double dbu = 0) Description: 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. Python specific notes: | |||||
transformed | (1) Signature: [const] Edge transformed (const ICplxTrans t) Description: Transform the edge.
Transforms the edge with the given complex transformation. Does not modify the edge but returns the transformed edge. This method has been introduced in version 0.18. | |||||
(2) Signature: [const] Edge transformed (const Trans t) Description: Transform the edge.
Transforms the edge with the given transformation. Does not modify the edge but returns the transformed edge. | ||||||
(3) Signature: [const] DEdge transformed (const CplxTrans t) Description: Transform the edge.
Transforms the edge with the given complex transformation. Does not modify the edge but returns the transformed edge. | ||||||
transformed_cplx | Signature: [const] DEdge transformed_cplx (const CplxTrans t) Description: Transform the edge.
Use of this method is deprecated. Use transformed instead Transforms the edge with the given complex transformation. Does not modify the edge but returns the transformed edge. | |||||
x1 | Signature: [const] int x1 Description: Shortcut for p1.x Python specific notes: | |||||
x1= | Signature: void x1= (int coord) Description: Sets p1.x This method has been added in version 0.23. Python specific notes: | |||||
x2 | Signature: [const] int x2 Description: Shortcut for p2.x Python specific notes: | |||||
x2= | Signature: void x2= (int coord) Description: Sets p2.x This method has been added in version 0.23. Python specific notes: | |||||
y1 | Signature: [const] int y1 Description: Shortcut for p1.y Python specific notes: | |||||
y1= | Signature: void y1= (int coord) Description: Sets p1.y This method has been added in version 0.23. Python specific notes: | |||||
y2 | Signature: [const] int y2 Description: Shortcut for p2.y Python specific notes: | |||||
y2= | Signature: void y2= (int coord) Description: Sets p2.y This method has been added in version 0.23. Python specific notes: |