Changeset 275 for experimental/TerrainTest/ModificationManager.h
- Timestamp:
- Mar 20, 2011, 1:14:16 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/TerrainTest/ModificationManager.h
r272 r275 17 17 18 18 #include "region.h" 19 #include "myTileLoadedCallback.h" 20 #include "terrainModificationTechnique.h" 21 #include <osgTerrain/Terrain> 22 #include <osgTerrain/GeometryTechnique> 19 23 #include <osg/observer_ptr> 24 #include <vector> 20 25 21 26 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 */ 22 42 class ModificationManager 23 43 { 24 44 public: 45 //! Destructor: Must be public to ensure the singleton can be cleand up at the end of the programm. 25 46 ~ModificationManager(){}; 26 47 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 */ 27 53 static ModificationManager* getInstance() {static ModificationManager instance; return &instance;} 28 54 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); 30 61 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); 35 69 36 70 37 71 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 78 private: 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 38 88 };
Note: See TracChangeset
for help on using the changeset viewer.