VTK  9.0.1
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 =========================================================================*/
27 #ifndef vtkPointSource_h
28 #define vtkPointSource_h
29 
30 #include "vtkFiltersSourcesModule.h" // For export macro
31 #include "vtkPolyDataAlgorithm.h"
32 
33 #define VTK_POINT_UNIFORM 1
34 #define VTK_POINT_SHELL 0
35 
36 class vtkRandomSequence;
37 
38 class VTKFILTERSSOURCES_EXPORT vtkPointSource : public vtkPolyDataAlgorithm
39 {
40 public:
41  static vtkPointSource* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
49  vtkSetClampMacro(NumberOfPoints, vtkIdType, 1, VTK_ID_MAX);
50  vtkGetMacro(NumberOfPoints, vtkIdType);
52 
54 
57  vtkSetVector3Macro(Center, double);
58  vtkGetVectorMacro(Center, double, 3);
60 
62 
67  vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
68  vtkGetMacro(Radius, double);
70 
72 
77  vtkSetMacro(Distribution, int);
78  void SetDistributionToUniform() { this->SetDistribution(VTK_POINT_UNIFORM); }
79  void SetDistributionToShell() { this->SetDistribution(VTK_POINT_SHELL); }
80  vtkGetMacro(Distribution, int);
82 
84 
89  vtkSetMacro(OutputPointsPrecision, int);
90  vtkGetMacro(OutputPointsPrecision, int);
92 
94 
99  virtual void SetRandomSequence(vtkRandomSequence* randomSequence);
100  vtkGetObjectMacro(RandomSequence, vtkRandomSequence);
102 
103 protected:
104  vtkPointSource(vtkIdType numPts = 10);
105  ~vtkPointSource() override;
106 
108 
109  double Random();
110 
112  double Center[3];
113  double Radius;
117 
118 private:
119  vtkPointSource(const vtkPointSource&) = delete;
120  void operator=(const vtkPointSource&) = delete;
121 };
122 
123 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
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()
vtkIdType NumberOfPoints
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void SetDistributionToUniform()
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:338
#define VTK_ID_MAX
Definition: vtkType.h:342
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165