|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Exact bounded intersection of half-planes. More...
#include <geom_algorithms.H>
Classes | |
| struct | HalfPlane |
Public Member Functions | |
| Polygon | operator() (const Array< HalfPlane > &halfplanes) const |
| Intersect half-planes and return bounded feasible polygon. | |
| Polygon | operator() (const std::initializer_list< HalfPlane > il) const |
| Overload for initializer-list convenience. | |
Static Public Member Functions | |
| static Array< HalfPlane > | from_convex_polygon (const Polygon &poly) |
| Build half-planes from the edges of a closed convex polygon. | |
Static Private Member Functions | |
| static Geom_Number | signed_double_area (const Array< Point > &verts) |
| static bool | upper_half (const HalfPlane &h) |
| static Geom_Number | cross_dir (const HalfPlane &a, const HalfPlane &b) |
| static Geom_Number | dot_dir (const HalfPlane &a, const HalfPlane &b) |
| static bool | same_direction (const HalfPlane &a, const HalfPlane &b) |
| static bool | parallel (const HalfPlane &a, const HalfPlane &b) |
| static Point | line_intersection (const HalfPlane &a, const HalfPlane &b) |
| static void | push_clean (Array< Point > &out, const Point &p) |
| static Array< Point > | normalize_vertices (const Array< Point > &pts) |
| static Polygon | build_polygon (const Array< Point > &pts) |
Exact bounded intersection of half-planes.
Each half-plane is represented by a directed line (p -> q); the feasible side is the left side of that line (including boundary).
This class computes the bounded polygon defined by the intersection of a set of half-planes using the classic angle-sorted deque algorithm.
Definition at line 1772 of file geom_algorithms.H.
|
inlinestaticprivate |
Definition at line 1892 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and normalize_vertices().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 1811 of file geom_algorithms.H.
References Aleph::HalfPlaneIntersection::HalfPlane::dx(), and Aleph::HalfPlaneIntersection::HalfPlane::dy().
Referenced by operator()(), parallel(), and same_direction().
|
inlinestaticprivate |
Definition at line 1817 of file geom_algorithms.H.
References Aleph::HalfPlaneIntersection::HalfPlane::dx(), and Aleph::HalfPlaneIntersection::HalfPlane::dy().
Referenced by same_direction().
|
inlinestatic |
Build half-planes from the edges of a closed convex polygon.
Edge direction is normalized, so the interior of the polygon is always on the left side of each half-plane, for both CCW and CW input order.
| poly | Closed convex polygon. |
Definition at line 1916 of file geom_algorithms.H.
References ah_domain_error_if, Aleph::divide_and_conquer_partition_dp(), Aleph::Dlink::Iterator::has_curr(), Aleph::Polygon::is_closed(), Aleph::Array< T >::reserve(), signed_double_area(), and Aleph::Polygon::size().
Referenced by Aleph::VoronoiDiagramFromDelaunay::clipped_cells(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inlinestaticprivate |
Definition at line 1834 of file geom_algorithms.H.
References ah_domain_error_if, Aleph::divide_and_conquer_partition_dp(), Aleph::HalfPlaneIntersection::HalfPlane::dx(), Aleph::HalfPlaneIntersection::HalfPlane::dy(), Aleph::Point::get_x(), Aleph::Point::get_y(), and Aleph::HalfPlaneIntersection::HalfPlane::p.
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 1879 of file geom_algorithms.H.
References Aleph::and, Aleph::divide_and_conquer_partition_dp(), push_clean(), and Aleph::Array< T >::reserve().
Referenced by build_polygon().
|
inline |
Intersect half-planes and return bounded feasible polygon.
| halfplanes | Input half-planes. |
Definition at line 1947 of file geom_algorithms.H.
References Aleph::and, Aleph::DynDlist< T >::append(), build_polygon(), cross_dir(), Aleph::divide_and_conquer_partition_dp(), line_intersection(), Aleph::HalfPlaneIntersection::HalfPlane::offset(), parallel(), Aleph::quicksort_op(), Aleph::Array< T >::reserve(), same_direction(), Aleph::unique(), and upper_half().
|
inline |
Overload for initializer-list convenience.
| il | Input half-planes. |
Definition at line 2070 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::Array< T >::reserve().
|
inlinestaticprivate |
Definition at line 1829 of file geom_algorithms.H.
References cross_dir().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 1852 of file geom_algorithms.H.
References Aleph::COLLINEAR, Aleph::divide_and_conquer_partition_dp(), Aleph::on_segment(), and Aleph::orientation().
Referenced by normalize_vertices().
|
inlinestaticprivate |
Definition at line 1823 of file geom_algorithms.H.
References Aleph::and, cross_dir(), and dot_dir().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 1801 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::GeomPolygonUtils::signed_double_area().
Referenced by from_convex_polygon().
Definition at line 1806 of file geom_algorithms.H.
References Aleph::and, Aleph::divide_and_conquer_partition_dp(), and h.
Referenced by operator()().