VTK  9.1.0
vtkDelaunay2D.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkDelaunay2D.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=========================================================================*/
134#ifndef vtkDelaunay2D_h
135#define vtkDelaunay2D_h
136
137#include "vtkFiltersCoreModule.h" // For export macro
138#include "vtkPolyDataAlgorithm.h"
139
141class vtkCellArray;
142class vtkIdList;
143class vtkPointSet;
144
145#define VTK_DELAUNAY_XY_PLANE 0
146#define VTK_SET_TRANSFORM_PLANE 1
147#define VTK_BEST_FITTING_PLANE 2
148
149class VTKFILTERSCORE_EXPORT vtkDelaunay2D : public vtkPolyDataAlgorithm
150{
151public:
153 void PrintSelf(ostream& os, vtkIndent indent) override;
154
160
171
181
186
188
194 vtkSetClampMacro(Alpha, double, 0.0, VTK_DOUBLE_MAX);
195 vtkGetMacro(Alpha, double);
197
199
204 vtkSetClampMacro(Tolerance, double, 0.0, 1.0);
205 vtkGetMacro(Tolerance, double);
207
209
213 vtkSetClampMacro(Offset, double, 0.75, VTK_DOUBLE_MAX);
214 vtkGetMacro(Offset, double);
216
218
224 vtkSetMacro(BoundingTriangulation, vtkTypeBool);
225 vtkGetMacro(BoundingTriangulation, vtkTypeBool);
226 vtkBooleanMacro(BoundingTriangulation, vtkTypeBool);
228
230
241 vtkGetObjectMacro(Transform, vtkAbstractTransform);
243
245
253 vtkSetClampMacro(ProjectionPlaneMode, int, VTK_DELAUNAY_XY_PLANE, VTK_BEST_FITTING_PLANE);
254 vtkGetMacro(ProjectionPlaneMode, int);
256
264
265protected:
267 ~vtkDelaunay2D() override;
268
270
271 double Alpha;
272 double Tolerance;
274 double Offset;
275
277
278 int ProjectionPlaneMode; // selects the plane in 3D where the Delaunay triangulation will be
279 // computed.
280
281private:
282 vtkPolyData* Mesh; // the created mesh
283 double* Points; // the raw points in double precision
284 void SetPoint(vtkIdType id, double* x)
285 {
286 vtkIdType idx = 3 * id;
287 this->Points[idx] = x[0];
288 this->Points[idx + 1] = x[1];
289 this->Points[idx + 2] = x[2];
290 }
291
292 void GetPoint(vtkIdType id, double x[3])
293 {
294 double* ptr = this->Points + 3 * id;
295 x[0] = *ptr++;
296 x[1] = *ptr++;
297 x[2] = *ptr;
298 }
299
300 int NumberOfDuplicatePoints;
301 int NumberOfDegeneracies;
302
303 int* RecoverBoundary(vtkPolyData* source);
304 int RecoverEdge(vtkPolyData* source, vtkIdType p1, vtkIdType p2);
305 void FillPolygons(vtkCellArray* polys, int* triUse);
306
307 int InCircle(double x[3], double x1[3], double x2[3], double x3[3]);
308 vtkIdType FindTriangle(double x[3], vtkIdType ptIds[3], vtkIdType tri, double tol,
309 vtkIdType nei[3], vtkIdList* neighbors);
310 void CheckEdge(
311 vtkIdType ptId, double x[3], vtkIdType p1, vtkIdType p2, vtkIdType tri, bool recursive);
312
313 int FillInputPortInformation(int, vtkInformation*) override;
314
315private:
316 vtkDelaunay2D(const vtkDelaunay2D&) = delete;
317 void operator=(const vtkDelaunay2D&) = delete;
318};
319
320#endif
void GetPoint(const int i, const int j, const int k, double pnt[3])
superclass for all geometric transformations
Proxy object to connect input/output ports.
object to represent cell connectivity
Definition: vtkCellArray.h:190
create 2D Delaunay triangulation of input points
~vtkDelaunay2D() override
vtkPolyData * GetSource()
Get a pointer to the source object.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
virtual void SetTransform(vtkAbstractTransform *)
Set / get the transform which is applied to points to generate a 2D problem.
static vtkDelaunay2D * New()
Construct object with Alpha = 0.0; Tolerance = 0.001; Offset = 1.25; BoundingTriangulation turned off...
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
Specify the source object used to specify constrained edges and loops.
static vtkAbstractTransform * ComputeBestFittingPlane(vtkPointSet *input)
This method computes the best fit plane to a set of points represented by a vtkPointSet.
vtkTypeBool BoundingTriangulation
vtkAbstractTransform * Transform
void SetSourceData(vtkPolyData *)
Specify the source object used to specify constrained edges and loops.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
list of point or cell ids
Definition: vtkIdList.h:40
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition: vtkPointSet.h:76
Superclass for algorithms that produce only polydata as output.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:95
@ Transform
Definition: vtkX3D.h:47
int vtkTypeBool
Definition: vtkABI.h:69
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_BEST_FITTING_PLANE
#define VTK_DELAUNAY_XY_PLANE
int vtkIdType
Definition: vtkType.h:332
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165