VTK: Filters/Core/vtkMaskPoints.h Source File

| 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
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
42 enum DistributionType
43 {
44 RANDOMIZED_ID_STRIDES,
45 RANDOM_SAMPLING,
46 SPATIALLY_STRATIFIED,
47 UNIFORM_SPATIAL_BOUNDS,
48 UNIFORM_SPATIAL_SURFACE,
49 UNIFORM_SPATIAL_VOLUME
50 };
51
52 static vtkMaskPoints* New();
53 vtkTypeMacro(vtkMaskPoints, vtkPolyDataAlgorithm);
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:
186 vtkMaskPoints();
187 ~vtkMaskPoints() override = default;
188
189 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
190 int FillInputPortInformation(int port, vtkInformation* info) override;
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;
196 vtkIdType MaximumNumberOfPoints;
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
vtkAlgorithm::DEFAULT_PRECISION
@ DEFAULT_PRECISION
Definition: vtkAlgorithm.h:91
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMaskPoints
selectively filter points
Definition: vtkMaskPoints.h:39
vtkMaskPoints::~vtkMaskPoints
~vtkMaskPoints() override=default
vtkMaskPoints::InternalSplitController
virtual void InternalSplitController(int, int)
Definition: vtkMaskPoints.h:209
vtkMaskPoints::MaximumNumberOfPoints
vtkIdType MaximumNumberOfPoints
Definition: vtkMaskPoints.h:196
vtkMaskPoints::InternalGather
virtual void InternalGather(unsigned long *, unsigned long *, int, int)
Definition: vtkMaskPoints.h:204
vtkMaskPoints::InternalScatter
virtual void InternalScatter(unsigned long *, unsigned long *, int, int)
Definition: vtkMaskPoints.h:203
vtkMaskPoints::InternalBroadcast
virtual void InternalBroadcast(double *, int, int)
Definition: vtkMaskPoints.h:205
vtkMaskPoints::GetLocalSampleSize
unsigned long GetLocalSampleSize(vtkIdType, int)
vtkMaskPoints::vtkMaskPoints
vtkMaskPoints()
vtkMaskPoints::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkMaskPoints::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMaskPoints::InternalGather
virtual void InternalGather(double *, double *, int, int)
Definition: vtkMaskPoints.h:206
vtkMaskPoints::InternalGetNumberOfProcesses
virtual int InternalGetNumberOfProcesses()
Definition: vtkMaskPoints.h:207
vtkMaskPoints::New
static vtkMaskPoints * New()
vtkMaskPoints::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkMaskPoints::InternalGetLocalProcessId
virtual int InternalGetLocalProcessId()
Definition: vtkMaskPoints.h:208
vtkMaskPoints::GetLocalAreaFactor
double GetLocalAreaFactor(double, int)
vtkMaskPoints::InternalBarrier
virtual void InternalBarrier()
Definition: vtkMaskPoints.h:211
vtkMaskPoints::InternalResetController
virtual void InternalResetController()
Definition: vtkMaskPoints.h:210
vtkMaskPoints::DistributionType
DistributionType
Definition: vtkMaskPoints.h:43
vtkMaskPoints::RANDOMIZED_ID_STRIDES
@ RANDOMIZED_ID_STRIDES
Definition: vtkMaskPoints.h:44
vtkMaskPoints::RANDOM_SAMPLING
@ RANDOM_SAMPLING
Definition: vtkMaskPoints.h:45
vtkMaskPoints::UNIFORM_SPATIAL_BOUNDS
@ UNIFORM_SPATIAL_BOUNDS
Definition: vtkMaskPoints.h:47
vtkMaskPoints::UNIFORM_SPATIAL_SURFACE
@ UNIFORM_SPATIAL_SURFACE
Definition: vtkMaskPoints.h:48
vtkMaskPoints::SPATIALLY_STRATIFIED
@ SPATIALLY_STRATIFIED
Definition: vtkMaskPoints.h:46
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:43
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkPolyDataAlgorithm.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315
VTK_ID_MAX
#define VTK_ID_MAX
Definition: vtkType.h:319
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:144