VTK
vtkVoronoi2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVoronoi2D.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 =========================================================================*/
91 #ifndef vtkVoronoi2D_h
92 #define vtkVoronoi2D_h
93 
94 #include "vtkFiltersCoreModule.h" // For export macro
95 #include "vtkPolyDataAlgorithm.h"
96 
99 class vtkPointSet;
100 class vtkSpheres;
101 
102 class VTKFILTERSCORE_EXPORT vtkVoronoi2D : public vtkPolyDataAlgorithm
103 {
104 public:
106 
109  static vtkVoronoi2D* New();
111  void PrintSelf(ostream& os, vtkIndent indent) override;
113 
115 
121  vtkSetClampMacro(Padding, double, 0.001, 0.25);
122  vtkGetMacro(Padding, double);
124 
126  {
127  NONE = 0,
128  POINT_IDS = 1,
129  THREAD_IDS = 2
130  };
131 
133 
138  vtkSetMacro(GenerateScalars, int);
139  vtkGetMacro(GenerateScalars, int);
140  void SetGenerateScalarsToNone() { this->SetGenerateScalars(NONE); }
141  void SetGenerateScalarsToPointIds() { this->SetGenerateScalars(POINT_IDS); }
142  void SetGenerateScalarsToThreadIds() { this->SetGenerateScalars(THREAD_IDS); }
144 
146 
155  virtual void SetTransform(vtkAbstractTransform*);
156  vtkGetObjectMacro(Transform, vtkAbstractTransform);
158 
160  {
161  XY_PLANE = 0,
162  SPECIFIED_TRANSFORM_PLANE = 1,
163  BEST_FITTING_PLANE = 2
164  };
165 
167 
175  vtkSetClampMacro(ProjectionPlaneMode, int, XY_PLANE, BEST_FITTING_PLANE);
176  vtkGetMacro(ProjectionPlaneMode, int);
177  void SetProjectionPlaneModeToXYPlane() { this->SetProjectionPlaneMode(XY_PLANE); }
179  {
180  this->SetProjectionPlaneMode(SPECIFIED_TRANSFORM_PLANE);
181  }
183  {
184  this->SetProjectionPlaneMode(BEST_FITTING_PLANE);
185  }
187 
189 
202  vtkSetClampMacro(PointOfInterest, vtkIdType, -1, VTK_ID_MAX);
203  vtkGetMacro(PointOfInterest, vtkIdType);
204  vtkSetClampMacro(MaximumNumberOfTileClips, vtkIdType, 1, VTK_ID_MAX);
205  vtkGetMacro(MaximumNumberOfTileClips, vtkIdType);
207 
209 
214  vtkStaticPointLocator2D* GetLocator() { return this->Locator; }
216 
218 
227  vtkSetMacro(GenerateVoronoiFlower, vtkTypeBool);
228  vtkGetMacro(GenerateVoronoiFlower, vtkTypeBool);
229  vtkBooleanMacro(GenerateVoronoiFlower, vtkTypeBool);
231 
233 
240  vtkGetObjectMacro(Spheres, vtkSpheres);
242 
247  int GetNumberOfThreadsUsed() { return this->NumberOfThreadsUsed; }
248 
252  vtkMTimeType GetMTime() override;
253 
254 protected:
255  vtkVoronoi2D();
256  ~vtkVoronoi2D() override;
257 
259  double Padding;
260  double Tolerance;
261  int ProjectionPlaneMode; // selects the plane in 3D where the tessellation will be computed
269 
270  // Satisfy pipeline-related API
272  int FillInputPortInformation(int, vtkInformation*) override;
273 
274 private:
275  vtkVoronoi2D(const vtkVoronoi2D&) = delete;
276  void operator=(const vtkVoronoi2D&) = delete;
277 };
278 
279 #endif
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:50
vtkVoronoi2D::ProjectionPlaneMode
int ProjectionPlaneMode
Definition: vtkVoronoi2D.h:261
vtkVoronoi2D::SetGenerateScalarsToNone
void SetGenerateScalarsToNone()
Definition: vtkVoronoi2D.h:140
vtkVoronoi2D::Locator
vtkStaticPointLocator2D * Locator
Definition: vtkVoronoi2D.h:262
vtkIdType
int vtkIdType
Definition: vtkType.h:349
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkVoronoi2D::GenerateVoronoiFlower
vtkTypeBool GenerateVoronoiFlower
Definition: vtkVoronoi2D.h:266
vtkVoronoi2D::ProjectionPlaneStrategy
ProjectionPlaneStrategy
Definition: vtkVoronoi2D.h:159
vtkVoronoi2D::SetProjectionPlaneModeToSpecifiedTransformPlane
void SetProjectionPlaneModeToSpecifiedTransformPlane()
Definition: vtkVoronoi2D.h:178
vtkVoronoi2D::SetGenerateScalarsToPointIds
void SetGenerateScalarsToPointIds()
Definition: vtkVoronoi2D.h:141
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::Transform
Definition: vtkX3D.h:47
vtkPolyDataAlgorithm.h
vtkVoronoi2D::Spheres
vtkSpheres * Spheres
Definition: vtkVoronoi2D.h:268
vtkVoronoi2D::GenerateScalars
int GenerateScalars
Definition: vtkVoronoi2D.h:258
vtkStaticPointLocator2D
quickly locate points in 2-space
Definition: vtkStaticPointLocator2D.h:65
vtkVoronoi2D::SetProjectionPlaneModeToXYPlane
void SetProjectionPlaneModeToXYPlane()
Definition: vtkVoronoi2D.h:177
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkVoronoi2D::PointOfInterest
vtkIdType PointOfInterest
Definition: vtkVoronoi2D.h:264
vtkVoronoi2D::GetLocator
vtkStaticPointLocator2D * GetLocator()
Retrieve the internal locator to manually configure it, for example specifying the number of points p...
Definition: vtkVoronoi2D.h:214
vtkPolyDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkVoronoi2D::GenerateScalarsStrategy
GenerateScalarsStrategy
Definition: vtkVoronoi2D.h:125
vtkVoronoi2D::SetProjectionPlaneModeToBestFittingPlane
void SetProjectionPlaneModeToBestFittingPlane()
Definition: vtkVoronoi2D.h:182
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
vtkVoronoi2D::GetNumberOfThreadsUsed
int GetNumberOfThreadsUsed()
Return the number of threads actually used during execution.
Definition: vtkVoronoi2D.h:247
vtkPointSet
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:62
VTK_ID_MAX
#define VTK_ID_MAX
Definition: vtkType.h:353
vtkVoronoi2D
create 2D Voronoi convex tiling of input points
Definition: vtkVoronoi2D.h:102
vtkVoronoi2D::MaximumNumberOfTileClips
vtkIdType MaximumNumberOfTileClips
Definition: vtkVoronoi2D.h:265
vtkSpheres
implicit function for a set of spheres
Definition: vtkSpheres.h:42
vtkVoronoi2D::NumberOfThreadsUsed
int NumberOfThreadsUsed
Definition: vtkVoronoi2D.h:267
vtkVoronoi2D::Transform
vtkAbstractTransform * Transform
Definition: vtkVoronoi2D.h:263
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkVoronoi2D::SetGenerateScalarsToThreadIds
void SetGenerateScalarsToThreadIds()
Definition: vtkVoronoi2D.h:142
vtkVoronoi2D::Tolerance
double Tolerance
Definition: vtkVoronoi2D.h:260
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkVoronoi2D::Padding
double Padding
Definition: vtkVoronoi2D.h:259
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:304
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41