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 =========================================================================*/
41 #ifndef vtkSuperquadric_h
42 #define vtkSuperquadric_h
43 
44 #include "vtkCommonDataModelModule.h" // For export macro
45 #include "vtkImplicitFunction.h"
46 
47 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
48 
50 {
51 public:
55  static vtkSuperquadric *New();
56 
58  void PrintSelf(ostream& os, vtkIndent indent);
59 
60  // ImplicitFunction interface
61  double EvaluateFunction(double x[3]);
62  double EvaluateFunction(double x, double y, double z)
63  {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
64  void EvaluateGradient(double x[3], double g[3]);
65 
67 
68  vtkSetVector3Macro(Center,double);
69  vtkGetVectorMacro(Center,double,3);
71 
73 
74  vtkSetVector3Macro(Scale,double);
75  vtkGetVectorMacro(Scale,double,3);
77 
79 
81  vtkGetMacro(Thickness,double);
82  vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
84 
86 
88  vtkGetMacro(PhiRoundness,double);
89  void SetPhiRoundness(double e);
91 
93 
95  vtkGetMacro(ThetaRoundness,double);
96  void SetThetaRoundness(double e);
98 
100 
101  vtkSetMacro(Size,double);
102  vtkGetMacro(Size,double);
104 
106 
108  vtkBooleanMacro(Toroidal,int);
109  vtkGetMacro(Toroidal,int);
110  vtkSetMacro(Toroidal,int);
112 
113 protected:
114  vtkSuperquadric();
116 
117  int Toroidal;
118  double Thickness;
119  double Size;
120  double PhiRoundness;
122  double Center[3];
123  double Scale[3];
124 private:
125  vtkSuperquadric(const vtkSuperquadric&); // Not implemented.
126  void operator=(const vtkSuperquadric&); // Not implemented.
127 };
128 
129 #endif
130 
131 
abstract interface for implicit functions
virtual double EvaluateFunction(double x[3])=0
virtual void EvaluateGradient(double x[3], double g[3])=0
#define VTK_MIN_SUPERQUADRIC_THICKNESS
double EvaluateFunction(double x, double y, double z)
a simple class to control print indentation
Definition: vtkIndent.h:38
void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()
implicit function for a Superquadric
#define VTKCOMMONDATAMODEL_EXPORT