Changeset 256 for experimental/TerrainTest/ModificationVisitor.cpp
- Timestamp:
- Feb 21, 2011, 9:36:05 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/TerrainTest/ModificationVisitor.cpp
r255 r256 1 1 #include "ModificationVisitor.h" 2 3 using namespace osgTerrain; 2 4 3 5 ModificationVisitor::ModificationVisitor(std::string extensionToSet) : _extensionToSet(extensionToSet) … … 12 14 if(std::string(node.className())=="TerrainTile") 13 15 { 14 OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: Tile found" << std::endl; 15 modifyTile(node); 16 //OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: Tile found" << std::endl; 17 osgTerrain::TerrainTile* tile = dynamic_cast<osgTerrain::TerrainTile*>(&node); 18 if(tile) 19 modifyTile(tile); 16 20 } 17 21 … … 37 41 } 38 42 39 void ModificationVisitor::modifyTile(osg ::Node& node)43 void ModificationVisitor::modifyTile(osgTerrain::TerrainTile* tile) 40 44 { 41 OSG_NOTIFY( osg::ALWAYS ) << "ModificationVisitor::modifyTerrain()" << std::endl; 45 OSG_NOTIFY( osg::ALWAYS ) << "ModificationVisitor::modifyTile()" << std::endl; 46 OpenThreads::Thread::microSleep( 500000 ); 42 47 43 48 HeightFieldLayer* hfl = dynamic_cast<HeightFieldLayer*>(tile->getElevationLayer()); 49 osg::HeightField* h = hfl->getHeightField(); 50 OSG_NOTIFY( osg::ALWAYS ) << "Origin: " << h->getOrigin()[0] <<" | "<<h->getOrigin()[1]<<" | "<<h->getOrigin()[2] << std::endl; 51 OSG_NOTIFY( osg::ALWAYS ) << "X-Intervall: " << h->getXInterval() << std::endl; 52 OSG_NOTIFY( osg::ALWAYS ) << "Y-Intervall: " << h->getYInterval() << std::endl; 44 53 45 54 55 // Determine if tile touches ROI 46 56 47 OpenThreads::Thread::microSleep( 500000 ); 57 // calculate colum start/end and row start/end of affected vertices 58 59 // modify height value of affected vertices 48 60 }
Note: See TracChangeset
for help on using the changeset viewer.