VTK  9.1.0
vtkMaskPoints.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMaskPoints.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
40#ifndef vtkMaskPoints_h
41#define vtkMaskPoints_h
42
43#include "vtkFiltersCoreModule.h" // For export macro
45
46class VTKFILTERSCORE_EXPORT vtkMaskPoints : public vtkPolyDataAlgorithm
47{
48public:
49 // Method used to pick points
51 {
57 UNIFORM_SPATIAL_VOLUME
58 };
59
60 static vtkMaskPoints* New();
62 void PrintSelf(ostream& os, vtkIndent indent) override;
63
65
68 vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
69 vtkGetMacro(OnRatio, int);
71
73
77 vtkSetClampMacro(MaximumNumberOfPoints, vtkIdType, 0, VTK_ID_MAX);
78 vtkGetMacro(MaximumNumberOfPoints, vtkIdType);
80
82
85 vtkSetClampMacro(Offset, vtkIdType, 0, VTK_ID_MAX);
86 vtkGetMacro(Offset, vtkIdType);
88
90
93 vtkSetMacro(RandomMode, bool);
94 vtkGetMacro(RandomMode, bool);
95 vtkBooleanMacro(RandomMode, bool);
97
99
103 vtkSetMacro(RandomSeed, int);
104 vtkGetMacro(RandomSeed, int);
106
108
138 vtkSetClampMacro(RandomModeType, int, RANDOMIZED_ID_STRIDES, UNIFORM_SPATIAL_VOLUME);
139 vtkGetMacro(RandomModeType, int);
141
143
156 vtkSetMacro(ProportionalMaximumNumberOfPoints, bool);
157 vtkGetMacro(ProportionalMaximumNumberOfPoints, bool);
158 vtkBooleanMacro(ProportionalMaximumNumberOfPoints, bool);
160
162
167 vtkSetMacro(GenerateVertices, bool);
168 vtkGetMacro(GenerateVertices, bool);
169 vtkBooleanMacro(GenerateVertices, bool);
171
173
178 vtkSetMacro(SingleVertexPerCell, bool);
179 vtkGetMacro(SingleVertexPerCell, bool);
180 vtkBooleanMacro(SingleVertexPerCell, bool);
182
184
189 vtkSetMacro(OutputPointsPrecision, int);
190 vtkGetMacro(OutputPointsPrecision, int);
192
193protected:
195 ~vtkMaskPoints() override = default;
196
199
200 int OnRatio = 2; // every OnRatio point is on; all others are off.
201 vtkIdType Offset = 0; // or starting point id.
202 bool RandomMode = false; // turn on/off randomization.
203 int RandomSeed = 1;
205 bool GenerateVertices = false; // generate polydata verts
206 bool SingleVertexPerCell = false;
207 int RandomModeType = RANDOMIZED_ID_STRIDES;
208 bool ProportionalMaximumNumberOfPoints = false;
209 int OutputPointsPrecision = DEFAULT_PRECISION;
210
211 virtual void InternalScatter(unsigned long*, unsigned long*, int, int) {}
212 virtual void InternalGather(unsigned long*, unsigned long*, int, int) {}
213 virtual void InternalBroadcast(double*, int, int) {}
214 virtual void InternalGather(double*, double*, int, int) {}
215 virtual int InternalGetNumberOfProcesses() { return 1; }
216 virtual int InternalGetLocalProcessId() { return 0; }
217 virtual void InternalSplitController(int, int) {}
218 virtual void InternalResetController() {}
219 virtual void InternalBarrier() {}
220
221 unsigned long GetLocalSampleSize(vtkIdType, int);
222 double GetLocalAreaFactor(double, int);
223
224private:
225 vtkMaskPoints(const vtkMaskPoints&) = delete;
226 void operator=(const vtkMaskPoints&) = delete;
227};
228
229#endif
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
selectively filter points
Definition: vtkMaskPoints.h:47
~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.
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
int vtkIdType
Definition: vtkType.h:332
#define VTK_ID_MAX
Definition: vtkType.h:336
#define VTK_INT_MAX
Definition: vtkType.h:155