VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkSuperquadricSource.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00052 #ifndef __vtkSuperquadricSource_h 00053 #define __vtkSuperquadricSource_h 00054 00055 #include "vtkPolyDataAlgorithm.h" 00056 00057 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024 00058 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4 00059 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24 00060 00061 class VTK_GRAPHICS_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm 00062 { 00063 public: 00067 static vtkSuperquadricSource *New(); 00068 00069 vtkTypeRevisionMacro(vtkSuperquadricSource,vtkPolyDataAlgorithm); 00070 void PrintSelf(ostream& os, vtkIndent indent); 00071 00073 00074 vtkSetVector3Macro(Center,double); 00075 vtkGetVectorMacro(Center,double,3); 00077 00079 00080 vtkSetVector3Macro(Scale,double); 00081 vtkGetVectorMacro(Scale,double,3); 00083 00085 00087 vtkGetMacro(ThetaResolution,int); 00088 void SetThetaResolution(int i); 00090 00092 00094 vtkGetMacro(PhiResolution,int); 00095 void SetPhiResolution(int i); 00097 00099 00102 vtkGetMacro(Thickness,double); 00103 vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0); 00105 00107 00109 vtkGetMacro(PhiRoundness,double); 00110 void SetPhiRoundness(double e); 00112 00114 00116 vtkGetMacro(ThetaRoundness,double); 00117 void SetThetaRoundness(double e); 00119 00121 00122 vtkSetMacro(Size,double); 00123 vtkGetMacro(Size,double); 00125 00127 00129 vtkBooleanMacro(Toroidal,int); 00130 vtkGetMacro(Toroidal,int); 00131 vtkSetMacro(Toroidal,int); 00133 00134 protected: 00135 vtkSuperquadricSource(int res=16); 00136 ~vtkSuperquadricSource() {}; 00137 00138 int Toroidal; 00139 int AxisOfSymmetry; 00140 double Thickness; 00141 double Size; 00142 double PhiRoundness; 00143 double ThetaRoundness; 00144 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00145 double Center[3]; 00146 double Scale[3]; 00147 int ThetaResolution; 00148 int PhiResolution; 00149 00150 private: 00151 vtkSuperquadricSource(const vtkSuperquadricSource&); // Not implemented. 00152 void operator=(const vtkSuperquadricSource&); // Not implemented. 00153 }; 00154 00155 #endif 00156