VTK  9.3.1
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
22 #ifndef vtkMaskPoints_h
23 #define vtkMaskPoints_h
24 
25 #include "vtkFiltersCoreModule.h" // For export macro
26 #include "vtkPolyDataAlgorithm.h"
27 
28 VTK_ABI_NAMESPACE_BEGIN
29 class VTKFILTERSCORE_EXPORT vtkMaskPoints : public vtkPolyDataAlgorithm
30 {
31 public:
32  // Method used to pick points
34  {
40  UNIFORM_SPATIAL_VOLUME
41  };
42 
43  static vtkMaskPoints* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
51  vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
52  vtkGetMacro(OnRatio, int);
54 
56 
60  vtkSetClampMacro(MaximumNumberOfPoints, vtkIdType, 0, VTK_ID_MAX);
61  vtkGetMacro(MaximumNumberOfPoints, vtkIdType);
63 
65 
68  vtkSetClampMacro(Offset, vtkIdType, 0, VTK_ID_MAX);
69  vtkGetMacro(Offset, vtkIdType);
71 
73 
76  vtkSetMacro(RandomMode, bool);
77  vtkGetMacro(RandomMode, bool);
78  vtkBooleanMacro(RandomMode, bool);
80 
82 
86  vtkSetMacro(RandomSeed, int);
87  vtkGetMacro(RandomSeed, int);
89 
91 
121  vtkSetClampMacro(RandomModeType, int, RANDOMIZED_ID_STRIDES, UNIFORM_SPATIAL_VOLUME);
122  vtkGetMacro(RandomModeType, int);
124 
126 
139  vtkSetMacro(ProportionalMaximumNumberOfPoints, bool);
140  vtkGetMacro(ProportionalMaximumNumberOfPoints, bool);
141  vtkBooleanMacro(ProportionalMaximumNumberOfPoints, bool);
143 
145 
150  vtkSetMacro(GenerateVertices, bool);
151  vtkGetMacro(GenerateVertices, bool);
152  vtkBooleanMacro(GenerateVertices, bool);
154 
156 
161  vtkSetMacro(SingleVertexPerCell, bool);
162  vtkGetMacro(SingleVertexPerCell, bool);
163  vtkBooleanMacro(SingleVertexPerCell, bool);
165 
167 
172  vtkSetMacro(OutputPointsPrecision, int);
173  vtkGetMacro(OutputPointsPrecision, int);
175 
176 protected:
177  vtkMaskPoints();
178  ~vtkMaskPoints() override = default;
179 
181  int FillInputPortInformation(int port, vtkInformation* info) override;
182 
183  int OnRatio = 2; // every OnRatio point is on; all others are off.
184  vtkIdType Offset = 0; // or starting point id.
185  bool RandomMode = false; // turn on/off randomization.
186  int RandomSeed = 1;
188  bool GenerateVertices = false; // generate polydata verts
189  bool SingleVertexPerCell = false;
190  int RandomModeType = RANDOMIZED_ID_STRIDES;
191  bool ProportionalMaximumNumberOfPoints = false;
192  int OutputPointsPrecision = DEFAULT_PRECISION;
193 
194  virtual void InternalScatter(unsigned long*, unsigned long*, int, int) {}
195  virtual void InternalGather(unsigned long*, unsigned long*, int, int) {}
196  virtual void InternalBroadcast(double*, int, int) {}
197  virtual void InternalGather(double*, double*, int, int) {}
198  virtual int InternalGetNumberOfProcesses() { return 1; }
199  virtual int InternalGetLocalProcessId() { return 0; }
200  virtual void InternalSplitController(int, int) {}
201  virtual void InternalResetController() {}
202  virtual void InternalBarrier() {}
203 
204  unsigned long GetLocalSampleSize(vtkIdType, int);
205  double GetLocalAreaFactor(double, int);
206 
207 private:
208  vtkMaskPoints(const vtkMaskPoints&) = delete;
209  void operator=(const vtkMaskPoints&) = delete;
210 };
211 
212 VTK_ABI_NAMESPACE_END
213 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
#define VTK_INT_MAX
Definition: vtkType.h:144
int vtkIdType
Definition: vtkType.h:315
virtual int InternalGetNumberOfProcesses()
virtual void InternalBarrier()
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
vtkIdType MaximumNumberOfPoints
selectively filter points
Definition: vtkMaskPoints.h:29
virtual void InternalBroadcast(double *, int, int)
virtual void InternalSplitController(int, int)
virtual int InternalGetLocalProcessId()
virtual void InternalGather(unsigned long *, unsigned long *, int, int)
#define VTK_ID_MAX
Definition: vtkType.h:319
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual void InternalGather(double *, double *, int, int)
Store zero or more vtkInformation instances.
virtual void InternalResetController()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void InternalScatter(unsigned long *, unsigned long *, int, int)