00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00033 #ifndef __vtkGlobeSource_h
00034 #define __vtkGlobeSource_h
00035 
00036 #include "vtkPolyDataAlgorithm.h"
00037 
00038 class vtkCellArray;
00039 class vtkFloatArray;
00040 
00041 
00042 class VTK_GEOVIS_EXPORT vtkGlobeSource : public vtkPolyDataAlgorithm 
00043 {
00044 public:
00045   vtkTypeRevisionMacro(vtkGlobeSource,vtkPolyDataAlgorithm);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00048 
00049   
00050   
00051   
00052   vtkSetVector3Macro(Origin, double);
00053 
00055 
00056   vtkSetClampMacro(StartLongitude,double,-180.0,180.0);
00057   vtkSetClampMacro(EndLongitude,double,-180.0,180.0);
00058   vtkSetClampMacro(StartLatitude,double,-90.0,90.0);
00059   vtkSetClampMacro(EndLatitude,double,-90.0,90.0);
00061 
00063 
00065   vtkSetClampMacro(LongitudeResolution,int,3,100);
00066   vtkGetMacro(LongitudeResolution,int);
00068 
00070 
00072   vtkSetClampMacro(LatitudeResolution,int,3,100);
00073   vtkGetMacro(LatitudeResolution,int);
00075 
00077 
00078   vtkSetClampMacro(Radius,double,0.0,VTK_DOUBLE_MAX);
00079   vtkGetMacro(Radius,double);
00081 
00082   vtkSetClampMacro(CurtainHeight,double,0.0,VTK_DOUBLE_MAX);
00083   vtkGetMacro(CurtainHeight,double);
00084 
00086 
00092   vtkSetMacro(QuadrilateralTessellation,int);
00093   vtkGetMacro(QuadrilateralTessellation,int);
00094   vtkBooleanMacro(QuadrilateralTessellation,int);
00096 
00100   static vtkGlobeSource *New();
00101 
00103 
00105   static void ComputeGlobePoint(
00106     double theta, double phi, double radius, double* point, double* normal = 0);
00108 
00110 
00112   static void ComputeLatitudeLongitude(
00113     double* x, double& theta, double& phi);
00115   
00116 protected:
00117   vtkGlobeSource();
00118   ~vtkGlobeSource() {}
00119 
00120   int RequestData(
00121     vtkInformation *, 
00122     vtkInformationVector **, 
00123     vtkInformationVector *);
00124   int RequestInformation(
00125     vtkInformation *, 
00126     vtkInformationVector **, 
00127     vtkInformationVector *);
00128 
00129   void AddPoint(
00130     double theta, double phi, double radius,
00131     vtkPoints* newPoints, vtkFloatArray* newNormals,
00132     vtkFloatArray* newLongitudeArray, vtkFloatArray* newLatitudeArray,
00133     vtkDoubleArray* newLatLongArray);
00134 
00135 
00136   double Origin[3];
00137   double Radius;
00138   double CurtainHeight;
00139   int LongitudeResolution;
00140   int LatitudeResolution;
00141   double StartLongitude;
00142   double EndLongitude;
00143   double StartLatitude;
00144   double EndLatitude;
00145   int QuadrilateralTessellation;
00146 
00147 private:
00148   vtkGlobeSource(const vtkGlobeSource&);  
00149   void operator=(const vtkGlobeSource&);  
00150 };
00151 
00152 #endif