VTK  9.1.0
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
96
99class vtkPointSet;
100class vtkSpheres;
101
102class VTKFILTERSCORE_EXPORT vtkVoronoi2D : public vtkPolyDataAlgorithm
103{
104public:
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
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
253
254protected:
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
273
274private:
275 vtkVoronoi2D(const vtkVoronoi2D&) = delete;
276 void operator=(const vtkVoronoi2D&) = delete;
277};
278
279#endif
superclass for all geometric transformations
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition: vtkPointSet.h:106
Superclass for algorithms that produce only polydata as output.
implicit function for a set of spheres
Definition: vtkSpheres.h:43
quickly locate points in 2-space
create 2D Voronoi convex tiling of input points
Definition: vtkVoronoi2D.h:103
vtkSpheres * Spheres
Definition: vtkVoronoi2D.h:268
void SetGenerateScalarsToNone()
Indicate whether to create a scalar array as part of the output.
Definition: vtkVoronoi2D.h:140
vtkStaticPointLocator2D * GetLocator()
Retrieve the internal locator to manually configure it, for example specifying the number of points p...
Definition: vtkVoronoi2D.h:214
vtkAbstractTransform * Transform
Definition: vtkVoronoi2D.h:263
double Tolerance
Definition: vtkVoronoi2D.h:260
void SetProjectionPlaneModeToSpecifiedTransformPlane()
Define the method to project the input 3D points into a 2D plane for tessellation.
Definition: vtkVoronoi2D.h:178
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, type information, and printing.
vtkIdType MaximumNumberOfTileClips
Definition: vtkVoronoi2D.h:265
~vtkVoronoi2D() override
void SetGenerateScalarsToPointIds()
Indicate whether to create a scalar array as part of the output.
Definition: vtkVoronoi2D.h:141
void SetProjectionPlaneModeToBestFittingPlane()
Define the method to project the input 3D points into a 2D plane for tessellation.
Definition: vtkVoronoi2D.h:182
void SetProjectionPlaneModeToXYPlane()
Define the method to project the input 3D points into a 2D plane for tessellation.
Definition: vtkVoronoi2D.h:177
int NumberOfThreadsUsed
Definition: vtkVoronoi2D.h:267
static vtkVoronoi2D * New()
Standard methods for instantiation, type information, and printing.
vtkStaticPointLocator2D * Locator
Definition: vtkVoronoi2D.h:262
int GetNumberOfThreadsUsed()
Return the number of threads actually used during execution.
Definition: vtkVoronoi2D.h:247
vtkIdType PointOfInterest
Definition: vtkVoronoi2D.h:264
int ProjectionPlaneMode
Definition: vtkVoronoi2D.h:261
virtual void SetTransform(vtkAbstractTransform *)
Set / get the transform which is applied to points to generate a 2D problem.
vtkMTimeType GetMTime() override
Get the MTime of this object also considering the locator.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkTypeBool GenerateVoronoiFlower
Definition: vtkVoronoi2D.h:266
void SetGenerateScalarsToThreadIds()
Indicate whether to create a scalar array as part of the output.
Definition: vtkVoronoi2D.h:142
double Padding
Definition: vtkVoronoi2D.h:259
@ Transform
Definition: vtkX3D.h:47
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332
#define VTK_ID_MAX
Definition: vtkType.h:336
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287