#include "ModificationVisitor.h" using namespace osgTerrain; ModificationVisitor::ModificationVisitor(std::string extensionToSet) : _extensionToSet(extensionToSet) { setTraversalMode( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN ); } void ModificationVisitor::apply( osg::Node& node ) { //OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: Node found: " << node.className() << std::endl; if(std::string(node.className())=="TerrainTile") { //OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: Tile found" << std::endl; osgTerrain::TerrainTile* tile = dynamic_cast(&node); if(tile) modifyTile(tile); } traverse( node ); } void ModificationVisitor::apply( osg::PagedLOD& pNode ) { //OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: pagedLOD found: " << pNode.className() << std::endl; for( unsigned int i=0;i(tile->getElevationLayer()); osg::HeightField* h = hfl->getHeightField(); OSG_NOTIFY( osg::ALWAYS ) << "Origin: " << h->getOrigin()[0] <<" | "<getOrigin()[1]<<" | "<getOrigin()[2] << std::endl; OSG_NOTIFY( osg::ALWAYS ) << "X-Intervall: " << h->getXInterval() << std::endl; OSG_NOTIFY( osg::ALWAYS ) << "Y-Intervall: " << h->getYInterval() << std::endl; // Determine if tile touches ROI // calculate colum start/end and row start/end of affected vertices // modify height value of affected vertices }