Show
Ignore:
Timestamp:
12/14/10 21:07:41 (3 years ago)
Author:
robert
Message:

Added --speed option and output of buffer object and texture object pool stats at the end of the animation path.

Files:
1 modified

Legend:

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

    r12033 r12035  
    468468 
    469469}; 
    470  
     470//  
    471471class DatabasePagingOperation : public osg::Operation, public osgUtil::IncrementalCompileOperation::CompileCompletedCallback 
    472472{ 
     
    560560}; 
    561561 
     562struct ReportStatsAnimationCompletedCallback : public osgGA::AnimationPathManipulator::AnimationCompletedCallback 
     563{ 
     564    virtual void completed(const osgGA::AnimationPathManipulator*) 
     565    { 
     566        OSG_NOTICE<<"Animation completed"<<std::endl; 
     567        osg::Texture::getTextureObjectManager(0)->reportStats(osg::notify(osg::NOTICE)); 
     568        osg::GLBufferObjectManager::getGLBufferObjectManager(0)->reportStats(osg::notify(osg::NOTICE)); 
     569    } 
     570}; 
    562571 
    563572int main(int argc, char** argv) 
     
    577586        keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() ); 
    578587 
     588        char keyForAnimationPath = '8'; 
     589        double animationSpeed = 1.0; 
     590        while(arguments.read("--speed",animationSpeed) ) {} 
     591 
    579592        std::string pathfile; 
    580         char keyForAnimationPath = '8'; 
    581593        while (arguments.read("-p",pathfile)) 
    582594        { 
     
    584596            if (apm || !apm->valid()) 
    585597            { 
     598                apm->setTimeScale(animationSpeed); 
     599                apm->setAnimationCompletedCallback(new ReportStatsAnimationCompletedCallback()); 
     600                 
    586601                unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); 
    587602                keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );