VTK  9.2.20230321
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 =========================================================================*/
143 #ifndef vtkMaskPoints_h
144 #define vtkMaskPoints_h
145 
146 #include "vtkFiltersCoreModule.h" // For export macro
147 #include "vtkPolyDataAlgorithm.h"
148 
149 VTK_ABI_NAMESPACE_BEGIN
150 class VTKFILTERSCORE_EXPORT vtkMaskPoints : public vtkPolyDataAlgorithm
151 {
152 public:
153  // Method used to pick points
155  {
161  UNIFORM_SPATIAL_VOLUME
162  };
163 
164  static vtkMaskPoints* New();
166  void PrintSelf(ostream& os, vtkIndent indent) override;
167 
169 
172  vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
173  vtkGetMacro(OnRatio, int);
175 
177 
181  vtkSetClampMacro(MaximumNumberOfPoints, vtkIdType, 0, VTK_ID_MAX);
182  vtkGetMacro(MaximumNumberOfPoints, vtkIdType);
184 
186 
189  vtkSetClampMacro(Offset, vtkIdType, 0, VTK_ID_MAX);
190  vtkGetMacro(Offset, vtkIdType);
192 
194 
197  vtkSetMacro(RandomMode, bool);
198  vtkGetMacro(RandomMode, bool);
199  vtkBooleanMacro(RandomMode, bool);
201 
203 
207  vtkSetMacro(RandomSeed, int);
208  vtkGetMacro(RandomSeed, int);
210 
212 
242  vtkSetClampMacro(RandomModeType, int, RANDOMIZED_ID_STRIDES, UNIFORM_SPATIAL_VOLUME);
243  vtkGetMacro(RandomModeType, int);
245 
247 
260  vtkSetMacro(ProportionalMaximumNumberOfPoints, bool);
261  vtkGetMacro(ProportionalMaximumNumberOfPoints, bool);
262  vtkBooleanMacro(ProportionalMaximumNumberOfPoints, bool);
264 
266 
271  vtkSetMacro(GenerateVertices, bool);
272  vtkGetMacro(GenerateVertices, bool);
273  vtkBooleanMacro(GenerateVertices, bool);
275 
277 
282  vtkSetMacro(SingleVertexPerCell, bool);
283  vtkGetMacro(SingleVertexPerCell, bool);
284  vtkBooleanMacro(SingleVertexPerCell, bool);
286 
288 
293  vtkSetMacro(OutputPointsPrecision, int);
294  vtkGetMacro(OutputPointsPrecision, int);
296 
297 protected:
299  ~vtkMaskPoints() override = default;
300 
303 
304  int OnRatio = 2; // every OnRatio point is on; all others are off.
305  vtkIdType Offset = 0; // or starting point id.
306  bool RandomMode = false; // turn on/off randomization.
307  int RandomSeed = 1;
309  bool GenerateVertices = false; // generate polydata verts
310  bool SingleVertexPerCell = false;
311  int RandomModeType = RANDOMIZED_ID_STRIDES;
312  bool ProportionalMaximumNumberOfPoints = false;
313  int OutputPointsPrecision = DEFAULT_PRECISION;
314 
315  virtual void InternalScatter(unsigned long*, unsigned long*, int, int) {}
316  virtual void InternalGather(unsigned long*, unsigned long*, int, int) {}
317  virtual void InternalBroadcast(double*, int, int) {}
318  virtual void InternalGather(double*, double*, int, int) {}
319  virtual int InternalGetNumberOfProcesses() { return 1; }
320  virtual int InternalGetLocalProcessId() { return 0; }
321  virtual void InternalSplitController(int, int) {}
322  virtual void InternalResetController() {}
323  virtual void InternalBarrier() {}
324 
325  unsigned long GetLocalSampleSize(vtkIdType, int);
326  double GetLocalAreaFactor(double, int);
327 
328 private:
329  vtkMaskPoints(const vtkMaskPoints&) = delete;
330  void operator=(const vtkMaskPoints&) = delete;
331 };
332 
333 VTK_ABI_NAMESPACE_END
334 #endif
a simple class to control print indentation
Definition: vtkIndent.h:120
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
selectively filter points
~vtkMaskPoints() override=default
virtual void InternalSplitController(int, int)
vtkIdType MaximumNumberOfPoints
virtual void InternalGather(unsigned long *, unsigned long *, int, int)
virtual void InternalScatter(unsigned long *, unsigned long *, int, int)
virtual void InternalBroadcast(double *, int, int)
unsigned long GetLocalSampleSize(vtkIdType, int)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void InternalGather(double *, double *, int, int)
virtual int InternalGetNumberOfProcesses()
static vtkMaskPoints * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual int InternalGetLocalProcessId()
double GetLocalAreaFactor(double, int)
virtual void InternalBarrier()
virtual void InternalResetController()
Superclass for algorithms that produce only polydata as output.
@ info
Definition: vtkX3D.h:388
@ port
Definition: vtkX3D.h:459
int vtkIdType
Definition: vtkType.h:327
#define VTK_ID_MAX
Definition: vtkType.h:331
#define VTK_INT_MAX
Definition: vtkType.h:156