VTK  9.3.20240419
vtkOrderedTriangulator.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
76 #ifndef vtkOrderedTriangulator_h
77 #define vtkOrderedTriangulator_h
78 
79 #include "vtkCommonDataModelModule.h" // For export macro
80 #include "vtkObject.h"
81 
82 VTK_ABI_NAMESPACE_BEGIN
84 class vtkCellArray;
85 class vtkHeap;
86 class vtkIdList;
87 class vtkPoints;
88 class vtkTetra;
89 class vtkDataArray;
90 class vtkDoubleArray;
91 struct vtkOTMesh;
92 struct vtkOTTemplates;
94 class vtkPointData;
95 class vtkCellData;
96 
97 // Template ID's must be 32-bits. See .cxx file for more information.
98 #if VTK_SIZEOF_SHORT == 4
99 typedef unsigned short TemplateIDType;
100 #elif VTK_SIZEOF_INT == 4
101 typedef unsigned int TemplateIDType;
102 #elif VTK_SIZEOF_LONG == 4
103 typedef unsigned long TemplateIDType;
104 #endif
105 
106 class VTKCOMMONDATAMODEL_EXPORT vtkOrderedTriangulator : public vtkObject
107 {
108 public:
110  void PrintSelf(ostream& os, vtkIndent indent) override;
111 
116 
118 
127  double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, int numPts);
128  void InitTriangulation(double bounds[6], int numPts);
130 
132 
146  vtkIdType InsertPoint(vtkIdType id, double x[3], double p[3], int type);
147  vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, double x[3], double p[3], int type);
149  vtkIdType id, vtkIdType sortid, vtkIdType sortid2, double x[3], double p[3], int type);
151 
153 
158  void Triangulate();
159  void TemplateTriangulate(int cellType, int numPts, int numEdges);
161 
170  void UpdatePointType(vtkIdType internalId, int type);
171 
178  double* GetPointPosition(vtkIdType internalId);
179 
186  double* GetPointLocation(vtkIdType internalId);
187 
196 
198 
201  vtkGetMacro(NumberOfPoints, int);
203 
205 
212  vtkSetMacro(UseTemplates, vtkTypeBool);
213  vtkGetMacro(UseTemplates, vtkTypeBool);
214  vtkBooleanMacro(UseTemplates, vtkTypeBool);
216 
218 
224  vtkSetMacro(PreSorted, vtkTypeBool);
225  vtkGetMacro(PreSorted, vtkTypeBool);
226  vtkBooleanMacro(PreSorted, vtkTypeBool);
228 
230 
234  vtkSetMacro(UseTwoSortIds, vtkTypeBool);
235  vtkGetMacro(UseTwoSortIds, vtkTypeBool);
236  vtkBooleanMacro(UseTwoSortIds, vtkTypeBool);
238 
250  vtkIdType GetTetras(int classification, vtkUnstructuredGrid* ugrid);
251 
262  vtkIdType AddTetras(int classification, vtkUnstructuredGrid* ugrid);
263 
271  vtkIdType AddTetras(int classification, vtkCellArray* connectivity);
272 
284  vtkIdType AddTetras(int classification, vtkIncrementalPointLocator* locator,
285  vtkCellArray* outConnectivity, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
286  vtkIdType cellId, vtkCellData* outCD);
287 
293  vtkIdType AddTetras(int classification, vtkIdList* ptIds, vtkPoints* pts);
294 
300  vtkIdType AddTetras(int classification, vtkIdList* ptIds);
301 
307 
314 
320 
333  int classification, vtkTetra* tet, vtkDataArray* cellScalars, vtkDoubleArray* tetScalars);
334 
335 protected:
338 
339 private:
340  void Initialize();
341 
342  vtkOTMesh* Mesh;
343  int NumberOfPoints; // number of points inserted
344  int MaximumNumberOfPoints; // maximum possible number of points to be inserted
345  double Bounds[6];
346  vtkTypeBool PreSorted;
347  vtkTypeBool UseTwoSortIds;
348  vtkHeap* Heap;
349 
350  vtkTypeBool UseTemplates;
351  int CellType;
352  int NumberOfCellPoints;
353  int NumberOfCellEdges;
354  vtkHeap* TemplateHeap;
355  vtkOTTemplates* Templates;
356  int TemplateTriangulation();
357  void AddTemplate();
358  TemplateIDType ComputeTemplateIndex();
359 
361  void operator=(const vtkOrderedTriangulator&) = delete;
362 };
363 
364 VTK_ABI_NAMESPACE_END
365 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:286
represent and manipulate cell attribute data
Definition: vtkCellData.h:141
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:155
dynamic, self-adjusting array of double
replacement for malloc/free and new/delete
Definition: vtkHeap.h:43
list of point or cell ids
Definition: vtkIdList.h:133
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
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 AddTetras(int classification, vtkIdList *ptIds)
Add the tetrahedra classified (0=inside,1=outside) to the list of ids.
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:140
represent and manipulate 3D points
Definition: vtkPoints.h:139
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:113
dataset represents arbitrary combinations of all possible cell types
@ type
Definition: vtkX3D.h:516
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315