VTK  9.1.0
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=========================================================================*/
85#ifndef vtkOrderedTriangulator_h
86#define vtkOrderedTriangulator_h
87
88#include "vtkCommonDataModelModule.h" // For export macro
89#include "vtkObject.h"
90
92class vtkCellArray;
93class vtkHeap;
94class vtkIdList;
95class vtkPoints;
96class vtkTetra;
97class vtkDataArray;
98class vtkDoubleArray;
99struct vtkOTMesh;
100struct vtkOTTemplates;
102class vtkPointData;
103class vtkCellData;
104
105// Template ID's must be 32-bits. See .cxx file for more information.
106#if VTK_SIZEOF_SHORT == 4
107typedef unsigned short TemplateIDType;
108#elif VTK_SIZEOF_INT == 4
109typedef unsigned int TemplateIDType;
110#elif VTK_SIZEOF_LONG == 4
111typedef unsigned long TemplateIDType;
112#endif
113
114class VTKCOMMONDATAMODEL_EXPORT vtkOrderedTriangulator : public vtkObject
115{
116public:
118 void PrintSelf(ostream& os, vtkIndent indent) override;
119
124
126
135 double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, int numPts);
136 void InitTriangulation(double bounds[6], int numPts);
138
140
154 vtkIdType InsertPoint(vtkIdType id, double x[3], double p[3], int type);
155 vtkIdType InsertPoint(vtkIdType id, vtkIdType sortid, double x[3], double p[3], int type);
157 vtkIdType id, vtkIdType sortid, vtkIdType sortid2, double x[3], double p[3], int type);
159
161
167 void TemplateTriangulate(int cellType, int numPts, int numEdges);
169
178 void UpdatePointType(vtkIdType internalId, int type);
179
186 double* GetPointPosition(vtkIdType internalId);
187
194 double* GetPointLocation(vtkIdType internalId);
195
204
206
209 vtkGetMacro(NumberOfPoints, int);
211
213
220 vtkSetMacro(UseTemplates, vtkTypeBool);
221 vtkGetMacro(UseTemplates, vtkTypeBool);
222 vtkBooleanMacro(UseTemplates, vtkTypeBool);
224
226
232 vtkSetMacro(PreSorted, vtkTypeBool);
233 vtkGetMacro(PreSorted, vtkTypeBool);
234 vtkBooleanMacro(PreSorted, vtkTypeBool);
236
238
242 vtkSetMacro(UseTwoSortIds, vtkTypeBool);
243 vtkGetMacro(UseTwoSortIds, vtkTypeBool);
244 vtkBooleanMacro(UseTwoSortIds, vtkTypeBool);
246
258 vtkIdType GetTetras(int classification, vtkUnstructuredGrid* ugrid);
259
270 vtkIdType AddTetras(int classification, vtkUnstructuredGrid* ugrid);
271
279 vtkIdType AddTetras(int classification, vtkCellArray* connectivity);
280
292 vtkIdType AddTetras(int classification, vtkIncrementalPointLocator* locator,
293 vtkCellArray* outConnectivity, vtkPointData* inPD, vtkPointData* outPD, vtkCellData* inCD,
294 vtkIdType cellId, vtkCellData* outCD);
295
301 vtkIdType AddTetras(int classification, vtkIdList* ptIds, vtkPoints* pts);
302
308
315
321
334 int classification, vtkTetra* tet, vtkDataArray* cellScalars, vtkDoubleArray* tetScalars);
335
336protected:
339
340private:
341 void Initialize();
342
343 vtkOTMesh* Mesh;
344 int NumberOfPoints; // number of points inserted
345 int MaximumNumberOfPoints; // maximum possible number of points to be inserted
346 double Bounds[6];
347 vtkTypeBool PreSorted;
348 vtkTypeBool UseTwoSortIds;
349 vtkHeap* Heap;
350
351 vtkTypeBool UseTemplates;
352 int CellType;
353 int NumberOfCellPoints;
354 int NumberOfCellEdges;
355 vtkHeap* TemplateHeap;
356 vtkOTTemplates* Templates;
357 int TemplateTriangulation();
358 void AddTemplate();
359 TemplateIDType ComputeTemplateIndex();
360
361private:
363 void operator=(const vtkOrderedTriangulator&) = delete;
364};
365
366#endif
object to represent cell connectivity
Definition: vtkCellArray.h:290
represent and manipulate cell attribute data
Definition: vtkCellData.h:142
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
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:140
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
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.
double * GetPointPosition(vtkIdType internalId)
Return the parametric coordinates of point ‘internalId’.
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.
void UpdatePointType(vtkIdType internalId, int type)
Update the point type.
void TemplateTriangulate(int cellType, int numPts, int numEdges)
Perform the triangulation.
static vtkOrderedTriangulator * New()
Construct object.
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.
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,...
double * GetPointLocation(vtkIdType internalId)
Return the global coordinates of point ‘internalId’.
represent and manipulate point attribute data
Definition: vtkPointData.h:142
represent and manipulate 3D points
Definition: vtkPoints.h:143
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:111
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