VTK
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 {}
130 
132  double Thickness;
133  double Size;
134  double PhiRoundness;
136  double Center[3];
137  double Scale[3];
138 private:
139  vtkSuperquadric(const vtkSuperquadric&) = delete;
140  void operator=(const vtkSuperquadric&) = delete;
141 };
142 
143 #endif
144 
145 
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
Evaluate function at position x-y-z and return value.
virtual void EvaluateGradient(double x[3], double g[3])=0
Evaluate function gradient at position x-y-z and pass back vector.
#define VTK_MIN_SUPERQUADRIC_THICKNESS
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:39
~vtkSuperquadric() override
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
implicit function for a Superquadric
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool Toroidal