|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Shared polygon helpers used across multiple geometry algorithms. More...
#include <geom_algorithms.H>
Static Public Member Functions | |
| static Array< Point > | extract_vertices (const Polygon &poly) |
| Extract vertices from a polygon into an array for indexed access. | |
| static Geom_Number | signed_double_area (const Array< Point > &verts) |
| Compute twice the signed area (shoelace formula without division). | |
| static Geom_Number | signed_double_area (const Polygon &poly) |
| Compute twice the signed area of a polygon. | |
| static Geom_Number | signed_area (const Array< Point > &verts) |
| Compute the actual signed area of a vertex array. | |
| static Geom_Number | signed_area (const Polygon &poly) |
| Compute the actual signed area of a polygon. | |
| static Geom_Number | area (const Array< Point > &verts) |
| Compute the absolute area of a vertex array. | |
| static Geom_Number | area (const Polygon &poly) |
| Compute the absolute area of a polygon. | |
| static bool | is_convex (const Array< Point > &verts) |
| Check if a vertex array forms a convex polygon. | |
| static void | ensure_ccw (Array< Point > &verts) |
Shared polygon helpers used across multiple geometry algorithms.
Provides utilities for working with polygons represented as Array<Point>. Many internal algorithms extract vertices into arrays for efficient indexed access. These helpers centralize common operations.
Polygon objects, prefer the convenience methods Polygon::area(), Polygon::is_convex(), etc. Use this class when working with extracted vertex arrays.signed_double_area() returns twice the signed area (avoids division). Use area() for the actual area value. Definition at line 231 of file geom_algorithms.H.
|
inlinestatic |
Compute the absolute area of a vertex array.
Definition at line 280 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and signed_area().
|
inlinestatic |
Compute the absolute area of a polygon.
Definition at line 287 of file geom_algorithms.H.
References signed_area().
Definition at line 317 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and signed_double_area().
Referenced by Aleph::MonotonePolygonTriangulation::ensure_ccw(), Aleph::ConvexPolygonOffset::ensure_ccw(), Aleph::BooleanPolygonOperations::ensure_ccw(), Aleph::MinkowskiSumConvex::normalize(), and Aleph::PolygonOffset::operator()().
|
inlinestatic |
Extract vertices from a polygon into an array for indexed access.
Definition at line 235 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Dlink::Iterator::has_curr(), Aleph::Array< T >::reserve(), and Aleph::Polygon::size().
Referenced by brute_convex_distance_squared(), Aleph::BooleanPolygonOperations::extract(), Aleph::CuttingEarsTriangulation::extract_vertices(), Aleph::VoronoiDiagramFromDelaunay::extract_vertices(), Aleph::MonotonePolygonTriangulation::extract_vertices(), Aleph::ConvexPolygonDecomposition::extract_vertices(), Aleph::RotatingCalipersConvexPolygon::extract_vertices(), Aleph::ConvexPolygonIntersectionBasic::extract_vertices(), Aleph::MinkowskiSumConvex::extract_vertices(), Aleph::ConvexPolygonOffset::extract_verts(), main(), Aleph::ConvexPolygonDistanceGJK::operator()(), Aleph::PolygonOffset::operator()(), poly_verts(), signed_double_area(), Aleph::VisvalingamWhyattSimplification::simplify_polygon(), Aleph::DouglasPeuckerSimplification::simplify_polygon(), Aleph::ChaikinSmoothing::smooth_polygon(), and TEST_F().
Check if a vertex array forms a convex polygon.
Definition at line 294 of file geom_algorithms.H.
References Aleph::area_of_parallelogram(), and Aleph::divide_and_conquer_partition_dp().
Referenced by Aleph::ConvexPolygonOffset::is_convex(), Aleph::RotatingCalipersConvexPolygon::is_convex(), Aleph::ConvexPolygonIntersectionBasic::is_convex(), Aleph::VoronoiDiagramFromDelaunay::is_convex(), Aleph::MinkowskiSumConvex::is_convex(), and Aleph::ConvexPolygonDistanceGJK::operator()().
|
inlinestatic |
Compute the actual signed area of a vertex array.
Definition at line 268 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and signed_double_area().
|
inlinestatic |
Compute the actual signed area of a polygon.
Definition at line 274 of file geom_algorithms.H.
References signed_double_area().
|
inlinestatic |
Compute twice the signed area (shoelace formula without division).
Returns positive for CCW vertices, negative for CW. This is 2× the actual signed area; use area() or signed_area() for the true value.
Definition at line 249 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Point::get_x(), Aleph::Point::get_y(), and Aleph::sum().
Referenced by Aleph::PolygonOffset::abs_area(), Aleph::PolygonOffset::cleanup(), ensure_ccw(), Aleph::PolygonOffset::extract_contours(), poly_area(), signed_area(), signed_area(), Aleph::MonotonePolygonTriangulation::signed_double_area(), Aleph::MinkowskiSumConvex::signed_double_area(), Aleph::ConvexPolygonOffset::signed_double_area(), Aleph::ConvexPolygonIntersectionBasic::signed_double_area(), Aleph::HalfPlaneIntersection::signed_double_area(), Aleph::CuttingEarsTriangulation::signed_double_area(), and signed_double_area().
|
inlinestatic |
Compute twice the signed area of a polygon.
Definition at line 262 of file geom_algorithms.H.
References extract_vertices(), and signed_double_area().