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 
127 
129 
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);
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 
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 
311 
318 
324 
337  int classification, vtkTetra* tet, vtkDataArray* cellScalars, vtkDoubleArray* tetScalars);
338 
339 protected:
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
object to represent cell connectivity
Definition: vtkCellArray.h:296
represent and manipulate cell attribute data
Definition: vtkCellData.h:151
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:165
dynamic, self-adjusting array of double
replacement for malloc/free and new/delete
Definition: vtkHeap.h:54
list of point or cell ids
Definition: vtkIdList.h:143
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:119
abstract base class for most VTK objects
Definition: vtkObject.h:82
helper class to generate triangulations
vtkIdType GetTetras(int classification, vtkUnstructuredGrid *ugrid)
Initialize and add the tetras and points from the triangulation to the unstructured grid provided.
vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, double x[3], double p[3], int type)
For each point to be inserted, provide an id, a position x, parametric coordinate p,...
void InitTriangulation(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, int numPts)
Initialize the triangulation process.
vtkIdType InsertPoint(vtkIdType id, double x[3], double p[3], int type)
For each point to be inserted, provide an id, a position x, parametric coordinate p,...
vtkIdType GetPointId(vtkIdType internalId)
Return the Id of point ‘internalId’.
void Triangulate()
Perform the triangulation.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void InitTriangulation(double bounds[6], int numPts)
Initialize the triangulation process.
vtkIdType AddTetras(int classification, vtkUnstructuredGrid *ugrid)
Add the tetras to the unstructured grid provided.
vtkIdType AddTetras(int classification, vtkIdList *ptIds, vtkPoints *pts)
Add the tetrahedra classified (0=inside,1=outside) to the list of ids and coordinates provided.
static vtkOrderedTriangulator * New()
Construct object.
void UpdatePointType(vtkIdType internalId, int type)
Update the point type.
double * GetPointPosition(vtkIdType internalId)
Return the parametric coordinates of point ‘internalId’.
void TemplateTriangulate(int cellType, int numPts, int numEdges)
Perform the triangulation.
vtkIdType AddTetras(int classification, vtkCellArray *connectivity)
Add the tetrahedra classified (0=inside,1=outside) to the connectivity list provided.
~vtkOrderedTriangulator() override
void InitTetraTraversal()
Methods to get one tetra at a time.
vtkIdType AddTetras(int classification, vtkIncrementalPointLocator *locator, vtkCellArray *outConnectivity, vtkPointData *inPD, vtkPointData *outPD, vtkCellData *inCD, vtkIdType cellId, vtkCellData *outCD)
Assuming that all the inserted points come from a cell ‘cellId’ to triangulate, get the tetrahedra in...
int GetNextTetra(int classification, vtkTetra *tet, vtkDataArray *cellScalars, vtkDoubleArray *tetScalars)
Methods to get one tetra at a time.
double * GetPointLocation(vtkIdType internalId)
Return the global coordinates of point ‘internalId’.
vtkIdType AddTriangles(vtkCellArray *connectivity)
Add the triangle faces classified (2=boundary) to the connectivity list provided.
vtkIdType AddTriangles(vtkIdType id, vtkCellArray *connectivity)
Add the triangle faces classified (2=boundary) and attached to the specified point id to the connecti...
vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, vtkIdType sortid2, double x[3], double p[3], int type)
For each point to be inserted, provide an id, a position x, parametric coordinate p,...
represent and manipulate point attribute data
Definition: vtkPointData.h:151
represent and manipulate 3D points
Definition: vtkPoints.h:149
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:114
dataset represents arbitrary combinations of all possible cell types
@ type
Definition: vtkX3D.h:522
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332