VTK  9.3.0
vtkDelaunay3D.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
97#ifndef vtkDelaunay3D_h
98#define vtkDelaunay3D_h
99
100#include "vtkFiltersCoreModule.h" // For export macro
102
103VTK_ABI_NAMESPACE_BEGIN
104class vtkIdList;
105class vtkPointLocator;
106class vtkPointSet;
107class vtkPoints;
108class vtkTetraArray;
110
111class VTKFILTERSCORE_EXPORT vtkDelaunay3D : public vtkUnstructuredGridAlgorithm
112{
113public:
115 void PrintSelf(ostream& os, vtkIndent indent) override;
116
122
124
133 vtkSetClampMacro(Alpha, double, 0.0, VTK_DOUBLE_MAX);
134 vtkGetMacro(Alpha, double);
136
138
141 vtkSetMacro(AlphaTets, vtkTypeBool);
142 vtkGetMacro(AlphaTets, vtkTypeBool);
143 vtkBooleanMacro(AlphaTets, vtkTypeBool);
145
147
150 vtkSetMacro(AlphaTris, vtkTypeBool);
151 vtkGetMacro(AlphaTris, vtkTypeBool);
152 vtkBooleanMacro(AlphaTris, vtkTypeBool);
154
156
159 vtkSetMacro(AlphaLines, vtkTypeBool);
160 vtkGetMacro(AlphaLines, vtkTypeBool);
161 vtkBooleanMacro(AlphaLines, vtkTypeBool);
163
165
168 vtkSetMacro(AlphaVerts, vtkTypeBool);
169 vtkGetMacro(AlphaVerts, vtkTypeBool);
170 vtkBooleanMacro(AlphaVerts, vtkTypeBool);
172
174
179 vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
180 vtkGetMacro(Tolerance, double);
182
184
188 vtkSetClampMacro(Offset, double, 2.5, VTK_DOUBLE_MAX);
189 vtkGetMacro(Offset, double);
191
193
199 vtkSetMacro(BoundingTriangulation, vtkTypeBool);
200 vtkGetMacro(BoundingTriangulation, vtkTypeBool);
201 vtkBooleanMacro(BoundingTriangulation, vtkTypeBool);
203
205
210 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
212
218
232 double center[3], double length, vtkIdType numPts, vtkPoints*& points);
233
245 vtkUnstructuredGrid* Mesh, vtkPoints* points, vtkIdType id, double x[3], vtkIdList* holeTetras);
246
254
259
261
266 vtkSetMacro(OutputPointsPrecision, int);
267 vtkGetMacro(OutputPointsPrecision, int);
269
270protected:
272 ~vtkDelaunay3D() override;
273
275
276 double Alpha;
281 double Tolerance;
283 double Offset;
285
286 vtkIncrementalPointLocator* Locator; // help locate points faster
287
288 vtkTetraArray* TetraArray; // used to keep track of circumspheres/neighbors
289 int FindTetra(vtkUnstructuredGrid* Mesh, double x[3], vtkIdType tetraId, int depth);
290 int InSphere(double x[3], vtkIdType tetraId);
291 void InsertTetra(vtkUnstructuredGrid* Mesh, vtkPoints* points, vtkIdType tetraId);
292
293 int NumberOfDuplicatePoints; // keep track of bad data
295
296 // Keep track of number of references to points to avoid new/delete calls
298
300 vtkIdList* faces, vtkIncrementalPointLocator* Locator);
301
303
304private: // members added for performance
305 vtkIdList* Tetras; // used in InsertPoint
306 vtkIdList* Faces; // used in InsertPoint
307 vtkIdList* CheckedTetras; // used by InsertPoint
308
309 vtkDelaunay3D(const vtkDelaunay3D&) = delete;
310 void operator=(const vtkDelaunay3D&) = delete;
311};
312
313VTK_ABI_NAMESPACE_END
314#endif
create 3D Delaunay triangulation of input points
void CreateDefaultLocator()
Create default locator.
vtkUnstructuredGrid * InitPointInsertion(double center[3], double length, vtkIdType numPts, vtkPoints *&points)
This is a helper method used with InsertPoint() to create tetrahedronalizations of points.
~vtkDelaunay3D() override
int InSphere(double x[3], vtkIdType tetraId)
vtkMTimeType GetMTime() override
Return the MTime also considering the locator.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkDelaunay3D * New()
Construct object with Alpha = 0.0; Tolerance = 0.001; Offset = 2.5; BoundingTriangulation turned off.
vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid *Mesh, vtkIdList *tetras, vtkIdList *faces, vtkIncrementalPointLocator *Locator)
vtkTetraArray * TetraArray
void InsertTetra(vtkUnstructuredGrid *Mesh, vtkPoints *points, vtkIdType tetraId)
void EndPointInsertion()
Invoke this method after all points have been inserted.
vtkTypeBool AlphaTets
int NumberOfDuplicatePoints
vtkIncrementalPointLocator * Locator
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
void SetLocator(vtkIncrementalPointLocator *locator)
Set / get a spatial locator for merging points.
vtkTypeBool BoundingTriangulation
vtkTypeBool AlphaTris
void InsertPoint(vtkUnstructuredGrid *Mesh, vtkPoints *points, vtkIdType id, double x[3], vtkIdList *holeTetras)
This is a helper method used with InitPointInsertion() to create tetrahedronalizations of points.
vtkTypeBool AlphaLines
vtkTypeBool AlphaVerts
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int FindTetra(vtkUnstructuredGrid *Mesh, double x[3], vtkIdType tetraId, int depth)
list of point or cell ids
Definition vtkIdList.h:32
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
quickly locate points in 3-space
concrete class for storing a set of points
Definition vtkPointSet.h:68
represent and manipulate 3D points
Definition vtkPoints.h:38
Superclass for algorithms that produce only unstructured grid as output.
dataset represents arbitrary combinations of all possible cell types
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270
#define VTK_DOUBLE_MAX
Definition vtkType.h:154