source: experimental/TerrainTest/myTileLoadedCallback.h @ 375

Last change on this file since 375 was 277, checked in by Torben Dannhauer, 14 years ago
File size: 1.1 KB
RevLine 
[165]1#pragma once
2#include <osgTerrain/TerrainTile>
3
[275]4
[165]5namespace osgTerrain {
6
[276]7template <class T>
8class  GeometryTechniquePrototypeWorkaroundTLC : public TerrainTile::TileLoadedCallback
[165]9{
10public:
[275]11        //! Constructor: Nothing to do.
[276]12        GeometryTechniquePrototypeWorkaroundTLC() {};
[165]13
[275]14        //! Destructor: Nothing to do.
[276]15        virtual ~GeometryTechniquePrototypeWorkaroundTLC() {};
[275]16
17        /**
18         * \brief This function must be implemented.
19         *
[277]20         * @return : Extrnal layer loading status.
[275]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.
[277]30         * @param options : Reader writer options. Defined in the base class, but here not used.
[275]31         */ 
[276]32        virtual void loaded(osgTerrain::TerrainTile* tile, const osgDB::ReaderWriter::Options* options) const {tile->setTerrainTechnique( new T() );}; 
[165]33};
34
[275]35}       // Namespace end.
Note: See TracBrowser for help on using the repository browser.