VTK  9.7.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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkMaskPoints : public vtkPolyDataAlgorithm
31 {
32 public:
33  // Method used to pick points
35  {
41  UNIFORM_SPATIAL_VOLUME
42  };
43 
44  static vtkMaskPoints* New();
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
52  vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
53  vtkGetMacro(OnRatio, int);
55 
57 
61  vtkSetClampMacro(MaximumNumberOfPoints, vtkIdType, 0, VTK_ID_MAX);
62  vtkGetMacro(MaximumNumberOfPoints, vtkIdType);
64 
66 
69  vtkSetClampMacro(Offset, vtkIdType, 0, VTK_ID_MAX);
70  vtkGetMacro(Offset, vtkIdType);
72 
74 
77  vtkSetMacro(RandomMode, bool);
78  vtkGetMacro(RandomMode, bool);
79  vtkBooleanMacro(RandomMode, bool);
81 
83 
87  vtkSetMacro(RandomSeed, int);
88  vtkGetMacro(RandomSeed, int);
90 
92 
122  vtkSetClampMacro(RandomModeType, int, RANDOMIZED_ID_STRIDES, UNIFORM_SPATIAL_VOLUME);
123  vtkGetMacro(RandomModeType, int);
125 
127 
140  vtkSetMacro(ProportionalMaximumNumberOfPoints, bool);
141  vtkGetMacro(ProportionalMaximumNumberOfPoints, bool);
142  vtkBooleanMacro(ProportionalMaximumNumberOfPoints, bool);
144 
146 
151  vtkSetMacro(GenerateVertices, bool);
152  vtkGetMacro(GenerateVertices, bool);
153  vtkBooleanMacro(GenerateVertices, bool);
155 
157 
162  vtkSetMacro(SingleVertexPerCell, bool);
163  vtkGetMacro(SingleVertexPerCell, bool);
164  vtkBooleanMacro(SingleVertexPerCell, bool);
166 
168 
173  vtkSetMacro(OutputPointsPrecision, int);
174  vtkGetMacro(OutputPointsPrecision, int);
176 
177 protected:
178  vtkMaskPoints();
179  ~vtkMaskPoints() override = default;
180 
182  int FillInputPortInformation(int port, vtkInformation* info) override;
183 
184  int OnRatio = 2; // every OnRatio point is on; all others are off.
185  vtkIdType Offset = 0; // or starting point id.
186  bool RandomMode = false; // turn on/off randomization.
187  int RandomSeed = 1;
189  bool GenerateVertices = false; // generate polydata verts
190  bool SingleVertexPerCell = false;
191  int RandomModeType = RANDOMIZED_ID_STRIDES;
192  bool ProportionalMaximumNumberOfPoints = false;
193  int OutputPointsPrecision = DEFAULT_PRECISION;
194 
195  virtual void InternalScatter(unsigned long*, unsigned long*, int, int) {}
196  virtual void InternalGather(unsigned long*, unsigned long*, int, int) {}
197  virtual void InternalBroadcast(double*, int, int) {}
198  virtual void InternalGather(double*, double*, int, int) {}
199  virtual int InternalGetNumberOfProcesses() { return 1; }
200  virtual int InternalGetLocalProcessId() { return 0; }
201  virtual void InternalSplitController(int, int) {}
202  virtual void InternalResetController() {}
203  virtual void InternalBarrier() {}
204 
205  unsigned long GetLocalSampleSize(vtkIdType, int);
206  double GetLocalAreaFactor(double, int);
207 
208 private:
209  vtkMaskPoints(const vtkMaskPoints&) = delete;
210  void operator=(const vtkMaskPoints&) = delete;
211 };
212 
213 VTK_ABI_NAMESPACE_END
214 #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:192
int vtkIdType
Definition: vtkType.h:363
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:30
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:367
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.
#define VTK_MARSHALAUTO
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)