osgEarth 2.1.1
Public Member Functions | Private Member Functions | Private Attributes

osgEarth::ImageLayerOptions Class Reference

Inheritance diagram for osgEarth::ImageLayerOptions:
Collaboration diagram for osgEarth::ImageLayerOptions:

List of all members.

Public Member Functions

 ImageLayerOptions (const ConfigOptions &options=ConfigOptions())
 ImageLayerOptions (const std::string &name, const TileSourceOptions &driverOpt=TileSourceOptions())
optional< float > & opacity ()
const optional< float > & opacity () const
optional< float > & minVisibleRange ()
const optional< float > & minVisibleRange () const
optional< float > & maxVisibleRange ()
const optional< float > & maxVisibleRange () const
optional< std::string > & noDataImageFilename ()
const optional< std::string > & noDataImageFilename () const
optional< osg::Vec4ub > & transparentColor ()
const optional< osg::Vec4ub > & transparentColor () const
optional
< osg::Texture::FilterMode > & 
magFilter (void)
const optional
< osg::Texture::FilterMode > & 
magFilter (void) const
optional
< osg::Texture::FilterMode > & 
minFilter (void)
const optional
< osg::Texture::FilterMode > & 
minFilter (void) const
optional< bool > & lodBlending ()
const optional< bool > & lodBlending () const
virtual Config getConfig () const
virtual void mergeConfig (const Config &conf)

Private Member Functions

void fromConfig (const Config &conf)
void setDefaults ()

Private Attributes

optional< float > _opacity
optional< float > _minRange
optional< float > _maxRange
optional< osg::Vec4ub > _transparentColor
optional< std::string > _noDataImageFilename
optional
< osg::Texture::FilterMode > 
_magFilter
optional
< osg::Texture::FilterMode > 
_minFilter
optional< bool > _lodBlending

Detailed Description

Initialization options for an image layer.

Definition at line 36 of file ImageLayer.


Constructor & Destructor Documentation

ImageLayerOptions::ImageLayerOptions ( const ConfigOptions options = ConfigOptions())

Constructs new image layer options.

Definition at line 36 of file ImageLayer.cpp.

Here is the call graph for this function:

ImageLayerOptions::ImageLayerOptions ( const std::string &  name,
const TileSourceOptions driverOpt = TileSourceOptions() 
)

Constructs new image layer options, giving a name to the layer and specifying driver options to use.

Definition at line 43 of file ImageLayer.cpp.

Here is the call graph for this function:


Member Function Documentation

void ImageLayerOptions::fromConfig ( const Config conf) [private]

Reimplemented from osgEarth::TerrainLayerOptions.

Definition at line 68 of file ImageLayer.cpp.

{
    conf.getIfSet( "nodata_image", _noDataImageFilename );
    conf.getIfSet( "opacity", _opacity );
    conf.getIfSet( "min_range", _minRange );
    conf.getIfSet( "max_range", _maxRange );
    conf.getIfSet( "lod_blending", _lodBlending );

    if ( conf.hasValue( "transparent_color" ) )
        _transparentColor = stringToColor( conf.value( "transparent_color" ), osg::Vec4ub(0,0,0,0));

        //Load the filter settings
        conf.getIfSet("mag_filter","LINEAR",                _magFilter,osg::Texture::LINEAR);
    conf.getIfSet("mag_filter","LINEAR_MIPMAP_LINEAR",  _magFilter,osg::Texture::LINEAR_MIPMAP_LINEAR);
    conf.getIfSet("mag_filter","LINEAR_MIPMAP_NEAREST", _magFilter,osg::Texture::LINEAR_MIPMAP_NEAREST);
    conf.getIfSet("mag_filter","NEAREST",               _magFilter,osg::Texture::NEAREST);
    conf.getIfSet("mag_filter","NEAREST_MIPMAP_LINEAR", _magFilter,osg::Texture::NEAREST_MIPMAP_LINEAR);
    conf.getIfSet("mag_filter","NEAREST_MIPMAP_NEAREST",_magFilter,osg::Texture::NEAREST_MIPMAP_NEAREST);
    conf.getIfSet("min_filter","LINEAR",                _minFilter,osg::Texture::LINEAR);
    conf.getIfSet("min_filter","LINEAR_MIPMAP_LINEAR",  _minFilter,osg::Texture::LINEAR_MIPMAP_LINEAR);
    conf.getIfSet("min_filter","LINEAR_MIPMAP_NEAREST", _minFilter,osg::Texture::LINEAR_MIPMAP_NEAREST);
    conf.getIfSet("min_filter","NEAREST",               _minFilter,osg::Texture::NEAREST);
    conf.getIfSet("min_filter","NEAREST_MIPMAP_LINEAR", _minFilter,osg::Texture::NEAREST_MIPMAP_LINEAR);
    conf.getIfSet("min_filter","NEAREST_MIPMAP_NEAREST",_minFilter,osg::Texture::NEAREST_MIPMAP_NEAREST);   
}

