Ignore:
Timestamp:
Mar 20, 2011, 1:14:16 PM (13 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/TerrainTest/ModificationManager.h

    r272 r275  
    1717
    1818#include "region.h"
     19#include "myTileLoadedCallback.h"
     20#include "terrainModificationTechnique.h"
     21#include <osgTerrain/Terrain>
     22#include <osgTerrain/GeometryTechnique>
    1923#include <osg/observer_ptr>
     24#include <vector>
    2025
    2126
     27
     28
     29/**
     30 * \brief This class provides a management interface to control terrain modification.
     31 *
     32 * It is possible to modify preprocessed VirtualPLanetBuilder (VPB) Databases on the fly.
     33 * The modification can be performed in two ways:
     34 * a) Modifying only the tile data and using the standard geometryTechnique to mesh the drawable.
     35 * b) Using an userdefined geometryTechnique to create other meshes than the regular triangle mesh.
     36 *
     37 * Currently the changes are made on run time but in the pseudo loader. This way the modification does not affect the frame rate but only the delay in the tile delivery to the rendering thread.
     38 *
     39 * @author Torben Dannhauer
     40 * @date  Mrz 2011
     41 */
    2242class ModificationManager
    2343{
    2444public:
     45        //! Destructor: Must be public to ensure the singleton can be cleand up at the end of the programm.
    2546        ~ModificationManager(){};
    2647
     48        /**
     49         * \brief This function returns a reference to the singleton instance of the terrain manager.
     50         *
     51         * @return Reference to the singleton instance of the terrain manager.
     52         */
    2753        static ModificationManager* getInstance() {static ModificationManager instance; return &instance;}
    2854
    29         //void addRoi();
     55        /**
     56         * \brief This function adds a terrain class to the manager to be managed and accessible to terrain modifications.
     57         *
     58         * @param terrain : Terrain to manage.
     59         */
     60        void addTerrainToManage(osgTerrain::Terrain* terrain);
    3061
    31 private:
    32         ModificationManager(){};
    33 
    34         ModificationManager(const ModificationManager& cc) {};
     62        /**
     63         * \brief This functions removes a terrain class from the manager to stop it's managing.
     64         *
     65         * @param terrain : Terrain to remove.
     66         * @return : True of the specified terrain was managed and is now removed. If the specified terrain was not managed it will return false.
     67         */
     68        bool removeTerrainToManage(osgTerrain::Terrain* terrain);
    3569
    3670
    3771
     72        //void addRoi(region modificationROI, terrainModificationTechnique* technique=NULL);
     73        //bool removeRoi(region modificationROI);
     74
     75        void setGeometryTechniquePrototype( osgTerrain::GeometryTechnique* geomTechnique, osgTerrain::Terrain* terrain=NULL );
     76
     77
     78private:
     79        //! Constructor: Private to avoid that this class can be instantiated - it should only be usable as singleton.
     80        ModificationManager(){};
     81
     82        //! Copy-Constructor: Private to avoid that someone can create an class instance by copying the singleton instance.
     83        ModificationManager(const ModificationManager& cc) {};
     84
     85        //! Vector of all managed terrain pointers.
     86        std::vector<osgTerrain::Terrain*> managedTerrain;
     87
    3888};
Note: See TracChangeset for help on using the changeset viewer.