GEOS  3.9.1dev
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
geos::triangulate::VoronoiDiagramBuilder Class Reference

A utility class which creates Voronoi Diagrams from collections of points. More...

#include <VoronoiDiagramBuilder.h>

Collaboration diagram for geos::triangulate::VoronoiDiagramBuilder:
[legend]

Public Member Functions

 VoronoiDiagramBuilder ()
 Creates a new Voronoi diagram builder. More...
 
 ~VoronoiDiagramBuilder ()=default
 
void setSites (const geom::Geometry &geom)
 Sets the sites (point or vertices) which will be diagrammed. All vertices of the given geometry will be used as sites. More...
 
void setSites (const geom::CoordinateSequence &coords)
 Sets the sites (point or vertices) which will be diagrammed from a collection of geom::Coordinates. More...
 
void setClipEnvelope (const geom::Envelope *clipEnv)
 Sets the envelope to clip the diagram to. More...
 
void setTolerance (double tolerance)
 Sets the snapping tolerance which will be used to improved the robustness of the triangulation computation. More...
 
std::unique_ptr< quadedge::QuadEdgeSubdivisiongetSubdivision ()
 Gets the quadedge::QuadEdgeSubdivision which models the computed diagram. More...
 
std::unique_ptr< geom::GeometryCollectiongetDiagram (const geom::GeometryFactory &geomFact)
 Gets the faces of the computed diagram as a geom::GeometryCollection of geom::Polygons, clipped as specified. More...
 
std::unique_ptr< geom::GeometrygetDiagramEdges (const geom::GeometryFactory &geomFact)
 Gets the faces of the computed diagram as a geom::GeometryCollection of geom::LineStrings, clipped as specified. More...
 

Private Member Functions

void create ()
 

Static Private Member Functions

static std::unique_ptr< geom::GeometryCollectionclipGeometryCollection (std::vector< std::unique_ptr< geom::Geometry >> &geoms, const geom::Envelope &clipEnv)
 

Private Attributes

std::unique_ptr< geom::CoordinateSequencesiteCoords
 
double tolerance
 
std::unique_ptr< quadedge::QuadEdgeSubdivisionsubdiv
 
const geom::EnvelopeclipEnv
 
geom::Envelope diagramEnv
 

Detailed Description

A utility class which creates Voronoi Diagrams from collections of points.

The diagram is returned as a geom::GeometryCollection of geom::Polygons, clipped to the larger of a supplied envelope or to an envelope determined by the input sites.

Author
Martin Davis

Definition at line 46 of file VoronoiDiagramBuilder.h.

Constructor & Destructor Documentation

geos::triangulate::VoronoiDiagramBuilder::VoronoiDiagramBuilder ( )

Creates a new Voronoi diagram builder.

geos::triangulate::VoronoiDiagramBuilder::~VoronoiDiagramBuilder ( )
default

Member Function Documentation

static std::unique_ptr<geom::GeometryCollection> geos::triangulate::VoronoiDiagramBuilder::clipGeometryCollection ( std::vector< std::unique_ptr< geom::Geometry >> &  geoms,
const geom::Envelope clipEnv 
)
staticprivate
void geos::triangulate::VoronoiDiagramBuilder::create ( )
private
std::unique_ptr<geom::GeometryCollection> geos::triangulate::VoronoiDiagramBuilder::getDiagram ( const geom::GeometryFactory geomFact)

Gets the faces of the computed diagram as a geom::GeometryCollection of geom::Polygons, clipped as specified.

Parameters
geomFactthe geometry factory to use to create the output
Returns
the faces of the diagram
std::unique_ptr<geom::Geometry> geos::triangulate::VoronoiDiagramBuilder::getDiagramEdges ( const geom::GeometryFactory geomFact)

Gets the faces of the computed diagram as a geom::GeometryCollection of geom::LineStrings, clipped as specified.

Parameters
geomFactthe geometry factory to use to create the output
Returns
the faces of the diagram
std::unique_ptr<quadedge::QuadEdgeSubdivision> geos::triangulate::VoronoiDiagramBuilder::getSubdivision ( )

Gets the quadedge::QuadEdgeSubdivision which models the computed diagram.

Returns
the subdivision containing the triangulation
void geos::triangulate::VoronoiDiagramBuilder::setClipEnvelope ( const geom::Envelope clipEnv)

Sets the envelope to clip the diagram to.

The diagram will be clipped to the larger of this envelope or an envelope surrounding the sites.

Parameters
clipEnvthe clip envelope; must be kept alive by caller until done with this instance; set to 0 for no clipping.
void geos::triangulate::VoronoiDiagramBuilder::setSites ( const geom::Geometry geom)

Sets the sites (point or vertices) which will be diagrammed. All vertices of the given geometry will be used as sites.

Parameters
geomthe geometry from which the sites will be extracted.
void geos::triangulate::VoronoiDiagramBuilder::setSites ( const geom::CoordinateSequence coords)

Sets the sites (point or vertices) which will be diagrammed from a collection of geom::Coordinates.

Parameters
coordsa collection of Coordinates.
void geos::triangulate::VoronoiDiagramBuilder::setTolerance ( double  tolerance)

Sets the snapping tolerance which will be used to improved the robustness of the triangulation computation.

A tolerance of 0.0 specifies that no snapping will take place.

Parameters
tolerancethe tolerance distance to use

Member Data Documentation

const geom::Envelope* geos::triangulate::VoronoiDiagramBuilder::clipEnv
private

Definition at line 124 of file VoronoiDiagramBuilder.h.

geom::Envelope geos::triangulate::VoronoiDiagramBuilder::diagramEnv
private

Definition at line 125 of file VoronoiDiagramBuilder.h.

std::unique_ptr<geom::CoordinateSequence> geos::triangulate::VoronoiDiagramBuilder::siteCoords
private

Definition at line 121 of file VoronoiDiagramBuilder.h.

std::unique_ptr<quadedge::QuadEdgeSubdivision> geos::triangulate::VoronoiDiagramBuilder::subdiv
private

Definition at line 123 of file VoronoiDiagramBuilder.h.

double geos::triangulate::VoronoiDiagramBuilder::tolerance
private

Definition at line 122 of file VoronoiDiagramBuilder.h.


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