VTK  9.2.6
vtkSuperquadric.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSuperquadric.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
51 #ifndef vtkSuperquadric_h
52 #define vtkSuperquadric_h
53 
54 #include "vtkCommonDataModelModule.h" // For export macro
55 #include "vtkImplicitFunction.h"
56 
57 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
58 
59 class VTKCOMMONDATAMODEL_EXPORT vtkSuperquadric : public vtkImplicitFunction
60 {
61 public:
66  static vtkSuperquadric* New();
67 
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
71  // ImplicitFunction interface
73  double EvaluateFunction(double x[3]) override;
74  void EvaluateGradient(double x[3], double g[3]) override;
75 
77 
80  vtkSetVector3Macro(Center, double);
81  vtkGetVectorMacro(Center, double, 3);
83 
85 
88  vtkSetVector3Macro(Scale, double);
89  vtkGetVectorMacro(Scale, double, 3);
91 
93 
97  vtkGetMacro(Thickness, double);
98  vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
100 
102 
106  vtkGetMacro(PhiRoundness, double);
107  void SetPhiRoundness(double e);
109 
111 
115  vtkGetMacro(ThetaRoundness, double);
116  void SetThetaRoundness(double e);
118 
120 
123  vtkSetMacro(Size, double);
124  vtkGetMacro(Size, double);
126 
128 
131  vtkBooleanMacro(Toroidal, vtkTypeBool);
132  vtkGetMacro(Toroidal, vtkTypeBool);
133  vtkSetMacro(Toroidal, vtkTypeBool);
135 
136 protected:
138  ~vtkSuperquadric() override = default;
139 
141  double Thickness;
142  double Size;
143  double PhiRoundness;
145  double Center[3];
146  double Scale[3];
147 
148 private:
149  vtkSuperquadric(const vtkSuperquadric&) = delete;
150  void operator=(const vtkSuperquadric&) = delete;
151 };
152 
153 #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:49
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:69
#define VTK_MIN_SUPERQUADRIC_THICKNESS