VTK  9.3.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 
94 VTK_ABI_NAMESPACE_BEGIN
95 class vtkIdList;
96 class vtkPointLocator;
97 class vtkPointSet;
98 class vtkPoints;
99 class vtkTetraArray;
101 
102 class VTKFILTERSCORE_EXPORT vtkDelaunay3D : public vtkUnstructuredGridAlgorithm
103 {
104 public:
106  void PrintSelf(ostream& os, vtkIndent indent) override;
107 
112  static vtkDelaunay3D* New();
113 
115 
124  vtkSetClampMacro(Alpha, double, 0.0, VTK_DOUBLE_MAX);
125  vtkGetMacro(Alpha, double);
127 
129 
132  vtkSetMacro(AlphaTets, vtkTypeBool);
133  vtkGetMacro(AlphaTets, vtkTypeBool);
134  vtkBooleanMacro(AlphaTets, vtkTypeBool);
136 
138 
141  vtkSetMacro(AlphaTris, vtkTypeBool);
142  vtkGetMacro(AlphaTris, vtkTypeBool);
143  vtkBooleanMacro(AlphaTris, vtkTypeBool);
145 
147 
150  vtkSetMacro(AlphaLines, vtkTypeBool);
151  vtkGetMacro(AlphaLines, vtkTypeBool);
152  vtkBooleanMacro(AlphaLines, vtkTypeBool);
154 
156 
159  vtkSetMacro(AlphaVerts, vtkTypeBool);
160  vtkGetMacro(AlphaVerts, vtkTypeBool);
161  vtkBooleanMacro(AlphaVerts, vtkTypeBool);
163 
165 
170  vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
171  vtkGetMacro(Tolerance, double);
173 
175 
179  vtkSetClampMacro(Offset, double, 2.5, VTK_DOUBLE_MAX);
180  vtkGetMacro(Offset, double);
182 
184 
190  vtkSetMacro(BoundingTriangulation, vtkTypeBool);
191  vtkGetMacro(BoundingTriangulation, vtkTypeBool);
192  vtkBooleanMacro(BoundingTriangulation, vtkTypeBool);
194 
196 
200  void SetLocator(vtkIncrementalPointLocator* locator);
201  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
203 
208  void CreateDefaultLocator();
209 
222  vtkUnstructuredGrid* InitPointInsertion(
223  double center[3], double length, vtkIdType numPts, vtkPoints*& points);
224 
235  void InsertPoint(
236  vtkUnstructuredGrid* Mesh, vtkPoints* points, vtkIdType id, double x[3], vtkIdList* holeTetras);
237 
244  void EndPointInsertion();
245 
249  vtkMTimeType GetMTime() override;
250 
252 
257  vtkSetMacro(OutputPointsPrecision, int);
258  vtkGetMacro(OutputPointsPrecision, int);
260 
261 protected:
262  vtkDelaunay3D();
263  ~vtkDelaunay3D() override;
264 
266 
267  double Alpha;
272  double Tolerance;
274  double Offset;
276 
277  vtkIncrementalPointLocator* Locator; // help locate points faster
278 
279  vtkTetraArray* TetraArray; // used to keep track of circumspheres/neighbors
280  int FindTetra(vtkUnstructuredGrid* Mesh, double x[3], vtkIdType tetraId, int depth);
281  int InSphere(double x[3], vtkIdType tetraId);
282  void InsertTetra(vtkUnstructuredGrid* Mesh, vtkPoints* points, vtkIdType tetraId);
283 
284  int NumberOfDuplicatePoints; // keep track of bad data
286 
287  // Keep track of number of references to points to avoid new/delete calls
289 
290  vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid* Mesh, vtkIdList* tetras,
291  vtkIdList* faces, vtkIncrementalPointLocator* Locator);
292 
293  int FillInputPortInformation(int, vtkInformation*) override;
294 
295 private: // members added for performance
296  vtkIdList* Tetras; // used in InsertPoint
297  vtkIdList* Faces; // used in InsertPoint
298  vtkIdList* CheckedTetras; // used by InsertPoint
299 
300  vtkDelaunay3D(const vtkDelaunay3D&) = delete;
301  void operator=(const vtkDelaunay3D&) = delete;
302 };
303 
304 VTK_ABI_NAMESPACE_END
305 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154
quickly locate points in 3-space
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
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:315
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:22
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.
represent and manipulate 3D points
Definition: vtkPoints.h:28
vtkTypeBool AlphaVerts