Introduced TerrainTile::TileLoadedCallback

This commit is contained in:
Robert Osfield
2008-09-10 18:11:54 +00:00
parent ed4bd41574
commit b4b5b5ea41
8 changed files with 82 additions and 10 deletions

View File

@@ -39,6 +39,7 @@
#include <osgGA/TerrainManipulator>
#include <osgTerrain/Terrain>
#include <osgTerrain/TerrainTile>
#include <osgViewer/ViewerEventHandlers>
#include <osgViewer/Viewer>
@@ -232,6 +233,24 @@ protected:
osg::ref_ptr<osgTerrain::Terrain> _terrain;
};
struct CustomTileLoadedCallback : public osgTerrain::TerrainTile::TileLoadedCallback
{
CustomTileLoadedCallback()
{
}
virtual bool deferExternalLayerLoading() const
{
return true;
}
virtual void loaded(osgTerrain::TerrainTile* tile, const osgDB::ReaderWriter::Options* options) const
{
osg::notify(osg::NOTICE)<<"Need to decide what to do here guys"<<std::endl;
}
};
int main( int argc, char **argv )
{
// use an ArgumentParser object to manage the program arguments.
@@ -240,6 +259,10 @@ int main( int argc, char **argv )
arguments.getApplicationUsage()->addCommandLineOption("-r","Set the terrain sample ratio.");
arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access.");
// set the tile loaded callback to load the optional imagery
osgTerrain::TerrainTile::setTileLoadedCallback(new CustomTileLoadedCallback());
// construct the viewer.
osgViewer::Viewer viewer(arguments);