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 00150 00154 vtkSetMacro(OutputPointsPrecision,int); 00155 vtkGetMacro(OutputPointsPrecision,int); 00157 00158 protected: 00159 vtkSuperquadricSource(int res=16); 00160 ~vtkSuperquadricSource() {} 00161 00162 int Toroidal; 00163 int AxisOfSymmetry; 00164 double Thickness; 00165 double Size; 00166 double PhiRoundness; 00167 double ThetaRoundness; 00168 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00169 double Center[3]; 00170 double Scale[3]; 00171 int ThetaResolution; 00172 int PhiResolution; 00173 int OutputPointsPrecision; 00174 00175 private: 00176 vtkSuperquadricSource(const vtkSuperquadricSource&); // Not implemented. 00177 void operator=(const vtkSuperquadricSource&); // Not implemented. 00178 }; 00179 00180 #endif 00181