25 for(
TriInd iT(0); iT < triangles.size(); ++iT)
28 for(VerticesArr3::const_iterator v = vv.begin(); v != vv.end(); ++v)
30 vertTris[*v].push_back(iT);
46RemapEdges(std::vector<Edge>& edges,
const std::vector<std::size_t>& mapping)
59 std::vector<
V2d<T> >& vertices,
60 std::vector<Edge>& edges)
77 typedef TriangleVec::const_iterator CIt;
78 for(CIt t = triangles.begin(); t != triangles.end(); ++t)
90 unordered_map<Edge, EdgeVec> originalToPieces;
91 typedef unordered_map<Edge, EdgeVec>::const_iterator Cit;
92 for(Cit ptoIt = pieceToOriginals.begin(); ptoIt != pieceToOriginals.end();
95 const Edge piece = ptoIt->first;
96 const EdgeVec& originals = ptoIt->second;
97 for(EdgeVec::const_iterator origIt = originals.begin();
98 origIt != originals.end();
101 originalToPieces[*origIt].push_back(piece);
104 return originalToPieces;
#define CDT_INLINE_IF_HEADER_ONLY
Macro for inlining non-template functions when in header-only mode to avoid multiple declaration erro...
std::vector< TriIndVec > VerticesTriangles
Triangles by vertex index.
CDT_EXPORT void RemapEdges(TEdgeIter first, TEdgeIter last, const std::vector< std::size_t > &mapping, TGetEdgeVertexStart getStart, TGetEdgeVertexEnd getEnd, TMakeEdgeFromStartAndEnd makeEdge)
Remap vertex indices in edges (in-place) using given vertex-index mapping.
CDT_EXPORT VerticesTriangles calculateTrianglesByVertex(const TriangleVec &triangles, VertInd verticesSize)
Calculate triangles adjacent to vertices (triangles by vertex index)
void RemoveDuplicates(std::vector< TVertex, TAllocator > &vertices, const std::vector< std::size_t > &duplicates)
Remove duplicates in-place from vector of custom points.
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)
CDT_EXPORT EdgeUSet extractEdgesFromTriangles(const TriangleVec &triangles)
Extract all edges of triangles.
CDT_EXPORT unordered_map< Edge, EdgeVec > EdgeToPiecesMapping(const unordered_map< Edge, EdgeVec > &pieceToOriginals)
DuplicatesInfo FindDuplicates(TVertexIter first, TVertexIter last, TGetVertexCoordX getX, TGetVertexCoordY getY)
Find duplicates in given custom point-type range.
Namespace containing triangulation functionality.
std::vector< Edge > EdgeVec
Vector of edges.
unordered_set< Edge > EdgeUSet
Hash table of edges.
VertInd edge_get_v2(const Edge &e)
Get edge second vertex.
VertInd edge_get_v1(const Edge &e)
Get edge first vertex.
IndexSizeType VertInd
Vertex index.
array< VertInd, 3 > VerticesArr3
array of three vertex indices
Edge edge_make(VertInd iV1, VertInd iV2)
Get edge second vertex.
const T & getX_V2d(const V2d< T > &v)
X- coordinate getter for V2d.
IndexSizeType TriInd
Triangle index.
std::vector< Triangle > TriangleVec
Vector of triangles.
const T & getY_V2d(const V2d< T > &v)
Y-coordinate getter for V2d.
Information about removed duplicated vertices.
std::vector< std::size_t > duplicates
duplicates' indices
Edge connecting two vertices: vertex with smaller index is always first.