Last change
on this file since 252 was
252,
checked in by Torben Dannhauer, 13 years ago
|
Pseudoloader works!
Next step: learn how to perform mdifications in the pseudoloader.
|
File size:
1.0 KB
|
Rev | Line | |
---|
[251] | 1 | #include "ModificationVisitor.h" |
---|
| 2 | |
---|
[252] | 3 | ModificationVisitor::ModificationVisitor(std::string extensionToSet) : _extensionToSet(extensionToSet) |
---|
[251] | 4 | { |
---|
| 5 | setTraversalMode( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN ); |
---|
| 6 | } |
---|
| 7 | |
---|
| 8 | void ModificationVisitor::apply( osg::Node& node ) |
---|
| 9 | { |
---|
[252] | 10 | //OSG_NOTIFY( osg::ALWAYS ) << "ModVisitor: Node found: " << node.className() << std::endl; |
---|
[251] | 11 | traverse( node ); |
---|
| 12 | } |
---|
| 13 | |
---|
| 14 | void ModificationVisitor::apply( osg::PagedLOD& pNode ) |
---|
| 15 | { |
---|
[252] | 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 | |
---|
[251] | 29 | traverse( pNode ); |
---|
| 30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.