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 "vtkObject.h"
91 
92 class vtkUnstructuredGrid;
93 class vtkCellArray;
94 class vtkHeap;
95 class vtkIdList;
96 class vtkPoints;
97 class vtkTetra;
98 class vtkDataArray;
99 class vtkDoubleArray;
100 struct vtkOTMesh;
101 struct vtkOTTemplates;
102 class vtkIncrementalPointLocator;
103 class vtkPointData;
104 class vtkCellData;
105 
106 // Template ID's must be 32-bits. See .cxx file for more information.
107 #if VTK_SIZEOF_SHORT == 4
108 typedef unsigned short TemplateIDType;
109 #elif VTK_SIZEOF_INT == 4
110 typedef unsigned int TemplateIDType;
111 #elif VTK_SIZEOF_LONG == 4
112 typedef unsigned long TemplateIDType;
113 #endif
114 
116 {
117 public:
119  void PrintSelf(ostream& os, vtkIndent indent);
120 
122  static vtkOrderedTriangulator *New();
123 
125 
131  void InitTriangulation(double xmin, double xmax, double ymin, double ymax,
132  double zmin, double zmax, int numPts);
133  void InitTriangulation(double bounds[6], int numPts);
135 
137 
150  vtkIdType InsertPoint(vtkIdType id, double x[3], double p[3], int type);
151  vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, double x[3],
152  double p[3], int type);
153  vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, vtkIdType sortid2,
154  double x[3], double p[3], int type);
156 
158 
161  void Triangulate();
162  void TemplateTriangulate(int cellType, int numPts, int numEdges);
164 
171  void UpdatePointType(vtkIdType internalId, int type);
172 
177  double *GetPointPosition(vtkIdType internalId);
178 
183  double *GetPointLocation(vtkIdType internalId);
184 
190  vtkIdType GetPointId(vtkIdType internalId);
191 
193 
194  vtkGetMacro(NumberOfPoints,int);
196 
198 
203  vtkSetMacro(UseTemplates,int);
204  vtkGetMacro(UseTemplates,int);
205  vtkBooleanMacro(UseTemplates,int);
207 
209 
213  vtkSetMacro(PreSorted,int);
214  vtkGetMacro(PreSorted,int);
215  vtkBooleanMacro(PreSorted,int);
217 
219 
221  vtkSetMacro(UseTwoSortIds,int);
222  vtkGetMacro(UseTwoSortIds,int);
223  vtkBooleanMacro(UseTwoSortIds,int);
225 
235  vtkIdType GetTetras(int classification, vtkUnstructuredGrid *ugrid);
236 
244  vtkIdType AddTetras(int classification, vtkUnstructuredGrid *ugrid);
245 
251  vtkIdType AddTetras(int classification, vtkCellArray *connectivity);
252 
254 
260  vtkIdType AddTetras(int classification,
261  vtkIncrementalPointLocator *locator,
262  vtkCellArray *outConnectivity,
263  vtkPointData *inPD,
264  vtkPointData *outPD,
265  vtkCellData *inCD,
266  vtkIdType cellId,
267  vtkCellData *outCD);
269 
273  vtkIdType AddTetras(int classification, vtkIdList *ptIds, vtkPoints *pts);
274 
277  vtkIdType AddTriangles(vtkCellArray *connectivity);
278 
282  vtkIdType AddTriangles(vtkIdType id, vtkCellArray *connectivity);
283 
286  void InitTetraTraversal();
287 
289 
297  int GetNextTetra(int classification, vtkTetra *tet,
298  vtkDataArray *cellScalars, vtkDoubleArray *tetScalars);
300 
301 protected:
304 
305 private:
306  void Initialize();
307 
308  vtkOTMesh *Mesh;
309  int NumberOfPoints; //number of points inserted
310  int MaximumNumberOfPoints; //maximum possible number of points to be inserted
311  double Bounds[6];
312  int PreSorted;
313  int UseTwoSortIds;
314  vtkHeap *Heap;
315  double Quanta;
316 
317  int UseTemplates;
318  int CellType;
319  int NumberOfCellPoints;
320  int NumberOfCellEdges;
321  vtkHeap *TemplateHeap;
322  vtkOTTemplates *Templates;
323  int TemplateTriangulation();
324  void AddTemplate();
325  TemplateIDType ComputeTemplateIndex();
326 
327 private:
328  vtkOrderedTriangulator(const vtkOrderedTriangulator&); // Not implemented.
329  void operator=(const vtkOrderedTriangulator&); // Not implemented.
330 };
331 
332 #endif
333 
334 
abstract base class for most VTK objects
Definition: vtkObject.h:60
represent and manipulate point attribute data
Definition: vtkPointData.h:35
#define VTK_FILTERING_EXPORT
helper class to generate triangulations
int vtkIdType
Definition: vtkType.h:255
dynamic, self-adjusting array of double
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:45
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
list of point or cell ids
Definition: vtkIdList.h:34
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:53
object to represent cell connectivity
Definition: vtkCellArray.h:48
replacement for malloc/free and new/delete
Definition: vtkHeap.h:51
static vtkObject * New()
represent and manipulate 3D points
Definition: vtkPoints.h:38