VTK  9.5.20250922
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#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
137
138VTK_ABI_NAMESPACE_BEGIN
139class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkMaskPoints : public vtkPolyDataAlgorithm
140{
141public:
142 // Method used to pick points
144 {
150 UNIFORM_SPATIAL_VOLUME
151 };
152
155 void PrintSelf(ostream& os, vtkIndent indent) override;
156
158
161 vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
162 vtkGetMacro(OnRatio, int);
164
166
170 vtkSetClampMacro(MaximumNumberOfPoints, vtkIdType, 0, VTK_ID_MAX);
171 vtkGetMacro(MaximumNumberOfPoints, vtkIdType);
173
175
178 vtkSetClampMacro(Offset, vtkIdType, 0, VTK_ID_MAX);
179 vtkGetMacro(Offset, vtkIdType);
181
183
186 vtkSetMacro(RandomMode, bool);
187 vtkGetMacro(RandomMode, bool);
188 vtkBooleanMacro(RandomMode, bool);
190
192
196 vtkSetMacro(RandomSeed, int);
197 vtkGetMacro(RandomSeed, int);
199
201
231 vtkSetClampMacro(RandomModeType, int, RANDOMIZED_ID_STRIDES, UNIFORM_SPATIAL_VOLUME);
232 vtkGetMacro(RandomModeType, int);
234
236
249 vtkSetMacro(ProportionalMaximumNumberOfPoints, bool);
250 vtkGetMacro(ProportionalMaximumNumberOfPoints, bool);
251 vtkBooleanMacro(ProportionalMaximumNumberOfPoints, bool);
253
255
260 vtkSetMacro(GenerateVertices, bool);
261 vtkGetMacro(GenerateVertices, bool);
262 vtkBooleanMacro(GenerateVertices, bool);
264
266
271 vtkSetMacro(SingleVertexPerCell, bool);
272 vtkGetMacro(SingleVertexPerCell, bool);
273 vtkBooleanMacro(SingleVertexPerCell, bool);
275
277
282 vtkSetMacro(OutputPointsPrecision, int);
283 vtkGetMacro(OutputPointsPrecision, int);
285
286protected:
288 ~vtkMaskPoints() override = default;
289
291 int FillInputPortInformation(int port, vtkInformation* info) override;
292
293 int OnRatio = 2; // every OnRatio point is on; all others are off.
294 vtkIdType Offset = 0; // or starting point id.
295 bool RandomMode = false; // turn on/off randomization.
296 int RandomSeed = 1;
298 bool GenerateVertices = false; // generate polydata verts
299 bool SingleVertexPerCell = false;
300 int RandomModeType = RANDOMIZED_ID_STRIDES;
301 bool ProportionalMaximumNumberOfPoints = false;
302 int OutputPointsPrecision = DEFAULT_PRECISION;
303
304 virtual void InternalScatter(unsigned long*, unsigned long*, int, int) {}
305 virtual void InternalGather(unsigned long*, unsigned long*, int, int) {}
306 virtual void InternalBroadcast(double*, int, int) {}
307 virtual void InternalGather(double*, double*, int, int) {}
308 virtual int InternalGetNumberOfProcesses() { return 1; }
309 virtual int InternalGetLocalProcessId() { return 0; }
310 virtual void InternalSplitController(int, int) {}
311 virtual void InternalResetController() {}
312 virtual void InternalBarrier() {}
313
314 unsigned long GetLocalSampleSize(vtkIdType, int);
315 double GetLocalAreaFactor(double, int);
316
317private:
318 vtkMaskPoints(const vtkMaskPoints&) = delete;
319 void operator=(const vtkMaskPoints&) = delete;
320};
321
322VTK_ABI_NAMESPACE_END
323#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:333
#define VTK_ID_MAX
Definition vtkType.h:337
#define VTK_INT_MAX
Definition vtkType.h:162
#define VTK_MARSHALAUTO