osgEarth 2.1.1
|
00001 /* -*-c++-*- */ 00002 /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph 00003 * Copyright 2008-2010 Pelican Mapping 00004 * http://osgearth.org 00005 * 00006 * osgEarth is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public License 00017 * along with this program. If not, see <http://www.gnu.org/licenses/> 00018 */ 00019 00020 #ifndef OSGEARTH_ARCGIS_MAP_SERVICE_H 00021 #define OSGEARTH_ARCGIS_MAP_SERVICE_H 1 00022 00023 #include <osgEarth/Profile> 00024 #include <list> 00025 #include "Extent.h" 00026 00027 using namespace osgEarth; 00028 00029 class MapServiceLayer 00030 { 00031 public: 00032 MapServiceLayer( int id, const std::string& name ); 00033 00034 int getId() const; 00035 00036 const std::string& getName() const; 00037 00038 private: 00039 int id; 00040 std::string name; 00041 }; 00042 00043 typedef std::list<MapServiceLayer> MapServiceLayerList; 00044 00045 00049 class TileInfo 00050 { 00051 public: 00052 TileInfo(); 00053 00054 TileInfo( int tile_size, const std::string& format, int min_level, int max_level, int _num_tiles_wide, int _num_tiles_high ); 00055 00056 TileInfo( const TileInfo& rhs ); 00057 00058 bool isValid() const; 00059 00060 int getTileSize() const; 00061 00062 const std::string& getFormat() const; 00063 00064 int getMinLevel() const; 00065 00066 int getMaxLevel() const; 00067 00068 int getNumTilesWide() const; 00069 00070 int getNumTilesHigh() const; 00071 00072 private: 00073 std::string format; 00074 int tile_size; 00075 int min_level, max_level; 00076 bool is_valid; 00077 int num_tiles_wide; 00078 int num_tiles_high; 00079 }; 00080 00081 00085 class MapService 00086 { 00087 public: 00088 MapService(); 00089 00095 bool init( const std::string& url, const osgDB::ReaderWriter::Options* options =0L ); 00096 00100 bool isValid() const; 00101 00102 bool isTiled() const; 00103 00107 const std::string& getError() const; 00108 00112 const Profile* getProfile() const; 00113 00117 const TileInfo& getTileInfo() const; 00118 00119 private: 00120 bool is_valid; 00121 std::string url; 00122 osg::ref_ptr<const Profile> profile; 00123 std::string error_msg; 00124 MapServiceLayerList layers; 00125 bool tiled; 00126 TileInfo tile_info; 00127 00128 bool setError( const std::string& ); 00129 }; 00130 00131 #endif // OSGEARTH_ARCGIS_MAP_SERVICE_H