Data structure representing a 2D constrained Delaunay triangulation. More...
#include <Triangulation.h>
Public Types | |
typedef std::vector< V2d< T > > | V2dVec |
Vertices vector. | |
Public Member Functions | |
Triangulation () | |
Default constructor. | |
Triangulation (VertexInsertionOrder::Enum vertexInsertionOrder) | |
Constructor. | |
Triangulation (VertexInsertionOrder::Enum vertexInsertionOrder, IntersectingConstraintEdges::Enum intersectingEdgesStrategy, T minDistToConstraintEdge) | |
Constructor. | |
Triangulation (VertexInsertionOrder::Enum vertexInsertionOrder, const TNearPointLocator &nearPtLocator, IntersectingConstraintEdges::Enum intersectingEdgesStrategy, T minDistToConstraintEdge) | |
Constructor. | |
template<typename TVertexIter, typename TGetVertexCoordX, typename TGetVertexCoordY> | |
void | insertVertices (TVertexIter first, TVertexIter last, TGetVertexCoordX getX, TGetVertexCoordY getY) |
Insert custom point-types specified by iterator range and X/Y-getters. | |
void | insertVertices (const std::vector< V2d< T > > &vertices) |
Insert vertices into triangulation. | |
template<typename TEdgeIter, typename TGetEdgeVertexStart, typename TGetEdgeVertexEnd> | |
void | insertEdges (TEdgeIter first, TEdgeIter last, TGetEdgeVertexStart getStart, TGetEdgeVertexEnd getEnd) |
Insert constraint edges into triangulation for Constrained Delaunay Triangulation (for example see figure below). | |
void | insertEdges (const std::vector< Edge > &edges) |
Insert constraint edges into triangulation for Constrained Delaunay Triangulation (for example see figure below). | |
template<typename TEdgeIter, typename TGetEdgeVertexStart, typename TGetEdgeVertexEnd> | |
void | conformToEdges (TEdgeIter first, TEdgeIter last, TGetEdgeVertexStart getStart, TGetEdgeVertexEnd getEnd) |
Insert constraint edges into triangulation for Conforming Delaunay Triangulation (for example see figure below). | |
void | conformToEdges (const std::vector< Edge > &edges) |
Insert constraint edges into triangulation for Conforming Delaunay Triangulation (for example see figure below). | |
void | eraseSuperTriangle () |
Erase triangles adjacent to super triangle. | |
void | eraseOuterTriangles () |
Erase triangles outside of constrained boundary using growing. | |
void | eraseOuterTrianglesAndHoles () |
Erase triangles outside of constrained boundary and auto-detected holes. | |
void | initializedWithCustomSuperGeometry () |
Call this method after directly setting custom super-geometry via vertices and triangles members. | |
bool | isFinalized () const |
Check if the triangulation was finalized with erase... method and super-triangle was removed. | |
std::vector< LayerDepth > | calculateTriangleDepths () const |
Calculate depth of each triangle in constraint triangulation. | |
void | setCallbackHandler (ICallbackHandler *callbackHandler) |
Set user-provided callback handler. | |
void | flipEdge (TriInd iT, TriInd iTopo) |
Flip an edge between two triangle. | |
void | flipEdge (TriInd iT, TriInd iTopo, VertInd v1, VertInd v2, VertInd v3, VertInd v4, TriInd n1, TriInd n2, TriInd n3, TriInd n4) |
Flip edge between two triangles given all the information such as triangle vertices and neighbors. | |
void | removeTriangles (const TriIndUSet &removedTriangles) |
Remove triangles with specified indices. | |
TriIndVec & | VertTrisInternal () |
Access internal vertex adjacent triangles. | |
const TriIndVec & | VertTrisInternal () const |
Access internal vertex adjacent triangles. | |
Public Attributes | |
V2dVec | vertices |
triangulation's vertices | |
TriangleVec | triangles |
triangulation's triangles | |
EdgeUSet | fixedEdges |
triangulation's constraints (fixed edges) | |
unordered_map< Edge, BoundaryOverlapCount > | overlapCount |
Stores count of overlapping boundaries for a fixed edge. | |
unordered_map< Edge, EdgeVec > | pieceToOriginals |
Stores list of original edges represented by a given fixed edge. | |
Data structure representing a 2D constrained Delaunay triangulation.
T | type of vertex coordinates (e.g., float, double) |
TNearPointLocator | class providing locating near point for efficiently inserting new points. Provides methods: 'addPoint(vPos, iV)' and 'nearPoint(vPos) -> iV' |
Definition at line 404 of file Triangulation.h.
typedef std::vector<V2d<T> > CDT::Triangulation< T, TNearPointLocator >::V2dVec |
Vertices vector.
Definition at line 407 of file Triangulation.h.
CDT::Triangulation< T, TNearPointLocator >::Triangulation | ( | ) |
Default constructor.
Definition at line 43 of file Triangulation.hpp.
|
explicit |
Constructor.
vertexInsertionOrder | strategy used for ordering vertex insertions |
CDT::Triangulation< T, TNearPointLocator >::Triangulation | ( | VertexInsertionOrder::Enum | vertexInsertionOrder, |
IntersectingConstraintEdges::Enum | intersectingEdgesStrategy, | ||
T | minDistToConstraintEdge ) |
Constructor.
vertexInsertionOrder | strategy used for ordering vertex insertions |
intersectingEdgesStrategy | strategy for treating intersecting constraint edges |
minDistToConstraintEdge | distance within which point is considered to be lying on a constraint edge. Used when adding constraints to the triangulation. |
CDT::Triangulation< T, TNearPointLocator >::Triangulation | ( | VertexInsertionOrder::Enum | vertexInsertionOrder, |
const TNearPointLocator & | nearPtLocator, | ||
IntersectingConstraintEdges::Enum | intersectingEdgesStrategy, | ||
T | minDistToConstraintEdge ) |
Constructor.
vertexInsertionOrder | strategy used for ordering vertex insertions |
nearPtLocator | class providing locating near point for efficiently inserting new points |
intersectingEdgesStrategy | strategy for treating intersecting constraint edges |
minDistToConstraintEdge | distance within which point is considered to be lying on a constraint edge. Used when adding constraints to the triangulation. |
std::vector< LayerDepth > CDT::Triangulation< T, TNearPointLocator >::calculateTriangleDepths | ( | ) | const |
Calculate depth of each triangle in constraint triangulation.
Supports overlapping boundaries.
Perform depth peeling from super triangle to outermost boundary, then to next boundary and so on until all triangles are traversed.
For example depth is:
Definition at line 1828 of file Triangulation.hpp.
void CDT::Triangulation< T, TNearPointLocator >::conformToEdges | ( | const std::vector< Edge > & | edges | ) |
Insert constraint edges into triangulation for Conforming Delaunay Triangulation (for example see figure below).
May add new vertices.
edges | edges to conform to |
Definition at line 313 of file Triangulation.hpp.
void CDT::Triangulation< T, TNearPointLocator >::conformToEdges | ( | TEdgeIter | first, |
TEdgeIter | last, | ||
TGetEdgeVertexStart | getStart, | ||
TGetEdgeVertexEnd | getEnd ) |
Insert constraint edges into triangulation for Conforming Delaunay Triangulation (for example see figure below).
May add new vertices.
TEdgeIter | iterator that dereferences to custom edge type |
TGetEdgeVertexStart | function object getting start vertex index from an edge. Getter signature: const TEdgeIter::value_type& -> CDT::VertInd |
TGetEdgeVertexEnd | function object getting end vertex index from an edge. Getter signature: const TEdgeIter::value_type& -> CDT::VertInd |
first | beginning of the range of edges to add |
last | end of the range of edges to add |
getStart | getter of edge start vertex index |
getEnd | getter of edge end vertex index |
Definition at line 1113 of file Triangulation.h.
void CDT::Triangulation< T, TNearPointLocator >::eraseOuterTriangles | ( | ) |
Erase triangles outside of constrained boundary using growing.
Definition at line 115 of file Triangulation.hpp.
void CDT::Triangulation< T, TNearPointLocator >::eraseOuterTrianglesAndHoles | ( | ) |
Erase triangles outside of constrained boundary and auto-detected holes.
Definition at line 124 of file Triangulation.hpp.
void CDT::Triangulation< T, TNearPointLocator >::eraseSuperTriangle | ( | ) |
Erase triangles adjacent to super triangle.
void CDT::Triangulation< T, TNearPointLocator >::initializedWithCustomSuperGeometry | ( | ) |
Call this method after directly setting custom super-geometry via vertices and triangles members.
Definition at line 260 of file Triangulation.hpp.
void CDT::Triangulation< T, TNearPointLocator >::insertEdges | ( | const std::vector< Edge > & | edges | ) |
Insert constraint edges into triangulation for Constrained Delaunay Triangulation (for example see figure below).
Uses only original vertices: no new verties are added
edges | constraint edges |
Definition at line 306 of file Triangulation.hpp.
void CDT::Triangulation< T, TNearPointLocator >::insertEdges | ( | TEdgeIter | first, |
TEdgeIter | last, | ||
TGetEdgeVertexStart | getStart, | ||
TGetEdgeVertexEnd | getEnd ) |
Insert constraint edges into triangulation for Constrained Delaunay Triangulation (for example see figure below).
Uses only original vertices: no new verties are added
TEdgeIter | iterator that dereferences to custom edge type |
TGetEdgeVertexStart | function object getting start vertex index from an edge. Getter signature: const TEdgeIter::value_type& -> CDT::VertInd |
TGetEdgeVertexEnd | function object getting end vertex index from an edge. Getter signature: const TEdgeIter::value_type& -> CDT::VertInd |
first | beginning of the range of edges to add |
last | end of the range of edges to add |
getStart | getter of edge start vertex index |
getEnd | getter of edge end vertex index |
Definition at line 1081 of file Triangulation.h.
void CDT::Triangulation< T, TNearPointLocator >::insertVertices | ( | const std::vector< V2d< T > > & | vertices | ) |
Insert vertices into triangulation.
vertices | vector of vertices to insert |
Definition at line 1776 of file Triangulation.hpp.
void CDT::Triangulation< T, TNearPointLocator >::insertVertices | ( | TVertexIter | first, |
TVertexIter | last, | ||
TGetVertexCoordX | getX, | ||
TGetVertexCoordY | getY ) |
Insert custom point-types specified by iterator range and X/Y-getters.
TVertexIter | iterator that dereferences to custom point type |
TGetVertexCoordX | function object getting x coordinate from vertex. Getter signature: const TVertexIter::value_type& -> T |
TGetVertexCoordY | function object getting y coordinate from vertex. Getter signature: const TVertexIter::value_type& -> T |
first | beginning of the range of vertices to add |
last | end of the range of vertices to add |
getX | getter of X-coordinate |
getY | getter of Y-coordinate |
Definition at line 995 of file Triangulation.h.
bool CDT::Triangulation< T, TNearPointLocator >::isFinalized | ( | ) | const |
Check if the triangulation was finalized with erase...
method and super-triangle was removed.
Definition at line 1784 of file Triangulation.hpp.
void CDT::Triangulation< T, TNearPointLocator >::setCallbackHandler | ( | ICallbackHandler * | callbackHandler | ) |
Set user-provided callback handler.
callbackHandler | pointer to the callback handler |
Definition at line 1860 of file Triangulation.hpp.
EdgeUSet CDT::Triangulation< T, TNearPointLocator >::fixedEdges |
triangulation's constraints (fixed edges)
Definition at line 410 of file Triangulation.h.
unordered_map<Edge, BoundaryOverlapCount> CDT::Triangulation< T, TNearPointLocator >::overlapCount |
Stores count of overlapping boundaries for a fixed edge.
If no entry is present for an edge: no boundaries overlap.
Definition at line 419 of file Triangulation.h.
unordered_map<Edge, EdgeVec> CDT::Triangulation< T, TNearPointLocator >::pieceToOriginals |
Stores list of original edges represented by a given fixed edge.
Definition at line 426 of file Triangulation.h.
TriangleVec CDT::Triangulation< T, TNearPointLocator >::triangles |
triangulation's triangles
Definition at line 409 of file Triangulation.h.
V2dVec CDT::Triangulation< T, TNearPointLocator >::vertices |
triangulation's vertices
Definition at line 408 of file Triangulation.h.