VTK  9.3.0
vtkSuperquadricSource.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
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 VTK_ABI_NAMESPACE_BEGIN
62 class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
63 {
64 public:
71 
73  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
76 
79  vtkSetVector3Macro(Center, double);
80  vtkGetVectorMacro(Center, double, 3);
82 
84 
87  vtkSetVector3Macro(Scale, double);
88  vtkGetVectorMacro(Scale, double, 3);
90 
92 
95  vtkGetMacro(ThetaResolution, int);
96  void SetThetaResolution(int i);
98 
100 
103  vtkGetMacro(PhiResolution, int);
104  void SetPhiResolution(int i);
106 
108 
113  vtkGetMacro(Thickness, double);
114  vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
116 
118 
123  vtkGetMacro(PhiRoundness, double);
124  void SetPhiRoundness(double e);
126 
128 
133  vtkGetMacro(ThetaRoundness, double);
134  void SetThetaRoundness(double e);
136 
138 
141  vtkSetMacro(Size, double);
142  vtkGetMacro(Size, double);
144 
146 
150  vtkSetMacro(AxisOfSymmetry, int);
151  vtkGetMacro(AxisOfSymmetry, int);
152  void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
153  void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
154  void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
156 
158 
162  vtkBooleanMacro(Toroidal, vtkTypeBool);
163  vtkGetMacro(Toroidal, vtkTypeBool);
164  vtkSetMacro(Toroidal, vtkTypeBool);
166 
168 
173  vtkSetMacro(OutputPointsPrecision, int);
174  vtkGetMacro(OutputPointsPrecision, int);
176 
177 protected:
178  vtkSuperquadricSource(int res = 16);
179  ~vtkSuperquadricSource() override = default;
180 
183  double Thickness;
184  double Size;
185  double PhiRoundness;
189  double Center[3];
190  double Scale[3];
194 
195 private:
197  void operator=(const vtkSuperquadricSource&) = delete;
198 };
199 
200 VTK_ABI_NAMESPACE_END
201 #endif
a simple class to control print indentation
Definition: vtkIndent.h:38
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:64
#define VTK_MIN_SUPERQUADRIC_THICKNESS