VTK  9.1.0
vtkMaskPoints.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMaskPoints.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 =========================================================================*/
140 #ifndef vtkMaskPoints_h
141 #define vtkMaskPoints_h
142 
143 #include "vtkFiltersCoreModule.h" // For export macro
144 #include "vtkPolyDataAlgorithm.h"
145 
146 class VTKFILTERSCORE_EXPORT vtkMaskPoints : public vtkPolyDataAlgorithm
147 {
148 public:
149  // Method used to pick points
151  {
157  UNIFORM_SPATIAL_VOLUME
158  };
159 
160  static vtkMaskPoints* New();
162  void PrintSelf(ostream& os, vtkIndent indent) override;
163 
165 
168  vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
169  vtkGetMacro(OnRatio, int);
171 
173 
177  vtkSetClampMacro(MaximumNumberOfPoints, vtkIdType, 0, VTK_ID_MAX);
178  vtkGetMacro(MaximumNumberOfPoints, vtkIdType);
180 
182 
185  vtkSetClampMacro(Offset, vtkIdType, 0, VTK_ID_MAX);
186  vtkGetMacro(Offset, vtkIdType);
188 
190 
193  vtkSetMacro(RandomMode, bool);
194  vtkGetMacro(RandomMode, bool);
195  vtkBooleanMacro(RandomMode, bool);
197 
199 
203  vtkSetMacro(RandomSeed, int);
204  vtkGetMacro(RandomSeed, int);
206 
208 
238  vtkSetClampMacro(RandomModeType, int, RANDOMIZED_ID_STRIDES, UNIFORM_SPATIAL_VOLUME);
239  vtkGetMacro(RandomModeType, int);
241 
243 
256  vtkSetMacro(ProportionalMaximumNumberOfPoints, bool);
257  vtkGetMacro(ProportionalMaximumNumberOfPoints, bool);
258  vtkBooleanMacro(ProportionalMaximumNumberOfPoints, bool);
260 
262 
267  vtkSetMacro(GenerateVertices, bool);
268  vtkGetMacro(GenerateVertices, bool);
269  vtkBooleanMacro(GenerateVertices, bool);
271 
273 
278  vtkSetMacro(SingleVertexPerCell, bool);
279  vtkGetMacro(SingleVertexPerCell, bool);
280  vtkBooleanMacro(SingleVertexPerCell, bool);
282 
284 
289  vtkSetMacro(OutputPointsPrecision, int);
290  vtkGetMacro(OutputPointsPrecision, int);
292 
293 protected:
295  ~vtkMaskPoints() override = default;
296 
299 
300  int OnRatio = 2; // every OnRatio point is on; all others are off.
301  vtkIdType Offset = 0; // or starting point id.
302  bool RandomMode = false; // turn on/off randomization.
303  int RandomSeed = 1;
305  bool GenerateVertices = false; // generate polydata verts
306  bool SingleVertexPerCell = false;
307  int RandomModeType = RANDOMIZED_ID_STRIDES;
308  bool ProportionalMaximumNumberOfPoints = false;
309  int OutputPointsPrecision = DEFAULT_PRECISION;
310 
311  virtual void InternalScatter(unsigned long*, unsigned long*, int, int) {}
312  virtual void InternalGather(unsigned long*, unsigned long*, int, int) {}
313  virtual void InternalBroadcast(double*, int, int) {}
314  virtual void InternalGather(double*, double*, int, int) {}
315  virtual int InternalGetNumberOfProcesses() { return 1; }
316  virtual int InternalGetLocalProcessId() { return 0; }
317  virtual void InternalSplitController(int, int) {}
318  virtual void InternalResetController() {}
319  virtual void InternalBarrier() {}
320 
321  unsigned long GetLocalSampleSize(vtkIdType, int);
322  double GetLocalAreaFactor(double, int);
323 
324 private:
325  vtkMaskPoints(const vtkMaskPoints&) = delete;
326  void operator=(const vtkMaskPoints&) = delete;
327 };
328 
329 #endif
vtkMaskPoints::UNIFORM_SPATIAL_SURFACE
@ UNIFORM_SPATIAL_SURFACE
Definition: vtkMaskPoints.h:156
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkMaskPoints::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkMaskPoints::~vtkMaskPoints
~vtkMaskPoints() override=default
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkMaskPoints::InternalBroadcast
virtual void InternalBroadcast(double *, int, int)
Definition: vtkMaskPoints.h:313
vtkMaskPoints::InternalGather
virtual void InternalGather(unsigned long *, unsigned long *, int, int)
Definition: vtkMaskPoints.h:312
vtkMaskPoints::MaximumNumberOfPoints
vtkIdType MaximumNumberOfPoints
Definition: vtkMaskPoints.h:304
vtkMaskPoints::InternalBarrier
virtual void InternalBarrier()
Definition: vtkMaskPoints.h:319
vtkMaskPoints::InternalGather
virtual void InternalGather(double *, double *, int, int)
Definition: vtkMaskPoints.h:314
vtkMaskPoints::SPATIALLY_STRATIFIED
@ SPATIALLY_STRATIFIED
Definition: vtkMaskPoints.h:154
vtkAlgorithm::DEFAULT_PRECISION
@ DEFAULT_PRECISION
Definition: vtkAlgorithm.h:153
vtkPolyDataAlgorithm.h
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkMaskPoints::UNIFORM_SPATIAL_BOUNDS
@ UNIFORM_SPATIAL_BOUNDS
Definition: vtkMaskPoints.h:155
vtkMaskPoints::InternalGetNumberOfProcesses
virtual int InternalGetNumberOfProcesses()
Definition: vtkMaskPoints.h:315
vtkMaskPoints::vtkMaskPoints
vtkMaskPoints()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkMaskPoints::RANDOMIZED_ID_STRIDES
@ RANDOMIZED_ID_STRIDES
Definition: vtkMaskPoints.h:152
vtkMaskPoints
selectively filter points
Definition: vtkMaskPoints.h:147
vtkMaskPoints::InternalScatter
virtual void InternalScatter(unsigned long *, unsigned long *, int, int)
Definition: vtkMaskPoints.h:311
vtkMaskPoints::DistributionType
DistributionType
Definition: vtkMaskPoints.h:151
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkMaskPoints::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMaskPoints::RANDOM_SAMPLING
@ RANDOM_SAMPLING
Definition: vtkMaskPoints.h:153
VTK_ID_MAX
#define VTK_ID_MAX
Definition: vtkType.h:336
vtkMaskPoints::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkMaskPoints::InternalSplitController
virtual void InternalSplitController(int, int)
Definition: vtkMaskPoints.h:317
vtkMaskPoints::InternalGetLocalProcessId
virtual int InternalGetLocalProcessId()
Definition: vtkMaskPoints.h:316
vtkMaskPoints::InternalResetController
virtual void InternalResetController()
Definition: vtkMaskPoints.h:318
vtkMaskPoints::GetLocalSampleSize
unsigned long GetLocalSampleSize(vtkIdType, int)
vtkMaskPoints::New
static vtkMaskPoints * New()
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151
vtkMaskPoints::GetLocalAreaFactor
double GetLocalAreaFactor(double, int)