VTK
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 =========================================================================*/
131 #ifndef vtkDelaunay2D_h
132 #define vtkDelaunay2D_h
133 
134 #include "vtkFiltersCoreModule.h" // For export macro
135 #include "vtkPolyDataAlgorithm.h"
136 
138 class vtkCellArray;
139 class vtkIdList;
140 class vtkPointSet;
141 
142 #define VTK_DELAUNAY_XY_PLANE 0
143 #define VTK_SET_TRANSFORM_PLANE 1
144 #define VTK_BEST_FITTING_PLANE 2
145 
146 class VTKFILTERSCORE_EXPORT vtkDelaunay2D : public vtkPolyDataAlgorithm
147 {
148 public:
150  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
151 
156  static vtkDelaunay2D *New();
157 
167  void SetSourceData(vtkPolyData *);
168 
177  void SetSourceConnection(vtkAlgorithmOutput *algOutput);
178 
182  vtkPolyData *GetSource();
183 
185 
191  vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX);
192  vtkGetMacro(Alpha,double);
194 
196 
201  vtkSetClampMacro(Tolerance,double,0.0,1.0);
202  vtkGetMacro(Tolerance,double);
204 
206 
210  vtkSetClampMacro(Offset,double,0.75,VTK_DOUBLE_MAX);
211  vtkGetMacro(Offset,double);
213 
215 
221  vtkSetMacro(BoundingTriangulation,int);
222  vtkGetMacro(BoundingTriangulation,int);
223  vtkBooleanMacro(BoundingTriangulation,int);
225 
227 
237  virtual void SetTransform(vtkAbstractTransform*);
238  vtkGetObjectMacro(Transform, vtkAbstractTransform);
240 
242 
245  vtkSetClampMacro(ProjectionPlaneMode,int,
247  vtkGetMacro(ProjectionPlaneMode,int);
249 
250 protected:
251  vtkDelaunay2D();
252  ~vtkDelaunay2D() VTK_OVERRIDE;
253 
254  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
255 
256  vtkAbstractTransform * ComputeBestFittingPlane(vtkPointSet *input);
257 
258  double Alpha;
259  double Tolerance;
260  int BoundingTriangulation;
261  double Offset;
262 
264 
265  int ProjectionPlaneMode; //selects the plane in 3D where the Delaunay triangulation will be computed.
266 
267 private:
268  vtkPolyData *Mesh; //the created mesh
269  double *Points; //the raw points in double precision
270  void SetPoint(vtkIdType id, double *x)
271  {vtkIdType idx=3*id;
272  this->Points[idx] = x[0];
273  this->Points[idx+1] = x[1];
274  this->Points[idx+2] = x[2];
275  }
276 
277  void GetPoint(vtkIdType id, double x[3])
278  {double *ptr = this->Points + 3*id;
279  x[0] = *ptr++;
280  x[1] = *ptr++;
281  x[2] = *ptr;
282  }
283 
284  int NumberOfDuplicatePoints;
285  int NumberOfDegeneracies;
286 
287  int *RecoverBoundary(vtkPolyData *source);
288  int RecoverEdge(vtkPolyData* source, vtkIdType p1, vtkIdType p2);
289  void FillPolygons(vtkCellArray *polys, int *triUse);
290 
291  int InCircle (double x[3], double x1[3], double x2[3], double x3[3]);
292  vtkIdType FindTriangle(double x[3], vtkIdType ptIds[3], vtkIdType tri,
293  double tol, vtkIdType nei[3], vtkIdList *neighbors);
294  void CheckEdge(vtkIdType ptId, double x[3], vtkIdType p1, vtkIdType p2,
295  vtkIdType tri, bool recursive);
296 
297  int FillInputPortInformation(int, vtkInformation*) VTK_OVERRIDE;
298 
299 private:
300  vtkDelaunay2D(const vtkDelaunay2D&) VTK_DELETE_FUNCTION;
301  void operator=(const vtkDelaunay2D&) VTK_DELETE_FUNCTION;
302 };
303 
304 #endif
#define VTK_DOUBLE_MAX
Definition: vtkType.h:163
Store vtkAlgorithm input/output information.
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:42
int vtkIdType
Definition: vtkType.h:287
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
void GetPoint(const int i, const int j, const int k, double pnt[3])
Proxy object to connect input/output ports.
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:36
superclass for all geometric transformations
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
#define VTK_BEST_FITTING_PLANE
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
object to represent cell connectivity
Definition: vtkCellArray.h:50
create 2D Delaunay triangulation of input points
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
#define VTK_DELAUNAY_XY_PLANE
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Transform
Definition: ADIOSDefs.h:39