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 =========================================================================*/
31 #ifndef vtkMaskPoints_h
32 #define vtkMaskPoints_h
33 
34 #include "vtkFiltersCoreModule.h" // For export macro
35 #include "vtkPolyDataAlgorithm.h"
36 
37 class VTKFILTERSCORE_EXPORT vtkMaskPoints : public vtkPolyDataAlgorithm
38 {
39 public:
40  // Method used to pick points
42  {
48  UNIFORM_SPATIAL_VOLUME
49  };
50 
51  static vtkMaskPoints* New();
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
56 
59  vtkSetClampMacro(OnRatio, int, 1, VTK_INT_MAX);
60  vtkGetMacro(OnRatio, int);
62 
64 
68  vtkSetClampMacro(MaximumNumberOfPoints, vtkIdType, 0, VTK_ID_MAX);
69  vtkGetMacro(MaximumNumberOfPoints, vtkIdType);
71 
73 
76  vtkSetClampMacro(Offset, vtkIdType, 0, VTK_ID_MAX);
77  vtkGetMacro(Offset, vtkIdType);
79 
81 
84  vtkSetMacro(RandomMode, bool);
85  vtkGetMacro(RandomMode, bool);
86  vtkBooleanMacro(RandomMode, bool);
88 
90 
94  vtkSetMacro(RandomSeed, int);
95  vtkGetMacro(RandomSeed, int);
97 
99 
129  vtkSetClampMacro(RandomModeType, int, RANDOMIZED_ID_STRIDES, UNIFORM_SPATIAL_VOLUME);
130  vtkGetMacro(RandomModeType, int);
132 
134 
147  vtkSetMacro(ProportionalMaximumNumberOfPoints, bool);
148  vtkGetMacro(ProportionalMaximumNumberOfPoints, bool);
149  vtkBooleanMacro(ProportionalMaximumNumberOfPoints, bool);
151 
153 
158  vtkSetMacro(GenerateVertices, bool);
159  vtkGetMacro(GenerateVertices, bool);
160  vtkBooleanMacro(GenerateVertices, bool);
162 
164 
169  vtkSetMacro(SingleVertexPerCell, bool);
170  vtkGetMacro(SingleVertexPerCell, bool);
171  vtkBooleanMacro(SingleVertexPerCell, bool);
173 
175 
180  vtkSetMacro(OutputPointsPrecision, int);
181  vtkGetMacro(OutputPointsPrecision, int);
183 
184 protected:
186  ~vtkMaskPoints() override = default;
187 
190 
191  int OnRatio = 2; // every OnRatio point is on; all others are off.
192  vtkIdType Offset = 0; // or starting point id.
193  bool RandomMode = false; // turn on/off randomization.
194  int RandomSeed = 1;
196  bool GenerateVertices = false; // generate polydata verts
197  bool SingleVertexPerCell = false;
198  int RandomModeType = RANDOMIZED_ID_STRIDES;
199  bool ProportionalMaximumNumberOfPoints = false;
200  int OutputPointsPrecision = DEFAULT_PRECISION;
201 
202  virtual void InternalScatter(unsigned long*, unsigned long*, int, int) {}
203  virtual void InternalGather(unsigned long*, unsigned long*, int, int) {}
204  virtual void InternalBroadcast(double*, int, int) {}
205  virtual void InternalGather(double*, double*, int, int) {}
206  virtual int InternalGetNumberOfProcesses() { return 1; }
207  virtual int InternalGetLocalProcessId() { return 0; }
208  virtual void InternalSplitController(int, int) {}
209  virtual void InternalResetController() {}
210  virtual void InternalBarrier() {}
211 
212  unsigned long GetLocalSampleSize(vtkIdType, int);
213  double GetLocalAreaFactor(double, int);
214 
215 private:
216  vtkMaskPoints(const vtkMaskPoints&) = delete;
217  void operator=(const vtkMaskPoints&) = delete;
218 };
219 
220 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
selectively filter points
Definition: vtkMaskPoints.h:38
~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