Here is the call graph for this function:

Here is the caller graph for this function:

Config ImageLayerOptions::getConfig ( ) const [virtual]

Reimplemented from osgEarth::TerrainLayerOptions.

Definition at line 95 of file ImageLayer.cpp.

{
    Config conf = TerrainLayerOptions::getConfig();
    conf.updateIfSet( "nodata_image", _noDataImageFilename );
    conf.updateIfSet( "opacity", _opacity );
    conf.updateIfSet( "min_range", _minRange );
    conf.updateIfSet( "max_range", _maxRange );
    conf.updateIfSet( "lod_blending", _lodBlending );

        if (_transparentColor.isSet())
        conf.update("transparent_color", colorToString( _transparentColor.value()));

    //Save the filter settings
        conf.updateIfSet("mag_filter","LINEAR",                _magFilter,osg::Texture::LINEAR);
    conf.updateIfSet("mag_filter","LINEAR_MIPMAP_LINEAR",  _magFilter,osg::Texture::LINEAR_MIPMAP_LINEAR);
    conf.updateIfSet("mag_filter","LINEAR_MIPMAP_NEAREST", _magFilter,osg::Texture::LINEAR_MIPMAP_NEAREST);
    conf.updateIfSet("mag_filter","NEAREST",               _magFilter,osg::Texture::NEAREST);
    conf.updateIfSet("mag_filter","NEAREST_MIPMAP_LINEAR", _magFilter,osg::Texture::NEAREST_MIPMAP_LINEAR);
    conf.updateIfSet("mag_filter","NEAREST_MIPMAP_NEAREST",_magFilter,osg::Texture::NEAREST_MIPMAP_NEAREST);
    conf.updateIfSet("min_filter","LINEAR",                _minFilter,osg::Texture::LINEAR);
    conf.updateIfSet("min_filter","LINEAR_MIPMAP_LINEAR",  _minFilter,osg::Texture::LINEAR_MIPMAP_LINEAR);
    conf.updateIfSet("min_filter","LINEAR_MIPMAP_NEAREST", _minFilter,osg::Texture::LINEAR_MIPMAP_NEAREST);
    conf.updateIfSet("min_filter","NEAREST",               _minFilter,osg::Texture::NEAREST);
    conf.updateIfSet("min_filter","NEAREST_MIPMAP_LINEAR", _minFilter,osg::Texture::NEAREST_MIPMAP_LINEAR);
    conf.updateIfSet("min_filter","NEAREST_MIPMAP_NEAREST",_minFilter,osg::Texture::NEAREST_MIPMAP_NEAREST);
    
    return conf;
}

Here is the call graph for this function:

Here is the caller graph for this function:

optional<bool>& osgEarth::ImageLayerOptions::lodBlending ( ) [inline]

Whether LOD blending is enabled for this layer

Definition at line 96 of file ImageLayer.

{ return _lodBlending; }

Here is the caller graph for this function:

const optional<bool>& osgEarth::ImageLayerOptions::lodBlending ( ) const [inline]

Definition at line 97 of file ImageLayer.

{ return _lodBlending; }
optional<osg::Texture::FilterMode>& osgEarth::ImageLayerOptions::magFilter ( void  ) [inline]

