Infinite lines. More...
#include <ogdf/basic/geometry.h>
Public Types | |
using | numberType = typename PointType::numberType |
Public Member Functions | |
GenericLine () | |
Creates an empty line. More... | |
GenericLine (const GenericLine< PointType > &dl) | |
Copy constructor. More... | |
GenericLine (const PointType &p1, const PointType &p2) | |
Creates a line through the points p1 and p2 . 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 456 of file geometry.h.
using ogdf::GenericLine< PointType >::numberType = typename PointType::numberType |
Definition at line 458 of file geometry.h.
|
inline |
Creates an empty line.
Definition at line 472 of file geometry.h.
|
inline |
Creates a line through the points p1
and p2
.
Definition at line 475 of file geometry.h.
|
inline |
Copy constructor.
Definition at line 478 of file geometry.h.
|
inline |
Creates a line through the points (x1
,y1
) and (x2
,y2
).
Definition at line 481 of file geometry.h.
|
inlinevirtual |
Returns true iff p
lies on this line.
Definition at line 560 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 524 of file geometry.h.
|
inlineprotected |
Returns the x-coordinate of the difference (second point - first point).
Definition at line 465 of file geometry.h.
|
inlineprotected |
Returns the y-coordinate of the difference (second point - first point).
Definition at line 468 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 588 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 536 of file geometry.h.
|
inline |
Returns true iff this line runs horizontally.
Definition at line 506 of file geometry.h.
|
inline |
Returns true iff this line runs vertically.
Definition at line 503 of file geometry.h.
|
inline |
Inequality operator.
Definition at line 491 of file geometry.h.
|
inline |
Assignment operator.
Definition at line 494 of file geometry.h.
|
inline |
Equality operator.
Definition at line 485 of file geometry.h.
|
inline |
Returns the slope of the line.
Definition at line 509 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 605 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 513 of file geometry.h.
|
protected |
The first point of the line.
Definition at line 461 of file geometry.h.
|
protected |
The second point of the line.
Definition at line 462 of file geometry.h.