VTK  9.0.20200921
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 =========================================================================*/
42 #ifndef vtkSuperquadric_h
43 #define vtkSuperquadric_h
44 
45 #include "vtkCommonDataModelModule.h" // For export macro
46 #include "vtkImplicitFunction.h"
47 
48 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
49 
50 class VTKCOMMONDATAMODEL_EXPORT vtkSuperquadric : public vtkImplicitFunction
51 {
52 public:
57  static vtkSuperquadric* New();
58 
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
62  // ImplicitFunction interface
64  double EvaluateFunction(double x[3]) override;
65  void EvaluateGradient(double x[3], double g[3]) override;
66 
68 
71  vtkSetVector3Macro(Center, double);
72  vtkGetVectorMacro(Center, double, 3);
74 
76 
79  vtkSetVector3Macro(Scale, double);
80  vtkGetVectorMacro(Scale, double, 3);
82 
84 
88  vtkGetMacro(Thickness, double);
89  vtkSetClampMacro(Thickness, double, VTK_MIN_SUPERQUADRIC_THICKNESS, 1.0);
91 
93 
97  vtkGetMacro(PhiRoundness, double);
98  void SetPhiRoundness(double e);
100 
102 
106  vtkGetMacro(ThetaRoundness, double);
107  void SetThetaRoundness(double e);
109 
111 
114  vtkSetMacro(Size, double);
115  vtkGetMacro(Size, double);
117 
119 
122  vtkBooleanMacro(Toroidal, vtkTypeBool);
123  vtkGetMacro(Toroidal, vtkTypeBool);
124  vtkSetMacro(Toroidal, vtkTypeBool);
126 
127 protected:
128  vtkSuperquadric();
129  ~vtkSuperquadric() override = default;
130 
132  double Thickness;
133  double Size;
134  double PhiRoundness;
136  double Center[3];
137  double Scale[3];
138 
139 private:
140  vtkSuperquadric(const vtkSuperquadric&) = delete;
141  void operator=(const vtkSuperquadric&) = delete;
142 };
143 
144 #endif
VTK_MIN_SUPERQUADRIC_THICKNESS
#define VTK_MIN_SUPERQUADRIC_THICKNESS
Definition: vtkSuperquadric.h:48
vtkSuperquadric::Thickness
double Thickness
Definition: vtkSuperquadric.h:132
vtkSuperquadric::Size
double Size
Definition: vtkSuperquadric.h:133
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkImplicitFunction::EvaluateFunction
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
vtkSuperquadric::ThetaRoundness
double ThetaRoundness
Definition: vtkSuperquadric.h:135
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:60
vtkSuperquadric::Toroidal
vtkTypeBool Toroidal
Definition: vtkSuperquadric.h:131
vtkSuperquadric::PhiRoundness
double PhiRoundness
Definition: vtkSuperquadric.h:134
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkImplicitFunction::EvaluateGradient
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
vtkImplicitFunction.h
vtkSuperquadric
implicit function for a Superquadric
Definition: vtkSuperquadric.h:50
vtkImplicitFunction::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69