VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkSuperquadric.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 =========================================================================*/ 00041 #ifndef vtkSuperquadric_h 00042 #define vtkSuperquadric_h 00043 00044 #include "vtkCommonDataModelModule.h" // For export macro 00045 #include "vtkImplicitFunction.h" 00046 00047 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4 00048 00049 class VTKCOMMONDATAMODEL_EXPORT vtkSuperquadric : public vtkImplicitFunction 00050 { 00051 public: 00055 static vtkSuperquadric *New(); 00056 00057 vtkTypeMacro(vtkSuperquadric,vtkImplicitFunction); 00058 void PrintSelf(ostream& os, vtkIndent indent); 00059 00060 // ImplicitFunction interface 00061 double EvaluateFunction(double x[3]); 00062 double EvaluateFunction(double x, double y, double z) 00063 {return this->vtkImplicitFunction::EvaluateFunction(x, y, z); } ; 00064 void EvaluateGradient(double x[3], double g[3]); 00065 00067 00068 vtkSetVector3Macro(Center,double); 00069 vtkGetVectorMacro(Center,double,3); 00071 00073 00074 vtkSetVector3Macro(Scale,double); 00075 vtkGetVectorMacro(Scale,double,3); 00077 00079 00081 vtkGetMacro(Thickness,double); 00082 vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0); 00084 00086 00088 vtkGetMacro(PhiRoundness,double); 00089 void SetPhiRoundness(double e); 00091 00093 00095 vtkGetMacro(ThetaRoundness,double); 00096 void SetThetaRoundness(double e); 00098 00100 00101 vtkSetMacro(Size,double); 00102 vtkGetMacro(Size,double); 00104 00106 00108 vtkBooleanMacro(Toroidal,int); 00109 vtkGetMacro(Toroidal,int); 00110 vtkSetMacro(Toroidal,int); 00112 00113 protected: 00114 vtkSuperquadric(); 00115 ~vtkSuperquadric() {} 00116 00117 int Toroidal; 00118 double Thickness; 00119 double Size; 00120 double PhiRoundness; 00121 double ThetaRoundness; 00122 double Center[3]; 00123 double Scale[3]; 00124 private: 00125 vtkSuperquadric(const vtkSuperquadric&); // Not implemented. 00126 void operator=(const vtkSuperquadric&); // Not implemented. 00127 }; 00128 00129 #endif 00130 00131