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
42#ifndef vtkSuperquadricSource_h
43#define vtkSuperquadricSource_h
44
45#include "vtkFiltersSourcesModule.h" // For export macro
47
48#define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
49#define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
50#define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
51
52VTK_ABI_NAMESPACE_BEGIN
53class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
54{
55public:
62
64 void PrintSelf(ostream& os, vtkIndent indent) override;
65
67
70 vtkSetVector3Macro(Center, double);
71 vtkGetVectorMacro(Center, double, 3);
73
75
78 vtkSetVector3Macro(Scale, double);
79 vtkGetVectorMacro(Scale, double, 3);
81
83
86 vtkGetMacro(ThetaResolution, int);
87 void SetThetaResolution(int i);
89
91
94 vtkGetMacro(PhiResolution, int);
95 void SetPhiResolution(int i);
97
99
104 vtkGetMacro(Thickness, double);
105 vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
107
109
114 vtkGetMacro(PhiRoundness, double);
115 void SetPhiRoundness(double e);
117
119
124 vtkGetMacro(ThetaRoundness, double);
125 void SetThetaRoundness(double e);
127
129
132 vtkSetMacro(Size, double);
133 vtkGetMacro(Size, double);
135
137
141 vtkSetMacro(AxisOfSymmetry, int);
142 vtkGetMacro(AxisOfSymmetry, int);
143 void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
144 void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
145 void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
147
149
153 vtkBooleanMacro(Toroidal, vtkTypeBool);
154 vtkGetMacro(Toroidal, vtkTypeBool);
155 vtkSetMacro(Toroidal, vtkTypeBool);
157
159
164 vtkSetMacro(OutputPointsPrecision, int);
165 vtkGetMacro(OutputPointsPrecision, int);
167
168protected:
170 ~vtkSuperquadricSource() override = default;
171
174 double Thickness;
175 double Size;
180 double Center[3];
181 double Scale[3];
185
186private:
188 void operator=(const vtkSuperquadricSource&) = delete;
189};
190
191VTK_ABI_NAMESPACE_END
192#endif
a simple class to control print indentation
Definition vtkIndent.h:29
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).
static vtkSuperquadricSource * New()
Create a default superquadric with a radius of 0.5, non-toroidal, spherical, and centered at the orig...
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.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MIN_SUPERQUADRIC_THICKNESS