VTK  9.2.6
vtkPointSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPointSource.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 =========================================================================*/
43 #ifndef vtkPointSource_h
44 #define vtkPointSource_h
45 
46 #include "vtkFiltersSourcesModule.h" // For export macro
47 #include "vtkPolyDataAlgorithm.h"
48 
49 #define VTK_POINT_SHELL 0
50 #define VTK_POINT_UNIFORM 1
51 #define VTK_POINT_EXPONENTIAL 2
52 
53 class vtkRandomSequence;
54 
55 class VTKFILTERSSOURCES_EXPORT vtkPointSource : public vtkPolyDataAlgorithm
56 {
57 public:
59 
62  static vtkPointSource* New();
64  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
68 
71  vtkSetClampMacro(NumberOfPoints, vtkIdType, 1, VTK_ID_MAX);
72  vtkGetMacro(NumberOfPoints, vtkIdType);
74 
76 
79  vtkSetVector3Macro(Center, double);
80  vtkGetVectorMacro(Center, double, 3);
82 
84 
89  vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
90  vtkGetMacro(Radius, double);
92 
94 
101  vtkSetClampMacro(Distribution, int, VTK_POINT_SHELL, VTK_POINT_EXPONENTIAL);
102  void SetDistributionToShell() { this->SetDistribution(VTK_POINT_SHELL); }
103  void SetDistributionToUniform() { this->SetDistribution(VTK_POINT_UNIFORM); }
104  void SetDistributionToExponential() { this->SetDistribution(VTK_POINT_EXPONENTIAL); }
105  vtkGetMacro(Distribution, int);
107 
109 
116  vtkSetMacro(Lambda, double);
117  vtkGetMacro(Lambda, double);
119 
121 
126  vtkSetMacro(OutputPointsPrecision, int);
127  vtkGetMacro(OutputPointsPrecision, int);
129 
131 
136  virtual void SetRandomSequence(vtkRandomSequence* randomSequence);
137  vtkGetObjectMacro(RandomSequence, vtkRandomSequence);
139 
140 protected:
141  vtkPointSource(vtkIdType numPts = 10);
142  ~vtkPointSource() override;
143 
145 
146  double Random();
147 
149  double Center[3];
150  double Radius;
152  double Lambda;
155 
156 private:
157  vtkPointSource(const vtkPointSource&) = delete;
158  void operator=(const vtkPointSource&) = delete;
159 };
160 
161 #endif
vtkRandomSequence * RandomSequence
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
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:332
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:39
#define VTK_POINT_UNIFORM
void SetDistributionToUniform()
Specify the point distribution to use.
#define VTK_POINT_EXPONENTIAL
#define VTK_ID_MAX
Definition: vtkType.h:336
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.