VTK  9.1.0
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 =========================================================================*/
136 #ifndef vtkPointSource_h
137 #define vtkPointSource_h
138 
139 #include "vtkFiltersSourcesModule.h" // For export macro
140 #include "vtkPolyDataAlgorithm.h"
141 
142 #define VTK_POINT_UNIFORM 1
143 #define VTK_POINT_SHELL 0
144 
145 class vtkRandomSequence;
146 
147 class VTKFILTERSSOURCES_EXPORT vtkPointSource : public vtkPolyDataAlgorithm
148 {
149 public:
150  static vtkPointSource* New();
152  void PrintSelf(ostream& os, vtkIndent indent) override;
153 
155 
158  vtkSetClampMacro(NumberOfPoints, vtkIdType, 1, VTK_ID_MAX);
159  vtkGetMacro(NumberOfPoints, vtkIdType);
161 
163 
166  vtkSetVector3Macro(Center, double);
167  vtkGetVectorMacro(Center, double, 3);
169 
171 
176  vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
177  vtkGetMacro(Radius, double);
179 
181 
186  vtkSetMacro(Distribution, int);
187  void SetDistributionToUniform() { this->SetDistribution(VTK_POINT_UNIFORM); }
188  void SetDistributionToShell() { this->SetDistribution(VTK_POINT_SHELL); }
189  vtkGetMacro(Distribution, int);
191 
193 
198  vtkSetMacro(OutputPointsPrecision, int);
199  vtkGetMacro(OutputPointsPrecision, int);
201 
203 
208  virtual void SetRandomSequence(vtkRandomSequence* randomSequence);
209  vtkGetObjectMacro(RandomSequence, vtkRandomSequence);
211 
212 protected:
213  vtkPointSource(vtkIdType numPts = 10);
214  ~vtkPointSource() override;
215 
217 
218  double Random();
219 
221  double Center[3];
222  double Radius;
226 
227 private:
228  vtkPointSource(const vtkPointSource&) = delete;
229  void operator=(const vtkPointSource&) = delete;
230 };
231 
232 #endif
a simple class to control print indentation
Definition: vtkIndent.h:113
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
Methods invoked by print to print information about the object including superclasses.
void SetDistributionToShell()
Specify the distribution to use.
vtkIdType NumberOfPoints
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetDistributionToUniform()
Specify the distribution to use.
vtkPointSource(vtkIdType numPts=10)
~vtkPointSource() override
static vtkPointSource * New()
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
int vtkIdType
Definition: vtkType.h:332
#define VTK_ID_MAX
Definition: vtkType.h:336
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165