VTK  9.2.6
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 =========================================================================*/
43 #ifndef vtkMaskPoints_h
44 #define vtkMaskPoints_h
45 
46 #include "vtkFiltersCoreModule.h" // For export macro
47 #include "vtkPolyDataAlgorithm.h"
48 
49 class VTKFILTERSCORE_EXPORT vtkMaskPoints : public vtkPolyDataAlgorithm
50 {
51 public:
52  // Method used to pick points
54  {
60  UNIFORM_SPATIAL_VOLUME
61  };
62 
63  static vtkMaskPoints* New();
65  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
68 
71  vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
72  vtkGetMacro(OnRatio, int);
74 
76 
80  vtkSetClampMacro(MaximumNumberOfPoints, vtkIdType, 0, VTK_ID_MAX);
81  vtkGetMacro(MaximumNumberOfPoints, vtkIdType);
83 
85 
88  vtkSetClampMacro(Offset, vtkIdType, 0, VTK_ID_MAX);
89  vtkGetMacro(Offset, vtkIdType);
91 
93 
96  vtkSetMacro(RandomMode, bool);
97  vtkGetMacro(RandomMode, bool);
98  vtkBooleanMacro(RandomMode, bool);
100 
102 
106  vtkSetMacro(RandomSeed, int);
107  vtkGetMacro(RandomSeed, int);
109 
111 
141  vtkSetClampMacro(RandomModeType, int, RANDOMIZED_ID_STRIDES, UNIFORM_SPATIAL_VOLUME);
142  vtkGetMacro(RandomModeType, int);
144 
146 
159  vtkSetMacro(ProportionalMaximumNumberOfPoints, bool);
160  vtkGetMacro(ProportionalMaximumNumberOfPoints, bool);
161  vtkBooleanMacro(ProportionalMaximumNumberOfPoints, bool);
163 
165 
170  vtkSetMacro(GenerateVertices, bool);
171  vtkGetMacro(GenerateVertices, bool);
172  vtkBooleanMacro(GenerateVertices, bool);
174 
176 
181  vtkSetMacro(SingleVertexPerCell, bool);
182  vtkGetMacro(SingleVertexPerCell, bool);
183  vtkBooleanMacro(SingleVertexPerCell, bool);
185 
187 
192  vtkSetMacro(OutputPointsPrecision, int);
193  vtkGetMacro(OutputPointsPrecision, int);
195 
196 protected:
198  ~vtkMaskPoints() override = default;
199 
202 
203  int OnRatio = 2; // every OnRatio point is on; all others are off.
204  vtkIdType Offset = 0; // or starting point id.
205  bool RandomMode = false; // turn on/off randomization.
206  int RandomSeed = 1;
208  bool GenerateVertices = false; // generate polydata verts
209  bool SingleVertexPerCell = false;
210  int RandomModeType = RANDOMIZED_ID_STRIDES;
211  bool ProportionalMaximumNumberOfPoints = false;
212  int OutputPointsPrecision = DEFAULT_PRECISION;
213 
214  virtual void InternalScatter(unsigned long*, unsigned long*, int, int) {}
215  virtual void InternalGather(unsigned long*, unsigned long*, int, int) {}
216  virtual void InternalBroadcast(double*, int, int) {}
217  virtual void InternalGather(double*, double*, int, int) {}
218  virtual int InternalGetNumberOfProcesses() { return 1; }
219  virtual int InternalGetLocalProcessId() { return 0; }
220  virtual void InternalSplitController(int, int) {}
221  virtual void InternalResetController() {}
222  virtual void InternalBarrier() {}
223 
224  unsigned long GetLocalSampleSize(vtkIdType, int);
225  double GetLocalAreaFactor(double, int);
226 
227 private:
228  vtkMaskPoints(const vtkMaskPoints&) = delete;
229  void operator=(const vtkMaskPoints&) = delete;
230 };
231 
232 #endif
a simple class to control print indentation
Definition: vtkIndent.h:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
selectively filter points
Definition: vtkMaskPoints.h:50
~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()
static vtkMaskPoints * New()
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()
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