Changeset 258 for experimental
- Timestamp:
- Feb 23, 2011, 8:28:20 AM (14 years ago)
- Location:
- experimental/TerrainTest
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
experimental/TerrainTest/ModificationVisitor.cpp
r257 r258 6 6 { 7 7 setTraversalMode( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN ); 8 technique = new ellipsoidTechnique(); 8 9 } 9 10 … … 43 44 void ModificationVisitor::modifyTile(osgTerrain::TerrainTile* tile) 44 45 { 45 //OSG_NOTIFY( osg::ALWAYS ) << "ModificationVisitor::modifyTile() " << std::endl;46 //OSG_NOTIFY( osg::ALWAYS ) << "ModificationVisitor::modifyTile() : Checking if tile is affected.." << std::endl; 46 47 HeightFieldLayer* hfl = dynamic_cast<HeightFieldLayer*>(tile->getElevationLayer()); 47 48 osg::HeightField* h = hfl->getHeightField(); … … 54 55 55 56 // Determine extend of the tile. 56 int rows = h->getNumRows();57 int cols = h->getNumColumns();58 57 double lat_min = h->getOrigin()[1]; 59 double lat_max = lat_min + rows* h->getYInterval();58 double lat_max = lat_min + h->getNumRows() * h->getYInterval(); 60 59 double lon_min = h->getOrigin()[0]; 61 double lon_max = lon_min + cols* h->getXInterval();60 double lon_max = lon_min + h->getNumColumns() * h->getXInterval(); 62 61 63 62 // Check if tile is fully or partially inside ROI: … … 65 64 && lon_max>dest_lon_min && lon_min<dest_lon_max ) // lon inside ROI 66 65 { 67 OSG_NOTIFY( osg::ALWAYS ) << "ModificationVisitor::modifyTile() :: affected Tile" << std::endl; 68 OSG_NOTIFY( osg::ALWAYS ) << "LAT: " << lat_min << " | " << lat_max << std::endl; 69 OSG_NOTIFY( osg::ALWAYS ) << "LON: " << lon_min << " | " << lon_max << std::endl; 70 71 72 // calculate colum start/end and row start/end of affected vertices 73 int startX=0,startY=0,endX=cols,endY=rows; 74 75 76 // modify height value of affected vertices 77 h->setHeight( 0,0, 600); 78 66 technique->modifyHeightfield(h, lat_min, lat_max, lon_min, lon_max); 79 67 } 80 81 82 83 84 85 86 87 //OSG_NOTIFY( osg::ALWAYS ) << "Origin: " << h->getOrigin()[0] << " | " << h->getOrigin()[1] << std::endl;88 //OSG_NOTIFY( osg::ALWAYS ) << "X-Intervall: " << h->getXInterval() << std::endl;89 //OSG_NOTIFY( osg::ALWAYS ) << "Y-Intervall: " << h->getYInterval() << std::endl;90 //if(dest_lat_min<=lat_min && lat_max<=dest_lat_max && dest_lon_min<=lon_min && lon_max<=dest_lon_max)91 //{92 // OSG_NOTIFY( osg::ALWAYS ) << "ModificationVisitor::modifyTile() :: affected Tile" << std::endl;93 // OSG_NOTIFY( osg::ALWAYS ) << "LAT: " << lat_min << " | " << lat_max << std::endl;94 // OSG_NOTIFY( osg::ALWAYS ) << "LON: " << lon_min << " | " << lon_max << std::endl;95 96 // h->setHeight( 0,0, 1000);97 //}98 //OpenThreads::Thread::microSleep( 50000 );99 68 } -
experimental/TerrainTest/ModificationVisitor.h
r256 r258 6 6 #include <osgTerrain/TerrainTile> 7 7 #include <osgTerrain/Layer> 8 9 #include "ellipsoidTechnique.h" 8 10 9 11 … … 18 20 void modifyTile(osgTerrain::TerrainTile* tile); 19 21 std::string _extensionToSet; 22 23 ellipsoidTechnique* technique; 20 24 }; -
experimental/TerrainTest/Plugins terrainmod/Plugins terrainmod.vcproj
r256 r258 180 180 > 181 181 <File 182 RelativePath="..\ellipsoidTechnique.cpp" 183 > 184 </File> 185 <File 182 186 RelativePath="..\ModificationVisitor.cpp" 183 187 > … … 194 198 > 195 199 <File 200 RelativePath="..\ellipsoidTechnique.h" 201 > 202 </File> 203 <File 196 204 RelativePath="..\ModificationVisitor.h" 197 205 >
Note: See TracChangeset
for help on using the changeset viewer.