Show
Ignore:
Timestamp:
02/23/11 12:43:30 (4 years ago)
Author:
robert
Message:

Added error reporting for old options

Files:
1 modified

Legend:

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

    r12182 r12183  
    973973    arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); 
    974974    arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); 
    975     arguments.getApplicationUsage()->addCommandLineOption("-s <numSlices>","Number of slices to create."); 
    976975    arguments.getApplicationUsage()->addCommandLineOption("--images [filenames]","Specify a stack of 2d images to build the 3d volume from."); 
    977976    arguments.getApplicationUsage()->addCommandLineOption("--shader","Use OpenGL Shading Language. (default)"); 
     
    986985    arguments.getApplicationUsage()->addCommandLineOption("--ySize <size>","Relative length of rendered brick."); 
    987986    arguments.getApplicationUsage()->addCommandLineOption("--zSize <size>","Relative height of rendered brick."); 
    988     arguments.getApplicationUsage()->addCommandLineOption("--xMultiplier <multiplier>","Tex coord x mulitplier."); 
    989     arguments.getApplicationUsage()->addCommandLineOption("--yMultiplier <multiplier>","Tex coord y mulitplier."); 
    990     arguments.getApplicationUsage()->addCommandLineOption("--zMultiplier <multiplier>","Tex coord z mulitplier."); 
    991     arguments.getApplicationUsage()->addCommandLineOption("--clip <ratio>","clip volume as a ratio, 0.0 clip all, 1.0 clip none."); 
    992987    arguments.getApplicationUsage()->addCommandLineOption("--maxTextureSize <size>","Set the texture maximum resolution in the s,t,r (x,y,z) dimensions."); 
    993988    arguments.getApplicationUsage()->addCommandLineOption("--s_maxTextureSize <size>","Set the texture maximum resolution in the s (x) dimension."); 
     
    10691064    } 
    10701065 
    1071     unsigned int numSlices=500; 
    1072     while (arguments.read("-s",numSlices)) {} 
    1073  
    1074  
    1075     float sliceEnd=1.0f; 
    1076     while (arguments.read("--clip",sliceEnd)) {} 
     1066    { 
     1067        // deprecated options 
     1068 
     1069        bool invalidOption = false; 
     1070 
     1071        unsigned int numSlices=500; 
     1072        while (arguments.read("-s",numSlices)) { OSG_NOTICE<<"Warning: -s option no longer supported."<<std::endl; invalidOption = true; } 
     1073 
     1074        float sliceEnd=1.0f; 
     1075        while (arguments.read("--clip",sliceEnd)) { OSG_NOTICE<<"Warning: --clip option no longer supported."<<std::endl; invalidOption = true; } 
     1076 
     1077        float xMultiplier=1.0f; 
     1078        while (arguments.read("--xMultiplier",xMultiplier)) { OSG_NOTICE<<"Warning: --xMultiplier option no longer supported."<<std::endl; invalidOption = true; } 
     1079 
     1080        float yMultiplier=1.0f; 
     1081        while (arguments.read("--yMultiplier",yMultiplier)) { OSG_NOTICE<<"Warning: --yMultiplier option no longer supported."<<std::endl; invalidOption = true; } 
     1082 
     1083        float zMultiplier=1.0f; 
     1084        while (arguments.read("--zMultiplier",zMultiplier)) { OSG_NOTICE<<"Warning: --yMultiplier option no longer supported."<<std::endl; invalidOption = true; } 
     1085 
     1086        if (invalidOption) return 1; 
     1087    } 
     1088 
    10771089 
    10781090    float alphaFunc=0.02f; 
     
    16761688 
    16771689    return 0; 
    1678  
    16791690}