Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::VoronoiDiagram Class Reference

O(n log n) Voronoi diagram construction. More...

#include <geom_algorithms.H>

Collaboration diagram for Aleph::VoronoiDiagram:
[legend]

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< ClippedCellclipped_cells (const DynList< Point > &pts, const Polygon &clip) const
 Compute Voronoi cells clipped to a bounding polygon.
 

Private Attributes

DelaunayTriangulationRandomizedIncremental delaunay_
 Internal Delaunay triangulator.
 
VoronoiDiagramFromDelaunay voronoi_
 Internal dual builder.
 

Detailed Description

O(n log n) Voronoi diagram construction.

Computes the Voronoi diagram by composing:

  1. O(n log n) randomized incremental Delaunay triangulation
  2. O(n) dual construction (circumcenters → Voronoi vertices)

Uses exact rational arithmetic (Geom_Number) throughout.

The output types are identical to VoronoiDiagramFromDelaunay.

Complexity

  • Expected time: O(n log n)
  • Space: O(n)
Example
auto res = vd({Point(0,0), Point(1,0), Point(0,1)});
// res.cells / res.edges contain the diagram.
long double vd
Definition btreepic.C:152
Represents a point with rectangular coordinates in a 2D plane.
Definition point.H:229
O(n log n) Voronoi diagram construction.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.

Fast Voronoi diagram computation using randomized incremental Delaunay.

This class provides a convenient interface to compute the Voronoi diagram of a set of points. It combines DelaunayTriangulationRandomizedIncremental with VoronoiDiagramFromDelaunay to produce the dual diagram.

Author
Leandro Rabindranath León
Alejandro J. Mujica

Definition at line 4198 of file geom_algorithms.H.

Member Typedef Documentation

◆ Cell

Type for Voronoi cells.

Definition at line 4205 of file geom_algorithms.H.

◆ ClippedCell

Type for clipped Voronoi cells.

Definition at line 4206 of file geom_algorithms.H.

◆ Edge

Type for Voronoi edges.

Definition at line 4204 of file geom_algorithms.H.

◆ Result

Complete result structure.

Definition at line 4207 of file geom_algorithms.H.

Member Function Documentation

◆ clipped_cells()

Array< ClippedCell > Aleph::VoronoiDiagram::clipped_cells ( const DynList< Point > &  pts,
const Polygon clip 
) const
inline

Compute Voronoi cells clipped to a bounding polygon.

Parameters
ptsInput list of sites.
clipBounding polygon used for clipping.
Returns
Array of clipped cells.

Definition at line 4240 of file geom_algorithms.H.

References Aleph::VoronoiDiagramFromDelaunay::clipped_cells_indexed(), delaunay_, and Aleph::divide_and_conquer_partition_dp().

◆ operator()() [1/2]

Result Aleph::VoronoiDiagram::operator() ( const DynList< Point > &  pts) const
inline

Compute the Voronoi diagram for a list of points.

Parameters
ptsInput list of sites.
Returns
Result structure containing the diagram components.

Definition at line 4214 of file geom_algorithms.H.

References delaunay_, Aleph::divide_and_conquer_partition_dp(), and voronoi_.

◆ operator()() [2/2]

Result Aleph::VoronoiDiagram::operator() ( const std::initializer_list< Point il) const
inline

Compute the Voronoi diagram from an initializer list.

Parameters
ilInitializer list of points.
Returns
Result structure containing the diagram components.

Definition at line 4225 of file geom_algorithms.H.

References Aleph::DynList< T >::append(), and Aleph::divide_and_conquer_partition_dp().

Member Data Documentation

◆ delaunay_

DelaunayTriangulationRandomizedIncremental Aleph::VoronoiDiagram::delaunay_
private

Internal Delaunay triangulator.

Definition at line 4200 of file geom_algorithms.H.

Referenced by clipped_cells(), and operator()().

◆ voronoi_

VoronoiDiagramFromDelaunay Aleph::VoronoiDiagram::voronoi_
private

Internal dual builder.

Definition at line 4201 of file geom_algorithms.H.

Referenced by operator()().


The documentation for this class was generated from the following file: