Finite line segments. More...
#include <ogdf/basic/geometry.h>
Public Member Functions | |
GenericSegment () | |
Creates an empty line segment. More... | |
GenericSegment (const GenericLine< PointType > &dl) | |
Creates a line segment defined by the start and end point of line dl . More... | |
GenericSegment (const GenericSegment< PointType > &ds)=default | |
Copy constructor. More... | |
GenericSegment (const PointType &p1, const PointType &p2) | |
Creates a line segment from p1 to p2 . More... | |
GenericSegment (double x1, double y1, double x2, double y2) | |
Creates a line segment from (x1 ,y1 ) to (x2 ,y2 ). More... | |
bool | contains (const PointType &p) const override |
Returns true iff p lies on this line segment. More... | |
GenericLine< PointType >::numberType | dx () const |
Returns the x-coordinate of the difference (end point - start point). More... | |
GenericLine< PointType >::numberType | dy () const |
Returns the y-coordinate of the difference (end point - start point). More... | |
const PointType & | end () const |
Returns the end point of the line segment. More... | |
IntersectionType | horIntersection (const double horAxis, double &crossing) const override |
Computes the intersection of this line segment and the horizontal line through y = horAxis . More... | |
IntersectionType | intersection (const GenericSegment< PointType > &segment, PointType &inter, bool endpoints=true) const |
Returns an IntersectionType specifying whether segment and this line segment intersect. More... | |
double | length () const |
Returns the length (Euclidean distance between start and end point) of this line segment. More... | |
bool | operator!= (const GenericSegment< PointType > &dl) const |
Inequality operator. More... | |
GenericSegment & | operator= (const GenericSegment< PointType > &ds)=default |
Copy assignment operator. More... | |
bool | operator== (const GenericSegment< PointType > &dl) const |
Equality operator. More... | |
const PointType & | start () const |
Returns the start point of the line segment. More... | |
IntersectionType | verIntersection (const double verAxis, double &crossing) const override |
Computes the intersection between this line segment and the vertical line through x = verAxis . More... | |
Public Member Functions inherited from ogdf::GenericLine< PointType > | |
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... | |
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... | |
double | yAbs () const |
Returns the value y' such that (0,y') lies on the unlimited straight-line defined by this line. More... | |
Private Member Functions | |
bool | inBoundingRect (const PointType &p, bool includeBorders=true) const |
Returns whether p lies in the rectangle which has m_p1 and m_p2 as opposing corners. More... | |
Additional Inherited Members | |
Public Types inherited from ogdf::GenericLine< PointType > | |
using | numberType = typename PointType::numberType |
Protected Member Functions inherited from ogdf::GenericLine< PointType > | |
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 inherited from ogdf::GenericLine< PointType > | |
PointType | m_p1 |
The first point of the line. More... | |
PointType | m_p2 |
The second point of the line. More... | |
Finite line segments.
Definition at line 631 of file geometry.h.
|
inline |
Creates an empty line segment.
Definition at line 657 of file geometry.h.
|
inline |
Creates a line segment from p1
to p2
.
Definition at line 660 of file geometry.h.
|
inlineexplicit |
Creates a line segment defined by the start and end point of line dl
.
Definition at line 663 of file geometry.h.
|
inline |
Creates a line segment from (x1
,y1
) to (x2
,y2
).
Definition at line 666 of file geometry.h.
|
default |
Copy constructor.
|
inlineoverride |
Returns true iff p
lies on this line segment.
Definition at line 735 of file geometry.h.
|
inline |
Returns the x-coordinate of the difference (end point - start point).
Definition at line 690 of file geometry.h.
|
inline |
Returns the y-coordinate of the difference (end point - start point).
Definition at line 693 of file geometry.h.
|
inline |
Returns the end point of the line segment.
Definition at line 687 of file geometry.h.
|
inlineoverridevirtual |
Computes the intersection of this line segment and the horizontal line through y = horAxis
.
horAxis | defines the horizontal line. |
crossing | is assigned the x-coordinate of the intersection point. |
horAxis
. Reimplemented from ogdf::GenericLine< PointType >.
Definition at line 751 of file geometry.h.
|
inlineprivate |
|
inline |
Returns an IntersectionType specifying whether segment
and this line segment intersect.
segment | is the second line segment. |
inter | is assigned an intersection point if IntersectionType::SinglePoint or IntersectionType::Overlapping is returned. |
endpoints | determines if common endpoints are treated as potential intersection points. |
Definition at line 705 of file geometry.h.
|
inline |
Returns the length (Euclidean distance between start and end point) of this line segment.
Definition at line 740 of file geometry.h.
|
inline |
Inequality operator.
Definition at line 681 of file geometry.h.
|
default |
Copy assignment operator.
|
inline |
Equality operator.
Definition at line 676 of file geometry.h.
|
inline |
Returns the start point of the line segment.
Definition at line 684 of file geometry.h.
|
inlineoverridevirtual |
Computes the intersection between this line segment and the vertical line through x = verAxis
.
verAxis | defines the vertical line. |
crossing | is assigned the y-coordinate of the intersection point. |
verAxis
. Reimplemented from ogdf::GenericLine< PointType >.
Definition at line 772 of file geometry.h.