|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Exact point-in-polygon classification via winding number. More...
#include <geom_algorithms.H>
Public Types | |
| enum class | Location { Outside , Boundary , Inside } |
Static Public Member Functions | |
| static Location | locate (const Polygon &poly, const Point &p) |
| Classify point location with respect to a polygon. | |
| static bool | contains (const Polygon &poly, const Point &p) |
| Return true if the point is inside or on the boundary. | |
| static bool | strictly_contains (const Polygon &poly, const Point &p) |
| Return true only for strict interior points. | |
Exact point-in-polygon classification via winding number.
Classifies a point relative to a simple closed polygon as:
Uses exact geometric predicates (orientation, on_segment) with Geom_Number, avoiding floating-point robustness issues.
Definition at line 1489 of file geom_algorithms.H.
| Enumerator | |
|---|---|
| Outside | |
| Boundary | |
| Inside | |
Definition at line 1492 of file geom_algorithms.H.
|
inlinestatic |
Return true if the point is inside or on the boundary.
| poly | Closed simple polygon. |
| p | Query point. |
Definition at line 1533 of file geom_algorithms.H.
References locate(), and Outside.
Referenced by brute_convex_distance_squared(), demo_advanced_algorithms(), Aleph::ShortestPathInPolygon::operator()(), Aleph::ConvexPolygonDistanceGJK::polygons_intersect_or_contain(), Aleph::detail::shortest_path_portals(), and TEST_F().
|
inlinestatic |
Classify point location with respect to a polygon.
| poly | Closed simple polygon. |
| p | Query point. |
| domain_error | if polygon is open or has fewer than 3 vertices. |
Definition at line 1508 of file geom_algorithms.H.
References ah_domain_error_if, Boundary, Aleph::Polygon::Boundary, Aleph::divide_and_conquer_partition_dp(), Inside, Aleph::Polygon::Inside, Aleph::Polygon::is_closed(), Aleph::Polygon::locate_point(), Outside, Aleph::Polygon::Outside, and Aleph::Polygon::size().
Referenced by contains(), strictly_contains(), TEST(), and TEST_F().
|
inlinestatic |
Return true only for strict interior points.
| poly | Closed simple polygon. |
| p | Query point. |
Definition at line 1546 of file geom_algorithms.H.
References Inside, and locate().
Referenced by Aleph::VisibilityPolygon::operator()().