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 "vtkImplicitFunction.h"
45 
46 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4
47 
49 {
50 public:
54  static vtkSuperquadric *New();
55 
57  void PrintSelf(ostream& os, vtkIndent indent);
58 
59  // ImplicitFunction interface
60  double EvaluateFunction(double x[3]);
61  double EvaluateFunction(double x, double y, double z)
62  {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
63  void EvaluateGradient(double x[3], double g[3]);
64 
66 
67  vtkSetVector3Macro(Center,double);
68  vtkGetVectorMacro(Center,double,3);
70 
72 
73  vtkSetVector3Macro(Scale,double);
74  vtkGetVectorMacro(Scale,double,3);
76 
78 
80  vtkGetMacro(Thickness,double);
81  vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
83 
85 
87  vtkGetMacro(PhiRoundness,double);
88  void SetPhiRoundness(double e);
90 
92 
94  vtkGetMacro(ThetaRoundness,double);
95  void SetThetaRoundness(double e);
97 
99 
100  vtkSetMacro(Size,double);
101  vtkGetMacro(Size,double);
103 
105 
107  vtkBooleanMacro(Toroidal,int);
108  vtkGetMacro(Toroidal,int);
109  vtkSetMacro(Toroidal,int);
111 
112 protected:
113  vtkSuperquadric();
115 
116  int Toroidal;
117  double Thickness;
118  double Size;
119  double PhiRoundness;
121  double Center[3];
122  double Scale[3];
123 private:
124  vtkSuperquadric(const vtkSuperquadric&); // Not implemented.
125  void operator=(const vtkSuperquadric&); // Not implemented.
126 };
127 
128 #endif
129 
130