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. | |
| GenericLine (const GenericLine< PointType > &dl) | |
| Copy constructor. | |
| GenericLine (const PointType &p1, const PointType &p2) | |
Creates a line through the points p1 and p2. | |
| GenericLine (numberType x1, numberType y1, numberType x2, numberType y2) | |
Creates a line through the points (x1,y1) and (x2,y2). | |
| virtual bool | contains (const DPoint &p) const |
Returns true iff p lies on this line. | |
| double | det (const GenericLine< PointType > &line) const |
Determines if line is left or right of this line. | |
| virtual IntersectionType | horIntersection (const double horAxis, double &crossing) const |
Computes the intersection of this line and the horizontal line through y = horAxis. | |
| IntersectionType | intersection (const GenericLine< PointType > &line, DPoint &inter) const |
Returns an IntersectionType specifying whether line and this line intersect. | |
| bool | isHorizontal () const |
| Returns true iff this line runs horizontally. | |
| bool | isVertical () const |
| Returns true iff this line runs vertically. | |
| bool | operator!= (const GenericLine< PointType > &dl) const |
| Inequality operator. | |
| GenericLine< PointType > & | operator= (const GenericLine< PointType > &dl) |
| Assignment operator. | |
| bool | operator== (const GenericLine< PointType > &dl) const |
| Equality operator. | |
| double | slope () const |
| Returns the slope of the line. | |
| virtual IntersectionType | verIntersection (const double verAxis, double &crossing) const |
Computes the intersection between this line and the vertical line through x = verAxis. | |
| double | yAbs () const |
| Returns the value y' such that (0,y') lies on the unlimited straight-line defined by this line. | |
Protected Member Functions | |
| numberType | dx () const |
| Returns the x-coordinate of the difference (second point - first point). | |
| numberType | dy () const |
| Returns the y-coordinate of the difference (second point - first point). | |
Protected Attributes | |
| PointType | m_p1 |
| The first point of the line. | |
| PointType | m_p2 |
| The second point of the line. | |
Infinite lines.
Definition at line 448 of file geometry.h.
| using ogdf::GenericLine< PointType >::numberType = typename PointType::numberType |
Definition at line 450 of file geometry.h.
|
inline |
Creates an empty line.
Definition at line 464 of file geometry.h.
Creates a line through the points p1 and p2.
Definition at line 467 of file geometry.h.
|
inline |
Copy constructor.
Definition at line 470 of file geometry.h.
|
inline |
Creates a line through the points (x1,y1) and (x2,y2).
Definition at line 473 of file geometry.h.
Returns true iff p lies on this line.
Definition at line 552 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 516 of file geometry.h.
|
inlineprotected |
Returns the x-coordinate of the difference (second point - first point).
Definition at line 457 of file geometry.h.
|
inlineprotected |
Returns the y-coordinate of the difference (second point - first point).
Definition at line 460 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 580 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 528 of file geometry.h.
|
inline |
Returns true iff this line runs horizontally.
Definition at line 498 of file geometry.h.
|
inline |
Returns true iff this line runs vertically.
Definition at line 495 of file geometry.h.
|
inline |
Inequality operator.
Definition at line 483 of file geometry.h.
|
inline |
Assignment operator.
Definition at line 486 of file geometry.h.
|
inline |
Equality operator.
Definition at line 477 of file geometry.h.
|
inline |
Returns the slope of the line.
Definition at line 501 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 597 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 505 of file geometry.h.
|
protected |
The first point of the line.
Definition at line 453 of file geometry.h.
|
protected |
The second point of the line.
Definition at line 454 of file geometry.h.