Ignore:
Timestamp:
Feb 21, 2011, 6:35:43 PM (13 years ago)
Author:
Torben Dannhauer
Message:

Pseudoloader works!

Next step: learn how to perform mdifications in the pseudoloader.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • experimental/TerrainTest/ModificationVisitor.cpp

    r251 r252  
    11#include "ModificationVisitor.h"
    22
    3 ModificationVisitor::ModificationVisitor()
     3ModificationVisitor::ModificationVisitor(std::string extensionToSet) : _extensionToSet(extensionToSet)
    44{
    55        setTraversalMode( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN );
     
    88void ModificationVisitor::apply( osg::Node& node )
    99{
    10         OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: Node found" << std::endl;
     10        //OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: Node found: " << node.className() << std::endl;
    1111        traverse( node );
    1212}
     
    1414void ModificationVisitor::apply( osg::PagedLOD& pNode )
    1515{
    16         OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: pagedLOD found" << std::endl;
     16        //OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: pagedLOD found: " << pNode.className() << std::endl;
     17
     18        for( unsigned int i=0;i<pNode.getNumFileNames();i++)
     19        {
     20                //OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: pagedLOD Child #" << i << std::endl;
     21                if(pNode.getFileName(i)!="")
     22                {
     23                        //OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: pagedLOD Child Name pre: " << pNode.getFileName(i) << std::endl;
     24                        pNode.setFileName(i, pNode.getFileName(i)+_extensionToSet );
     25                        //OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: pagedLOD Child Name post: " << newFileName << std::endl;
     26                }
     27        }
     28
    1729        traverse( pNode );
    1830}
Note: See TracChangeset for help on using the changeset viewer.