VTK  9.5.20250904
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
144#ifndef vtkSuperquadricSource_h
145#define vtkSuperquadricSource_h
146
147#include "vtkFiltersSourcesModule.h" // For export macro
148#include "vtkPolyDataAlgorithm.h"
149#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
150
151#define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
152#define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
153#define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24
154
155VTK_ABI_NAMESPACE_BEGIN
156class VTKFILTERSSOURCES_EXPORT VTK_MARSHALAUTO vtkSuperquadricSource : public vtkPolyDataAlgorithm
157{
158public:
165
167 void PrintSelf(ostream& os, vtkIndent indent) override;
168
170
173 vtkSetVector3Macro(Center, double);
174 vtkGetVectorMacro(Center, double, 3);
176
178
181 vtkSetVector3Macro(Scale, double);
182 vtkGetVectorMacro(Scale, double, 3);
184
186
189 vtkGetMacro(ThetaResolution, int);
192
194
197 vtkGetMacro(PhiResolution, int);
198 void SetPhiResolution(int i);
200
202
207 vtkGetMacro(Thickness, double);
208 vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
210
212
217 vtkGetMacro(PhiRoundness, double);
218 void SetPhiRoundness(double e);
220
222
227 vtkGetMacro(ThetaRoundness, double);
228 void SetThetaRoundness(double e);
230
232
235 vtkSetMacro(Size, double);
236 vtkGetMacro(Size, double);
238
240
244 vtkSetMacro(AxisOfSymmetry, int);
245 vtkGetMacro(AxisOfSymmetry, int);
246 void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); }
247 void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); }
248 void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); }
250
252
256 vtkBooleanMacro(Toroidal, vtkTypeBool);
257 vtkGetMacro(Toroidal, vtkTypeBool);
258 vtkSetMacro(Toroidal, vtkTypeBool);
260
262
267 vtkSetMacro(OutputPointsPrecision, int);
268 vtkGetMacro(OutputPointsPrecision, int);
270
271protected:
273 ~vtkSuperquadricSource() override = default;
274
277 double Thickness;
278 double Size;
283 double Center[3];
284 double Scale[3];
288
289private:
291 void operator=(const vtkSuperquadricSource&) = delete;
292};
293
294VTK_ABI_NAMESPACE_END
295#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
#define VTK_MARSHALAUTO