/usr/include/osgEarthDrivers/engine_mp/MPTerrainEngineOptions is in libosgearth-dev 2.7.0+dfsg-2+b3.
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 143 144 | /* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2015 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_DRIVERS_MP_TERRAIN_ENGINE_OPTIONS
#define OSGEARTH_DRIVERS_MP_TERRAIN_ENGINE_OPTIONS 1
#include <osgEarth/Common>
#include <osgEarth/TerrainOptions>
#include <osgEarthSymbology/Color>
namespace osgEarth { namespace Drivers { namespace MPTerrainEngine
{
using namespace osgEarth;
using namespace osgEarth::Symbology;
/**
* Options for configuring the MP Engine driver.
*/
class MPTerrainEngineOptions : public TerrainOptions // NO EXPORT (header-only)
{
public:
MPTerrainEngineOptions( const ConfigOptions& options =ConfigOptions() ) : TerrainOptions( options ),
_skirtRatio ( 0.05 ),
_quickRelease ( true ),
_normalizeEdges ( false ),
_rangeMode ( osg::LOD::DISTANCE_FROM_EYE_POINT ),
_tilePixelSize ( 256 ),
_color ( Color::White ),
_incrementalUpdate ( false ),
_smoothing ( false )
{
setDriver( "mp" );
fromConfig( _conf );
}
/** dtor */
virtual ~MPTerrainEngineOptions() { }
public:
/** Ratio of terrain tile skirt height to tile radius */
optional<float>& heightFieldSkirtRatio() { return _skirtRatio; }
const optional<float>& heightFieldSkirtRatio() const { return _skirtRatio; }
/** Whether to run a post-render process that releases GL objects as quickly as
* possible, freeing up memory faster */
optional<bool>& quickReleaseGLObjects() { return _quickRelease; }
const optional<bool>& quickReleaseGLObjects() const { return _quickRelease; }
/** Whether to average normal vectors on tile boundaries. Doing so reduces the
* the appearance of seams when using lighting, but requires extra CPU work. */
optional<bool>& normalizeEdges() { return _normalizeEdges; }
const optional<bool>& normalizeEdges() const { return _normalizeEdges; }
/** Mode to use when calculating LOD switching distances */
optional<osg::LOD::RangeMode>& rangeMode() { return _rangeMode;}
const optional<osg::LOD::RangeMode>& rangeMode() const { return _rangeMode;}
/** The size of the tile, in pixels, when using rangeMode = PIXEL_SIZE_ON_SCREEN */
optional<float>& tilePixelSize() { return _tilePixelSize; }
const optional<float>& tilePixelSize() const { return _tilePixelSize; }
/** The color of the globe surface where no images are applied */
optional<Color>& color() { return _color; }
const optional<Color>& color() const { return _color; }
/**
* Whether to create smooth transitions between elevation datasets at differing LODs
* by inheriting low-resolution data from parent tiles and filling in the new data.
* When smoothing is on, elevation may not be "true" in all locations, since the engine
* will interpolate values from low LODs. Defaults to FALSE.
*/
optional<bool>& elevationSmoothing() { return _smoothing; }
const optional<bool>& elevationSmoothing() const { return _smoothing; }
public:
/** @deprecated */
optional<bool>& incrementalUpdate() { return _incrementalUpdate; }
const optional<bool>& incrementalUpdate() const { return _incrementalUpdate; }
protected:
virtual Config getConfig() const {
Config conf = TerrainOptions::getConfig();
conf.updateIfSet( "skirt_ratio", _skirtRatio );
conf.updateIfSet( "quick_release_gl_objects", _quickRelease );
conf.updateIfSet( "normalize_edges", _normalizeEdges);
conf.updateIfSet( "tile_pixel_size", _tilePixelSize );
conf.updateIfSet( "range_mode", "PIXEL_SIZE_ON_SCREEN", _rangeMode, osg::LOD::PIXEL_SIZE_ON_SCREEN );
conf.updateIfSet( "range_mode", "DISTANCE_FROM_EYE_POINT", _rangeMode, osg::LOD::DISTANCE_FROM_EYE_POINT);
conf.updateIfSet( "color", _color );
conf.updateIfSet( "incremental_update", _incrementalUpdate );
conf.updateIfSet( "elevation_smoothing", _smoothing );
return conf;
}
virtual void mergeConfig( const Config& conf ) {
TerrainOptions::mergeConfig( conf );
fromConfig( conf );
}
private:
void fromConfig( const Config& conf ) {
conf.getIfSet( "skirt_ratio", _skirtRatio );
conf.getIfSet( "quick_release_gl_objects", _quickRelease );
conf.getIfSet( "normalize_edges", _normalizeEdges );
conf.getIfSet( "tile_pixel_size", _tilePixelSize );
conf.getIfSet( "range_mode", "PIXEL_SIZE_ON_SCREEN", _rangeMode, osg::LOD::PIXEL_SIZE_ON_SCREEN );
conf.getIfSet( "range_mode", "DISTANCE_FROM_EYE_POINT", _rangeMode, osg::LOD::DISTANCE_FROM_EYE_POINT);
conf.getIfSet( "color", _color );
conf.getIfSet( "incremental_update", _incrementalUpdate );
conf.getIfSet( "elevation_smoothing", _smoothing );
}
optional<float> _skirtRatio;
optional<bool> _quickRelease;
optional<float> _lodFallOff;
optional<bool> _normalizeEdges;
optional<osg::LOD::RangeMode> _rangeMode;
optional<float> _tilePixelSize;
optional<Color> _color;
optional<bool> _incrementalUpdate;
optional<bool> _smoothing;
};
} } } // namespace osgEarth::Drivers::MPTerrainEngine
#endif // OSGEARTH_DRIVERS_MP_TERRAIN_ENGINE_OPTIONS
|