|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Fortune sweep-line Voronoi construction. More...
#include <geom_algorithms.H>
Classes | |
| struct | Arc |
| Arc in the beach-line state structure. More... | |
| struct | Event |
| Forward declaration of beach-line arc. More... | |
| struct | EventCmp |
| Comparator for prioritizing events in the sweep-line. More... | |
| struct | TriKey |
| Key for identifying a triangle by its vertex indices. More... | |
Public Types | |
| using | Edge = VoronoiDiagramFromDelaunay::Edge |
| Type for Voronoi edges. | |
| using | Cell = VoronoiDiagramFromDelaunay::Cell |
| Type for Voronoi cells. | |
| using | ClippedCell = VoronoiDiagramFromDelaunay::ClippedCell |
| Type for clipped Voronoi cells. | |
| using | Result = VoronoiDiagramFromDelaunay::Result |
| Complete result structure. | |
Public Member Functions | |
| Result | operator() (const DynList< Point > &pts) const |
| Compute the Voronoi diagram for a list of points. | |
| Result | operator() (const std::initializer_list< Point > il) const |
| Compute the Voronoi diagram from an initializer list. | |
| Array< ClippedCell > | clipped_cells (const DynList< Point > &pts, const Polygon &clip) const |
| Compute Voronoi cells clipped to a bounding polygon. | |
| Array< ClippedCell > | clipped_cells (const std::initializer_list< Point > il, const Polygon &clip) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Static Private Member Functions | |
| static double | as_double (const Geom_Number &v) |
| static bool | all_collinear (const Array< Point > &pts) |
| static DelaunayTriangulationBowyerWatson::IndexedTriangle | normalized_triangle (const size_t i, const size_t j, const size_t k, const Array< Point > &sites) |
| static double | breakpoint_x (const Point &left_site, const Point &right_site, const double sweepline_y) |
| static Arc * | locate_arc (Arc *head, const Array< Point > &sites, const double x, const double sweepline_y) |
| static void | invalidate_circle_event (Arc *arc) |
| static void | enqueue_circle_event (Arc *arc, const double sweepline_y, const Array< Point > &sites, DynBinHeap< Event *, EventCmp > &queue, Array< std::unique_ptr< Event > > &event_pool, size_t &next_event_id) |
| static bool | is_valid_delaunay (const DelaunayTriangulationBowyerWatson::Result &dt) |
| static DelaunayTriangulationBowyerWatson::Result | triangulate_sweep (const Array< Point > &sites) |
Private Attributes | |
| VoronoiDiagramFromDelaunay | voronoi_ |
| DelaunayTriangulationBowyerWatson | fallback_ |
Static Private Attributes | |
| static constexpr double | kEps = 1e-9 |
Fortune sweep-line Voronoi construction.
This class computes a Delaunay triangulation via Fortune's beach-line sweep (site + circle events) and then reuses VoronoiDiagramFromDelaunay to build Voronoi vertices/edges/cells, avoiding duplicated dual logic.
Fortune's algorithm is a sweep-line algorithm for generating Voronoi diagrams in O(n log n) time.
Definition at line 4261 of file geom_algorithms.H.
Type for Voronoi cells.
Definition at line 4265 of file geom_algorithms.H.
Type for clipped Voronoi cells.
Definition at line 4266 of file geom_algorithms.H.
Type for Voronoi edges.
Definition at line 4264 of file geom_algorithms.H.
Complete result structure.
Definition at line 4267 of file geom_algorithms.H.
|
inlinestaticprivate |
Definition at line 4341 of file geom_algorithms.H.
References Aleph::COLLINEAR, Aleph::divide_and_conquer_partition_dp(), and Aleph::orientation().
Referenced by triangulate_sweep().
|
inlinestaticprivate |
Definition at line 4336 of file geom_algorithms.H.
References Aleph::geom_number_to_double().
Referenced by breakpoint_x(), enqueue_circle_event(), and triangulate_sweep().
|
inlinestaticprivate |
Definition at line 4363 of file geom_algorithms.H.
References ah_domain_error_if, as_double(), Aleph::divide_and_conquer_partition_dp(), and kEps.
Referenced by locate_arc().
|
inline |
Compute Voronoi cells clipped to a bounding polygon.
| pts | Input list of sites. |
| clip | Bounding polygon used for clipping. |
Definition at line 4697 of file geom_algorithms.H.
References Aleph::VoronoiDiagramFromDelaunay::clipped_cells_indexed(), and Aleph::divide_and_conquer_partition_dp().
Referenced by clipped_cells(), and TEST_F().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4704 of file geom_algorithms.H.
References Aleph::DynList< T >::append(), clipped_cells(), and Aleph::divide_and_conquer_partition_dp().
|
inlinestaticprivate |
Definition at line 4436 of file geom_algorithms.H.
References as_double(), Aleph::VoronoiDiagramFortune::Arc::circle, Aleph::CW, Aleph::divide_and_conquer_partition_dp(), Aleph::Point::get_x(), Aleph::Point::get_y(), invalidate_circle_event(), kEps, Aleph::VoronoiDiagramFortune::Arc::next, Aleph::orientation(), Aleph::VoronoiDiagramFortune::Arc::prev, Aleph::DynBinHeap< T, Compare >::put(), r, Aleph::VoronoiDiagramFortune::Arc::site, and Aleph::VoronoiDiagramFortune::Event::y.
Referenced by triangulate_sweep().
Definition at line 4427 of file geom_algorithms.H.
References Aleph::and, Aleph::VoronoiDiagramFortune::Arc::circle, and Aleph::VoronoiDiagramFortune::Event::valid.
Referenced by enqueue_circle_event(), and triangulate_sweep().
|
inlinestaticprivate |
Definition at line 4499 of file geom_algorithms.H.
References Aleph::and, Aleph::CCW, Aleph::COLLINEAR, Aleph::CW, Aleph::divide_and_conquer_partition_dp(), Aleph::in_circle_determinant(), k, and Aleph::orientation().
Referenced by operator()().
|
inlinestaticprivate |
Definition at line 4402 of file geom_algorithms.H.
References Aleph::and, breakpoint_x(), Aleph::divide_and_conquer_partition_dp(), kEps, Aleph::VoronoiDiagramFortune::Arc::next, and Aleph::VoronoiDiagramFortune::Arc::prev.
Referenced by triangulate_sweep().
|
inlinestaticprivate |
Definition at line 4354 of file geom_algorithms.H.
References Aleph::CW, k, and Aleph::orientation().
Referenced by triangulate_sweep().
Compute the Voronoi diagram for a list of points.
| pts | Input list of sites. |
Definition at line 4661 of file geom_algorithms.H.
References Aleph::divide_and_conquer_partition_dp(), fallback_, is_valid_delaunay(), triangulate_sweep(), and voronoi_.
|
inline |
Compute the Voronoi diagram from an initializer list.
| il | Initializer list of points. |
Definition at line 4682 of file geom_algorithms.H.
References Aleph::DynList< T >::append(), and Aleph::divide_and_conquer_partition_dp().
|
inlinestaticprivate |
Definition at line 4526 of file geom_algorithms.H.
References ah_domain_error_if, all_collinear(), as_double(), Aleph::VoronoiDiagramFortune::Arc::circle, Aleph::COLLINEAR, Aleph::divide_and_conquer_partition_dp(), enqueue_circle_event(), Aleph::DynBinHeap< T, Compare >::get(), invalidate_circle_event(), Aleph::GenBinHeap< NodeType, Key, Compare >::is_empty(), k, kEps, locate_arc(), Aleph::VoronoiDiagramFortune::Arc::next, normalized_triangle(), Aleph::orientation(), Aleph::VoronoiDiagramFortune::Arc::prev, Aleph::DynBinHeap< T, Compare >::put(), Aleph::Array< T >::reserve(), Aleph::VoronoiDiagramFortune::Arc::site, Aleph::Array< T >::size(), and Aleph::VoronoiDiagramFortune::Event::y.
Referenced by operator()().
|
private |
Definition at line 4334 of file geom_algorithms.H.
Referenced by operator()().
Definition at line 4331 of file geom_algorithms.H.
Referenced by breakpoint_x(), enqueue_circle_event(), locate_arc(), and triangulate_sweep().
|
private |
Definition at line 4333 of file geom_algorithms.H.
Referenced by operator()().