|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Dedicated exact intersection for a single pair of segments. More...
#include <geom_algorithms.H>
Classes | |
| struct | Result |
| Detailed result of a segment-segment intersection test. More... | |
Public Types | |
| enum class | Kind { NONE , POINT , OVERLAP } |
| Types of intersection between two segments. More... | |
Public Member Functions | |
| Result | operator() (const Segment &s1, const Segment &s2) const |
| Computes the intersection of two line segments. | |
Static Private Member Functions | |
| static bool | point_less_on_axis (const Point &a, const Point &b, const bool vertical_axis) |
| static Point | point_max_on_axis (const Point &a, const Point &b, const bool vertical_axis) |
| static Point | point_min_on_axis (const Point &a, const Point &b, const bool vertical_axis) |
| static Segment | collinear_overlap (const Segment &s1, const Segment &s2) |
Dedicated exact intersection for a single pair of segments.
This utility solves the 2-segment case directly in constant time using exact predicates from point.H, instead of routing through a sweep-line structure meant for many segments.
Returned intersection kinds:
Kind::NONE: no intersection.Kind::POINT: unique intersection point (proper cross, endpoint touch, or degenerate point-on-segment).Kind::OVERLAP: collinear overlap interval (non-zero length).Definition at line 5572 of file geom_algorithms.H.
Types of intersection between two segments.
| Enumerator | |
|---|---|
| NONE | No intersection. |
| POINT | Intersection at a single point. |
| OVERLAP | Intersection over a collinear interval. |
Definition at line 5578 of file geom_algorithms.H.
|
inlinestaticprivate |
Definition at line 5632 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Segment::get_src_point(), Aleph::Point::get_x(), point_less_on_axis(), point_max_on_axis(), and point_min_on_axis().
Referenced by operator()().
|
inline |
Computes the intersection of two line segments.
| s1 | First segment. |
| s2 | Second segment. |
Definition at line 5659 of file geom_algorithms.H.
References collinear_overlap(), Aleph::divide_and_conquer_partition_dp(), Aleph::SegmentSegmentIntersection::Result::kind, OVERLAP, POINT, and Aleph::segments_intersect().
|
inlinestaticprivate |
Definition at line 5602 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by collinear_overlap(), point_max_on_axis(), and point_min_on_axis().
|
inlinestaticprivate |
Definition at line 5618 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and point_less_on_axis().
Referenced by collinear_overlap().
|
inlinestaticprivate |
Definition at line 5625 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and point_less_on_axis().
Referenced by collinear_overlap().