Show
Ignore:
Timestamp:
01/05/07 16:52:33 (8 years ago)
Author:
robert
Message:

Simplified the osganimate and osgautotransform mains, removing most or all of the argument parser code.

Files:
1 modified

Legend:

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

    r5903 r5910  
    207207int main( int argc, char **argv ) 
    208208{ 
    209     // use an ArgumentParser object to manage the program arguments. 
     209     
     210    bool overlay = false; 
    210211    osg::ArgumentParser arguments(&argc,argv); 
    211  
    212     // set up the usage document, in case we need to print out how to use this program. 
    213     arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates use of osg::AnimationPath and UpdateCallbacks for adding animation to your scenes."); 
    214     arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); 
    215     arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); 
    216  
     212    while (arguments.read("--overlay")) overlay = true; 
     213     
    217214    // initialize the viewer. 
    218215    osgViewer::Viewer viewer; 
    219216 
    220     // if user request help write it out to cout. 
    221     if (arguments.read("-h") || arguments.read("--help")) 
    222     { 
    223         arguments.getApplicationUsage()->write(std::cout); 
    224         return 1; 
    225     } 
    226      
    227     bool overlay = false; 
    228     while (arguments.read("--overlay")) overlay = true; 
    229  
    230     // any option left unread are converted into errors to write out later. 
    231     arguments.reportRemainingOptionsAsUnrecognized(); 
    232  
    233     // report any errors if they have occured when parsing the program aguments. 
    234     if (arguments.errors()) 
    235     { 
    236         arguments.writeErrorMessages(std::cout); 
    237         return 1; 
    238     } 
    239      
    240217    // load the nodes from the commandline arguments. 
    241218    osg::Node* model = createModel(overlay);