Line segments with real coordinates. More...
#include <ogdf/basic/geometry.h>
Inheritance diagram for ogdf::DSegment:Public Member Functions | |
| DSegment () | |
| Creates an empty line segment. More... | |
| DSegment (const DPoint &p1, const DPoint &p2) | |
Creates a line segment from p1 to p2. More... | |
| DSegment (const DLine &dl) | |
Creates a line segment defined by the start and end point of line dl. More... | |
| DSegment (double x1, double y1, double x2, double y2) | |
Creates a line segment from (x1,y1) to (x2,y2). More... | |
| DSegment (const DSegment &ds) | |
| Copy constructor. More... | |
| double | det (const DSegment &segment) const |
Determines if segment is left or right of this segment. More... | |
Public Member Functions inherited from ogdf::DLine | |
| DLine () | |
| Creates an empty line. More... | |
| DLine (const DPoint &p1, const DPoint &p2) | |
Creates a line with start point p1 and end point p2. More... | |
| DLine (const DLine &dl) | |
| Copy constructor. More... | |
| DLine (double x1, double y1, double x2, double y2) | |
Creates a line with start point (x1,y1) and end point (x2,y2). More... | |
| bool | contains (const DPoint &p) const |
Returns true iff p lie on this line. More... | |
| double | dx () const |
| Returns the x-coordinate of the difference (end point - start point). More... | |
| double | dy () const |
| Returns the y-coordinate of the difference (end point - start point). More... | |
| const DPoint & | end () const |
| Returns the end point of the line. More... | |
| int | horIntersection (const double horAxis, double &crossing) const |
Computes the intersection between this line and the horizontal line through y = horAxis. More... | |
| bool | intersection (const DLine &line, DPoint &inter, bool endpoints=true) const |
Returns true iff line and this line intersect. More... | |
| bool | intersectionOfLines (const DLine &line, DPoint &inter) const |
| bool | isHorizontal () const |
| Returns true iff this line runs horizontally. More... | |
| bool | isVertical () const |
| Returns true iff this line runs vertically. More... | |
| double | length () const |
| Returns the length (euclidean distance between start and edn point) of this line. More... | |
| bool | operator!= (const DLine &dl) const |
| Inequality operator. More... | |
| DLine & | operator= (const DLine &dl) |
| Assignment operator. More... | |
| bool | operator== (const DLine &dl) const |
| Equality operator. More... | |
| double | slope () const |
| Returns the slope of the line. More... | |
| const DPoint & | start () const |
| Returns the start point of the line. More... | |
| int | verIntersection (const double verAxis, double &crossing) const |
Computes the intersection between this line and the vertical line through x = verAxis. More... | |
| double | yAbs () const |
| Returns the value y' such that (0,y') lies on the unlimited straight-line define dby this line. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ogdf::DLine | |
| DPoint | m_end |
| The end point of the line. More... | |
| DPoint | m_start |
| The start point of the line. More... | |
Line segments with real coordinates.
Definition at line 778 of file geometry.h.
|
inline |
Creates an empty line segment.
Definition at line 785 of file geometry.h.
Creates a line segment from p1 to p2.
Definition at line 788 of file geometry.h.
|
inlineexplicit |
Creates a line segment defined by the start and end point of line dl.
Definition at line 791 of file geometry.h.
|
inline |
Creates a line segment from (x1,y1) to (x2,y2).
Definition at line 794 of file geometry.h.
|
inline |
Copy constructor.
Definition at line 797 of file geometry.h.
|
inline |
Determines if segment is left or right of this segment.
segment is left of this segment, and a a negative number if segment is right of this segment. Definition at line 806 of file geometry.h.