VTK  9.3.20240418
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
30 
31 class VTKCOMMONMISC_EXPORT vtkPolygonBuilder
32 {
33 public:
35 
39  void InsertTriangle(const vtkIdType* abc);
40 
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
maintain an ordered list of IdList objects
The polygon output is the boundary of the union of the triangles.
void Reset()
Prepare the builder for a new set of inputs.
void InsertTriangle(const vtkIdType *abc)
Insert a triangle as a triplet of point IDs.
void GetPolygons(vtkIdListCollection *polys)
Populate polys with lists of polygons, defined as sequential external vertices.
int vtkIdType
Definition: vtkType.h:315