VTK  9.3.0
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
40 #ifndef vtkPointSource_h
41 #define vtkPointSource_h
42 
43 #include "vtkFiltersSourcesModule.h" // For export macro
44 #include "vtkPolyDataAlgorithm.h"
45 
46 #define VTK_POINT_SHELL 0
47 #define VTK_POINT_UNIFORM 1
48 #define VTK_POINT_EXPONENTIAL 2
49 
50 VTK_ABI_NAMESPACE_BEGIN
51 class vtkRandomSequence;
52 
53 class VTKFILTERSSOURCES_EXPORT vtkPointSource : public vtkPolyDataAlgorithm
54 {
55 public:
57 
60  static vtkPointSource* New();
62  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
66 
69  vtkSetClampMacro(NumberOfPoints, vtkIdType, 1, VTK_ID_MAX);
70  vtkGetMacro(NumberOfPoints, vtkIdType);
72 
74 
77  vtkSetVector3Macro(Center, double);
78  vtkGetVectorMacro(Center, double, 3);
80 
82 
87  vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
88  vtkGetMacro(Radius, double);
90 
92 
99  vtkSetClampMacro(Distribution, int, VTK_POINT_SHELL, VTK_POINT_EXPONENTIAL);
100  void SetDistributionToShell() { this->SetDistribution(VTK_POINT_SHELL); }
101  void SetDistributionToUniform() { this->SetDistribution(VTK_POINT_UNIFORM); }
102  void SetDistributionToExponential() { this->SetDistribution(VTK_POINT_EXPONENTIAL); }
103  vtkGetMacro(Distribution, int);
105 
107 
114  vtkSetMacro(Lambda, double);
115  vtkGetMacro(Lambda, double);
117 
119 
124  vtkSetMacro(OutputPointsPrecision, int);
125  vtkGetMacro(OutputPointsPrecision, int);
127 
129 
134  virtual void SetRandomSequence(vtkRandomSequence* randomSequence);
135  vtkGetObjectMacro(RandomSequence, vtkRandomSequence);
137 
138 protected:
139  vtkPointSource(vtkIdType numPts = 10);
140  ~vtkPointSource() override;
141 
143 
144  double Random();
145 
147  double Center[3];
148  double Radius;
150  double Lambda;
153 
154 private:
155  vtkPointSource(const vtkPointSource&) = delete;
156  void operator=(const vtkPointSource&) = delete;
157 };
158 
159 VTK_ABI_NAMESPACE_END
160 #endif
a simple class to control print indentation
Definition: vtkIndent.h:38
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