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=========================================================================*/
88#ifndef vtkOrderedTriangulator_h
89#define vtkOrderedTriangulator_h
90
91#include "vtkCommonDataModelModule.h" // For export macro
92#include "vtkObject.h"
93
95class vtkCellArray;
96class vtkHeap;
97class vtkIdList;
98class vtkPoints;
99class vtkTetra;
100class vtkDataArray;
101class vtkDoubleArray;
102struct vtkOTMesh;
103struct vtkOTTemplates;
105class vtkPointData;
106class vtkCellData;
107
108// Template ID's must be 32-bits. See .cxx file for more information.
109#if VTK_SIZEOF_SHORT == 4
110typedef unsigned short TemplateIDType;
111#elif VTK_SIZEOF_INT == 4
112typedef unsigned int TemplateIDType;
113#elif VTK_SIZEOF_LONG == 4
114typedef unsigned long TemplateIDType;
115#endif
116
117class VTKCOMMONDATAMODEL_EXPORT vtkOrderedTriangulator : public vtkObject
118{
119public:
121 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
122
127
129
137 void InitTriangulation(double xmin, double xmax, double ymin, double ymax,
138 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],
159 double p[3], int type);
161 double x[3], double p[3], int type);
163
165
171 void TemplateTriangulate(int cellType, int numPts, int numEdges);
173
182 void UpdatePointType(vtkIdType internalId, int type);
183
190 double *GetPointPosition(vtkIdType internalId);
191
198 double *GetPointLocation(vtkIdType internalId);
199
208
210
213 vtkGetMacro(NumberOfPoints,int);
215
217
224 vtkSetMacro(UseTemplates,int);
225 vtkGetMacro(UseTemplates,int);
226 vtkBooleanMacro(UseTemplates,int);
228
230
236 vtkSetMacro(PreSorted,int);
237 vtkGetMacro(PreSorted,int);
238 vtkBooleanMacro(PreSorted,int);
240
242
246 vtkSetMacro(UseTwoSortIds,int);
247 vtkGetMacro(UseTwoSortIds,int);
248 vtkBooleanMacro(UseTwoSortIds,int);
250
262 vtkIdType GetTetras(int classification, vtkUnstructuredGrid *ugrid);
263
274 vtkIdType AddTetras(int classification, vtkUnstructuredGrid *ugrid);
275
283 vtkIdType AddTetras(int classification, vtkCellArray *connectivity);
284
296 vtkIdType AddTetras(int classification,
298 vtkCellArray *outConnectivity,
299 vtkPointData *inPD,
300 vtkPointData *outPD,
301 vtkCellData *inCD,
302 vtkIdType cellId,
303 vtkCellData *outCD);
304
310 vtkIdType AddTetras(int classification, vtkIdList *ptIds, vtkPoints *pts);
311
317
324
330
342 int GetNextTetra(int classification, vtkTetra *tet,
343 vtkDataArray *cellScalars, vtkDoubleArray *tetScalars);
344
345protected:
348
349private:
350 void Initialize();
351
352 vtkOTMesh *Mesh;
353 int NumberOfPoints; //number of points inserted
354 int MaximumNumberOfPoints; //maximum possible number of points to be inserted
355 double Bounds[6];
356 int PreSorted;
357 int UseTwoSortIds;
358 vtkHeap *Heap;
359
360 int UseTemplates;
361 int CellType;
362 int NumberOfCellPoints;
363 int NumberOfCellEdges;
364 vtkHeap *TemplateHeap;
365 vtkOTTemplates *Templates;
366 int TemplateTriangulation();
367 void AddTemplate();
368 TemplateIDType ComputeTemplateIndex();
369
370private:
371 vtkOrderedTriangulator(const vtkOrderedTriangulator&) VTK_DELETE_FUNCTION;
372 void operator=(const vtkOrderedTriangulator&) VTK_DELETE_FUNCTION;
373};
374
375#endif
376
377
object to represent cell connectivity
Definition: vtkCellArray.h:51
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
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:37
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
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)
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)
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)
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)
double * GetPointLocation(vtkIdType internalId)
Return the global coordinates of point ‘internalId’.
represent and manipulate point attribute data
Definition: vtkPointData.h:38
represent and manipulate 3D points
Definition: vtkPoints.h:40
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:48
dataset represents arbitrary combinations of all possible cell types
CellTypeInDataSet cellType(vtkDataSet *input)
@ type
Definition: vtkX3D.h:516
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287