VTK  9.2.6
vtkDelaunay3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDelaunay3D.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 =========================================================================*/
100 #ifndef vtkDelaunay3D_h
101 #define vtkDelaunay3D_h
102 
103 #include "vtkFiltersCoreModule.h" // For export macro
105 
106 class vtkIdList;
107 class vtkPointLocator;
108 class vtkPointSet;
109 class vtkPoints;
110 class vtkTetraArray;
112 
113 class VTKFILTERSCORE_EXPORT vtkDelaunay3D : public vtkUnstructuredGridAlgorithm
114 {
115 public:
117  void PrintSelf(ostream& os, vtkIndent indent) override;
118 
123  static vtkDelaunay3D* New();
124 
126 
135  vtkSetClampMacro(Alpha, double, 0.0, VTK_DOUBLE_MAX);
136  vtkGetMacro(Alpha, double);
138 
140 
143  vtkSetMacro(AlphaTets, vtkTypeBool);
144  vtkGetMacro(AlphaTets, vtkTypeBool);
145  vtkBooleanMacro(AlphaTets, vtkTypeBool);
147 
149 
152  vtkSetMacro(AlphaTris, vtkTypeBool);
153  vtkGetMacro(AlphaTris, vtkTypeBool);
154  vtkBooleanMacro(AlphaTris, vtkTypeBool);
156 
158 
161  vtkSetMacro(AlphaLines, vtkTypeBool);
162  vtkGetMacro(AlphaLines, vtkTypeBool);
163  vtkBooleanMacro(AlphaLines, vtkTypeBool);
165 
167 
170  vtkSetMacro(AlphaVerts, vtkTypeBool);
171  vtkGetMacro(AlphaVerts, vtkTypeBool);
172  vtkBooleanMacro(AlphaVerts, vtkTypeBool);
174 
176 
181  vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
182  vtkGetMacro(Tolerance, double);
184 
186 
190  vtkSetClampMacro(Offset, double, 2.5, VTK_DOUBLE_MAX);
191  vtkGetMacro(Offset, double);
193 
195 
201  vtkSetMacro(BoundingTriangulation, vtkTypeBool);
202  vtkGetMacro(BoundingTriangulation, vtkTypeBool);
203  vtkBooleanMacro(BoundingTriangulation, vtkTypeBool);
205 
207 
211  void SetLocator(vtkIncrementalPointLocator* locator);
212  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
214 
219  void CreateDefaultLocator();
220 
233  vtkUnstructuredGrid* InitPointInsertion(
234  double center[3], double length, vtkIdType numPts, vtkPoints*& points);
235 
246  void InsertPoint(
247  vtkUnstructuredGrid* Mesh, vtkPoints* points, vtkIdType id, double x[3], vtkIdList* holeTetras);
248 
255  void EndPointInsertion();
256 
260  vtkMTimeType GetMTime() override;
261 
263 
268  vtkSetMacro(OutputPointsPrecision, int);
269  vtkGetMacro(OutputPointsPrecision, int);
271 
272 protected:
273  vtkDelaunay3D();
274  ~vtkDelaunay3D() override;
275 
277 
278  double Alpha;
283  double Tolerance;
285  double Offset;
287 
288  vtkIncrementalPointLocator* Locator; // help locate points faster
289 
290  vtkTetraArray* TetraArray; // used to keep track of circumspheres/neighbors
291  int FindTetra(vtkUnstructuredGrid* Mesh, double x[3], vtkIdType tetraId, int depth);
292  int InSphere(double x[3], vtkIdType tetraId);
293  void InsertTetra(vtkUnstructuredGrid* Mesh, vtkPoints* points, vtkIdType tetraId);
294 
295  int NumberOfDuplicatePoints; // keep track of bad data
297 
298  // Keep track of number of references to points to avoid new/delete calls
300 
301  vtkIdType FindEnclosingFaces(double x[3], vtkUnstructuredGrid* Mesh, vtkIdList* tetras,
302  vtkIdList* faces, vtkIncrementalPointLocator* Locator);
303 
304  int FillInputPortInformation(int, vtkInformation*) override;
305 
306 private: // members added for performance
307  vtkIdList* Tetras; // used in InsertPoint
308  vtkIdList* Faces; // used in InsertPoint
309  vtkIdList* CheckedTetras; // used by InsertPoint
310 
311 private:
312  vtkDelaunay3D(const vtkDelaunay3D&) = delete;
313  void operator=(const vtkDelaunay3D&) = delete;
314 };
315 
316 #endif
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
quickly locate points in 3-space
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
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:69
create 3D Delaunay triangulation of input points
int vtkIdType
Definition: vtkType.h:332
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkTypeBool AlphaTris
int vtkTypeBool
Definition: vtkABI.h:69
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:39
list of point or cell ids
Definition: vtkIdList.h:33
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:39
vtkTypeBool AlphaVerts