VTK  9.1.0
vtkPolygonBuilder.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPolygonBuilder.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
25#ifndef vtkPolygonBuilder_h
26#define vtkPolygonBuilder_h
27
28#include "vtkCommonMiscModule.h" // For export macro
29#include "vtkIdList.h"
30#include "vtkObject.h"
31#include "vtkType.h" //for basic types
32#include <cstddef> //for size_t
33#include <map> //for private data members
34#include <utility> //for private data members
35#include <vector> // for private data members
36
38
39class VTKCOMMONMISC_EXPORT vtkPolygonBuilder
40{
41public:
43
47 void InsertTriangle(const vtkIdType* abc);
48
55
59 void Reset();
60
61private:
62 typedef std::pair<vtkIdType, vtkIdType> Edge;
63 typedef std::map<Edge, size_t> EdgeHistogram;
64 typedef std::multimap<vtkIdType, vtkIdType> EdgeMap;
65 typedef std::vector<vtkIdType> Triangle;
66 typedef std::vector<Triangle> Triangles;
67 typedef std::map<vtkIdType, Triangles> TriangleMap;
68
69 TriangleMap Tris;
70
71 EdgeHistogram EdgeCounter;
72 EdgeMap Edges;
73};
74
75#endif
76// 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:332