VTK  9.7.1
vtkVoronoi2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
83 #ifndef vtkVoronoi2D_h
84 #define vtkVoronoi2D_h
85 
86 #include "vtkDeprecation.h" // For deprecation macro
87 #include "vtkFiltersCoreModule.h" // For export macro
88 #include "vtkPolyDataAlgorithm.h"
89 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
90 
91 VTK_ABI_NAMESPACE_BEGIN
94 class vtkPointSet;
95 class vtkSpheres;
96 
98  "Please use vtkVoronoiFlower2D.") VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkVoronoi2D
99  : public vtkPolyDataAlgorithm
100 {
101 public:
103 
106  static vtkVoronoi2D* New();
108  void PrintSelf(ostream& os, vtkIndent indent) override;
110 
112 
118  vtkSetClampMacro(Padding, double, 0.001, 0.25);
119  vtkGetMacro(Padding, double);
121 
123  {
124  NONE = 0,
125  POINT_IDS = 1,
126  THREAD_IDS = 2
127  };
128 
130 
135  vtkSetMacro(GenerateScalars, int);
136  vtkGetMacro(GenerateScalars, int);
137  void SetGenerateScalarsToNone() { this->SetGenerateScalars(NONE); }
138  void SetGenerateScalarsToPointIds() { this->SetGenerateScalars(POINT_IDS); }
139  void SetGenerateScalarsToThreadIds() { this->SetGenerateScalars(THREAD_IDS); }
141 
143 
152  virtual void SetTransform(vtkAbstractTransform*);
153  vtkGetObjectMacro(Transform, vtkAbstractTransform);
155 
157  {
158  XY_PLANE = 0,
159  SPECIFIED_TRANSFORM_PLANE = 1,
160  BEST_FITTING_PLANE = 2
161  };
162 
164 
172  vtkSetClampMacro(ProjectionPlaneMode, int, XY_PLANE, BEST_FITTING_PLANE);
173  vtkGetMacro(ProjectionPlaneMode, int);
174  void SetProjectionPlaneModeToXYPlane() { this->SetProjectionPlaneMode(XY_PLANE); }
176  {
177  this->SetProjectionPlaneMode(SPECIFIED_TRANSFORM_PLANE);
178  }
180  {
181  this->SetProjectionPlaneMode(BEST_FITTING_PLANE);
182  }
184 
186 
199  vtkSetClampMacro(PointOfInterest, vtkIdType, -1, VTK_ID_MAX);
200  vtkGetMacro(PointOfInterest, vtkIdType);
201  vtkSetClampMacro(MaximumNumberOfTileClips, vtkIdType, 1, VTK_ID_MAX);
202  vtkGetMacro(MaximumNumberOfTileClips, vtkIdType);
204 
206 
211  vtkStaticPointLocator2D* GetLocator() { return this->Locator; }
213 
215 
224  vtkSetMacro(GenerateVoronoiFlower, vtkTypeBool);
225  vtkGetMacro(GenerateVoronoiFlower, vtkTypeBool);
226  vtkBooleanMacro(GenerateVoronoiFlower, vtkTypeBool);
228 
230 
237  vtkGetObjectMacro(Spheres, vtkSpheres);
239 
244  int GetNumberOfThreadsUsed() { return this->NumberOfThreadsUsed; }
245 
249  vtkMTimeType GetMTime() override;
250 
251 protected:
252  vtkVoronoi2D();
253  ~vtkVoronoi2D() override;
254 
256  double Padding;
257  double Tolerance;
258  int ProjectionPlaneMode; // selects the plane in 3D where the tessellation will be computed
266 
267  // Satisfy pipeline-related API
269  int FillInputPortInformation(int, vtkInformation*) override;
270 
271 private:
272  vtkVoronoi2D(const vtkVoronoi2D&) = delete;
273  void operator=(const vtkVoronoi2D&) = delete;
274 };
275 
276 VTK_ABI_NAMESPACE_END
277 #endif
vtkSpheres * Spheres
Definition: vtkVoronoi2D.h:265
int ProjectionPlaneMode
Definition: vtkVoronoi2D.h:258
implicit function for a set of spheres
Definition: vtkSpheres.h:31
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
void SetProjectionPlaneModeToSpecifiedTransformPlane()
Define the method to project the input 3D points into a 2D plane for tessellation.
Definition: vtkVoronoi2D.h:175
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkAbstractTransform * Transform
Definition: vtkVoronoi2D.h:260
vtkStaticPointLocator2D * Locator
Definition: vtkVoronoi2D.h:259
concrete class for storing a set of points
Definition: vtkPointSet.h:58
int vtkIdType
Definition: vtkType.h:363
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
vtkIdType MaximumNumberOfTileClips
Definition: vtkVoronoi2D.h:262
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
double Tolerance
Definition: vtkVoronoi2D.h:257
create 2D Voronoi convex tiling of input points
superclass for all geometric transformations
vtkTypeBool GenerateVoronoiFlower
Definition: vtkVoronoi2D.h:263
virtual vtkMTimeType GetMTime()
Return this object's modified time.
create 2D Voronoi convex tiling of input points
Definition: vtkVoronoi2D.h:97
int GetNumberOfThreadsUsed()
Return the number of threads actually used during execution.
Definition: vtkVoronoi2D.h:244
double Padding
Definition: vtkVoronoi2D.h:256
void SetProjectionPlaneModeToBestFittingPlane()
Define the method to project the input 3D points into a 2D plane for tessellation.
Definition: vtkVoronoi2D.h:179
#define VTK_ID_MAX
Definition: vtkType.h:367
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
vtkStaticPointLocator2D * GetLocator()
Retrieve the internal locator to manually configure it, for example specifying the number of points p...
Definition: vtkVoronoi2D.h:211
int NumberOfThreadsUsed
Definition: vtkVoronoi2D.h:264
#define VTK_MARSHALAUTO
void SetGenerateScalarsToNone()
Indicate whether to create a scalar array as part of the output.
Definition: vtkVoronoi2D.h:137
void SetProjectionPlaneModeToXYPlane()
Define the method to project the input 3D points into a 2D plane for tessellation.
Definition: vtkVoronoi2D.h:174
void SetGenerateScalarsToThreadIds()
Indicate whether to create a scalar array as part of the output.
Definition: vtkVoronoi2D.h:139
#define VTK_DEPRECATED_IN_9_7_0(reason)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType PointOfInterest
Definition: vtkVoronoi2D.h:261
void SetGenerateScalarsToPointIds()
Indicate whether to create a scalar array as part of the output.
Definition: vtkVoronoi2D.h:138
quickly locate points in 2-space