VTK  9.7.1
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
31 #ifndef vtkPointSource_h
32 #define vtkPointSource_h
33 
34 #include "vtkFiltersSourcesModule.h" // For export macro
35 #include "vtkPolyDataAlgorithm.h"
36 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
37 
38 #define VTK_POINT_SHELL 0
39 #define VTK_POINT_UNIFORM 1
40 #define VTK_POINT_EXPONENTIAL 2
41 
42 VTK_ABI_NAMESPACE_BEGIN
43 class vtkRandomSequence;
44 
45 class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkPointSource : public vtkPolyDataAlgorithm
46 {
47 public:
49 
52  static vtkPointSource* New();
54  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
58 
61  vtkSetClampMacro(NumberOfPoints, vtkIdType, 1, VTK_ID_MAX);
62  vtkGetMacro(NumberOfPoints, vtkIdType);
64 
66 
69  vtkSetVector3Macro(Center, double);
70  vtkGetVectorMacro(Center, double, 3);
72 
74 
79  vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
80  vtkGetMacro(Radius, double);
82 
84 
91  vtkSetClampMacro(Distribution, int, VTK_POINT_SHELL, VTK_POINT_EXPONENTIAL);
92  void SetDistributionToShell() { this->SetDistribution(VTK_POINT_SHELL); }
93  void SetDistributionToUniform() { this->SetDistribution(VTK_POINT_UNIFORM); }
94  void SetDistributionToExponential() { this->SetDistribution(VTK_POINT_EXPONENTIAL); }
95  vtkGetMacro(Distribution, int);
97 
99 
106  vtkSetMacro(Lambda, double);
107  vtkGetMacro(Lambda, double);
109 
111 
116  vtkSetMacro(OutputPointsPrecision, int);
117  vtkGetMacro(OutputPointsPrecision, int);
119 
121 
126  virtual void SetRandomSequence(vtkRandomSequence* randomSequence);
127  vtkGetObjectMacro(RandomSequence, vtkRandomSequence);
129 
130 protected:
131  vtkPointSource(vtkIdType numPts = 10);
132  ~vtkPointSource() override;
133 
135 
136  double Random();
137 
139  double Center[3];
140  double Radius;
142  double Lambda;
145 
146 private:
147  vtkPointSource(const vtkPointSource&) = delete;
148  void operator=(const vtkPointSource&) = delete;
149 };
150 
151 VTK_ABI_NAMESPACE_END
152 #endif
vtkRandomSequence * RandomSequence
#define VTK_DOUBLE_MAX
Definition: vtkType.h:202
void SetDistributionToShell()
Specify the point distribution to use.
void SetDistributionToExponential()
Specify the point distribution to use.
#define VTK_POINT_SHELL
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
int vtkIdType
Definition: vtkType.h:363
Generate a sequence of random numbers.
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_POINT_UNIFORM
void SetDistributionToUniform()
Specify the point distribution to use.
#define VTK_POINT_EXPONENTIAL
#define VTK_ID_MAX
Definition: vtkType.h:367
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
create a random cloud of points
vtkIdType NumberOfPoints
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.