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 =========================================================================*/
130 #ifndef vtkDelaunay2D_h
131 #define vtkDelaunay2D_h
132 
133 #include "vtkFiltersCoreModule.h" // For export macro
134 #include "vtkPolyDataAlgorithm.h"
135 
137 class vtkCellArray;
138 class vtkIdList;
139 class vtkPointSet;
140 
141 #define VTK_DELAUNAY_XY_PLANE 0
142 #define VTK_SET_TRANSFORM_PLANE 1
143 #define VTK_BEST_FITTING_PLANE 2
144 
146 {
147 public:
149  void PrintSelf(ostream& os, vtkIndent indent);
150 
153  static vtkDelaunay2D *New();
154 
163 
171 
174 
176 
180  vtkSetClampMacro(Alpha,double,0.0,VTK_DOUBLE_MAX);
181  vtkGetMacro(Alpha,double);
183 
185 
188  vtkSetClampMacro(Tolerance,double,0.0,1.0);
189  vtkGetMacro(Tolerance,double);
191 
193 
195  vtkSetClampMacro(Offset,double,0.75,VTK_DOUBLE_MAX);
196  vtkGetMacro(Offset,double);
198 
200 
204  vtkSetMacro(BoundingTriangulation,int);
205  vtkGetMacro(BoundingTriangulation,int);
206  vtkBooleanMacro(BoundingTriangulation,int);
208 
210 
221 
223 
224  vtkSetClampMacro(ProjectionPlaneMode,int,
226  vtkGetMacro(ProjectionPlaneMode,int);
228 
229 protected:
232 
234 
236 
237  double Alpha;
238  double Tolerance;
240  double Offset;
241 
243 
244  int ProjectionPlaneMode; //selects the plane in 3D where the Delaunay triangulation will be computed.
245 
246 private:
247  vtkPolyData *Mesh; //the created mesh
248  double *Points; //the raw points in double precision
249  void SetPoint(vtkIdType id, double *x)
250  {vtkIdType idx=3*id;
251  this->Points[idx] = x[0];
252  this->Points[idx+1] = x[1];
253  this->Points[idx+2] = x[2];
254  }
255 
256  void GetPoint(vtkIdType id, double x[3])
257  {double *ptr = this->Points + 3*id;
258  x[0] = *ptr++;
259  x[1] = *ptr++;
260  x[2] = *ptr;
261  }
262 
263  int NumberOfDuplicatePoints;
264  int NumberOfDegeneracies;
265 
266  int *RecoverBoundary(vtkPolyData *source);
267  int RecoverEdge(vtkIdType p1, vtkIdType p2);
268  void FillPolygons(vtkCellArray *polys, int *triUse);
269 
270  int InCircle (double x[3], double x1[3], double x2[3], double x3[3]);
271  vtkIdType FindTriangle(double x[3], vtkIdType ptIds[3], vtkIdType tri,
272  double tol, vtkIdType nei[3], vtkIdList *neighbors);
273  void CheckEdge(vtkIdType ptId, double x[3], vtkIdType p1, vtkIdType p2,
274  vtkIdType tri, bool recursive);
275 
276  virtual int FillInputPortInformation(int, vtkInformation*);
277 
278 private:
279  vtkDelaunay2D(const vtkDelaunay2D&); // Not implemented.
280  void operator=(const vtkDelaunay2D&); // Not implemented.
281 };
282 
283 #endif
vtkDelaunay2D::BoundingTriangulation
int BoundingTriangulation
Definition: vtkDelaunay2D.h:239
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkgl::id
GLuint id
Definition: vtkgl.h:11834
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:50
vtkDelaunay2D::GetSource
vtkPolyData * GetSource()
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkDelaunay2D
create 2D Delaunay triangulation of input points
Definition: vtkDelaunay2D.h:146
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkDelaunay2D::Transform
vtkAbstractTransform * Transform
Definition: vtkDelaunay2D.h:242
vtkDelaunay2D::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkPolyDataAlgorithm::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkgl::input
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
vtkX3D::Transform
@ Transform
Definition: vtkX3D.h:41
vtkDelaunay2D::~vtkDelaunay2D
~vtkDelaunay2D()
vtkDelaunay2D::ComputeBestFittingPlane
vtkAbstractTransform * ComputeBestFittingPlane(vtkPointSet *input)
vtkFiltersCoreModule.h
vtkPolyDataAlgorithm.h
source
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Definition: vtkBoostGraphAdapter.h:821
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkDelaunay2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkDelaunay2D::ProjectionPlaneMode
int ProjectionPlaneMode
Definition: vtkDelaunay2D.h:244
VTKFILTERSCORE_EXPORT
#define VTKFILTERSCORE_EXPORT
Definition: vtkFiltersCoreModule.h:15
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkDelaunay2D::Alpha
double Alpha
Definition: vtkDelaunay2D.h:237
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
VTK_BEST_FITTING_PLANE
#define VTK_BEST_FITTING_PLANE
Definition: vtkDelaunay2D.h:143
vtkDelaunay2D::SetTransform
virtual void SetTransform(vtkAbstractTransform *)
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkDelaunay2D::vtkDelaunay2D
vtkDelaunay2D()
vtkDelaunay2D::Offset
double Offset
Definition: vtkDelaunay2D.h:240
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkPointSet
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:45
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkDelaunay2D::Tolerance
double Tolerance
Definition: vtkDelaunay2D.h:238
vtkDelaunay2D::New
static vtkDelaunay2D * New()
vtkDelaunay2D::SetSourceData
void SetSourceData(vtkPolyData *)
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:142
VTK_DELAUNAY_XY_PLANE
#define VTK_DELAUNAY_XY_PLANE
Definition: vtkDelaunay2D.h:141
vtkDelaunay2D::SetSourceConnection
void SetSourceConnection(vtkAlgorithmOutput *algOutput)
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44