VTK  9.4.20241114
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
141#ifndef vtkSuperquadricSource_h
142#define vtkSuperquadricSource_h
143
144#include "vtkFiltersSourcesModule.h" // For export macro
145#include "vtkPolyDataAlgorithm.h"
146
147#define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
148#define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
149#define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
150
151VTK_ABI_NAMESPACE_BEGIN
152class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm
153{
154public:
161
163 void PrintSelf(ostream& os, vtkIndent indent) override;
164
166
169 vtkSetVector3Macro(Center, double);
170 vtkGetVectorMacro(Center, double, 3);
172
174
177 vtkSetVector3Macro(Scale, double);
178 vtkGetVectorMacro(Scale, double, 3);
180
182
185 vtkGetMacro(ThetaResolution, int);
188
190
193 vtkGetMacro(PhiResolution, int);
194 void SetPhiResolution(int i);
196
198
203 vtkGetMacro(Thickness, double);
204 vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
206
208
213 vtkGetMacro(PhiRoundness, double);
214 void SetPhiRoundness(double e);
216
218
223 vtkGetMacro(ThetaRoundness, double);
224 void SetThetaRoundness(double e);
226
228
231 vtkSetMacro(Size, double);
232 vtkGetMacro(Size, double);
234
236
240 vtkSetMacro(AxisOfSymmetry, int);
241 vtkGetMacro(AxisOfSymmetry, int);
242 void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
243 void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
244 void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
246
248
252 vtkBooleanMacro(Toroidal, vtkTypeBool);
253 vtkGetMacro(Toroidal, vtkTypeBool);
254 vtkSetMacro(Toroidal, vtkTypeBool);
256
258
263 vtkSetMacro(OutputPointsPrecision, int);
264 vtkGetMacro(OutputPointsPrecision, int);
266
267protected:
269 ~vtkSuperquadricSource() override = default;
270
273 double Thickness;
274 double Size;
279 double Center[3];
280 double Scale[3];
284
285private:
287 void operator=(const vtkSuperquadricSource&) = delete;
288};
289
290VTK_ABI_NAMESPACE_END
291#endif
a simple class to control print indentation
Definition vtkIndent.h:108
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