/usr/include/osgEarthDrivers/vpb/VPBOptions is in libosgearth-dev 2.4.0+dfsg-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | /* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2008-2013 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef OSGEARTH_DRIVER_VPB_DRIVEROPTIONS
#define OSGEARTH_DRIVER_VPB_DRIVEROPTIONS 1
#include <osgEarth/Common>
#include <osgEarth/TileSource>
#include <osgEarth/URI>
namespace osgEarth { namespace Drivers
{
using namespace osgEarth;
class VPBOptions : public TileSourceOptions // NO EXPORT; header only
{
public: // types
enum DirectoryStructure {
DS_NESTED,
DS_TASK,
DS_FLAT
};
public: // properties
optional<URI>& url() { return _url; }
const optional<URI>& url() const { return _url; }
optional<int>& primarySplitLevel() { return _primarySplitLevel; }
const optional<int>& primarySplitLevel() const { return _primarySplitLevel; }
optional<int>& secondarySplitLevel() { return _secondarySplitLevel; }
const optional<int>& secondarySplitLevel() const { return _secondarySplitLevel; }
optional<DirectoryStructure>& directoryStructure() { return _dirStruct; }
const optional<DirectoryStructure>& directoryStructure() const { return _dirStruct; }
optional<int>& layer() { return _layer; }
const optional<int>& layer() const { return _layer; }
optional<std::string>& layerSetName() { return _layerSetName; }
const optional<std::string>& layerSetName() const { return _layerSetName; }
optional<int>& numTilesWideAtLod0() { return _widthLod0; }
const optional<int>& numTilesWideAtLod0() const { return _widthLod0; }
optional<int>& numTilesHighAtLod0() { return _heightLod0; }
const optional<int>& numTilesHighAtLod0() const { return _heightLod0; }
optional<std::string>& baseName() { return _baseName; }
const optional<std::string>& baseName() const { return _baseName; }
optional<int>& terrainTileCacheSize() { return _terrainTileCacheSize; }
const optional<int>& terrainTileCacheSize() const { return _terrainTileCacheSize; }
public:
VPBOptions( const TileSourceOptions& opt =TileSourceOptions() ) : TileSourceOptions( opt ),
_primarySplitLevel( INT_MAX ),
_secondarySplitLevel( INT_MAX ),
_layer( 0 ),
_widthLod0( 1 ),
_heightLod0( 1 ),
_dirStruct( DS_NESTED ),
_terrainTileCacheSize(128)
{
setDriver( "vpb" );
fromConfig( _conf );
}
/** dtor */
virtual ~VPBOptions() { }
public:
Config getConfig() const {
Config conf = TileSourceOptions::getConfig();
conf.updateIfSet("url", _url);
conf.updateIfSet("primary_split_level", _primarySplitLevel);
conf.updateIfSet("secondary_split_level", _secondarySplitLevel);
conf.updateIfSet("layer", _layer);
conf.updateIfSet("layer_setname", _layerSetName);
conf.updateIfSet("num_tiles_wide_at_lod_0", _widthLod0 );
conf.updateIfSet("num_tiles_high_at_lod_0", _heightLod0 );
conf.updateIfSet("base_name", _baseName );
conf.updateIfSet("terrain_tile_cache_size", _terrainTileCacheSize);
if ( _dirStruct.isSet() ) {
if ( _dirStruct == DS_FLAT ) conf.update("directory_structure", "flat");
else if ( _dirStruct == DS_TASK ) conf.update("directory_structure", "task");
else if ( _dirStruct == DS_NESTED ) conf.update("directory_structure", "nested");
}
return conf;
}
protected:
void mergeConfig( const Config& conf ) {
TileSourceOptions::mergeConfig( conf );
fromConfig( conf );
}
private:
void fromConfig( const Config& conf ) {
conf.getIfSet("url", _url);
conf.getIfSet("primary_split_level", _primarySplitLevel);
conf.getIfSet("secondary_split_level", _secondarySplitLevel);
conf.getIfSet("layer", _layer);
conf.getIfSet("layer_setname", _layerSetName);
conf.getIfSet("numTilesWideAtLod0", _widthLod0 );
conf.getIfSet("numTilesHighAtLod0", _heightLod0 );
conf.getIfSet("base_name", _baseName);
conf.getIfSet("terrain_tile_cache_size", _terrainTileCacheSize);
std::string ds = conf.value("directory_structure");
if ( ds == "flat" ) _dirStruct = DS_FLAT;
else if ( ds == "task" ) _dirStruct = DS_TASK;
else if ( ds == "nested" ) _dirStruct = DS_NESTED;
}
optional<URI> _url;
optional<std::string> _baseName, _layerSetName;
optional<int> _primarySplitLevel, _secondarySplitLevel, _layer, _widthLod0, _heightLod0;
optional<DirectoryStructure> _dirStruct;
optional<int> _terrainTileCacheSize;
};
} } // namespace osgEarth::Drivers
#endif // OSGEARTH_DRIVER_VPB_DRIVEROPTIONS
|