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

Graphics/vtkSuperquadricSource.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkSuperquadricSource.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 =========================================================================*/
00059 #ifndef __vtkSuperquadricSource_h
00060 #define __vtkSuperquadricSource_h
00061 
00062 #include "vtkPolyDataSource.h"
00063 
00064 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
00065 #define VTK_MIN_SUPERQUADRIC_THICKNESS  1e-4
00066 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS  1e-24
00067 
00068 class VTK_GRAPHICS_EXPORT vtkSuperquadricSource : public vtkPolyDataSource 
00069 {
00070 public:
00073   static vtkSuperquadricSource *New();
00074 
00075   vtkTypeRevisionMacro(vtkSuperquadricSource,vtkPolyDataSource);
00076   void PrintSelf(ostream& os, vtkIndent indent);
00077 
00079 
00080   vtkSetVector3Macro(Center,float);
00081   vtkGetVectorMacro(Center,float,3);
00083 
00085 
00086   vtkSetVector3Macro(Scale,float);
00087   vtkGetVectorMacro(Scale,float,3);
00089 
00091 
00092   vtkGetMacro(ThetaResolution,int);
00093   void SetThetaResolution(int i);
00095 
00097 
00098   vtkGetMacro(PhiResolution,int);
00099   void SetPhiResolution(int i);
00101 
00103 
00105   vtkGetMacro(Thickness,float);
00106   vtkSetClampMacro(Thickness,float,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
00108 
00110 
00112   vtkGetMacro(PhiRoundness,float);
00113   void SetPhiRoundness(float e); 
00115 
00117 
00119   vtkGetMacro(ThetaRoundness,float);
00120   void SetThetaRoundness(float e);
00122 
00124 
00125   vtkSetMacro(Size,float);
00126   vtkGetMacro(Size,float);
00128 
00130 
00132   vtkBooleanMacro(Toroidal,int);
00133   vtkGetMacro(Toroidal,int);
00134   vtkSetMacro(Toroidal,int);
00136 
00137 protected:
00138   vtkSuperquadricSource(int res=16);
00139   ~vtkSuperquadricSource() {};
00140 
00141   int Toroidal;
00142   float Thickness;
00143   float Size;
00144   float PhiRoundness;
00145   float ThetaRoundness;
00146   void Execute();
00147   float Center[3];
00148   float Scale[3];
00149   int ThetaResolution;
00150   int PhiResolution;
00151 
00152 private:
00153   vtkSuperquadricSource(const vtkSuperquadricSource&);  // Not implemented.
00154   void operator=(const vtkSuperquadricSource&);  // Not implemented.
00155 };
00156 
00157 #endif
00158 
00159