VTK  9.2.6
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 =========================================================================*/
88 #ifndef vtkOrderedTriangulator_h
89 #define vtkOrderedTriangulator_h
90 
91 #include "vtkCommonDataModelModule.h" // For export macro
92 #include "vtkObject.h"
93 
95 class vtkCellArray;
96 class vtkHeap;
97 class vtkIdList;
98 class vtkPoints;
99 class vtkTetra;
100 class vtkDataArray;
101 class vtkDoubleArray;
102 struct vtkOTMesh;
103 struct vtkOTTemplates;
105 class vtkPointData;
106 class vtkCellData;
107 
108 // Template ID's must be 32-bits. See .cxx file for more information.
109 #if VTK_SIZEOF_SHORT == 4
110 typedef unsigned short TemplateIDType;
111 #elif VTK_SIZEOF_INT == 4
112 typedef unsigned int TemplateIDType;
113 #elif VTK_SIZEOF_LONG == 4
114 typedef unsigned long TemplateIDType;
115 #endif
116 
117 class VTKCOMMONDATAMODEL_EXPORT vtkOrderedTriangulator : public vtkObject
118 {
119 public:
121  void PrintSelf(ostream& os, vtkIndent indent) override;
122 
126  static vtkOrderedTriangulator* New();
127 
129 
137  void InitTriangulation(
138  double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, int numPts);
139  void InitTriangulation(double bounds[6], int numPts);
141 
143 
157  vtkIdType InsertPoint(vtkIdType id, double x[3], double p[3], int type);
158  vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, double x[3], double p[3], int type);
159  vtkIdType InsertPoint(
160  vtkIdType id, vtkIdType sortid, vtkIdType sortid2, double x[3], double p[3], int type);
162 
164 
169  void Triangulate();
170  void TemplateTriangulate(int cellType, int numPts, int numEdges);
172 
181  void UpdatePointType(vtkIdType internalId, int type);
182 
189  double* GetPointPosition(vtkIdType internalId);
190 
197  double* GetPointLocation(vtkIdType internalId);
198 
206  vtkIdType GetPointId(vtkIdType internalId);
207 
209 
212  vtkGetMacro(NumberOfPoints, int);
214 
216 
223  vtkSetMacro(UseTemplates, vtkTypeBool);
224  vtkGetMacro(UseTemplates, vtkTypeBool);
225  vtkBooleanMacro(UseTemplates, vtkTypeBool);
227 
229 
235  vtkSetMacro(PreSorted, vtkTypeBool);
236  vtkGetMacro(PreSorted, vtkTypeBool);
237  vtkBooleanMacro(PreSorted, vtkTypeBool);
239 
241 
245  vtkSetMacro(UseTwoSortIds, vtkTypeBool);
246  vtkGetMacro(UseTwoSortIds, vtkTypeBool);
247  vtkBooleanMacro(UseTwoSortIds, vtkTypeBool);
249 
261  vtkIdType GetTetras(int classification, vtkUnstructuredGrid* ugrid);
262 
273  vtkIdType AddTetras(int classification, vtkUnstructuredGrid* ugrid);
274 
282  vtkIdType AddTetras(int classification, vtkCellArray* connectivity);
283 
295  vtkIdType AddTetras(int classification, vtkIncrementalPointLocator* locator,
296  vtkCellArray* outConnectivity, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
297  vtkIdType cellId, vtkCellData* outCD);
298 
304  vtkIdType AddTetras(int classification, vtkIdList* ptIds, vtkPoints* pts);
305 
310  vtkIdType AddTriangles(vtkCellArray* connectivity);
311 
317  vtkIdType AddTriangles(vtkIdType id, vtkCellArray* connectivity);
318 
323  void InitTetraTraversal();
324 
336  int GetNextTetra(
337  int classification, vtkTetra* tet, vtkDataArray* cellScalars, vtkDoubleArray* tetScalars);
338 
339 protected:
341  ~vtkOrderedTriangulator() override;
342 
343 private:
344  void Initialize();
345 
346  vtkOTMesh* Mesh;
347  int NumberOfPoints; // number of points inserted
348  int MaximumNumberOfPoints; // maximum possible number of points to be inserted
349  double Bounds[6];
350  vtkTypeBool PreSorted;
351  vtkTypeBool UseTwoSortIds;
352  vtkHeap* Heap;
353 
354  vtkTypeBool UseTemplates;
355  int CellType;
356  int NumberOfCellPoints;
357  int NumberOfCellEdges;
358  vtkHeap* TemplateHeap;
359  vtkOTTemplates* Templates;
360  int TemplateTriangulation();
361  void AddTemplate();
362  TemplateIDType ComputeTemplateIndex();
363 
364 private:
366  void operator=(const vtkOrderedTriangulator&) = delete;
367 };
368 
369 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
represent and manipulate point attribute data
Definition: vtkPointData.h:41
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represent and manipulate cell attribute data
Definition: vtkCellData.h:41
Abstract class in support of both point location and point insertion.
helper class to generate triangulations
int vtkIdType
Definition: vtkType.h:332
dynamic, self-adjusting array of double
int vtkTypeBool
Definition: vtkABI.h:69
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:44
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:33
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
object to represent cell connectivity
Definition: vtkCellArray.h:186
replacement for malloc/free and new/delete
Definition: vtkHeap.h:53
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:39