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 =========================================================================*/
00070 #ifndef __vtkSuperquadricSource_h
00071 #define __vtkSuperquadricSource_h
00072 
00073 #include "vtkPolyDataSource.h"
00074 
00075 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024
00076 #define VTK_MIN_SUPERQUADRIC_THICKNESS  1e-4
00077 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS  1e-24
00078 
00079 class VTK_GRAPHICS_EXPORT vtkSuperquadricSource : public vtkPolyDataSource 
00080 {
00081 public:
00084   static vtkSuperquadricSource *New();
00085 
00086   vtkTypeRevisionMacro(vtkSuperquadricSource,vtkPolyDataSource);
00087   void PrintSelf(ostream& os, vtkIndent indent);
00088 
00090 
00091   vtkSetVector3Macro(Center,float);
00092   vtkGetVectorMacro(Center,float,3);
00094 
00096 
00097   vtkSetVector3Macro(Scale,float);
00098   vtkGetVectorMacro(Scale,float,3);
00100 
00102 
00103   vtkGetMacro(ThetaResolution,int);
00104   void SetThetaResolution(int i);
00106 
00108 
00109   vtkGetMacro(PhiResolution,int);
00110   void SetPhiResolution(int i);
00112 
00114 
00116   vtkGetMacro(Thickness,float);
00117   vtkSetClampMacro(Thickness,float,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0);
00119 
00121 
00123   vtkGetMacro(PhiRoundness,float);
00124   void SetPhiRoundness(float e); 
00126 
00128 
00130   vtkGetMacro(ThetaRoundness,float);
00131   void SetThetaRoundness(float e);
00133 
00135 
00136   vtkSetMacro(Size,float);
00137   vtkGetMacro(Size,float);
00139 
00141 
00143   vtkBooleanMacro(Toroidal,int);
00144   vtkGetMacro(Toroidal,int);
00145   vtkSetMacro(Toroidal,int);
00147 
00148 protected:
00149   vtkSuperquadricSource(int res=16);
00150   ~vtkSuperquadricSource() {};
00151 
00152   int Toroidal;
00153   float Thickness;
00154   float Size;
00155   float PhiRoundness;
00156   float ThetaRoundness;
00157   void Execute();
00158   float Center[3];
00159   float Scale[3];
00160   int ThetaResolution;
00161   int PhiResolution;
00162 
00163 private:
00164   vtkSuperquadricSource(const vtkSuperquadricSource&);  // Not implemented.
00165   void operator=(const vtkSuperquadricSource&);  // Not implemented.
00166 };
00167 
00168 #endif
00169 
00170