VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPolygonBuilder.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00030 #ifndef vtkPolygonBuilder_h 00031 #define vtkPolygonBuilder_h 00032 00033 #include "vtkCommonMiscModule.h" // For export macro 00034 #include <vector> //for private data members 00035 #include "vtkType.h" //for basic types 00036 #include <cstddef> //for size_t 00037 #include "vtkObject.h" 00038 class vtkIdList; 00039 00040 class VTKCOMMONMISC_EXPORT vtkPolygonBuilder 00041 { 00042 public: 00043 vtkPolygonBuilder(); 00044 void Reset(); 00045 bool InsertTriangle(vtkIdType* abc); 00046 void GetPolygon(vtkIdList* poly) const; 00047 00048 private: 00049 typedef size_t VertexRef; 00050 struct Vertex 00051 { 00052 VertexRef Next; 00053 vtkIdType Vert; 00054 Vertex(VertexRef next, vtkIdType vert):Next(next), Vert(vert){} 00055 }; 00056 00057 bool FindEdge(vtkIdType a, vtkIdType b, VertexRef& v) const; 00058 VertexRef Insert(VertexRef i, vtkIdType vertexId); 00059 vtkIdType GetVertexId(VertexRef i) const { return this->Poly[i].Vert;} 00060 VertexRef GetNextVertex(VertexRef i) const { return this->Poly[i].Next;} 00061 00062 std::vector<Vertex> Poly; 00063 }; 00064 00065 #endif 00066 // VTK-HeaderTest-Exclude: vtkPolygonBuilder.h