osgEarth 2.1.1
|
Public Member Functions | |
ProfileOptions (const ConfigOptions &options=ConfigOptions()) | |
ProfileOptions (const std::string &namedProfile) | |
bool | defined () const |
optional< std::string > & | namedProfile () |
const optional< std::string > & | namedProfile () const |
optional< std::string > & | srsString () |
const optional< std::string > & | srsString () const |
optional< std::string > & | vsrsString () |
const optional< std::string > & | vsrsString () const |
optional< Bounds > & | bounds () |
const optional< Bounds > & | bounds () const |
optional< int > & | numTilesWideAtLod0 () |
const optional< int > & | numTilesWideAtLod0 () const |
optional< int > & | numTilesHighAtLod0 () |
const optional< int > & | numTilesHighAtLod0 () const |
Config | getConfig () const |
Protected Member Functions | |
void | mergeConfig (const Config &conf) |
Private Member Functions | |
void | fromConfig (const Config &conf) |
Private Attributes | |
optional< std::string > | _namedProfile |
optional< std::string > | _srsInitString |
optional< std::string > | _vsrsInitString |
optional< Bounds > | _bounds |
optional< int > | _numTilesWideAtLod0 |
optional< int > | _numTilesHighAtLod0 |
ProfileOptions::ProfileOptions | ( | const ConfigOptions & | options = ConfigOptions() | ) |
Definition at line 35 of file Profile.cpp.
: ConfigOptions( options ), _namedProfile( "" ), _srsInitString( "" ), _vsrsInitString( "" ), _bounds( Bounds() ), _numTilesWideAtLod0( 1 ), _numTilesHighAtLod0( 1 ) { fromConfig( _conf ); }
ProfileOptions::ProfileOptions | ( | const std::string & | namedProfile | ) |
Definition at line 47 of file Profile.cpp.
: _srsInitString( "" ), _vsrsInitString( "" ), _bounds( Bounds() ), _numTilesWideAtLod0( 1 ), _numTilesHighAtLod0( 1 ) { _namedProfile = namedProfile; // don't set above }
bool ProfileOptions::defined | ( | ) | const |
Returns true if this configuration is well-defined and usable
Definition at line 107 of file Profile.cpp.
{ return _namedProfile.isSet() || _srsInitString.isSet(); }
void ProfileOptions::fromConfig | ( | const Config & | conf | ) | [private] |
Definition at line 58 of file Profile.cpp.
{ if ( !conf.value().empty() ) _namedProfile = conf.value(); conf.getIfSet( "srs", _srsInitString ); conf.getIfSet( "vsrs", _vsrsInitString ); if ( conf.hasValue( "xmin" ) && conf.hasValue( "ymin" ) && conf.hasValue( "xmax" ) && conf.hasValue( "ymax" ) ) { _bounds = Bounds( conf.value<double>( "xmin", 0 ), conf.value<double>( "ymin", 0 ), conf.value<double>( "xmax", 0 ), conf.value<double>( "ymax", 0 ) ); } conf.getIfSet( "num_tiles_wide_at_lod_0", _numTilesWideAtLod0 ); conf.getIfSet( "num_tiles_high_at_lod_0", _numTilesHighAtLod0 ); }
Config ProfileOptions::getConfig | ( | ) | const [virtual] |
Reimplemented from osgEarth::ConfigOptions.
Definition at line 80 of file Profile.cpp.
{ Config conf( "profile" ); if ( _namedProfile.isSet() ) { conf.value() = _namedProfile.value(); } else { conf.updateIfSet( "srs", _srsInitString ); conf.updateIfSet( "vsrs", _vsrsInitString ); if ( _bounds.isSet() ) { conf.update( "xmin", toString(_bounds->xMin()) ); conf.update( "ymin", toString(_bounds->yMin()) ); conf.update( "xmax", toString(_bounds->xMax()) ); conf.update( "ymax", toString(_bounds->yMax()) ); } conf.updateIfSet( "num_tiles_wide_at_lod_0", _numTilesWideAtLod0 ); conf.updateIfSet( "num_tiles_high_at_lod_0", _numTilesHighAtLod0 ); } return conf; }
void osgEarth::ProfileOptions::mergeConfig | ( | const Config & | conf | ) | [inline, protected, virtual] |
Reimplemented from osgEarth::ConfigOptions.
Definition at line 77 of file Profile.
{ ConfigOptions::mergeConfig( conf ); fromConfig( conf ); }
const optional<std::string>& osgEarth::ProfileOptions::namedProfile | ( | ) | const [inline] |
Definition at line 51 of file Profile.
{ return _namedProfile; }
optional<std::string>& osgEarth::ProfileOptions::namedProfile | ( | ) | [inline] |
Gets the optional Well-Known Profile string.
Definition at line 50 of file Profile.
{ return _namedProfile; }
optional<int>& osgEarth::ProfileOptions::numTilesHighAtLod0 | ( | ) | [inline] |
Number of tiles on the Y axis at LOD 0
Definition at line 70 of file Profile.
{ return _numTilesHighAtLod0; }
const optional<int>& osgEarth::ProfileOptions::numTilesHighAtLod0 | ( | ) | const [inline] |
Definition at line 71 of file Profile.
{ return _numTilesHighAtLod0; }
const optional<int>& osgEarth::ProfileOptions::numTilesWideAtLod0 | ( | ) | const [inline] |
Definition at line 67 of file Profile.
{ return _numTilesWideAtLod0; }
optional<int>& osgEarth::ProfileOptions::numTilesWideAtLod0 | ( | ) | [inline] |
Number of tiles in the X axis at LOD 0
Definition at line 66 of file Profile.
{ return _numTilesWideAtLod0; }
const optional<std::string>& osgEarth::ProfileOptions::srsString | ( | ) | const [inline] |
Definition at line 55 of file Profile.
{ return _srsInitString; }
optional<std::string>& osgEarth::ProfileOptions::srsString | ( | ) | [inline] |
Gets the spatial reference system initialization string to use for the profile.
Definition at line 54 of file Profile.
{ return _srsInitString; }
optional<std::string>& osgEarth::ProfileOptions::vsrsString | ( | ) | [inline] |
Gets the vertical spatial reference init string for this profile.
Definition at line 58 of file Profile.
{ return _vsrsInitString; }
const optional<std::string>& osgEarth::ProfileOptions::vsrsString | ( | ) | const [inline] |
Definition at line 59 of file Profile.
{ return _vsrsInitString; }
optional<Bounds> osgEarth::ProfileOptions::_bounds [private] |
optional<std::string> osgEarth::ProfileOptions::_namedProfile [private] |
optional<int> osgEarth::ProfileOptions::_numTilesHighAtLod0 [private] |
optional<int> osgEarth::ProfileOptions::_numTilesWideAtLod0 [private] |
optional<std::string> osgEarth::ProfileOptions::_srsInitString [private] |
optional<std::string> osgEarth::ProfileOptions::_vsrsInitString [private] |