osgEarth 2.1.1
Public Member Functions | Public Attributes

CustomTileSource Class Reference

Inheritance diagram for CustomTileSource:
Collaboration diagram for CustomTileSource:

List of all members.

Public Member Functions

 CustomTileSource (const TileSourceOptions &options=TileSourceOptions())
void initialize (const std::string &referenceURI, const Profile *overrideProfile)
osg::Image * createImage (const TileKey &key, ProgressCallback *progress)

Public Attributes

osg::ref_ptr< Ring_geom

Detailed Description

Definition at line 46 of file osgearth_tilesource.cpp.


Constructor & Destructor Documentation

CustomTileSource::CustomTileSource ( const TileSourceOptions options = TileSourceOptions()) [inline]

Definition at line 49 of file osgearth_tilesource.cpp.

                                                                              : TileSource(options)
    {
        _geom = new Ring();
        _geom->push_back( osg::Vec3(5, 5, 0) );
        _geom->push_back( osg::Vec3(250, 5, 0) );
        _geom->push_back( osg::Vec3(250, 250, 0) );
        _geom->push_back( osg::Vec3(5, 250, 0) );
    }

Member Function Documentation

osg::Image* CustomTileSource::createImage ( const TileKey key,
ProgressCallback progress 
) [inline, virtual]

Creates an image for the given TileKey. The returned object is new and is the responsibility of the caller.

Implements osgEarth::TileSource.

Definition at line 66 of file osgearth_tilesource.cpp.

    {
        GeometryRasterizer rasterizer( 256, 256 );
        rasterizer.draw( _geom.get(), colors[key.getLevelOfDetail() % 4] );
        return rasterizer.finalize();
    }

Here is the call graph for this function:

void CustomTileSource::initialize ( const std::string &  referenceURI,
const Profile overrideProfile 
) [inline, virtual]

Initialize the TileSource. The profile should be computed and set here using setProfile()

Implements osgEarth::TileSource.

Definition at line 58 of file osgearth_tilesource.cpp.

    {
        if ( overrideProfile )
            setProfile( overrideProfile );
        else
            setProfile( Registry::instance()->getGlobalGeodeticProfile() );
    }

Here is the call graph for this function:


Member Data Documentation

Definition at line 73 of file osgearth_tilesource.cpp.


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