source: experimental/TerrainTest/myTileLoadedCallback.h

Last change on this file was 277, checked in by Torben Dannhauer, 13 years ago
File size: 1.1 KB
Line 
1#pragma once
2#include <osgTerrain/TerrainTile>
3
4
5namespace osgTerrain {
6
7template <class T>
8class  GeometryTechniquePrototypeWorkaroundTLC : public TerrainTile::TileLoadedCallback
9{
10public:
11        //! Constructor: Nothing to do.
12        GeometryTechniquePrototypeWorkaroundTLC() {};
13
14        //! Destructor: Nothing to do.
15        virtual ~GeometryTechniquePrototypeWorkaroundTLC() {};
16
17        /**
18         * \brief This function must be implemented.
19         *
20         * @return : Extrnal layer loading status.
21         */ 
22        virtual bool deferExternalLayerLoading() const {return true;}
23
24        /**
25         * \brief This function is performed after every tile loading.
26         *
27         * It is used to install a custom geometryTechnique on every tile, because VPB databases older VPB 0.10 have a hardcoded geometryTechnique which ignores the GeometryTechniquePrototype of osgTerrain.
28         *
29         * @param tile : Loaded tile.
30         * @param options : Reader writer options. Defined in the base class, but here not used.
31         */ 
32        virtual void loaded(osgTerrain::TerrainTile* tile, const osgDB::ReaderWriter::Options* options) const {tile->setTerrainTechnique( new T() );}; 
33};
34
35}       // Namespace end.
Note: See TracBrowser for help on using the repository browser.