VTK  9.3.20240423
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
131#ifndef vtkMaskPoints_h
132#define vtkMaskPoints_h
133
134#include "vtkFiltersCoreModule.h" // For export macro
135#include "vtkPolyDataAlgorithm.h"
136
137VTK_ABI_NAMESPACE_BEGIN
138class VTKFILTERSCORE_EXPORT vtkMaskPoints : public vtkPolyDataAlgorithm
139{
140public:
141 // Method used to pick points
143 {
149 UNIFORM_SPATIAL_VOLUME
150 };
151
154 void PrintSelf(ostream& os, vtkIndent indent) override;
155
157
160 vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
161 vtkGetMacro(OnRatio, int);
163
165
169 vtkSetClampMacro(MaximumNumberOfPoints, vtkIdType, 0, VTK_ID_MAX);
170 vtkGetMacro(MaximumNumberOfPoints, vtkIdType);
172
174
177 vtkSetClampMacro(Offset, vtkIdType, 0, VTK_ID_MAX);
178 vtkGetMacro(Offset, vtkIdType);
180
182
185 vtkSetMacro(RandomMode, bool);
186 vtkGetMacro(RandomMode, bool);
187 vtkBooleanMacro(RandomMode, bool);
189
191
195 vtkSetMacro(RandomSeed, int);
196 vtkGetMacro(RandomSeed, int);
198
200
230 vtkSetClampMacro(RandomModeType, int, RANDOMIZED_ID_STRIDES, UNIFORM_SPATIAL_VOLUME);
231 vtkGetMacro(RandomModeType, int);
233
235
248 vtkSetMacro(ProportionalMaximumNumberOfPoints, bool);
249 vtkGetMacro(ProportionalMaximumNumberOfPoints, bool);
250 vtkBooleanMacro(ProportionalMaximumNumberOfPoints, bool);
252
254
259 vtkSetMacro(GenerateVertices, bool);
260 vtkGetMacro(GenerateVertices, bool);
261 vtkBooleanMacro(GenerateVertices, bool);
263
265
270 vtkSetMacro(SingleVertexPerCell, bool);
271 vtkGetMacro(SingleVertexPerCell, bool);
272 vtkBooleanMacro(SingleVertexPerCell, bool);
274
276
281 vtkSetMacro(OutputPointsPrecision, int);
282 vtkGetMacro(OutputPointsPrecision, int);
284
285protected:
287 ~vtkMaskPoints() override = default;
288
290 int FillInputPortInformation(int port, vtkInformation* info) override;
291
292 int OnRatio = 2; // every OnRatio point is on; all others are off.
293 vtkIdType Offset = 0; // or starting point id.
294 bool RandomMode = false; // turn on/off randomization.
295 int RandomSeed = 1;
297 bool GenerateVertices = false; // generate polydata verts
298 bool SingleVertexPerCell = false;
299 int RandomModeType = RANDOMIZED_ID_STRIDES;
300 bool ProportionalMaximumNumberOfPoints = false;
301 int OutputPointsPrecision = DEFAULT_PRECISION;
302
303 virtual void InternalScatter(unsigned long*, unsigned long*, int, int) {}
304 virtual void InternalGather(unsigned long*, unsigned long*, int, int) {}
305 virtual void InternalBroadcast(double*, int, int) {}
306 virtual void InternalGather(double*, double*, int, int) {}
307 virtual int InternalGetNumberOfProcesses() { return 1; }
308 virtual int InternalGetLocalProcessId() { return 0; }
309 virtual void InternalSplitController(int, int) {}
310 virtual void InternalResetController() {}
311 virtual void InternalBarrier() {}
312
313 unsigned long GetLocalSampleSize(vtkIdType, int);
314 double GetLocalAreaFactor(double, int);
315
316private:
317 vtkMaskPoints(const vtkMaskPoints&) = delete;
318 void operator=(const vtkMaskPoints&) = delete;
319};
320
321VTK_ABI_NAMESPACE_END
322#endif
a simple class to control print indentation
Definition vtkIndent.h:108
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()
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()
static vtkMaskPoints * New()
virtual void InternalResetController()
Superclass for algorithms that produce only polydata as output.
int vtkIdType
Definition vtkType.h:315
#define VTK_ID_MAX
Definition vtkType.h:319
#define VTK_INT_MAX
Definition vtkType.h:144