Ignore:
Timestamp:
Feb 21, 2011, 9:36:05 PM (14 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
experimental/TerrainTest
Files:
3 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}
  • experimental/TerrainTest/ModificationVisitor.h

    r255 r256  
    55#include <osg/PagedLOD>
    66#include <osgTerrain/TerrainTile>
     7#include <osgTerrain/Layer>
    78
    89
     
    1516
    1617private:
    17         void modifyTile(osg::Node& node);
     18        void modifyTile(osgTerrain::TerrainTile* tile);
    1819        std::string _extensionToSet;
    1920};
  • experimental/TerrainTest/Plugins terrainmod/Plugins terrainmod.vcproj

    r253 r256  
    6262                                Name="VCLinkerTool"
    6363                                LinkLibraryDependencies="false"
    64                                 AdditionalDependencies="osgDBd.lib osgd.lib OpenThreadsd.lib"
     64                                AdditionalDependencies="osgTerraind.lib osgDBd.lib osgd.lib OpenThreadsd.lib"
    6565                                OutputFile="$(OSG_ROOT)\bin\osgPlugins-2.9.11\osgdb_terrainmodd.dll"
    6666                                Version="0.0"
     
    138138                                Name="VCLinkerTool"
    139139                                LinkLibraryDependencies="false"
    140                                 AdditionalDependencies="osgDB.lib osg.lib OpenThreads.lib"
     140                                AdditionalDependencies="osgTerrain.lib osgDB.lib osg.lib OpenThreads.lib"
    141141                                OutputFile="$(OSG_ROOT)\bin\osgPlugins-2.9.11\osgdb_terrainmod.dll"
    142142                                Version="0.0"
Note: See TracChangeset for help on using the changeset viewer.