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

osgEarth::MaskLayer Class Reference

Inheritance diagram for osgEarth::MaskLayer:
Collaboration diagram for osgEarth::MaskLayer:

List of all members.

Public Member Functions

 MaskLayer (const MaskLayerOptions &options=MaskLayerOptions())
 MaskLayer (const std::string &name, const MaskSourceOptions &options)
 MaskLayer (const MaskLayerOptions &options, MaskSource *source)
MaskSourcegetMaskSource () const
osg::Vec3dArray * getOrCreateBoundary (float heightScale=1.0, const SpatialReference *srs=NULL, ProgressCallback *progress=0L)
void initialize (const std::string &referenceURI, const Map *map)

Private Member Functions

void copyOptions ()

Private Attributes

std::string _referenceURI
MaskLayerOptions _initOptions
MaskLayerOptions _runtimeOptions
osg::ref_ptr< MaskSource_maskSource
Revision _maskSourceRev
osg::ref_ptr< osg::Vec3dArray > _boundary

Detailed Description

A MaskLayer is a specialized layer used to mask out a part of the terrain. Typically you would use this if you had a pre-built 3D terrain model for an inset area.

Definition at line 71 of file MaskLayer.


Constructor & Destructor Documentation

MaskLayer::MaskLayer ( const MaskLayerOptions options = MaskLayerOptions())

Constructs a new mask layer based on a configuration setup.

Definition at line 74 of file MaskLayer.cpp.

                                                      :
_initOptions( options )
{
    copyOptions();
}

Here is the call graph for this function:

MaskLayer::MaskLayer ( const std::string &  name,
const MaskSourceOptions options 
)

Constructs a new mask layer with a user-provided driver options.

Definition at line 80 of file MaskLayer.cpp.

                                                                              :
_initOptions( MaskLayerOptions( name, options ) )
{
    copyOptions();
}

Here is the call graph for this function:

MaskLayer::MaskLayer ( const MaskLayerOptions options,
MaskSource source 
)

Constructs a new mask layer with a user-provided mask source.

Definition at line 86 of file MaskLayer.cpp.

                                                                          :
_maskSource( source ),
_initOptions( options )
{
    copyOptions();
}

Here is the call graph for this function:


Member Function Documentation

void MaskLayer::copyOptions ( ) [private]

Definition at line 94 of file MaskLayer.cpp.

Here is the caller graph for this function:

MaskSource* osgEarth::MaskLayer::getMaskSource ( ) const [inline]

Access the underlying mask source.

Definition at line 92 of file MaskLayer.

{ return _maskSource.get(); }
osg::Vec3dArray * MaskLayer::getOrCreateBoundary ( float  heightScale = 1.0,
const SpatialReference srs = NULL,
ProgressCallback progress = 0L 
)

Gets the geometric boundary polygon representing the area of the terrain to mask out.

Definition at line 116 of file MaskLayer.cpp.

{
    if ( _maskSource.valid() )
    {
        // if the model source has changed, regenerate the node.
        if ( _boundary.valid() && !_maskSource->inSyncWith(_maskSourceRev) )
        {
            _boundary = 0L;
        }

        if ( !_boundary.valid() )
        {
                        _boundary = _maskSource->createBoundary( srs, progress );

                        for (osg::Vec3dArray::iterator vIt = _boundary->begin(); vIt != _boundary->end(); ++vIt)
                                vIt->z() = vIt->z() * heightScale;

            _maskSource->sync( _maskSourceRev );
        }
    }

    return _boundary.get();
}
void MaskLayer::initialize ( const std::string &  referenceURI,
const Map map 
)

Definition at line 100 of file MaskLayer.cpp.

{
    _referenceURI = referenceURI;

    if ( !_maskSource.valid() && _initOptions.driver().isSet() )
    {
        _maskSource = MaskSourceFactory::create( *_initOptions.driver() );
    }

    if ( _maskSource.valid() )
    {
        _maskSource->initialize( _referenceURI, map );
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

osg::ref_ptr<osg::Vec3dArray> osgEarth::MaskLayer::_boundary [private]

Definition at line 110 of file MaskLayer.

Definition at line 107 of file MaskLayer.

Definition at line 108 of file MaskLayer.

Definition at line 109 of file MaskLayer.

std::string osgEarth::MaskLayer::_referenceURI [private]

Definition at line 106 of file MaskLayer.

Definition at line 107 of file MaskLayer.


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