Lines with real coordinates. More...
#include <ogdf/basic/geometry.h>
Inheritance diagram for ogdf::DLine:Public Member Functions | |
| DLine () | |
| Creates an empty line. | |
| DLine (const DPoint &p1, const DPoint &p2) | |
| Creates a line with start point p1 and end point p2. | |
| DLine (const DLine &dl) | |
| Copy constructor. | |
| DLine (double x1, double y1, double x2, double y2) | |
| Creates a line with start point (x1,y1) and end point (x2,y2). | |
| bool | contains (const DPoint &p) const |
| Returns true iff p lie on this line. | |
| double | dx () const |
| Returns the x-coordinate of the difference (end point - start point). | |
| double | dy () const |
| Returns the y-coordinate of the difference (end point - start point). | |
| const DPoint & | end () const |
| Returns the end point of the line. | |
| int | horIntersection (const double horAxis, double &crossing) const |
| Computes the intersection between this line and the horizontal line through y = horAxis. | |
| bool | intersection (const DLine &line, DPoint &inter, bool endpoints=true) const |
| Returns true iff 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. | |
| double | length () const |
| Returns the length (euclidean distance between start and edn point) of this line. | |
| bool | operator!= (const DLine &dl) const |
| Inequality operator. | |
| DLine & | operator= (const DLine &dl) |
| Assignment operator. | |
| bool | operator== (const DLine &dl) const |
| Equality operator. | |
| double | slope () const |
| Returns the slope of the line. | |
| const DPoint & | start () const |
| Returns the start point of the line. | |
| int | 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 define dby this line. | |
Protected Attributes | |
| DPoint | m_end |
| The end point of the line. | |
| DPoint | m_start |
| The start point of the line. | |
Lines with real coordinates.
Definition at line 383 of file geometry.h.
|
inline |
Creates an empty line.
Definition at line 392 of file geometry.h.
Creates a line with start point p1 and end point p2.
Definition at line 395 of file geometry.h.
|
inline |
Copy constructor.
Definition at line 398 of file geometry.h.
|
inline |
Creates a line with start point (x1,y1) and end point (x2,y2).
Definition at line 401 of file geometry.h.
| bool ogdf::DLine::contains | ( | const DPoint & | p | ) | const |
Returns true iff p lie on this line.
|
inline |
Returns the x-coordinate of the difference (end point - start point).
Definition at line 431 of file geometry.h.
|
inline |
Returns the y-coordinate of the difference (end point - start point).
Definition at line 434 of file geometry.h.
|
inline |
Returns the end point of the line.
Definition at line 428 of file geometry.h.
| int ogdf::DLine::horIntersection | ( | const double | horAxis, |
| double & | crossing | ||
| ) | const |
Computes the intersection between this line and the horizontal line through y = horAxis.
| horAxis | defines the horizontal line. |
| crossing | is assigned the x-coordinate of the intersection point. |
Returns true iff line and this line intersect.
| line | is the second line. |
| inter | is assigned the intersection point if true is returned. |
| endpoints | determines if common endpoints are treated as intersection. |
|
inline |
Returns true iff this line runs horizontally.
Definition at line 446 of file geometry.h.
|
inline |
Returns true iff this line runs vertically.
Definition at line 443 of file geometry.h.
|
inline |
Returns the length (euclidean distance between start and edn point) of this line.
Definition at line 461 of file geometry.h.
|
inline |
Inequality operator.
Definition at line 411 of file geometry.h.
Assignment operator.
Definition at line 416 of file geometry.h.
|
inline |
Equality operator.
Definition at line 406 of file geometry.h.
|
inline |
Returns the slope of the line.
Definition at line 437 of file geometry.h.
|
inline |
Returns the start point of the line.
Definition at line 425 of file geometry.h.
| int ogdf::DLine::verIntersection | ( | const double | verAxis, |
| double & | crossing | ||
| ) | const |
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. |
|
inline |
Returns the value y' such that (0,y') lies on the unlimited straight-line define dby this line.
Definition at line 440 of file geometry.h.
|
protected |
The end point of the line.
Definition at line 387 of file geometry.h.
|
protected |
The start point of the line.
Definition at line 386 of file geometry.h.