VTK
vtkSuperquadricSource.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSuperquadricSource.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 =========================================================================*/
57 #ifndef vtkSuperquadricSource_h
58 #define vtkSuperquadricSource_h
59 
60 #include "vtkFiltersSourcesModule.h" // For export macro
61 #include "vtkPolyDataAlgorithm.h"
62 
63 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
64 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
65 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
66 
67 class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
68 {
69 public:
75  static vtkSuperquadricSource *New();
76 
78  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
79 
81 
84  vtkSetVector3Macro(Center,double);
85  vtkGetVectorMacro(Center,double,3);
87 
89 
92  vtkSetVector3Macro(Scale,double);
93  vtkGetVectorMacro(Scale,double,3);
95 
97 
100  vtkGetMacro(ThetaResolution,int);
101  void SetThetaResolution(int i);
103 
105 
108  vtkGetMacro(PhiResolution,int);
109  void SetPhiResolution(int i);
111 
113 
118  vtkGetMacro(Thickness,double);
119  vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
121 
123 
128  vtkGetMacro(PhiRoundness,double);
129  void SetPhiRoundness(double e);
131 
133 
138  vtkGetMacro(ThetaRoundness,double);
139  void SetThetaRoundness(double e);
141 
143 
146  vtkSetMacro(Size,double);
147  vtkGetMacro(Size,double);
149 
151 
154  vtkSetMacro(AxisOfSymmetry,int);
155  vtkGetMacro(AxisOfSymmetry,int);
156  void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
157  void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
158  void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
160 
162 
166  vtkBooleanMacro(Toroidal,int);
167  vtkGetMacro(Toroidal,int);
168  vtkSetMacro(Toroidal,int);
170 
172 
177  vtkSetMacro(OutputPointsPrecision,int);
178  vtkGetMacro(OutputPointsPrecision,int);
180 
181 protected:
182  vtkSuperquadricSource(int res=16);
183  ~vtkSuperquadricSource() VTK_OVERRIDE {}
184 
185  int Toroidal;
187  double Thickness;
188  double Size;
189  double PhiRoundness;
192  double Center[3];
193  double Scale[3];
197 
198 private:
199  vtkSuperquadricSource(const vtkSuperquadricSource&) VTK_DELETE_FUNCTION;
200  void operator=(const vtkSuperquadricSource&) VTK_DELETE_FUNCTION;
201 };
202 
203 #endif
204 
VTK_MIN_SUPERQUADRIC_THICKNESS
#define VTK_MIN_SUPERQUADRIC_THICKNESS
Definition: vtkSuperquadricSource.h:64
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkSuperquadricSource::PhiRoundness
double PhiRoundness
Definition: vtkSuperquadricSource.h:189
vtkSuperquadricSource::ThetaRoundness
double ThetaRoundness
Definition: vtkSuperquadricSource.h:190
vtkSuperquadricSource::Size
double Size
Definition: vtkSuperquadricSource.h:188
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSuperquadricSource::PhiResolution
int PhiResolution
Definition: vtkSuperquadricSource.h:195
vtkSuperquadricSource::SetZAxisOfSymmetry
void SetZAxisOfSymmetry()
Definition: vtkSuperquadricSource.h:158
vtkPolyDataAlgorithm.h
vtkSuperquadricSource::SetYAxisOfSymmetry
void SetYAxisOfSymmetry()
Definition: vtkSuperquadricSource.h:157
vtkSuperquadricSource
create a polygonal superquadric centered at the origin
Definition: vtkSuperquadricSource.h:67
vtkSuperquadricSource::AxisOfSymmetry
int AxisOfSymmetry
Definition: vtkSuperquadricSource.h:186
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkSuperquadricSource::~vtkSuperquadricSource
~vtkSuperquadricSource() override
Definition: vtkSuperquadricSource.h:183
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSuperquadricSource::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkSuperquadricSource.h:196
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSuperquadricSource::SetXAxisOfSymmetry
void SetXAxisOfSymmetry()
Definition: vtkSuperquadricSource.h:156
vtkSuperquadricSource::ThetaResolution
int ThetaResolution
Definition: vtkSuperquadricSource.h:194
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkSuperquadricSource::Thickness
double Thickness
Definition: vtkSuperquadricSource.h:187
vtkSuperquadricSource::Toroidal
int Toroidal
Definition: vtkSuperquadricSource.h:185
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44