VTK
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
vtkRandomSequence
Generate a sequence of random numbers.
Definition: vtkRandomSequence.h:37
vtkPointSource::SetDistributionToUniform
void SetDistributionToUniform()
Definition: vtkPointSource.h:78
vtkPointSource::Distribution
int Distribution
Definition: vtkPointSource.h:114
vtkIdType
int vtkIdType
Definition: vtkType.h:349
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPointSource
create a random cloud of points
Definition: vtkPointSource.h:38
vtkPolyDataAlgorithm.h
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
vtkPointSource::NumberOfPoints
vtkIdType NumberOfPoints
Definition: vtkPointSource.h:111
VTK_POINT_UNIFORM
#define VTK_POINT_UNIFORM
Definition: vtkPointSource.h:33
VTK_ID_MAX
#define VTK_ID_MAX
Definition: vtkType.h:353
vtkPointSource::Radius
double Radius
Definition: vtkPointSource.h:113
vtkPointSource::SetDistributionToShell
void SetDistributionToShell()
Definition: vtkPointSource.h:79
vtkPointSource::RandomSequence
vtkRandomSequence * RandomSequence
Definition: vtkPointSource.h:116
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:171
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkPointSource::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkPointSource.h:115
VTK_POINT_SHELL
#define VTK_POINT_SHELL
Definition: vtkPointSource.h:34
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41