VTK  9.0.20201203
vtkSphereSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSphereSource.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 =========================================================================*/
33 #ifndef vtkSphereSource_h
34 #define vtkSphereSource_h
35 
36 #include "vtkFiltersSourcesModule.h" // For export macro
37 #include "vtkPolyDataAlgorithm.h"
38 
39 #define VTK_MAX_SPHERE_RESOLUTION 1024
40 
41 class VTKFILTERSSOURCES_EXPORT vtkSphereSource : public vtkPolyDataAlgorithm
42 {
43 public:
45 
49  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
56  static vtkSphereSource* New();
57 
59 
62  vtkSetClampMacro(Radius, double, 0.0, VTK_DOUBLE_MAX);
63  vtkGetMacro(Radius, double);
65 
67 
70  vtkSetVector3Macro(Center, double);
71  vtkGetVectorMacro(Center, double, 3);
73 
75 
79  vtkSetClampMacro(ThetaResolution, int, 3, VTK_MAX_SPHERE_RESOLUTION);
80  vtkGetMacro(ThetaResolution, int);
82 
84 
88  vtkSetClampMacro(PhiResolution, int, 3, VTK_MAX_SPHERE_RESOLUTION);
89  vtkGetMacro(PhiResolution, int);
91 
93 
96  vtkSetClampMacro(StartTheta, double, 0.0, 360.0);
97  vtkGetMacro(StartTheta, double);
99 
101 
104  vtkSetClampMacro(EndTheta, double, 0.0, 360.0);
105  vtkGetMacro(EndTheta, double);
107 
109 
113  vtkSetClampMacro(StartPhi, double, 0.0, 360.0);
114  vtkGetMacro(StartPhi, double);
116 
118 
121  vtkSetClampMacro(EndPhi, double, 0.0, 360.0);
122  vtkGetMacro(EndPhi, double);
124 
126 
134  vtkSetMacro(LatLongTessellation, vtkTypeBool);
135  vtkGetMacro(LatLongTessellation, vtkTypeBool);
136  vtkBooleanMacro(LatLongTessellation, vtkTypeBool);
138 
140 
145  vtkSetMacro(OutputPointsPrecision, int);
146  vtkGetMacro(OutputPointsPrecision, int);
148 
150 
154  vtkSetMacro(GenerateNormals, vtkTypeBool);
155  vtkGetMacro(GenerateNormals, vtkTypeBool);
156  vtkBooleanMacro(GenerateNormals, vtkTypeBool);
158 
159 protected:
160  vtkSphereSource(int res = 8);
161  ~vtkSphereSource() override = default;
162 
165 
166  double Radius;
167  double Center[3];
170  double StartTheta;
171  double EndTheta;
172  double StartPhi;
173  double EndPhi;
177 
178 private:
179  vtkSphereSource(const vtkSphereSource&) = delete;
180  void operator=(const vtkSphereSource&) = delete;
181 };
182 
183 #endif
VTK_MAX_SPHERE_RESOLUTION
#define VTK_MAX_SPHERE_RESOLUTION
Definition: vtkSphereSource.h:39
vtkSphereSource::EndTheta
double EndTheta
Definition: vtkSphereSource.h:171
vtkSphereSource::PhiResolution
int PhiResolution
Definition: vtkSphereSource.h:169
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkSphereSource::StartTheta
double StartTheta
Definition: vtkSphereSource.h:170
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSphereSource::Radius
double Radius
Definition: vtkSphereSource.h:166
vtkSphereSource::LatLongTessellation
vtkTypeBool LatLongTessellation
Definition: vtkSphereSource.h:174
vtkPolyDataAlgorithm.h
vtkSphereSource::StartPhi
double StartPhi
Definition: vtkSphereSource.h:172
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkSphereSource::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkSphereSource.h:175
vtkSphereSource::GenerateNormals
vtkTypeBool GenerateNormals
Definition: vtkSphereSource.h:176
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkSphereSource::ThetaResolution
int ThetaResolution
Definition: vtkSphereSource.h:168
vtkSphereSource::EndPhi
double EndPhi
Definition: vtkSphereSource.h:173
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:157
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkPolyDataAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41