|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
O(n log n) triangulation of simple polygons via y-monotone partition + linear-time monotone triangulation. More...
#include <geom_algorithms.H>
Classes | |
| class | EdgeStatusTree |
Public Member Functions | |
| DynList< Triangle > | operator() (Polygon p) const |
| Triangulate a simple polygon. | |
Private Types | |
| enum class | VertexType { START , END , SPLIT , MERGE , REGULAR } |
| Classification of vertices for y-monotone decomposition. More... | |
O(n log n) triangulation of simple polygons via y-monotone partition + linear-time monotone triangulation.
Definition at line 6522 of file geom_algorithms.H.
|
strongprivate |
Classification of vertices for y-monotone decomposition.
| Enumerator | |
|---|---|
| START | |
| END | |
| SPLIT | |
| MERGE | |
| REGULAR | |
Definition at line 6543 of file geom_algorithms.H.
|
inlinestaticprivate |
Definition at line 6949 of file geom_algorithms.H.
References Aleph::and, Aleph::Array< T >::append(), Aleph::divide_and_conquer_partition_dp(), Aleph::Array< T >::empty(), Aleph::Point::get_x(), Aleph::Point::get_y(), Aleph::in_place_sort(), Aleph::in_place_unique(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), Aleph::Array< T >::is_empty(), k, pred, Aleph::Array< T >::reserve(), Aleph::DynSetTree< Key, Tree, Compare >::search(), and Aleph::Array< T >::size().
Referenced by decompose_to_monotone_faces().
|
inlinestaticprivate |
Definition at line 6921 of file geom_algorithms.H.
References Aleph::and, Aleph::CW, Aleph::divide_and_conquer_partition_dp(), END, is_above(), is_below(), MERGE, Aleph::next(), Aleph::orientation(), REGULAR, Aleph::Array< T >::size(), SPLIT, and START.
Referenced by decompose_to_monotone_faces().
|
inlinestaticprivate |
Definition at line 7064 of file geom_algorithms.H.
References Aleph::and, Aleph::Array< T >::append(), build_faces_from_diagonals(), classify_vertex(), Aleph::divide_and_conquer_partition_dp(), edge_goes_down(), END, Aleph::MonotonePolygonTriangulation::EdgeStatusTree::erase(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), Aleph::MonotonePolygonTriangulation::EdgeStatusTree::insert(), is_y_monotone(), Aleph::MonotonePolygonTriangulation::EdgeStatusTree::left_edge_of_point(), MERGE, Aleph::quicksort_op(), REGULAR, regular_interior_right(), Aleph::Array< T >::reserve(), Aleph::Array< T >::size(), SPLIT, and START.
Referenced by operator()().
|
inlinestaticprivate |
Check if the edge starting at edge points downwards.
Definition at line 6565 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and is_below().
Referenced by decompose_to_monotone_faces().
|
inlinestaticprivate |
Definition at line 6584 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), and edge_x_at_y().
Referenced by Aleph::MonotonePolygonTriangulation::EdgeStatusTree::predecessor_for_insert(), and Aleph::MonotonePolygonTriangulation::EdgeStatusTree::successor_for_insert().
|
inlinestaticprivate |
Definition at line 6571 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Point::get_x(), Aleph::Point::get_y(), and y.
Referenced by edge_status_less(), and Aleph::MonotonePolygonTriangulation::EdgeStatusTree::left_edge_of_point().
|
inlinestaticprivate |
Definition at line 6535 of file geom_algorithms.H.
References Aleph::GeomPolygonUtils::ensure_ccw().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 6525 of file geom_algorithms.H.
References Aleph::GeomPolygonUtils::extract_vertices().
Referenced by operator()().
|
inlinestaticprivate |
Lexicographical "above" comparison (y primary, x secondary).
Definition at line 6548 of file geom_algorithms.H.
References Aleph::and, Aleph::divide_and_conquer_partition_dp(), Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by classify_vertex(), and is_below().
|
inlinestaticprivate |
Lexicographical "below" comparison.
Definition at line 6557 of file geom_algorithms.H.
References is_above().
Referenced by classify_vertex(), edge_goes_down(), and regular_interior_right().
|
inlinestaticprivate |
Check if a CCW polygon vertex array is y-monotone.
Definition at line 7305 of file geom_algorithms.H.
References Aleph::and, Aleph::divide_and_conquer_partition_dp(), Aleph::next(), and Aleph::Array< T >::size().
Referenced by decompose_to_monotone_faces(), and operator()().
Triangulate a simple polygon.
For convex and y-monotone polygons, the result is computed directly in O(n). For general simple polygons, the polygon is partitioned into y-monotone sub-polygons in O(n log n), then each sub-polygon is triangulated in linear time.
| p | The polygon (will not be modified; a copy is used). |
| domain_error | if polygon is not closed or has < 3 vertices. |
| domain_error | if polygon is degenerate (zero area). |
Definition at line 7239 of file geom_algorithms.H.
References Aleph::Polygon::add_vertex(), ah_domain_error_if, Aleph::DynList< T >::append(), decompose_to_monotone_faces(), Aleph::divide_and_conquer_partition_dp(), ensure_ccw(), extract_vertices(), Aleph::HTList::Iterator::has_curr(), Aleph::Polygon::is_closed(), is_y_monotone(), Aleph::Array< T >::reserve(), signed_double_area(), Aleph::Polygon::size(), Aleph::Array< T >::size(), Aleph::size(), and triangulate_monotone().
|
inlinestaticprivate |
Definition at line 6942 of file geom_algorithms.H.
References is_below(), and Aleph::Array< T >::size().
Referenced by decompose_to_monotone_faces().
|
inlinestaticprivate |
Definition at line 6530 of file geom_algorithms.H.
References Aleph::GeomPolygonUtils::signed_double_area().
Referenced by operator()().
|
inlinestaticprivate |
Triangulate a y-monotone polygon given as a vertex array.
Definition at line 6815 of file geom_algorithms.H.
References Aleph::and, Aleph::DynList< T >::append(), Aleph::area_of_parallelogram(), Aleph::divide_and_conquer_partition_dp(), Aleph::FixedStack< T >::is_empty(), Aleph::FixedStack< T >::pop(), Aleph::FixedStack< T >::push(), Aleph::quicksort_op(), Aleph::Array< T >::reserve(), Aleph::HTList::size(), Aleph::FixedStack< T >::size(), and Aleph::FixedStack< T >::top().
Referenced by operator()().