CDT  2.0.1
C++ library for constrained Delaunay triangulation
Loading...
Searching...
No Matches
CDT.cpp
Go to the documentation of this file.
1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
13
14#ifdef CDT_USE_AS_COMPILED_LIBRARY
15
16#include "CDT.hpp"
17#include "CDTUtils.hpp"
18#include "Triangulation.hpp"
19#include "VerifyTopology.h"
20
21namespace CDT
22{
23
24template struct CDT_EXPORT V2d<float>;
25template struct CDT_EXPORT V2d<double>;
26
27template struct CDT_EXPORT Box2d<float>;
28template struct CDT_EXPORT Box2d<double>;
29
30template class CDT_EXPORT Triangulation<float>;
31template class CDT_EXPORT Triangulation<double>;
32
33template CDT_EXPORT DuplicatesInfo
35template CDT_EXPORT DuplicatesInfo
37
39 std::vector<V2d<float> >&,
40 std::vector<Edge>&);
42 std::vector<V2d<double> >&,
43 std::vector<Edge>&);
44
45template CDT_EXPORT float degToRad<float>(float);
46template CDT_EXPORT double degToRad<double>(double);
47
48template CDT_EXPORT float
49orient2D<float>(const V2d<float>&, const V2d<float>&, const V2d<float>&);
50template CDT_EXPORT double
52
53template CDT_EXPORT float
54area<float>(const V2d<float>&, const V2d<float>&, const V2d<float>&);
55template CDT_EXPORT double
56area<double>(const V2d<double>&, const V2d<double>&, const V2d<double>&);
57
58template CDT_EXPORT V2d<float>
60template CDT_EXPORT V2d<double>
62
63template CDT_EXPORT float
65template CDT_EXPORT double smallestAngle<double>(
66 const V2d<double>&,
67 const V2d<double>&,
68 const V2d<double>&);
69
70template CDT_EXPORT bool
71verifyTopology<float>(const CDT::Triangulation<float>&);
72template CDT_EXPORT bool
73verifyTopology<double>(const CDT::Triangulation<double>&);
74
75template CDT_EXPORT bool verifyWinding<float>(const CDT::Triangulation<float>&);
76template CDT_EXPORT bool
77verifyWinding<double>(const CDT::Triangulation<double>&);
78
79template CDT_EXPORT float distance(const V2d<float>& a, const V2d<float>& b);
80template CDT_EXPORT double distance(const V2d<double>& a, const V2d<double>& b);
81
82template CDT_EXPORT float
83distanceSquared(const V2d<float>& a, const V2d<float>& b);
84template CDT_EXPORT double
85distanceSquared(const V2d<double>& a, const V2d<double>& b);
86
87} // namespace CDT
88
89#endif
Utilities and helpers - implementation.
Public API - implementation.
Triangulation class - implementation.
Helper function to verify if triangulation has no inconsistencies.
Data structure representing a 2D constrained Delaunay triangulation.
void RemoveDuplicates(std::vector< TVertex, TAllocator > &vertices, const std::vector< std::size_t > &duplicates)
Remove duplicates in-place from vector of custom points.
Definition CDT.h:321
DuplicatesInfo RemoveDuplicatesAndRemapEdges(std::vector< TVertex, TVertexAllocator > &vertices, TGetVertexCoordX getX, TGetVertexCoordY getY, TEdgeIter edgesFirst, TEdgeIter edgesLast, TGetEdgeVertexStart getStart, TGetEdgeVertexEnd getEnd, TMakeEdgeFromStartAndEnd makeEdge)
Find point duplicates, remove them from vector (in-place) and remap edges (in-place)
Definition CDT.h:365
Namespace containing triangulation functionality.
CDT_EXPORT T degToRad(T degrees)
Convert an angle from degrees to radians.
Definition CDTUtils.hpp:330
bool verifyTopology(const CDT::Triangulation< T, TNearPointLocator > &cdt)
Verify that triangulation topology is consistent.
CDT_EXPORT T area(const V2d< T > &a, const V2d< T > &b, const V2d< T > &c)
Surface area of a triangle ABC.
Definition CDTUtils.hpp:303
CDT_EXPORT T distance(const V2d< T > &a, const V2d< T > &b)
Distance between two 2D points.
Definition CDTUtils.hpp:251
CDT_EXPORT T orient2D(const V2d< T > &p, const V2d< T > &v1, const V2d< T > &v2)
Orient p against line v1-v2 2D: robust geometric predicate.
Definition CDTUtils.hpp:47
CDT_EXPORT T distanceSquared(const V2d< T > &a, const V2d< T > &b)
Squared distance between two 2D points.
Definition CDTUtils.hpp:257
CDT_EXPORT V2d< T > circumcenter(V2d< T > a, V2d< T > b, V2d< T > c)
Position of ABC triangle circumcenter.
Definition CDTUtils.hpp:309
bool verifyWinding(const CDT::Triangulation< T, TNearPointLocator > &cdt)
Check that every triangle is wound counter-clockwise: degenerate and inverted triangles are topologic...
CDT_EXPORT T smallestAngle(const V2d< T > &a, const V2d< T > &b, const V2d< T > &c)
Smallest angle of triangle ABC in radians.
Definition CDTUtils.hpp:322
2D bounding box
Definition CDTUtils.h:279
Information about removed duplicated vertices.
Definition CDT.h:67
2D vector
Definition CDTUtils.h:192