VTK  9.3.20240327
vtkPointSource.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
140 #ifndef vtkPointSource_h
141 #define vtkPointSource_h
142 
143 #include "vtkFiltersSourcesModule.h" // For export macro
144 #include "vtkPolyDataAlgorithm.h"
145 
146 #define VTK_POINT_SHELL 0
147 #define VTK_POINT_UNIFORM 1
148 #define VTK_POINT_EXPONENTIAL 2
149 
150 VTK_ABI_NAMESPACE_BEGIN
151 class vtkRandomSequence;
152 
153 class VTKFILTERSSOURCES_EXPORT vtkPointSource : public vtkPolyDataAlgorithm
154 {
155 public:
157 
160  static vtkPointSource* New();
162  void PrintSelf(ostream& os, vtkIndent indent) override;
164 
166 
169  vtkSetClampMacro(NumberOfPoints, vtkIdType, 1, VTK_ID_MAX);
170  vtkGetMacro(NumberOfPoints, vtkIdType);
172 
174 
177  vtkSetVector3Macro(Center, double);
178  vtkGetVectorMacro(Center, double, 3);
180 
182 
187  vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
188  vtkGetMacro(Radius, double);
190 
192 
199  vtkSetClampMacro(Distribution, int, VTK_POINT_SHELL, VTK_POINT_EXPONENTIAL);
200  void SetDistributionToShell() { this->SetDistribution(VTK_POINT_SHELL); }
201  void SetDistributionToUniform() { this->SetDistribution(VTK_POINT_UNIFORM); }
202  void SetDistributionToExponential() { this->SetDistribution(VTK_POINT_EXPONENTIAL); }
203  vtkGetMacro(Distribution, int);
205 
207 
214  vtkSetMacro(Lambda, double);
215  vtkGetMacro(Lambda, double);
217 
219 
224  vtkSetMacro(OutputPointsPrecision, int);
225  vtkGetMacro(OutputPointsPrecision, int);
227 
229 
234  virtual void SetRandomSequence(vtkRandomSequence* randomSequence);
235  vtkGetObjectMacro(RandomSequence, vtkRandomSequence);
237 
238 protected:
239  vtkPointSource(vtkIdType numPts = 10);
240  ~vtkPointSource() override;
241 
243 
244  double Random();
245 
247  double Center[3];
248  double Radius;
250  double Lambda;
253 
254 private:
255  vtkPointSource(const vtkPointSource&) = delete;
256  void operator=(const vtkPointSource&) = delete;
257 };
258 
259 VTK_ABI_NAMESPACE_END
260 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
create a random cloud of points
vtkRandomSequence * RandomSequence
double Random()
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, type information, and printing.
void SetDistributionToShell()
Specify the point distribution to use.
vtkIdType NumberOfPoints
void SetDistributionToExponential()
Specify the point distribution to use.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetDistributionToUniform()
Specify the point distribution to use.
vtkPointSource(vtkIdType numPts=10)
~vtkPointSource() override
static vtkPointSource * New()
Standard methods for instantiation, type information, and printing.
virtual void SetRandomSequence(vtkRandomSequence *randomSequence)
Set/Get a random sequence generator.
Superclass for algorithms that produce only polydata as output.
Generate a sequence of random numbers.
#define VTK_POINT_UNIFORM
#define VTK_POINT_SHELL
#define VTK_POINT_EXPONENTIAL
int vtkIdType
Definition: vtkType.h:315
#define VTK_ID_MAX
Definition: vtkType.h:319
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154