VTK: Common/Misc/vtkPolygonBuilder.h Source File

| VTK 9.3.1

vtkPolygonBuilder.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkPolygonBuilder_h
17 #define vtkPolygonBuilder_h
18
19 #include "vtkCommonMiscModule.h" // For export macro
20 #include "vtkIdList.h"
21 #include "vtkObject.h"
22 #include "vtkType.h" //for basic types
23 #include <cstddef> //for size_t
24 #include <map> //for private data members
25 #include <utility> //for private data members
26 #include <vector> // for private data members
27
28 VTK_ABI_NAMESPACE_BEGIN
29 class vtkIdListCollection;
30
31 class VTKCOMMONMISC_EXPORT vtkPolygonBuilder
32 {
33 public:
34 vtkPolygonBuilder();
35
39 void InsertTriangle(const vtkIdType* abc);
40
46 void GetPolygons(vtkIdListCollection* polys);
47
51 void Reset();
52
53 private:
54 typedef std::pair<vtkIdType, vtkIdType> Edge;
55 typedef std::map<Edge, size_t> EdgeHistogram;
56 typedef std::multimap<vtkIdType, vtkIdType> EdgeMap;
57 typedef std::vector<vtkIdType> Triangle;
58 typedef std::vector<Triangle> Triangles;
59 typedef std::map<vtkIdType, Triangles> TriangleMap;
60
61 TriangleMap Tris;
62
63 EdgeHistogram EdgeCounter;
64 EdgeMap Edges;
65 };
66
67 VTK_ABI_NAMESPACE_END
68 #endif
69 // VTK-HeaderTest-Exclude: vtkPolygonBuilder.h
vtkIdListCollection
maintain an ordered list of IdList objects
Definition: vtkIdListCollection.h:24
vtkPolygonBuilder
The polygon output is the boundary of the union of the triangles.
Definition: vtkPolygonBuilder.h:32
vtkPolygonBuilder::Reset
void Reset()
Prepare the builder for a new set of inputs.
vtkPolygonBuilder::vtkPolygonBuilder
vtkPolygonBuilder()
vtkPolygonBuilder::InsertTriangle
void InsertTriangle(const vtkIdType *abc)
Insert a triangle as a triplet of point IDs.
vtkPolygonBuilder::GetPolygons
void GetPolygons(vtkIdListCollection *polys)
Populate polys with lists of polygons, defined as sequential external vertices.
vtkIdList.h
vtkObject.h
vtkType.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315