VTK
|
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 "vtkGeovisCoreModule.h" // For export macro 00040 #include "vtkPolyDataAlgorithm.h" 00041 00042 class vtkPolyData; 00043 00044 class VTKGEOVISCORE_EXPORT vtkGeoGraticule : public vtkPolyDataAlgorithm 00045 { 00046 public: 00047 static vtkGeoGraticule* New(); 00048 virtual void PrintSelf( ostream& os, vtkIndent indent ); 00049 vtkTypeMacro(vtkGeoGraticule,vtkPolyDataAlgorithm); 00050 00052 00053 vtkSetVector2Macro(LatitudeBounds,double); 00054 vtkGetVector2Macro(LatitudeBounds,double); 00056 00058 00059 vtkSetVector2Macro(LongitudeBounds,double); 00060 vtkGetVector2Macro(LongitudeBounds,double); 00062 00063 //BTX 00064 enum LevelLimits { 00065 LEVEL_MIN = 0, 00066 LEVEL_MAX = 11, 00067 NUMBER_OF_LEVELS = ( LEVEL_MAX - LEVEL_MIN + 1 ) 00068 }; 00069 //ETX 00070 00072 00073 vtkSetClampMacro(LatitudeLevel,int,LEVEL_MIN,LEVEL_MAX); 00074 vtkGetMacro(LatitudeLevel,int); 00076 00078 00079 vtkSetClampMacro(LongitudeLevel,int,LEVEL_MIN,LEVEL_MAX); 00080 vtkGetMacro(LongitudeLevel,int); 00082 00084 00085 static double GetLatitudeDelta(int level) 00086 { return LatitudeLevelTics[level]; } 00088 00090 00091 static double GetLongitudeDelta(int level) 00092 { return LongitudeLevelTics[level]; } 00094 00096 00099 vtkSetMacro(GeometryType,int); 00100 vtkGetMacro(GeometryType,int); 00102 00103 //BTX 00104 enum GeometryType { 00105 POLYLINES = 0x1, 00106 QUADRILATERALS = 0x2 00107 }; 00108 //ETX 00109 00110 protected: 00111 vtkGeoGraticule(); 00112 virtual ~vtkGeoGraticule(); 00113 00114 int GeometryType; 00115 double LatitudeBounds[2]; 00116 double LongitudeBounds[2]; 00117 int LatitudeLevel; 00118 int LongitudeLevel; 00119 00121 00122 static double LatitudeLevelTics[NUMBER_OF_LEVELS]; 00123 static double LongitudeLevelTics[NUMBER_OF_LEVELS]; 00125 00126 virtual int RequestData( vtkInformation*, vtkInformationVector**, vtkInformationVector* ); 00127 00128 void GenerateGraticule( vtkPolyData* output, double latbds[2], double lngbds[2] ); 00129 int ComputeLineLevel( int ticId, int baseLevel, const double* levelIncrements ); 00130 00131 private: 00132 vtkGeoGraticule( const vtkGeoGraticule& ); // Not implemented. 00133 void operator = ( const vtkGeoGraticule& ); // Not implemented. 00134 }; 00135 00136 #endif // __vtkGeoGraticule_h