VTK
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 =========================================================================*/
30 #ifndef vtkPolygonBuilder_h
31 #define vtkPolygonBuilder_h
32 
33 #include "vtkCommonMiscModule.h" // For export macro
34 #include <vector> //for private data members
35 #include "vtkType.h" //for basic types
36 #include <cstddef> //for size_t
37 #include "vtkObject.h"
38 class vtkIdList;
39 
41 {
42 public:
44  void Reset();
45  bool InsertTriangle(vtkIdType* abc);
46  void GetPolygon(vtkIdList* poly) const;
47 
48 private:
49  typedef size_t VertexRef;
50  struct Vertex
51  {
52  VertexRef Next;
53  vtkIdType Vert;
54  Vertex(VertexRef next, vtkIdType vert):Next(next), Vert(vert){}
55  };
56 
57  bool FindEdge(vtkIdType a, vtkIdType b, VertexRef& v) const;
58  VertexRef Insert(VertexRef i, vtkIdType vertexId);
59  vtkIdType GetVertexId(VertexRef i) const { return this->Poly[i].Vert;}
60  VertexRef GetNextVertex(VertexRef i) const { return this->Poly[i].Next;}
61 
62  std::vector<Vertex> Poly;
63 };
64 
65 #endif
66 // VTK-HeaderTest-Exclude: vtkPolygonBuilder.h
#define VTKCOMMONMISC_EXPORT
int vtkIdType
Definition: vtkType.h:275
list of point or cell ids
Definition: vtkIdList.h:35