VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSuperquadricSource.h 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 =========================================================================*/ 00056 #ifndef __vtkSuperquadricSource_h 00057 #define __vtkSuperquadricSource_h 00058 00059 #include "vtkFiltersSourcesModule.h" // For export macro 00060 #include "vtkPolyDataAlgorithm.h" 00061 00062 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024 00063 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4 00064 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24 00065 00066 class VTKFILTERSSOURCES_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm 00067 { 00068 public: 00072 static vtkSuperquadricSource *New(); 00073 00074 vtkTypeMacro(vtkSuperquadricSource,vtkPolyDataAlgorithm); 00075 void PrintSelf(ostream& os, vtkIndent indent); 00076 00078 00079 vtkSetVector3Macro(Center,double); 00080 vtkGetVectorMacro(Center,double,3); 00082 00084 00085 vtkSetVector3Macro(Scale,double); 00086 vtkGetVectorMacro(Scale,double,3); 00088 00090 00092 vtkGetMacro(ThetaResolution,int); 00093 void SetThetaResolution(int i); 00095 00097 00099 vtkGetMacro(PhiResolution,int); 00100 void SetPhiResolution(int i); 00102 00104 00107 vtkGetMacro(Thickness,double); 00108 vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0); 00110 00112 00114 vtkGetMacro(PhiRoundness,double); 00115 void SetPhiRoundness(double e); 00117 00119 00121 vtkGetMacro(ThetaRoundness,double); 00122 void SetThetaRoundness(double e); 00124 00126 00127 vtkSetMacro(Size,double); 00128 vtkGetMacro(Size,double); 00130 00132 00134 vtkSetMacro(AxisOfSymmetry,int); 00135 vtkGetMacro(AxisOfSymmetry,int); 00136 void SetXAxisOfSymmetry() { this->SetAxisOfSymmetry(0); } 00137 void SetYAxisOfSymmetry() { this->SetAxisOfSymmetry(1); } 00138 void SetZAxisOfSymmetry() { this->SetAxisOfSymmetry(2); } 00140 00142 00144 vtkBooleanMacro(Toroidal,int); 00145 vtkGetMacro(Toroidal,int); 00146 vtkSetMacro(Toroidal,int); 00148 00149 protected: 00150 vtkSuperquadricSource(int res=16); 00151 ~vtkSuperquadricSource() {}; 00152 00153 int Toroidal; 00154 int AxisOfSymmetry; 00155 double Thickness; 00156 double Size; 00157 double PhiRoundness; 00158 double ThetaRoundness; 00159 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00160 double Center[3]; 00161 double Scale[3]; 00162 int ThetaResolution; 00163 int PhiResolution; 00164 00165 private: 00166 vtkSuperquadricSource(const vtkSuperquadricSource&); // Not implemented. 00167 void operator=(const vtkSuperquadricSource&); // Not implemented. 00168 }; 00169 00170 #endif 00171