VTK  9.3.0
vtkMaskPoints.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
31 #ifndef vtkMaskPoints_h
32 #define vtkMaskPoints_h
33 
34 #include "vtkFiltersCoreModule.h" // For export macro
35 #include "vtkPolyDataAlgorithm.h"
36 
37 VTK_ABI_NAMESPACE_BEGIN
38 class VTKFILTERSCORE_EXPORT vtkMaskPoints : public vtkPolyDataAlgorithm
39 {
40 public:
41  // Method used to pick points
43  {
49  UNIFORM_SPATIAL_VOLUME
50  };
51 
52  static vtkMaskPoints* New();
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
57 
60  vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
61  vtkGetMacro(OnRatio, int);
63 
65 
69  vtkSetClampMacro(MaximumNumberOfPoints, vtkIdType, 0, VTK_ID_MAX);
70  vtkGetMacro(MaximumNumberOfPoints, vtkIdType);
72 
74 
77  vtkSetClampMacro(Offset, vtkIdType, 0, VTK_ID_MAX);
78  vtkGetMacro(Offset, vtkIdType);
80 
82 
85  vtkSetMacro(RandomMode, bool);
86  vtkGetMacro(RandomMode, bool);
87  vtkBooleanMacro(RandomMode, bool);
89 
91 
95  vtkSetMacro(RandomSeed, int);
96  vtkGetMacro(RandomSeed, int);
98 
100 
130  vtkSetClampMacro(RandomModeType, int, RANDOMIZED_ID_STRIDES, UNIFORM_SPATIAL_VOLUME);
131  vtkGetMacro(RandomModeType, int);
133 
135 
148  vtkSetMacro(ProportionalMaximumNumberOfPoints, bool);
149  vtkGetMacro(ProportionalMaximumNumberOfPoints, bool);
150  vtkBooleanMacro(ProportionalMaximumNumberOfPoints, bool);
152 
154 
159  vtkSetMacro(GenerateVertices, bool);
160  vtkGetMacro(GenerateVertices, bool);
161  vtkBooleanMacro(GenerateVertices, bool);
163 
165 
170  vtkSetMacro(SingleVertexPerCell, bool);
171  vtkGetMacro(SingleVertexPerCell, bool);
172  vtkBooleanMacro(SingleVertexPerCell, bool);
174 
176 
181  vtkSetMacro(OutputPointsPrecision, int);
182  vtkGetMacro(OutputPointsPrecision, int);
184 
185 protected:
187  ~vtkMaskPoints() override = default;
188 
191 
192  int OnRatio = 2; // every OnRatio point is on; all others are off.
193  vtkIdType Offset = 0; // or starting point id.
194  bool RandomMode = false; // turn on/off randomization.
195  int RandomSeed = 1;
197  bool GenerateVertices = false; // generate polydata verts
198  bool SingleVertexPerCell = false;
199  int RandomModeType = RANDOMIZED_ID_STRIDES;
200  bool ProportionalMaximumNumberOfPoints = false;
201  int OutputPointsPrecision = DEFAULT_PRECISION;
202 
203  virtual void InternalScatter(unsigned long*, unsigned long*, int, int) {}
204  virtual void InternalGather(unsigned long*, unsigned long*, int, int) {}
205  virtual void InternalBroadcast(double*, int, int) {}
206  virtual void InternalGather(double*, double*, int, int) {}
207  virtual int InternalGetNumberOfProcesses() { return 1; }
208  virtual int InternalGetLocalProcessId() { return 0; }
209  virtual void InternalSplitController(int, int) {}
210  virtual void InternalResetController() {}
211  virtual void InternalBarrier() {}
212 
213  unsigned long GetLocalSampleSize(vtkIdType, int);
214  double GetLocalAreaFactor(double, int);
215 
216 private:
217  vtkMaskPoints(const vtkMaskPoints&) = delete;
218  void operator=(const vtkMaskPoints&) = delete;
219 };
220 
221 VTK_ABI_NAMESPACE_END
222 #endif
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
selectively filter points
Definition: vtkMaskPoints.h:39
~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:376
@ port
Definition: vtkX3D.h:447
int vtkIdType
Definition: vtkType.h:315
#define VTK_ID_MAX
Definition: vtkType.h:319
#define VTK_INT_MAX
Definition: vtkType.h:144