VTK  9.3.20240424
vtkSuperquadric.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
59#ifndef vtkSuperquadric_h
60#define vtkSuperquadric_h
61
62#include "vtkCommonDataModelModule.h" // For export macro
63#include "vtkImplicitFunction.h"
64
65#define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
66
67VTK_ABI_NAMESPACE_BEGIN
68class VTKCOMMONDATAMODEL_EXPORT vtkSuperquadric : public vtkImplicitFunction
69{
70public:
76
78 void PrintSelf(ostream& os, vtkIndent indent) override;
79
80 // ImplicitFunction interface
82 double EvaluateFunction(double x[3]) override;
83 void EvaluateGradient(double x[3], double g[3]) override;
84
86
89 vtkSetVector3Macro(Center, double);
90 vtkGetVectorMacro(Center, double, 3);
92
94
97 vtkSetVector3Macro(Scale, double);
98 vtkGetVectorMacro(Scale, double, 3);
100
102
106 vtkGetMacro(Thickness, double);
107 vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
109
111
115 vtkGetMacro(PhiRoundness, double);
116 void SetPhiRoundness(double e);
118
120
124 vtkGetMacro(ThetaRoundness, double);
125 void SetThetaRoundness(double e);
127
129
132 vtkSetMacro(Size, double);
133 vtkGetMacro(Size, double);
135
137
140 vtkBooleanMacro(Toroidal, vtkTypeBool);
141 vtkGetMacro(Toroidal, vtkTypeBool);
142 vtkSetMacro(Toroidal, vtkTypeBool);
144
145protected:
147 ~vtkSuperquadric() override = default;
148
150 double Thickness;
151 double Size;
154 double Center[3];
155 double Scale[3];
156
157private:
158 vtkSuperquadric(const vtkSuperquadric&) = delete;
159 void operator=(const vtkSuperquadric&) = delete;
160};
161
162VTK_ABI_NAMESPACE_END
163#endif
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
a simple class to control print indentation
Definition vtkIndent.h:108
implicit function for a Superquadric
static vtkSuperquadric * New()
Construct with superquadric radius of 0.5, toroidal off, center at 0.0, scale (1,1,...
void EvaluateGradient(double x[3], double g[3]) override
Evaluate function gradient at position x-y-z and pass back vector.
double EvaluateFunction(double x[3]) override
Evaluate function at position x-y-z and return value.
vtkTypeBool Toroidal
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetPhiRoundness(double e)
Set/Get Superquadric north/south roundness.
~vtkSuperquadric() override=default
void SetThetaRoundness(double e)
Set/Get Superquadric east/west roundness.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_MIN_SUPERQUADRIC_THICKNESS