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 =========================================================================*/ 00055 #ifndef __vtkSuperquadricSource_h 00056 #define __vtkSuperquadricSource_h 00057 00058 #include "vtkPolyDataAlgorithm.h" 00059 00060 #define VTK_MAX_SUPERQUADRIC_RESOLUTION 1024 00061 #define VTK_MIN_SUPERQUADRIC_THICKNESS 1e-4 00062 #define VTK_MIN_SUPERQUADRIC_ROUNDNESS 1e-24 00063 00064 class VTK_GRAPHICS_EXPORT vtkSuperquadricSource : public vtkPolyDataAlgorithm 00065 { 00066 public: 00070 static vtkSuperquadricSource *New(); 00071 00072 vtkTypeMacro(vtkSuperquadricSource,vtkPolyDataAlgorithm); 00073 void PrintSelf(ostream& os, vtkIndent indent); 00074 00076 00077 vtkSetVector3Macro(Center,double); 00078 vtkGetVectorMacro(Center,double,3); 00080 00082 00083 vtkSetVector3Macro(Scale,double); 00084 vtkGetVectorMacro(Scale,double,3); 00086 00088 00090 vtkGetMacro(ThetaResolution,int); 00091 void SetThetaResolution(int i); 00093 00095 00097 vtkGetMacro(PhiResolution,int); 00098 void SetPhiResolution(int i); 00100 00102 00105 vtkGetMacro(Thickness,double); 00106 vtkSetClampMacro(Thickness,double,VTK_MIN_SUPERQUADRIC_THICKNESS,1.0); 00108 00110 00112 vtkGetMacro(PhiRoundness,double); 00113 void SetPhiRoundness(double e); 00115 00117 00119 vtkGetMacro(ThetaRoundness,double); 00120 void SetThetaRoundness(double e); 00122 00124 00125 vtkSetMacro(Size,double); 00126 vtkGetMacro(Size,double); 00128 00130 00132 vtkBooleanMacro(Toroidal,int); 00133 vtkGetMacro(Toroidal,int); 00134 vtkSetMacro(Toroidal,int); 00136 00137 protected: 00138 vtkSuperquadricSource(int res=16); 00139 ~vtkSuperquadricSource() {}; 00140 00141 int Toroidal; 00142 int AxisOfSymmetry; 00143 double Thickness; 00144 double Size; 00145 double PhiRoundness; 00146 double ThetaRoundness; 00147 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00148 double Center[3]; 00149 double Scale[3]; 00150 int ThetaResolution; 00151 int PhiResolution; 00152 00153 private: 00154 vtkSuperquadricSource(const vtkSuperquadricSource&); // Not implemented. 00155 void operator=(const vtkSuperquadricSource&); // Not implemented. 00156 }; 00157 00158 #endif 00159