VTK  9.7.20260711
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
61
62#ifndef vtkSuperquadric_h
63#define vtkSuperquadric_h
64
65#include "vtkCommonDataModelModule.h" // For export macro
66#include "vtkImplicitFunction.h"
67
68#define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
69
70VTK_ABI_NAMESPACE_BEGIN
71class VTKCOMMONDATAMODEL_EXPORT vtkSuperquadric : public vtkImplicitFunction
72{
73public:
79
81 void PrintSelf(ostream& os, vtkIndent indent) override;
82
83 // ImplicitFunction interface
85 double EvaluateFunction(double x[3]) override;
86 void EvaluateGradient(double x[3], double g[3]) override;
87
89
92 vtkSetVector3Macro(Center, double);
93 vtkGetVectorMacro(Center, double, 3);
95
97
100 vtkSetVector3Macro(Scale, double);
101 vtkGetVectorMacro(Scale, double, 3);
103
105
109 vtkGetMacro(Thickness, double);
110 vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
112
114
118 vtkGetMacro(PhiRoundness, double);
119 void SetPhiRoundness(double e);
121
123
127 vtkGetMacro(ThetaRoundness, double);
128 void SetThetaRoundness(double e);
130
132
135 vtkSetMacro(Size, double);
136 vtkGetMacro(Size, double);
138
140
143 vtkBooleanMacro(Toroidal, vtkTypeBool);
144 vtkGetMacro(Toroidal, vtkTypeBool);
145 vtkSetMacro(Toroidal, vtkTypeBool);
147
148protected:
150 ~vtkSuperquadric() override = default;
151
153 double Thickness;
154 double Size;
157 double Center[3];
158 double Scale[3];
159
160private:
161 vtkSuperquadric(const vtkSuperquadric&) = delete;
162 void operator=(const vtkSuperquadric&) = delete;
163};
164
165VTK_ABI_NAMESPACE_END
166#endif
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
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