VTK  9.5.20250902
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
147#ifndef vtkDelaunay3D_h
148#define vtkDelaunay3D_h
149
150#include "vtkFiltersCoreModule.h" // For export macro
152#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
153
154VTK_ABI_NAMESPACE_BEGIN
155class vtkIdList;
156class vtkPointLocator;
157class vtkPointSet;
158class vtkPoints;
159class vtkTetraArray;
161
163{
164public:
166 void PrintSelf(ostream& os, vtkIndent indent) override;
167
173
175
184 vtkSetClampMacro(Alpha, double, 0.0, VTK_DOUBLE_MAX);
185 vtkGetMacro(Alpha, double);
187
189
192 vtkSetMacro(AlphaTets, vtkTypeBool);
193 vtkGetMacro(AlphaTets, vtkTypeBool);
194 vtkBooleanMacro(AlphaTets, vtkTypeBool);
196
198
201 vtkSetMacro(AlphaTris, vtkTypeBool);
202 vtkGetMacro(AlphaTris, vtkTypeBool);
203 vtkBooleanMacro(AlphaTris, vtkTypeBool);
205
207
210 vtkSetMacro(AlphaLines, vtkTypeBool);
211 vtkGetMacro(AlphaLines, vtkTypeBool);
212 vtkBooleanMacro(AlphaLines, vtkTypeBool);
214
216
219 vtkSetMacro(AlphaVerts, vtkTypeBool);
220 vtkGetMacro(AlphaVerts, vtkTypeBool);
221 vtkBooleanMacro(AlphaVerts, vtkTypeBool);
223
225
230 vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
231 vtkGetMacro(Tolerance, double);
233
235
239 vtkSetClampMacro(Offset, double, 2.5, VTK_DOUBLE_MAX);
240 vtkGetMacro(Offset, double);
242
244
250 vtkSetMacro(BoundingTriangulation, vtkTypeBool);
251 vtkGetMacro(BoundingTriangulation, vtkTypeBool);
252 vtkBooleanMacro(BoundingTriangulation, vtkTypeBool);
254
256
261 vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
263
269
283 double center[3], double length, vtkIdType numPts, vtkPoints*& points);
284
296 vtkUnstructuredGrid* Mesh, vtkPoints* points, vtkIdType id, double x[3], vtkIdList* holeTetras);
297
305
310
312
317 vtkSetMacro(OutputPointsPrecision, int);
318 vtkGetMacro(OutputPointsPrecision, int);
320
321protected:
323 ~vtkDelaunay3D() override;
324
326
327 double Alpha;
332 double Tolerance;
334 double Offset;
336
337 vtkIncrementalPointLocator* Locator; // help locate points faster
338
339 vtkTetraArray* TetraArray; // used to keep track of circumspheres/neighbors
340 int FindTetra(vtkUnstructuredGrid* Mesh, double x[3], vtkIdType tetraId, int depth);
341 int InSphere(double x[3], vtkIdType tetraId);
342 void InsertTetra(vtkUnstructuredGrid* Mesh, vtkPoints* points, vtkIdType tetraId);
343
344 int NumberOfDuplicatePoints; // keep track of bad data
346
347 // Keep track of number of references to points to avoid new/delete calls
349
351 vtkIdList* faces, vtkIncrementalPointLocator* Locator);
352
354
355private: // members added for performance
356 vtkIdList* Tetras; // used in InsertPoint
357 vtkIdList* Faces; // used in InsertPoint
358 vtkIdList* CheckedTetras; // used by InsertPoint
359
360 vtkDelaunay3D(const vtkDelaunay3D&) = delete;
361 void operator=(const vtkDelaunay3D&) = delete;
362};
363
364VTK_ABI_NAMESPACE_END
365#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:133
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:108
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:98
represent and manipulate 3D points
Definition vtkPoints.h:139
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:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287
#define VTK_DOUBLE_MAX
Definition vtkType.h:171
#define VTK_MARSHALAUTO