Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
Loading...
Searching...
No Matches
fishnet::geometry::DelaunayTriangulation< P > Class Template Reference

Wrapper around GDAL's Delaunay triangulation (GDALTriangulationCreateDelaunay). More...

#include <DelaunayTriangulation.hpp>

Public Types

using point_type = P
 
using numeric_type = typename P::numeric_type
 

Public Member Functions

 DelaunayTriangulation (util::forward_range_of< P > auto const &points, double tolerance=0.0, bool onlyEdges=false)
 Construct from a forward range of points.
 
fishnet::Option< std::unordered_set< Segment< numeric_type > > > edges () const noexcept
 Get the unique undirected edges of the triangulation.
 
fishnet::Option< std::vector< Triangle< numeric_type > > > triangles () const noexcept
 

Detailed Description

template<IPoint P>
class fishnet::geometry::DelaunayTriangulation< P >

Wrapper around GDAL's Delaunay triangulation (GDALTriangulationCreateDelaunay).

Takes a range of IPoint-conforming points, feeds them to GDAL, and exposes the result as fishnet Triangle objects and unique Segment edges.

Template Parameters
Ppoint type conforming to IPoint

Member Typedef Documentation

◆ numeric_type

template<IPoint P>
using fishnet::geometry::DelaunayTriangulation< P >::numeric_type = typename P::numeric_type

◆ point_type

template<IPoint P>
using fishnet::geometry::DelaunayTriangulation< P >::point_type = P

Constructor & Destructor Documentation

◆ DelaunayTriangulation()

template<IPoint P>
fishnet::geometry::DelaunayTriangulation< P >::DelaunayTriangulation ( util::forward_range_of< P > auto const &  points,
double  tolerance = 0.0,
bool  onlyEdges = false 
)
inlineexplicit

Construct from a forward range of points.

Parameters
pointsrange of points to triangulate

Member Function Documentation

◆ edges()

template<IPoint P>
fishnet::Option< std::unordered_set< Segment< numeric_type > > > fishnet::geometry::DelaunayTriangulation< P >::edges ( ) const
inlinenoexcept

Get the unique undirected edges of the triangulation.

Each edge is returned as a Segment. Deduplication is performed so every edge appears exactly once. Segment's commutative operator== and hash make this trivial.

Returns an empty Option if the triangulation failed.

Returns
Option containing vector of unique edges as Segments

◆ triangles()

template<IPoint P>
fishnet::Option< std::vector< Triangle< numeric_type > > > fishnet::geometry::DelaunayTriangulation< P >::triangles ( ) const
inlinenoexcept

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