VTK  9.7.1
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
88 #ifndef vtkDelaunay3D_h
89 #define vtkDelaunay3D_h
90 
91 #include "vtkFiltersCoreModule.h" // For export macro
93 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
94 
95 VTK_ABI_NAMESPACE_BEGIN
96 class vtkIdList;
97 class vtkPointLocator;
98 class vtkPointSet;
99 class vtkPoints;
100 class vtkTetraArray;
102 
103 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkDelaunay3D : public vtkUnstructuredGridAlgorithm
104 {
105 public:
107  void PrintSelf(ostream& os, vtkIndent indent) override;
108 
113  static vtkDelaunay3D* New();
114 
116 
125  vtkSetClampMacro(Alpha, double, 0.0, VTK_DOUBLE_MAX);
126  vtkGetMacro(Alpha, double);
128 
130 
133  vtkSetMacro(AlphaTets, vtkTypeBool);
134  vtkGetMacro(AlphaTets, vtkTypeBool);
135  vtkBooleanMacro(AlphaTets, vtkTypeBool);
137 
139 
142  vtkSetMacro(AlphaTris, vtkTypeBool);
143  vtkGetMacro(AlphaTris, vtkTypeBool);
144  vtkBooleanMacro(AlphaTris, vtkTypeBool);
146 
148 
151  vtkSetMacro(AlphaLines, vtkTypeBool);
152  vtkGetMacro(AlphaLines, vtkTypeBool);
153  vtkBooleanMacro(AlphaLines, vtkTypeBool);
155 
157 
160  vtkSetMacro(AlphaVerts, vtkTypeBool);
161  vtkGetMacro(AlphaVerts, vtkTypeBool);
162  vtkBooleanMacro(AlphaVerts, vtkTypeBool);
164 
166 
171  vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
172  vtkGetMacro(Tolerance, double);
174 
176 
180  vtkSetClampMacro(Offset, double, 2.5, VTK_DOUBLE_MAX);
181  vtkGetMacro(Offset, double);
183 
185 
191  vtkSetMacro(BoundingTriangulation, vtkTypeBool);
192  vtkGetMacro(BoundingTriangulation, vtkTypeBool);
193  vtkBooleanMacro(BoundingTriangulation, vtkTypeBool);
195 
197 
201  void SetLocator(vtkIncrementalPointLocator* locator);
202  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
204 
209  void CreateDefaultLocator();
210 
223  vtkUnstructuredGrid* InitPointInsertion(
224  double center[3], double length, vtkIdType numPts, vtkPoints*& points);
225 
236  void InsertPoint(
237  vtkUnstructuredGrid* Mesh, vtkPoints* points, vtkIdType id, double x[3], vtkIdList* holeTetras);
238 
245  void EndPointInsertion();
246 
250  vtkMTimeType GetMTime() override;
251 
253 
258  vtkSetMacro(OutputPointsPrecision, int);
259  vtkGetMacro(OutputPointsPrecision, int);
261 
262 protected:
263  vtkDelaunay3D();
264  ~vtkDelaunay3D() override;
265 
267 
268  double Alpha;
273  double Tolerance;
275  double Offset;
277 
278  vtkIncrementalPointLocator* Locator; // help locate points faster
279 
280  vtkTetraArray* TetraArray; // used to keep track of circumspheres/neighbors
281  int FindTetra(vtkUnstructuredGrid* Mesh, double x[3], vtkIdType tetraId, int depth);
282  int InSphere(double x[3], vtkIdType tetraId);
283  void InsertTetra(vtkUnstructuredGrid* Mesh, vtkPoints* points, vtkIdType tetraId);
284 
285  int NumberOfDuplicatePoints; // keep track of bad data
287 
288  // Keep track of number of references to points to avoid new/delete calls
290 
291  vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid* Mesh, vtkIdList* tetras,
292  vtkIdList* faces, vtkIncrementalPointLocator* Locator);
293 
294  int FillInputPortInformation(int, vtkInformation*) override;
295 
296 private: // members added for performance
297  vtkIdList* Tetras; // used in InsertPoint
298  vtkIdList* Faces; // used in InsertPoint
299  vtkIdList* CheckedTetras; // used by InsertPoint
300 
301  vtkDelaunay3D(const vtkDelaunay3D&) = delete;
302  void operator=(const vtkDelaunay3D&) = delete;
303 };
304 
305 VTK_ABI_NAMESPACE_END
306 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
#define VTK_DOUBLE_MAX
Definition: vtkType.h:202
quickly locate points in 3-space
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
vtkTypeBool BoundingTriangulation
static vtkUnstructuredGridAlgorithm * New()
Abstract class in support of both point location and point insertion.
int NumberOfDuplicatePoints
int NumberOfDegeneracies
int OutputPointsPrecision
concrete class for storing a set of points
Definition: vtkPointSet.h:58
create 3D Delaunay triangulation of input points
int vtkIdType
Definition: vtkType.h:363
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkTypeBool AlphaTris
int vtkTypeBool
Definition: vtkABI.h:64
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIncrementalPointLocator * Locator
vtkTypeBool AlphaLines
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:25
dataset represents arbitrary combinations of all possible cell types
virtual vtkMTimeType GetMTime()
Return this object's modified time.
Superclass for algorithms that produce only unstructured grid as output.
vtkTetraArray * TetraArray
vtkTypeBool AlphaTets
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
represent and manipulate 3D points
Definition: vtkPoints.h:30
vtkTypeBool AlphaVerts