VTK  9.3.0
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
39 #ifndef vtkSuperquadric_h
40 #define vtkSuperquadric_h
41 
42 #include "vtkCommonDataModelModule.h" // For export macro
43 #include "vtkImplicitFunction.h"
44 
45 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
46 
47 VTK_ABI_NAMESPACE_BEGIN
48 class VTKCOMMONDATAMODEL_EXPORT vtkSuperquadric : public vtkImplicitFunction
49 {
50 public:
55  static vtkSuperquadric* New();
56 
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
60  // ImplicitFunction interface
62  double EvaluateFunction(double x[3]) override;
63  void EvaluateGradient(double x[3], double g[3]) override;
64 
66 
69  vtkSetVector3Macro(Center, double);
70  vtkGetVectorMacro(Center, double, 3);
72 
74 
77  vtkSetVector3Macro(Scale, double);
78  vtkGetVectorMacro(Scale, double, 3);
80 
82 
86  vtkGetMacro(Thickness, double);
87  vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
89 
91 
95  vtkGetMacro(PhiRoundness, double);
96  void SetPhiRoundness(double e);
98 
100 
104  vtkGetMacro(ThetaRoundness, double);
105  void SetThetaRoundness(double e);
107 
109 
112  vtkSetMacro(Size, double);
113  vtkGetMacro(Size, double);
115 
117 
120  vtkBooleanMacro(Toroidal, vtkTypeBool);
121  vtkGetMacro(Toroidal, vtkTypeBool);
122  vtkSetMacro(Toroidal, vtkTypeBool);
124 
125 protected:
127  ~vtkSuperquadric() override = default;
128 
130  double Thickness;
131  double Size;
132  double PhiRoundness;
134  double Center[3];
135  double Scale[3];
136 
137 private:
138  vtkSuperquadric(const vtkSuperquadric&) = delete;
139  void operator=(const vtkSuperquadric&) = delete;
140 };
141 
142 VTK_ABI_NAMESPACE_END
143 #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:38
implicit function for a Superquadric
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.
static vtkSuperquadric * New()
Construct with superquadric radius of 0.5, toroidal off, center at 0.0, scale (1,1,...
~vtkSuperquadric() override=default
void SetThetaRoundness(double e)
Set/Get Superquadric east/west roundness.
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_MIN_SUPERQUADRIC_THICKNESS