/* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer * * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. * You have to aquire licenses for all used proprietary modules. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include "ModificationManager.h" // Used geometryTechniques #include "myTerrainTechnique.h" // Used terrainTechniques. //- #define USE_TERRAIN_PROTO_WORKAROUND USE_TERRAIN_PROTO_WORKAROUND using namespace osgTerrain; void ModificationManager::addTerrainToManage(osgTerrain::Terrain* terrain) { if(terrain) managedTerrain.push_back(terrain); } bool ModificationManager::removeTerrainToManage(osgTerrain::Terrain* terrain) { for(unsigned int i=0;isetTerrainTechniquePrototype( NULL ); #ifdef USE_TERRAIN_PROTO_WORKAROUND osgTerrain::TerrainTile::setTileLoadedCallback(NULL); #endif } else { terrain->setTerrainTechniquePrototype( geomTechnique ); #ifdef USE_TERRAIN_PROTO_WORKAROUND osg::ref_ptr > tlcb = new osgTerrain::GeometryTechniquePrototypeWorkaroundTLC(); osgTerrain::TerrainTile::setTileLoadedCallback(tlcb); #endif } return; } // IF END } // FOR END }