VTK  9.3.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 
37 #define VTK_POINT_SHELL 0
38 #define VTK_POINT_UNIFORM 1
39 #define VTK_POINT_EXPONENTIAL 2
40 
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkRandomSequence;
43 
44 class VTKFILTERSSOURCES_EXPORT vtkPointSource : public vtkPolyDataAlgorithm
45 {
46 public:
48 
51  static vtkPointSource* New();
53  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
57 
60  vtkSetClampMacro(NumberOfPoints, vtkIdType, 1, VTK_ID_MAX);
61  vtkGetMacro(NumberOfPoints, vtkIdType);
63 
65 
68  vtkSetVector3Macro(Center, double);
69  vtkGetVectorMacro(Center, double, 3);
71 
73 
78  vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
79  vtkGetMacro(Radius, double);
81 
83 
90  vtkSetClampMacro(Distribution, int, VTK_POINT_SHELL, VTK_POINT_EXPONENTIAL);
91  void SetDistributionToShell() { this->SetDistribution(VTK_POINT_SHELL); }
92  void SetDistributionToUniform() { this->SetDistribution(VTK_POINT_UNIFORM); }
93  void SetDistributionToExponential() { this->SetDistribution(VTK_POINT_EXPONENTIAL); }
94  vtkGetMacro(Distribution, int);
96 
98 
105  vtkSetMacro(Lambda, double);
106  vtkGetMacro(Lambda, double);
108 
110 
115  vtkSetMacro(OutputPointsPrecision, int);
116  vtkGetMacro(OutputPointsPrecision, int);
118 
120 
125  virtual void SetRandomSequence(vtkRandomSequence* randomSequence);
126  vtkGetObjectMacro(RandomSequence, vtkRandomSequence);
128 
129 protected:
130  vtkPointSource(vtkIdType numPts = 10);
131  ~vtkPointSource() override;
132 
134 
135  double Random();
136 
138  double Center[3];
139  double Radius;
141  double Lambda;
144 
145 private:
146  vtkPointSource(const vtkPointSource&) = delete;
147  void operator=(const vtkPointSource&) = delete;
148 };
149 
150 VTK_ABI_NAMESPACE_END
151 #endif
vtkRandomSequence * RandomSequence
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154
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:315
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:319
Store zero or more vtkInformation instances.
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.