Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Filtering/vtkSuperquadric.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSuperquadric.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00057 #ifndef __vtkSuperquadric_h
00058 #define __vtkSuperquadric_h
00059 
00060 #include "vtkImplicitFunction.h"
00061 
00062 #define VTK_MIN_SUPERQUADRIC_THICKNESS  1e-4
00063 
00064 class VTK_FILTERING_EXPORT vtkSuperquadric : public vtkImplicitFunction
00065 {
00066 public:
00070   static vtkSuperquadric *New();
00071 
00072   vtkTypeRevisionMacro(vtkSuperquadric,vtkImplicitFunction);
00073   void PrintSelf(ostream& os, vtkIndent indent);
00074 
00075   // ImplicitFunction interface
00076   float EvaluateFunction(float x[3]);
00077   float EvaluateFunction(float x, float y, float z)
00078     {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ;
00079   void EvaluateGradient(float x[3], float g[3]);
00080 
00082 
00083   vtkSetVector3Macro(Center,float);
00084   vtkGetVectorMacro(Center,float,3);
00086 
00088 
00089   vtkSetVector3Macro(Scale,float);
00090   vtkGetVectorMacro(Scale,float,3);
00092 
00094 
00096   vtkGetMacro(Thickness,float);
00097   vtkSetClampMacro(Thickness,float,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0f);
00099 
00101 
00103   vtkGetMacro(PhiRoundness,float);
00104   void SetPhiRoundness(float e); 
00106 
00108 
00110   vtkGetMacro(ThetaRoundness,float);
00111   void SetThetaRoundness(float e);
00113 
00115 
00116   vtkSetMacro(Size,float);
00117   vtkGetMacro(Size,float);
00119 
00121 
00123   vtkBooleanMacro(Toroidal,int);
00124   vtkGetMacro(Toroidal,int);
00125   vtkSetMacro(Toroidal,int);
00127 
00128 protected:
00129   vtkSuperquadric();
00130   ~vtkSuperquadric() {};
00131 
00132   int Toroidal;
00133   float Thickness;
00134   float Size;
00135   float PhiRoundness;
00136   float ThetaRoundness;
00137   float Center[3];
00138   float Scale[3];
00139 private:
00140   vtkSuperquadric(const vtkSuperquadric&);  // Not implemented.
00141   void operator=(const vtkSuperquadric&);  // Not implemented.
00142 };
00143 
00144 #endif
00145 
00146