API reference - Class EdgeNotation used in Ruby API documentation 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. Altough supported, edges are rarely used as individual database objects. See The Database API for more details about the database objects like the Edge class. Public constructors
Public methods
Public static methods and constants
Deprecated methods (protected, public, static, non-static and constructors)
Detailed description[const] bool !=(const Edge e)Description: Inequality test
[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. [const] bool <(const Edge e)Description: Less operator
[const] bool ==(const Edge e)Description: Equality test
void _createDescription: Ensures the C++ object is created Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. void _destroyDescription: Explicitly destroys the object Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing. [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. [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. void _manageDescription: Marks the object as managed by the script side. After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. Usually it's not required to call this method. It has been introduced in version 0.24. void _unmanageDescription: Marks the object as no longer owned by the script side. Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. Usually it's not required to call this method. It has been introduced in version 0.24. void assign(const Edge other)Description: Assigns another object to self [const] Box bboxDescription: Return the bounding box of the edge. [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. [const] bool contains?(const Point p)Description: 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. [const] bool contains_excl?(const Point p)Description: 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. void createDescription: Ensures the C++ object is created Use of this method is deprecated. Use _create instead [const] bool crossed_by?(const Edge e)Description: 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" [const] Point crossing_point(const Edge e)Description: 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. This method has been introduced in version 0.19. void destroyDescription: Explicitly destroys the object Use of this method is deprecated. Use _destroy instead [const] bool destroyed?Description: Returns a value indicating whether the object was already destroyed Use of this method is deprecated. Use _destroyed? instead [const] int distance(const Point p)Description: 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 "left" of the edge and positive if the point is to the "right". The distance is measured by projecting the point onto the line through the edge. If the edge is degenerated, the distance is not defined. [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. [const] new Edge ptr dupDescription: Creates a copy of self [const] int dxDescription: The horizontal extend of the edge. [const] unsigned int dx_absDescription: The absolute value of the horizontal extend of the edge. [const] int dyDescription: The vertical extend of the edge. [const] unsigned int dy_absDescription: The absolute value of the vertical extend of the edge. Edge enlarge(const Point 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. [const] Edge enlarged(const Point 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. 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. [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. [static] Edge from_dedge(const DEdge double_edge)Description: Construct an integer coordinate edge from a floating-point coordinate edge Create a integer coordinate edge from a floating-point coordinate edge [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. [const] bool intersect?(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. For degenerated edges, the intersection is mapped to point containment tests. [const] Point 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 is undefined. This method has been introduced in version 0.19. [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 [const] bool is_degenerate?Description: Test for degenerated edge An edge is degenerate, if both end and start point are identical. [const] bool is_parallel?(const Edge e)Description: Test for being parallel
[const] unsigned int lengthDescription: The length of the edge Edge move(const Point p)Description: Moves the edge.
Moves the edge by the given offset and returns the moved edge. The edge is overwritten. 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. [const] Edge moved(const Point 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. [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. [static] new Edge ptr newDescription: Default constructor: creates a degenerated edge 0,0 to 0,0 Python specific notes:This method is the default initializer of the object [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:This method is the default initializer of the object [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:This method is the default initializer of the object [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 [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 [const] unsigned int ortho_lengthDescription: The orthogonal length of the edge ("manhattan-length")
[const] Point p1Description: The first point. Python specific notes:The object exposes a readable attribute 'p1'. This is the getter. void p1=(const Point point)Description: Sets the first point. This method has been added in version 0.23. Python specific notes:The object exposes a writable attribute 'p1'. This is the setter. [const] Point p2Description: The second point. Python specific notes:The object exposes a readable attribute 'p2'. This is the getter. void p2=(const Point point)Description: Sets the second point. This method has been added in version 0.23. Python specific notes:The object exposes a writable attribute 'p2'. This is the setter. 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. [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. [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. [const] long sq_lengthDescription: The square of the length of the edge Edge swap_pointsDescription: 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. [const] Edge swapped_pointsDescription: 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. [const] string to_sDescription: Returns a string representing the edge Python specific notes:This method is also available as 'str(object)' [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. [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. [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. [const] Edge transformed_cplx(const ICplxTrans t)Description: Transform the edge.
Use of this method is deprecated. Use transformed instead [const] DEdge transformed_cplx(const CplxTrans t)Description: Transform the edge.
Use of this method is deprecated. Use transformed instead [const] int x1Description: Shortcut for p1.x Python specific notes:The object exposes a readable attribute 'x1'. This is the getter. void x1=(int coord)Description: Sets p1.x This method has been added in version 0.23. Python specific notes:The object exposes a writable attribute 'x1'. This is the setter. [const] int x2Description: Shortcut for p2.x Python specific notes:The object exposes a readable attribute 'x2'. This is the getter. void x2=(int coord)Description: Sets p2.x This method has been added in version 0.23. Python specific notes:The object exposes a writable attribute 'x2'. This is the setter. [const] int y1Description: Shortcut for p1.y Python specific notes:The object exposes a readable attribute 'y1'. This is the getter. void y1=(int coord)Description: Sets p1.y This method has been added in version 0.23. Python specific notes:The object exposes a writable attribute 'y1'. This is the setter. [const] int y2Description: Shortcut for p2.y Python specific notes:The object exposes a readable attribute 'y2'. This is the getter. void y2=(int coord)Description: Sets p2.y This method has been added in version 0.23. Python specific notes:The object exposes a writable attribute 'y2'. This is the setter. |