Infinite lines. More...
#include <ogdf/basic/geometry.h>
Inheritance diagram for ogdf::GenericLine< PointType >:Public Types | |
| using | numberType = typename PointType::numberType |
Public Member Functions | |
| GenericLine () | |
| Creates an empty line. More... | |
| GenericLine (const PointType &p1, const PointType &p2) | |
Creates a line through the points p1 and p2. More... | |
| GenericLine (const GenericLine< PointType > &dl) | |
| Copy constructor. More... | |
| GenericLine (numberType x1, numberType y1, numberType x2, numberType y2) | |
Creates a line through the points (x1,y1) and (x2,y2). More... | |
| virtual bool | contains (const DPoint &p) const |
Returns true iff p lies on this line. More... | |
| double | det (const GenericLine< PointType > &line) const |
Determines if line is left or right of this line. More... | |
| virtual IntersectionType | horIntersection (const double horAxis, double &crossing) const |
Computes the intersection of this line and the horizontal line through y = horAxis. More... | |
| IntersectionType | intersection (const GenericLine< PointType > &line, DPoint &inter) const |
Returns an IntersectionType specifying whether line and this line intersect. More... | |
| bool | isHorizontal () const |
| Returns true iff this line runs horizontally. More... | |
| bool | isVertical () const |
| Returns true iff this line runs vertically. More... | |
| bool | operator!= (const GenericLine< PointType > &dl) const |
| Inequality operator. More... | |
| GenericLine< PointType > & | operator= (const GenericLine< PointType > &dl) |
| Assignment operator. More... | |
| bool | operator== (const GenericLine< PointType > &dl) const |
| Equality operator. More... | |
| double | slope () const |
| Returns the slope of the line. More... | |
| virtual IntersectionType | 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 defined by this line. More... | |
Protected Member Functions | |
| numberType | dx () const |
| Returns the x-coordinate of the difference (second point - first point). More... | |
| numberType | dy () const |
| Returns the y-coordinate of the difference (second point - first point). More... | |
Protected Attributes | |
| PointType | m_p1 |
| The first point of the line. More... | |
| PointType | m_p2 |
| The second point of the line. More... | |
Infinite lines.
Definition at line 446 of file geometry.h.
| using ogdf::GenericLine< PointType >::numberType = typename PointType::numberType |
Definition at line 449 of file geometry.h.
|
inline |
Creates an empty line.
Definition at line 463 of file geometry.h.
|
inline |
Creates a line through the points p1 and p2.
Definition at line 466 of file geometry.h.
|
inline |
Copy constructor.
Definition at line 469 of file geometry.h.
|
inline |
Creates a line through the points (x1,y1) and (x2,y2).
Definition at line 472 of file geometry.h.
|
inlinevirtual |
Returns true iff p lies on this line.
Definition at line 555 of file geometry.h.
|
inline |
Determines if line is left or right of this line.
| line | is the second line. |
line is left of this line, and a negative number if line is right of this line. Definition at line 519 of file geometry.h.
|
inlineprotected |
Returns the x-coordinate of the difference (second point - first point).
Definition at line 456 of file geometry.h.
|
inlineprotected |
Returns the y-coordinate of the difference (second point - first point).
Definition at line 459 of file geometry.h.
|
inlinevirtual |
Computes the intersection of this line and the horizontal line through y = horAxis.
| horAxis | defines the horizontal line. |
| crossing | is assigned the x-coordinate of the intersection point. |
horAxis. Reimplemented in ogdf::GenericSegment< PointType >.
Definition at line 584 of file geometry.h.
|
inline |
Returns an IntersectionType specifying whether line and this line intersect.
| line | is the second line. |
| inter | is assigned an intersection point if IntersectionType::SinglePoint or IntersectionType::Overlapping is returned. |
Definition at line 531 of file geometry.h.
|
inline |
Returns true iff this line runs horizontally.
Definition at line 499 of file geometry.h.
|
inline |
Returns true iff this line runs vertically.
Definition at line 496 of file geometry.h.
|
inline |
Inequality operator.
Definition at line 482 of file geometry.h.
|
inline |
Assignment operator.
Definition at line 487 of file geometry.h.
|
inline |
Equality operator.
Definition at line 476 of file geometry.h.
|
inline |
Returns the slope of the line.
Definition at line 502 of file geometry.h.
|
inlinevirtual |
Computes the intersection between this line and the vertical line through x = verAxis.
| verAxis | defines the vertical line. |
| crossing | is assigned the y-coordinate of the intersection point. |
verAxis. Reimplemented in ogdf::GenericSegment< PointType >.
Definition at line 602 of file geometry.h.
|
inline |
Returns the value y' such that (0,y') lies on the unlimited straight-line defined by this line.
Definition at line 508 of file geometry.h.
|
protected |
The first point of the line.
Definition at line 452 of file geometry.h.
|
protected |
The second point of the line.
Definition at line 453 of file geometry.h.