The texture magnification mipmapping filter mode

Definition at line 84 of file ImageLayer.

{return _magFilter;}
const optional<osg::Texture::FilterMode>& osgEarth::ImageLayerOptions::magFilter ( void  ) const [inline]

Definition at line 85 of file ImageLayer.

{return _magFilter;}
optional<float>& osgEarth::ImageLayerOptions::maxVisibleRange ( ) [inline]

The initial maximum camera range at which this layer is visible.

Definition at line 66 of file ImageLayer.

{ return _maxRange; }

Here is the caller graph for this function:

const optional<float>& osgEarth::ImageLayerOptions::maxVisibleRange ( ) const [inline]

Definition at line 67 of file ImageLayer.

{ return _maxRange; }
void ImageLayerOptions::mergeConfig ( const Config conf) [virtual]

Reimplemented from osgEarth::TerrainLayerOptions.

Definition at line 61 of file ImageLayer.cpp.

Here is the call graph for this function:

optional<osg::Texture::FilterMode>& osgEarth::ImageLayerOptions::minFilter ( void  ) [inline]

The texture minification mipmapping filter mode

Definition at line 90 of file ImageLayer.

{return _minFilter;}
const optional<osg::Texture::FilterMode>& osgEarth::ImageLayerOptions::minFilter ( void  ) const [inline]

Definition at line 91 of file ImageLayer.

{return _minFilter;}
optional<float>& osgEarth::ImageLayerOptions::minVisibleRange ( ) [inline]

The initial minimum camera range at which this layer is visible.

Definition at line 60 of file ImageLayer.

{ return _minRange; }

Here is the caller graph for this function:

const optional<float>& osgEarth::ImageLayerOptions::minVisibleRange ( ) const [inline]

Definition at line 61 of file ImageLayer.

{ return _minRange; }
const optional<std::string>& osgEarth::ImageLayerOptions::noDataImageFilename ( ) const [inline]

Definition at line 73 of file ImageLayer.

optional<std::string>& osgEarth::ImageLayerOptions::noDataImageFilename ( ) [inline]

Gets or sets the nodata image for this MapLayer

Definition at line 72 of file ImageLayer.

Here is the caller graph for this function:

const optional<float>& osgEarth::ImageLayerOptions::opacity ( ) const [inline]

Definition at line 55 of file ImageLayer.

{ return _opacity; }
optional<float>& osgEarth::ImageLayerOptions::opacity ( ) [inline]

The initial opacity of this layer

Definition at line 54 of file ImageLayer.

{ return _opacity; }

Here is the caller graph for this function:

void ImageLayerOptions::setDefaults ( ) [private]

Reimplemented from osgEarth::TerrainLayerOptions.

Definition at line 51 of file ImageLayer.cpp.

{
    _opacity.init( 1.0f );
    _transparentColor.init( osg::Vec4ub(0,0,0,0) );
    _minRange.init( -FLT_MAX );
    _maxRange.init( FLT_MAX );
    _lodBlending.init( false );
}

Here is the call graph for this function:

Here is the caller graph for this function:

const optional<osg::Vec4ub>& osgEarth::ImageLayerOptions::transparentColor ( ) const [inline]

Definition at line 79 of file ImageLayer.

{ return _transparentColor; }
optional<osg::Vec4ub>& osgEarth::ImageLayerOptions::transparentColor ( ) [inline]

Gets the transparent color of this TileSource

Definition at line 78 of file ImageLayer.

{ return _transparentColor; }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 114 of file ImageLayer.

optional<osg::Texture::FilterMode> osgEarth::ImageLayerOptions::_magFilter [private]

Definition at line 112 of file ImageLayer.

Definition at line 109 of file ImageLayer.

optional<osg::Texture::FilterMode> osgEarth::ImageLayerOptions::_minFilter [private]

Definition at line 113 of file ImageLayer.

Definition at line 108 of file ImageLayer.

Definition at line 111 of file ImageLayer.

Definition at line 107 of file ImageLayer.

Definition at line 110 of file ImageLayer.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines