VTK
dox/Geovis/vtkGeoGraticule.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkGeoGraticule.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 =========================================================================*/
00015 /*-------------------------------------------------------------------------
00016   Copyright 2008 Sandia Corporation.
00017   Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00018   the U.S. Government retains certain rights in this software.
00019 -------------------------------------------------------------------------*/
00036 #ifndef __vtkGeoGraticule_h
00037 #define __vtkGeoGraticule_h
00038 
00039 #include "vtkPolyDataAlgorithm.h"
00040 
00041 class vtkPolyData;
00042 
00043 class VTK_GEOVIS_EXPORT vtkGeoGraticule : public vtkPolyDataAlgorithm
00044 {
00045 public:
00046   static vtkGeoGraticule* New();
00047   virtual void PrintSelf( ostream& os, vtkIndent indent );
00048   vtkTypeMacro(vtkGeoGraticule,vtkPolyDataAlgorithm);
00049 
00051 
00052   vtkSetVector2Macro(LatitudeBounds,double);
00053   vtkGetVector2Macro(LatitudeBounds,double);
00055 
00057 
00058   vtkSetVector2Macro(LongitudeBounds,double);
00059   vtkGetVector2Macro(LongitudeBounds,double);
00061 
00062   //BTX
00063   enum LevelLimits {
00064     LEVEL_MIN = 0,
00065     LEVEL_MAX = 11,
00066     NUMBER_OF_LEVELS = ( LEVEL_MAX - LEVEL_MIN + 1 )
00067   };
00068   //ETX
00069 
00071 
00072   vtkSetClampMacro(LatitudeLevel,int,LEVEL_MIN,LEVEL_MAX);
00073   vtkGetMacro(LatitudeLevel,int);
00075 
00077 
00078   vtkSetClampMacro(LongitudeLevel,int,LEVEL_MIN,LEVEL_MAX);
00079   vtkGetMacro(LongitudeLevel,int);
00081 
00083 
00084   static double GetLatitudeDelta(int level)
00085     { return LatitudeLevelTics[level]; }
00087 
00089 
00090   static double GetLongitudeDelta(int level)
00091     { return LongitudeLevelTics[level]; }
00093 
00095 
00098   vtkSetMacro(GeometryType,int);
00099   vtkGetMacro(GeometryType,int);
00101 
00102   //BTX
00103   enum GeometryType {
00104     POLYLINES      = 0x1,
00105     QUADRILATERALS = 0x2
00106   };
00107   //ETX
00108 
00109 protected:
00110   vtkGeoGraticule();
00111   virtual ~vtkGeoGraticule();
00112 
00113   int GeometryType;
00114   double LatitudeBounds[2];
00115   double LongitudeBounds[2];
00116   int LatitudeLevel;
00117   int LongitudeLevel;
00118 
00120 
00121   static double LatitudeLevelTics[NUMBER_OF_LEVELS];
00122   static double LongitudeLevelTics[NUMBER_OF_LEVELS];
00124 
00125   virtual int RequestData( vtkInformation*, vtkInformationVector**, vtkInformationVector* );
00126 
00127   void GenerateGraticule( vtkPolyData* output, double latbds[2], double lngbds[2] );
00128   int ComputeLineLevel( int ticId, int baseLevel, const double* levelIncrements );
00129 
00130 private:
00131   vtkGeoGraticule( const vtkGeoGraticule& ); // Not implemented.
00132   void operator = ( const vtkGeoGraticule& ); // Not implemented.
00133 };
00134 
00135 #endif // __vtkGeoGraticule_h