VTK
vtkOrderedTriangulator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOrderedTriangulator.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 =========================================================================*/
87 #ifndef vtkOrderedTriangulator_h
88 #define vtkOrderedTriangulator_h
89 
90 #include "vtkCommonDataModelModule.h" // For export macro
91 #include "vtkObject.h"
92 
94 class vtkCellArray;
95 class vtkHeap;
96 class vtkIdList;
97 class vtkPoints;
98 class vtkTetra;
99 class vtkDataArray;
100 class vtkDoubleArray;
101 struct vtkOTMesh;
102 struct vtkOTTemplates;
104 class vtkPointData;
105 class vtkCellData;
106 
107 // Template ID's must be 32-bits. See .cxx file for more information.
108 #if VTK_SIZEOF_SHORT == 4
109 typedef unsigned short TemplateIDType;
110 #elif VTK_SIZEOF_INT == 4
111 typedef unsigned int TemplateIDType;
112 #elif VTK_SIZEOF_LONG == 4
113 typedef unsigned long TemplateIDType;
114 #endif
115 
117 {
118 public:
120  void PrintSelf(ostream& os, vtkIndent indent);
121 
123  static vtkOrderedTriangulator *New();
124 
126 
132  void InitTriangulation(double xmin, double xmax, double ymin, double ymax,
133  double zmin, double zmax, int numPts);
134  void InitTriangulation(double bounds[6], int numPts);
136 
138 
151  vtkIdType InsertPoint(vtkIdType id, double x[3], double p[3], int type);
152  vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, double x[3],
153  double p[3], int type);
154  vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, vtkIdType sortid2,
155  double x[3], double p[3], int type);
157 
159 
162  void Triangulate();
163  void TemplateTriangulate(int cellType, int numPts, int numEdges);
165 
172  void UpdatePointType(vtkIdType internalId, int type);
173 
178  double *GetPointPosition(vtkIdType internalId);
179 
184  double *GetPointLocation(vtkIdType internalId);
185 
191  vtkIdType GetPointId(vtkIdType internalId);
192 
194 
195  vtkGetMacro(NumberOfPoints,int);
197 
199 
204  vtkSetMacro(UseTemplates,int);
205  vtkGetMacro(UseTemplates,int);
206  vtkBooleanMacro(UseTemplates,int);
208 
210 
214  vtkSetMacro(PreSorted,int);
215  vtkGetMacro(PreSorted,int);
216  vtkBooleanMacro(PreSorted,int);
218 
220 
222  vtkSetMacro(UseTwoSortIds,int);
223  vtkGetMacro(UseTwoSortIds,int);
224  vtkBooleanMacro(UseTwoSortIds,int);
226 
236  vtkIdType GetTetras(int classification, vtkUnstructuredGrid *ugrid);
237 
245  vtkIdType AddTetras(int classification, vtkUnstructuredGrid *ugrid);
246 
252  vtkIdType AddTetras(int classification, vtkCellArray *connectivity);
253 
255 
261  vtkIdType AddTetras(int classification,
263  vtkCellArray *outConnectivity,
264  vtkPointData *inPD,
265  vtkPointData *outPD,
266  vtkCellData *inCD,
267  vtkIdType cellId,
268  vtkCellData *outCD);
270 
274  vtkIdType AddTetras(int classification, vtkIdList *ptIds, vtkPoints *pts);
275 
278  vtkIdType AddTriangles(vtkCellArray *connectivity);
279 
283  vtkIdType AddTriangles(vtkIdType id, vtkCellArray *connectivity);
284 
287  void InitTetraTraversal();
288 
290 
298  int GetNextTetra(int classification, vtkTetra *tet,
299  vtkDataArray *cellScalars, vtkDoubleArray *tetScalars);
301 
302 protected:
305 
306 private:
307  void Initialize();
308 
309  vtkOTMesh *Mesh;
310  int NumberOfPoints; //number of points inserted
311  int MaximumNumberOfPoints; //maximum possible number of points to be inserted
312  double Bounds[6];
313  int PreSorted;
314  int UseTwoSortIds;
315  vtkHeap *Heap;
316  double Quanta;
317 
318  int UseTemplates;
319  int CellType;
320  int NumberOfCellPoints;
321  int NumberOfCellEdges;
322  vtkHeap *TemplateHeap;
323  vtkOTTemplates *Templates;
324  int TemplateTriangulation();
325  void AddTemplate();
326  TemplateIDType ComputeTemplateIndex();
327 
328 private:
329  vtkOrderedTriangulator(const vtkOrderedTriangulator&); // Not implemented.
330  void operator=(const vtkOrderedTriangulator&); // Not implemented.
331 };
332 
333 #endif
334 
335 
abstract base class for most VTK objects
Definition: vtkObject.h:61
represent and manipulate point attribute data
Definition: vtkPointData.h:36
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
Abstract class in support of both point location and point insertion.
helper class to generate triangulations
int vtkIdType
Definition: vtkType.h:275
dynamic, self-adjusting array of double
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:46
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
list of point or cell ids
Definition: vtkIdList.h:35
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
CellTypeInDataSet cellType(vtkDataSet *input)
object to represent cell connectivity
Definition: vtkCellArray.h:49
replacement for malloc/free and new/delete
Definition: vtkHeap.h:52
static vtkObject * New()
#define VTKCOMMONDATAMODEL_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38