osgEarth 2.1.1
Public Member Functions | Public Attributes

BuildColorLayer Struct Reference

Collaboration diagram for BuildColorLayer:

List of all members.

Public Member Functions

void init (const TileKey &key, ImageLayer *layer, const MapInfo &mapInfo, const OSGTerrainOptions &opt, TileBuilder::SourceRepo &repo)
void execute ()

Public Attributes

TileKey _key
const MapInfo_mapInfo
ImageLayer_layer
const OSGTerrainOptions_opt
TileBuilder::SourceRepo_repo

Detailed Description

Definition at line 31 of file TileBuilder.cpp.


Member Function Documentation

void BuildColorLayer::execute ( ) [inline]

Definition at line 43 of file TileBuilder.cpp.

    {
        GeoImage geoImage;
        bool isFallbackData = false;

        // fetch the image from the layer, falling back on parent keys utils we are 
        // able to find one that works.
        TileKey imageKey( _key );
        while( !geoImage.valid() && imageKey.valid() && _layer->isKeyValid(imageKey) )
        {
            geoImage = _layer->createImage( imageKey, 0L ); // TODO: include a progress callback?
            if ( !geoImage.valid() )
            {
                imageKey = imageKey.createParentKey();
                isFallbackData = true;
            }
        }

        GeoLocator* locator = 0L;

        if ( !geoImage.valid() )
        {
            // no image found, so make an empty one (one pixel alpha).
            geoImage = GeoImage( ImageUtils::createEmptyImage(), _key.getExtent() );
            locator = GeoLocator::createForKey( _key, *_mapInfo );
            isFallbackData = true;
        }
        else
        {
            locator = GeoLocator::createForExtent(geoImage.getExtent(), *_mapInfo);                                                                                       
        }
        // add the color layer to the repo.
        _repo->add( CustomColorLayer(
            _layer,
            geoImage.getImage(),
            locator,
            _key.getLevelOfDetail(),
            _key,
            isFallbackData ) );
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void BuildColorLayer::init ( const TileKey key,
ImageLayer layer,
const MapInfo mapInfo,
const OSGTerrainOptions opt,
TileBuilder::SourceRepo repo 
) [inline]

Definition at line 33 of file TileBuilder.cpp.

    {
        _key      = key;
        _layer    = layer;
        _mapInfo  = &mapInfo;
        _opt      = &opt;
        _repo     = &repo;
    }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 84 of file TileBuilder.cpp.

Definition at line 86 of file TileBuilder.cpp.

Definition at line 85 of file TileBuilder.cpp.

Definition at line 87 of file TileBuilder.cpp.

Definition at line 88 of file TileBuilder.cpp.


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