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) VTK_OVERRIDE;
61 
62  // ImplicitFunction interface
63  double EvaluateFunction(double x[3]) VTK_OVERRIDE;
64  double EvaluateFunction(double x, double y, double z)
65  {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
66  void EvaluateGradient(double x[3], double g[3]) VTK_OVERRIDE;
67 
69 
72  vtkSetVector3Macro(Center,double);
73  vtkGetVectorMacro(Center,double,3);
75 
77 
80  vtkSetVector3Macro(Scale,double);
81  vtkGetVectorMacro(Scale,double,3);
83 
85 
89  vtkGetMacro(Thickness,double);
90  vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
92 
94 
98  vtkGetMacro(PhiRoundness,double);
99  void SetPhiRoundness(double e);
101 
103 
107  vtkGetMacro(ThetaRoundness,double);
108  void SetThetaRoundness(double e);
110 
112 
115  vtkSetMacro(Size,double);
116  vtkGetMacro(Size,double);
118 
120 
123  vtkBooleanMacro(Toroidal,int);
124  vtkGetMacro(Toroidal,int);
125  vtkSetMacro(Toroidal,int);
127 
128 protected:
130  ~vtkSuperquadric() VTK_OVERRIDE {}
131 
132  int Toroidal;
133  double Thickness;
134  double Size;
135  double PhiRoundness;
137  double Center[3];
138  double Scale[3];
139 private:
140  vtkSuperquadric(const vtkSuperquadric&) VTK_DELETE_FUNCTION;
141  void operator=(const vtkSuperquadric&) VTK_DELETE_FUNCTION;
142 };
143 
144 #endif
145 
146 
vtkSuperquadric::Toroidal
int Toroidal
Definition: vtkSuperquadric.h:132
VTK_MIN_SUPERQUADRIC_THICKNESS
#define VTK_MIN_SUPERQUADRIC_THICKNESS
Definition: vtkSuperquadric.h:48
vtkSuperquadric::Thickness
double Thickness
Definition: vtkSuperquadric.h:133
vtkSuperquadric::Size
double Size
Definition: vtkSuperquadric.h:134
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:136
vtkSuperquadric::~vtkSuperquadric
~vtkSuperquadric() override
Definition: vtkSuperquadric.h:130
vtkSuperquadric::vtkSuperquadric
vtkSuperquadric()
vtkImplicitFunction
abstract interface for implicit functions
Definition: vtkImplicitFunction.h:59
vtkSuperquadric::New
static vtkSuperquadric * New()
Construct with superquadric radius of 0.5, toroidal off, center at 0.0, scale (1,1,...
vtkSuperquadric::PhiRoundness
double PhiRoundness
Definition: vtkSuperquadric.h:135
vtkSuperquadric::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkSuperquadric::EvaluateFunction
double EvaluateFunction(double x, double y, double z)
Definition: vtkSuperquadric.h:64
vtkSuperquadric::EvaluateGradient
void EvaluateGradient(double x[3], double g[3]) override
Evaluate function gradient at position x-y-z and pass back vector.
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkImplicitFunction.h
vtkSuperquadric
implicit function for a Superquadric
Definition: vtkSuperquadric.h:51
vtkSuperquadric::EvaluateFunction
double EvaluateFunction(double x[3]) override
Evaluate function at position x-y-z and return value.
vtkSuperquadric::SetThetaRoundness
void SetThetaRoundness(double e)
vtkSuperquadric::SetPhiRoundness
void SetPhiRoundness(double e)