osgEarth 2.1.1
|
Initialization (and serializable) options for a terrain layer.
Definition at line 36 of file TerrainLayer.
TerrainLayerOptions::TerrainLayerOptions | ( | const ConfigOptions & | options = ConfigOptions() | ) |
Definition at line 35 of file TerrainLayer.cpp.
: ConfigOptions( options ), _minLevel( 0 ), _maxLevel( 99 ), _cacheEnabled( true ), _cacheOnly( false ), _loadingWeight( 1.0f ), _exactCropping( false ), _enabled( true ), _reprojectedTileSize( 256 ) { setDefaults(); fromConfig( _conf ); }
TerrainLayerOptions::TerrainLayerOptions | ( | const std::string & | name, |
const TileSourceOptions & | driverOptions | ||
) |
Definition at line 51 of file TerrainLayer.cpp.
: ConfigOptions() { setDefaults(); fromConfig( _conf ); _name = name; _driver = driverOptions; }
optional<bool>& osgEarth::TerrainLayerOptions::cacheEnabled | ( | ) | [inline] |
Whether to cache this layer or not.
Definition at line 122 of file TerrainLayer.
{ return _cacheEnabled; }
const optional<bool>& osgEarth::TerrainLayerOptions::cacheEnabled | ( | ) | const [inline] |
Definition at line 123 of file TerrainLayer.
{ return _cacheEnabled; }
optional<std::string>& osgEarth::TerrainLayerOptions::cacheFormat | ( | ) | [inline] |
The format that this MapLayer should use when caching.
Definition at line 116 of file TerrainLayer.
{ return _cacheFormat; }
const optional<std::string>& osgEarth::TerrainLayerOptions::cacheFormat | ( | ) | const [inline] |
Definition at line 117 of file TerrainLayer.
{ return _cacheFormat; }
optional<std::string>& osgEarth::TerrainLayerOptions::cacheId | ( | ) | [inline] |
Explicit cache ID to uniquely identify the cache that matched this layer's tile source properties. This is usually automatically generated but you can override it here.
Definition at line 136 of file TerrainLayer.
{ return _cacheId; }
const optional<std::string>& osgEarth::TerrainLayerOptions::cacheId | ( | ) | const [inline] |
Definition at line 137 of file TerrainLayer.
{ return _cacheId; }
optional<bool>& osgEarth::TerrainLayerOptions::cacheOnly | ( | ) | [inline] |
Whether to try to run this MapLayer strictly from the cache only.
Definition at line 128 of file TerrainLayer.
{ return _cacheOnly; }
const optional<bool>& osgEarth::TerrainLayerOptions::cacheOnly | ( | ) | const [inline] |
Definition at line 129 of file TerrainLayer.
{ return _cacheOnly; }
optional<TileSourceOptions>& osgEarth::TerrainLayerOptions::driver | ( | ) | [inline] |
Options for the underlyint tile source driver.
Definition at line 59 of file TerrainLayer.
{ return _driver; }
const optional<TileSourceOptions>& osgEarth::TerrainLayerOptions::driver | ( | ) | const [inline] |
Definition at line 60 of file TerrainLayer.
{ return _driver; }
optional<double>& osgEarth::TerrainLayerOptions::edgeBufferRatio | ( | ) | [inline] |
The ratio used to expand the extent of a tile when the layer needs to be mosaiced to projected. This can be used to increase the number of tiles grabbed to ensure that enough data is grabbed to overlap the incoming tile.
Definition at line 151 of file TerrainLayer.
{ return _edgeBufferRatio;}
const optional<double>& osgEarth::TerrainLayerOptions::edgeBufferRatio | ( | ) | const [inline] |
Definition at line 152 of file TerrainLayer.
{ return _edgeBufferRatio; }
const optional<bool>& osgEarth::TerrainLayerOptions::enabled | ( | ) | const [inline] |
Definition at line 99 of file TerrainLayer.
{ return _enabled; }
optional<bool>& osgEarth::TerrainLayerOptions::enabled | ( | ) | [inline] |
Whether to render this layer with the map.
Definition at line 98 of file TerrainLayer.
{ return _enabled; }
optional<bool>& osgEarth::TerrainLayerOptions::exactCropping | ( | ) | [inline] |
Whether to use exact cropping if image cropping is necessary
Definition at line 104 of file TerrainLayer.
{ return _exactCropping; }
const optional<bool>& osgEarth::TerrainLayerOptions::exactCropping | ( | ) | const [inline] |
Definition at line 105 of file TerrainLayer.
{ return _exactCropping; }
void TerrainLayerOptions::fromConfig | ( | const Config & | conf | ) | [private] |
Reimplemented in osgEarth::ElevationLayerOptions, and osgEarth::ImageLayerOptions.
Definition at line 101 of file TerrainLayer.cpp.
{ _name = conf.value("name"); conf.getIfSet( "cacheid", _cacheId ); conf.getIfSet( "min_level", _minLevel ); conf.getIfSet( "max_level", _maxLevel ); conf.getIfSet( "min_level_resolution", _minLevelResolution ); conf.getIfSet( "max_level_resolution", _maxLevelResolution ); conf.getIfSet( "cache_enabled", _cacheEnabled ); conf.getIfSet( "cache_only", _cacheOnly ); conf.getIfSet( "cache_format", _cacheFormat ); conf.getIfSet( "loading_weight", _loadingWeight ); conf.getIfSet( "enabled", _enabled ); conf.getIfSet( "edge_buffer_ratio", _edgeBufferRatio); conf.getObjIfSet( "profile", _profile ); conf.getIfSet( "max_data_level", _maxDataLevel); conf.getIfSet( "reprojected_tilesize", _reprojectedTileSize); if ( conf.hasValue("driver") ) driver() = TileSourceOptions(conf); }
Config TerrainLayerOptions::getConfig | ( | ) | const [virtual] |
Reimplemented from osgEarth::ConfigOptions.
Reimplemented in osgEarth::ElevationLayerOptions, and osgEarth::ImageLayerOptions.
Definition at line 74 of file TerrainLayer.cpp.
{ Config conf = ConfigOptions::getConfig(); conf.attr("name") = _name; conf.updateIfSet( "cacheid", _cacheId ); conf.updateIfSet( "min_level", _minLevel ); conf.updateIfSet( "max_level", _maxLevel ); conf.updateIfSet( "min_level_resolution", _minLevelResolution ); conf.updateIfSet( "max_level_resolution", _maxLevelResolution ); conf.updateIfSet( "cache_enabled", _cacheEnabled ); conf.updateIfSet( "cache_only", _cacheOnly ); conf.updateIfSet( "cache_format", _cacheFormat ); conf.updateIfSet( "loading_weight", _loadingWeight ); conf.updateIfSet( "enabled", _enabled ); conf.updateIfSet( "edge_buffer_ratio", _edgeBufferRatio); conf.updateObjIfSet( "profile", _profile ); conf.updateIfSet( "max_data_level", _maxDataLevel); conf.updateIfSet( "reprojected_tilesize", _reprojectedTileSize); //Merge the TileSource options if (driver().isSet()) conf.merge( driver()->getConfig() ); return conf; }
const optional<float>& osgEarth::TerrainLayerOptions::loadingWeight | ( | ) | const [inline] |
Definition at line 143 of file TerrainLayer.
{ return _loadingWeight; }
optional<float>& osgEarth::TerrainLayerOptions::loadingWeight | ( | ) | [inline] |
The loading weight of this MapLayer (for threaded loading policies).
Definition at line 142 of file TerrainLayer.
{ return _loadingWeight; }
const optional<unsigned int>& osgEarth::TerrainLayerOptions::maxDataLevel | ( | ) | const [inline] |
Definition at line 91 of file TerrainLayer.
{ return _maxDataLevel; }
optional<unsigned int>& osgEarth::TerrainLayerOptions::maxDataLevel | ( | ) | [inline] |
The maximum level that data should be queried for this layer.
Definition at line 90 of file TerrainLayer.
{ return _maxDataLevel; }
optional<int>& osgEarth::TerrainLayerOptions::maxLevel | ( | ) | [inline] |
The maximum level of detail for which this layer should generate data.
Definition at line 78 of file TerrainLayer.
{ return _maxLevel; }
const optional<int>& osgEarth::TerrainLayerOptions::maxLevel | ( | ) | const [inline] |
Definition at line 79 of file TerrainLayer.
{ return _maxLevel; }
optional<double>& osgEarth::TerrainLayerOptions::maxLevelResolution | ( | ) | [inline] |
The maximum level resolution for which this layer should generate data.
Definition at line 84 of file TerrainLayer.
{ return _maxLevelResolution; }
const optional<double>& osgEarth::TerrainLayerOptions::maxLevelResolution | ( | ) | const [inline] |
Definition at line 85 of file TerrainLayer.
{ return _maxLevelResolution; }
void TerrainLayerOptions::mergeConfig | ( | const Config & | conf | ) | [virtual] |
Reimplemented from osgEarth::ConfigOptions.
Reimplemented in osgEarth::ElevationLayerOptions, and osgEarth::ImageLayerOptions.
Definition at line 125 of file TerrainLayer.cpp.
{ ConfigOptions::mergeConfig( conf ); fromConfig( conf ); }
optional<int>& osgEarth::TerrainLayerOptions::minLevel | ( | ) | [inline] |
Gets or sets the minimum level of detail for which this layer should generate data.
Definition at line 65 of file TerrainLayer.
{ return _minLevel; }
const optional<int>& osgEarth::TerrainLayerOptions::minLevel | ( | ) | const [inline] |
Definition at line 66 of file TerrainLayer.
{ return _minLevel; }
const optional<double>& osgEarth::TerrainLayerOptions::minLevelResolution | ( | ) | const [inline] |
Definition at line 72 of file TerrainLayer.
{ return _minLevelResolution; }
optional<double>& osgEarth::TerrainLayerOptions::minLevelResolution | ( | ) | [inline] |
Gets or sets the minimum level resolution for which this layer should generate data.
Definition at line 71 of file TerrainLayer.
{ return _minLevelResolution;}
std::string& osgEarth::TerrainLayerOptions::name | ( | ) | [inline] |
The readable name of the layer.
Definition at line 45 of file TerrainLayer.
{ return _name; }
const std::string& osgEarth::TerrainLayerOptions::name | ( | ) | const [inline] |
Definition at line 46 of file TerrainLayer.
{ return _name; }
const optional<ProfileOptions>& osgEarth::TerrainLayerOptions::profile | ( | ) | const [inline] |
Definition at line 54 of file TerrainLayer.
{ return _profile; }
optional<ProfileOptions>& osgEarth::TerrainLayerOptions::profile | ( | ) | [inline] |
Gets the explicit profile setup for this map layer. By default, the layer will try to automatically determine the Profile from the tile source. This property sets it explicitly instead.
Definition at line 53 of file TerrainLayer.
{ return _profile; }
const optional<unsigned int> osgEarth::TerrainLayerOptions::reprojectedTileSize | ( | ) | const [inline] |
Definition at line 111 of file TerrainLayer.
{ return _reprojectedTileSize; }
optional<unsigned int> osgEarth::TerrainLayerOptions::reprojectedTileSize | ( | ) | [inline] |
The desired tile size to reproject imagery to if necessary.
Definition at line 110 of file TerrainLayer.
{ return _reprojectedTileSize; }
void TerrainLayerOptions::setDefaults | ( | ) | [private] |
Reimplemented in osgEarth::ElevationLayerOptions, and osgEarth::ImageLayerOptions.
Definition at line 61 of file TerrainLayer.cpp.
{ _enabled.init( true ); _exactCropping.init( false ); _reprojectedTileSize.init( 256 ); _cacheEnabled.init( true ); _cacheOnly.init( false ); _loadingWeight.init( 1.0f ); _minLevel.init( 0 ); _maxLevel.init( 99 ); }
optional<bool> osgEarth::TerrainLayerOptions::_cacheEnabled [private] |
Definition at line 170 of file TerrainLayer.
optional<std::string> osgEarth::TerrainLayerOptions::_cacheFormat [private] |
Definition at line 169 of file TerrainLayer.
optional<std::string> osgEarth::TerrainLayerOptions::_cacheId [private] |
Definition at line 177 of file TerrainLayer.
optional<bool> osgEarth::TerrainLayerOptions::_cacheOnly [private] |
Definition at line 171 of file TerrainLayer.
Definition at line 164 of file TerrainLayer.
optional<double> osgEarth::TerrainLayerOptions::_edgeBufferRatio [private] |
Definition at line 176 of file TerrainLayer.
optional<bool> osgEarth::TerrainLayerOptions::_enabled [private] |
Definition at line 174 of file TerrainLayer.
optional<bool> osgEarth::TerrainLayerOptions::_exactCropping [private] |
Definition at line 173 of file TerrainLayer.
optional<float> osgEarth::TerrainLayerOptions::_loadingWeight [private] |
Definition at line 172 of file TerrainLayer.
optional<unsigned int> osgEarth::TerrainLayerOptions::_maxDataLevel [private] |
Definition at line 178 of file TerrainLayer.
optional<int> osgEarth::TerrainLayerOptions::_maxLevel [private] |
Definition at line 166 of file TerrainLayer.
optional<double> osgEarth::TerrainLayerOptions::_maxLevelResolution [private] |
Definition at line 168 of file TerrainLayer.
optional<int> osgEarth::TerrainLayerOptions::_minLevel [private] |
Definition at line 165 of file TerrainLayer.
optional<double> osgEarth::TerrainLayerOptions::_minLevelResolution [private] |
Definition at line 167 of file TerrainLayer.
std::string osgEarth::TerrainLayerOptions::_name [private] |
Definition at line 162 of file TerrainLayer.
Definition at line 163 of file TerrainLayer.
optional<unsigned int> osgEarth::TerrainLayerOptions::_reprojectedTileSize [private] |
Definition at line 175 of file TerrainLayer.