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 #ifndef OSGEARTH_MAP_OPTIONS_H 00020 #define OSGEARTH_MAP_OPTIONS_H 1 00021 00022 #include <osgEarth/Common> 00023 #include <osgEarth/Config> 00024 #include <osgEarth/Caching> 00025 #include <osgEarth/HeightFieldUtils> 00026 #include <osgEarth/HTTPClient> 00027 #include <osgEarth/Profile> 00028 #include <osgEarth/TerrainOptions> 00029 00030 namespace osgEarth 00031 { 00035 class OSGEARTH_EXPORT MapOptions : public ConfigOptions // no export (header-only) 00036 { 00037 public: 00038 enum CoordinateSystemType 00039 { 00040 CSTYPE_GEOCENTRIC, 00041 CSTYPE_GEOCENTRIC_CUBE, 00042 CSTYPE_PROJECTED 00043 }; 00044 00045 public: 00046 MapOptions( const ConfigOptions& options =ConfigOptions() ) 00047 : ConfigOptions( options ), 00048 _cstype( CSTYPE_GEOCENTRIC ), 00049 _referenceURI("") 00050 { 00051 fromConfig(_conf); 00052 } 00053 00057 optional<std::string> name() { return _name; } 00058 const optional<std::string> name() const { return _name; } 00059 00063 optional<CoordinateSystemType>& coordSysType() { return _cstype; } 00064 const optional<CoordinateSystemType>& coordSysType() const { return _cstype; } 00065 00070 optional<ProfileOptions>& profile() { return _profileOptions; } 00071 const optional<ProfileOptions>& profile() const { return _profileOptions; } 00072 00077 optional<CacheOptions>& cache() { return _cacheOptions; } 00078 const optional<CacheOptions>& cache() const { return _cacheOptions; } 00079 00080 public: 00085 optional<std::string>& referenceURI() { return _referenceURI; } 00086 const optional<std::string>& referenceURI() const { return _referenceURI; } 00087 00088 public: 00089 Config getConfig() const; 00090 00091 void mergeConfig( const Config& conf ) { 00092 ConfigOptions::mergeConfig( conf ); 00093 fromConfig( conf ); 00094 } 00095 00096 private: 00097 void fromConfig( const Config& conf ); 00098 00099 optional<std::string> _name; 00100 optional<ProfileOptions> _profileOptions; 00101 optional<CacheOptions> _cacheOptions; 00102 optional<CoordinateSystemType> _cstype; 00103 optional<std::string> _referenceURI; 00104 }; 00105 } 00106 00107 #endif // OSGEARTH_MAP_ENGINE_PROPERTIES_H