Show
Ignore:
Timestamp:
12/14/10 15:32:16 (3 years ago)
Author:
robert
Message:

Improved the parsing of output filename

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osganalysis/osganalysis.cpp

    r12030 r12031  
    2323#include <osgDB/ReadFile> 
    2424#include <osgDB/WriteFile> 
     25#include <osgDB/FileNameUtils> 
    2526 
    2627#include <osgGA/TrackballManipulator> 
     
    481482        _modelReadyToMerge(false), 
    482483        _sceneGraphProcessor(sceneGraphProcessor), 
    483         _incrementalCompileOperation(ico) {} 
     484        _incrementalCompileOperation(ico) 
     485        { 
     486        } 
    484487 
    485488    virtual void operator () (osg::Object* object) 
     
    502505            if (!_outputFilename.empty()) 
    503506            { 
     507                OSG_NOTICE<<"Writing out file "<<_outputFilename<<std::endl; 
     508                 
    504509                osgDB::writeNodeFile(*_loadedModel, _outputFilename); 
    505510            } 
     
    636641 
    637642    std::string outputPostfix; 
    638     while (arguments.read("-o",outputPostfix)) {} 
     643    while (arguments.read("-o",outputPostfix)) { OSG_NOTICE<<"Set ouputPostfix to "<<outputPostfix<<std::endl; } 
    639644 
    640645 
     
    667672 
    668673    std::string filename = fileNames[modelIndex++]; 
    669     std::string outputFilename = outputPostfix.empty() ? std::string() : filename+outputPostfix; 
     674    std::string outputFilename = outputPostfix.empty() ? std::string() : osgDB::getStrippedName(filename)+outputPostfix; 
    670675 
    671676    databasePagingOperation = new DatabasePagingOperation( 
     
    695700        { 
    696701            std::string filename = fileNames[modelIndex++]; 
    697             std::string outputFilename = outputPostfix.empty() ? std::string() : filename+outputPostfix; 
     702            std::string outputFilename = outputPostfix.empty() ? std::string() : osgDB::getStrippedName(filename)+outputPostfix; 
    698703 
    699704            databasePagingOperation = new DatabasePagingOperation(