Ignore:
Timestamp:
Feb 21, 2011, 9:36:05 PM (13 years ago)
Author:
Torben Dannhauer
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/TerrainTest/ModificationVisitor.cpp

    r255 r256  
    11#include "ModificationVisitor.h"
     2
     3using namespace osgTerrain;
    24
    35ModificationVisitor::ModificationVisitor(std::string extensionToSet) : _extensionToSet(extensionToSet)
     
    1214        if(std::string(node.className())=="TerrainTile")
    1315        {
    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);
    1620        }
    1721
     
    3741}
    3842
    39 void ModificationVisitor::modifyTile(osg::Node& node)
     43void ModificationVisitor::modifyTile(osgTerrain::TerrainTile* tile)
    4044{
    41         OSG_NOTIFY( osg::ALWAYS ) << "ModificationVisitor::modifyTerrain()" << std::endl;
     45        OSG_NOTIFY( osg::ALWAYS ) << "ModificationVisitor::modifyTile()" << std::endl;
     46        OpenThreads::Thread::microSleep( 500000 );
    4247
    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;
    4453
    4554
     55        // Determine if tile touches ROI
    4656
    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
    4860}
Note: See TracChangeset for help on using the changeset viewer.