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
30 #ifndef vtkSuperquadric_h
31 #define vtkSuperquadric_h
32 
33 #include "vtkCommonDataModelModule.h" // For export macro
34 #include "vtkImplicitFunction.h"
35 
36 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
37 
38 VTK_ABI_NAMESPACE_BEGIN
39 class VTKCOMMONDATAMODEL_EXPORT vtkSuperquadric : public vtkImplicitFunction
40 {
41 public:
46  static vtkSuperquadric* New();
47 
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
51  // ImplicitFunction interface
53  double EvaluateFunction(double x[3]) override;
54  void EvaluateGradient(double x[3], double g[3]) override;
55 
57 
60  vtkSetVector3Macro(Center, double);
61  vtkGetVectorMacro(Center, double, 3);
63 
65 
68  vtkSetVector3Macro(Scale, double);
69  vtkGetVectorMacro(Scale, double, 3);
71 
73 
77  vtkGetMacro(Thickness, double);
78  vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
80 
82 
86  vtkGetMacro(PhiRoundness, double);
87  void SetPhiRoundness(double e);
89 
91 
95  vtkGetMacro(ThetaRoundness, double);
96  void SetThetaRoundness(double e);
98 
100 
103  vtkSetMacro(Size, double);
104  vtkGetMacro(Size, double);
106 
108 
111  vtkBooleanMacro(Toroidal, vtkTypeBool);
112  vtkGetMacro(Toroidal, vtkTypeBool);
113  vtkSetMacro(Toroidal, vtkTypeBool);
115 
116 protected:
118  ~vtkSuperquadric() override = default;
119 
121  double Thickness;
122  double Size;
123  double PhiRoundness;
125  double Center[3];
126  double Scale[3];
127 
128 private:
129  vtkSuperquadric(const vtkSuperquadric&) = delete;
130  void operator=(const vtkSuperquadric&) = delete;
131 };
132 
133 VTK_ABI_NAMESPACE_END
134 #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:29
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