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 =========================================================================*/
51 #ifndef vtkSuperquadricSource_h
52 #define vtkSuperquadricSource_h
53 
54 #include "vtkFiltersSourcesModule.h" // For export macro
55 #include "vtkPolyDataAlgorithm.h"
56 
57 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
58 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
59 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
60 
61 class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
62 {
63 public:
69  static vtkSuperquadricSource *New();
70 
72  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
75 
78  vtkSetVector3Macro(Center,double);
79  vtkGetVectorMacro(Center,double,3);
81 
83 
86  vtkSetVector3Macro(Scale,double);
87  vtkGetVectorMacro(Scale,double,3);
89 
91 
94  vtkGetMacro(ThetaResolution,int);
95  void SetThetaResolution(int i);
97 
99 
102  vtkGetMacro(PhiResolution,int);
103  void SetPhiResolution(int i);
105 
107 
112  vtkGetMacro(Thickness,double);
113  vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
115 
117 
122  vtkGetMacro(PhiRoundness,double);
123  void SetPhiRoundness(double e);
125 
127 
132  vtkGetMacro(ThetaRoundness,double);
133  void SetThetaRoundness(double e);
135 
137 
140  vtkSetMacro(Size,double);
141  vtkGetMacro(Size,double);
143 
145 
148  vtkSetMacro(AxisOfSymmetry,int);
149  vtkGetMacro(AxisOfSymmetry,int);
150  void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
151  void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
152  void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
154 
156 
160  vtkBooleanMacro(Toroidal,vtkTypeBool);
161  vtkGetMacro(Toroidal,vtkTypeBool);
162  vtkSetMacro(Toroidal,vtkTypeBool);
164 
166 
171  vtkSetMacro(OutputPointsPrecision,int);
172  vtkGetMacro(OutputPointsPrecision,int);
174 
175 protected:
176  vtkSuperquadricSource(int res=16);
178 
181  double Thickness;
182  double Size;
183  double PhiRoundness;
186  double Center[3];
187  double Scale[3];
191 
192 private:
194  void operator=(const vtkSuperquadricSource&) = delete;
195 };
196 
197 #endif
198 
VTK_MIN_SUPERQUADRIC_THICKNESS
#define VTK_MIN_SUPERQUADRIC_THICKNESS
Definition: vtkSuperquadricSource.h:58
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkSuperquadricSource::PhiRoundness
double PhiRoundness
Definition: vtkSuperquadricSource.h:183
vtkSuperquadricSource::ThetaRoundness
double ThetaRoundness
Definition: vtkSuperquadricSource.h:184
vtkSuperquadricSource::Size
double Size
Definition: vtkSuperquadricSource.h:182
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:189
vtkSuperquadricSource::SetZAxisOfSymmetry
void SetZAxisOfSymmetry()
Definition: vtkSuperquadricSource.h:152
vtkSuperquadricSource::Toroidal
vtkTypeBool Toroidal
Definition: vtkSuperquadricSource.h:179
vtkPolyDataAlgorithm.h
vtkSuperquadricSource::SetYAxisOfSymmetry
void SetYAxisOfSymmetry()
Definition: vtkSuperquadricSource.h:151
vtkSuperquadricSource
create a polygonal superquadric centered at the origin
Definition: vtkSuperquadricSource.h:61
vtkSuperquadricSource::AxisOfSymmetry
int AxisOfSymmetry
Definition: vtkSuperquadricSource.h:180
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkSuperquadricSource::~vtkSuperquadricSource
~vtkSuperquadricSource() override
Definition: vtkSuperquadricSource.h:177
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkSuperquadricSource::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkSuperquadricSource.h:190
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:80
vtkSuperquadricSource::SetXAxisOfSymmetry
void SetXAxisOfSymmetry()
Definition: vtkSuperquadricSource.h:150
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkSuperquadricSource::ThetaResolution
int ThetaResolution
Definition: vtkSuperquadricSource.h:188
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkSuperquadricSource::Thickness
double Thickness
Definition: vtkSuperquadricSource.h:181
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41