VTK  9.2.6
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 =========================================================================*/
63 #ifndef vtkSuperquadricSource_h
64 #define vtkSuperquadricSource_h
65 
66 #include "vtkFiltersSourcesModule.h" // For export macro
67 #include "vtkPolyDataAlgorithm.h"
68 
69 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
70 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
71 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
72 
73 class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
74 {
75 public:
82 
84  void PrintSelf(ostream& os, vtkIndent indent) override;
85 
87 
90  vtkSetVector3Macro(Center, double);
91  vtkGetVectorMacro(Center, double, 3);
93 
95 
98  vtkSetVector3Macro(Scale, double);
99  vtkGetVectorMacro(Scale, double, 3);
101 
103 
106  vtkGetMacro(ThetaResolution, int);
107  void SetThetaResolution(int i);
109 
111 
114  vtkGetMacro(PhiResolution, int);
115  void SetPhiResolution(int i);
117 
119 
124  vtkGetMacro(Thickness, double);
125  vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
127 
129 
134  vtkGetMacro(PhiRoundness, double);
135  void SetPhiRoundness(double e);
137 
139 
144  vtkGetMacro(ThetaRoundness, double);
145  void SetThetaRoundness(double e);
147 
149 
152  vtkSetMacro(Size, double);
153  vtkGetMacro(Size, double);
155 
157 
161  vtkSetMacro(AxisOfSymmetry, int);
162  vtkGetMacro(AxisOfSymmetry, int);
163  void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
164  void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
165  void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
167 
169 
173  vtkBooleanMacro(Toroidal, vtkTypeBool);
174  vtkGetMacro(Toroidal, vtkTypeBool);
175  vtkSetMacro(Toroidal, vtkTypeBool);
177 
179 
184  vtkSetMacro(OutputPointsPrecision, int);
185  vtkGetMacro(OutputPointsPrecision, int);
187 
188 protected:
189  vtkSuperquadricSource(int res = 16);
190  ~vtkSuperquadricSource() override = default;
191 
194  double Thickness;
195  double Size;
196  double PhiRoundness;
200  double Center[3];
201  double Scale[3];
205 
206 private:
208  void operator=(const vtkSuperquadricSource&) = delete;
209 };
210 
211 #endif
a simple class to control print indentation
Definition: vtkIndent.h:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
create a polygonal superquadric centered at the origin
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
void SetPhiRoundness(double e)
Set/Get Superquadric north/south roundness.
~vtkSuperquadricSource() override=default
void SetZAxisOfSymmetry()
Set/Get axis of symmetry for superquadric (x axis: 0, y axis: 1, z axis: 2).
vtkSuperquadricSource(int res=16)
void SetPhiResolution(int i)
Set the number of points in the latitude direction.
void SetThetaRoundness(double e)
Set/Get Superquadric east/west roundness.
void SetYAxisOfSymmetry()
Set/Get axis of symmetry for superquadric (x axis: 0, y axis: 1, z axis: 2).
void SetXAxisOfSymmetry()
Set/Get axis of symmetry for superquadric (x axis: 0, y axis: 1, z axis: 2).
void SetThetaResolution(int i)
Set the number of points in the longitude direction.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkSuperquadricSource * New()
Create a default superquadric with a radius of 0.5, non-toroidal, spherical, and centered at the orig...
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_MIN_SUPERQUADRIC_THICKNESS