#include #include #include #include #include #include void testFrustum(double left,double right,double bottom,double top,double zNear,double zFar) { osg::Matrix f; f.makeFrustum(left,right,bottom,top,zNear,zFar); double c_left=0; double c_right=0; double c_top=0; double c_bottom=0; double c_zNear=0; double c_zFar=0; std::cout << "testFrustum"<setCommandLineUsage(arguments.getApplicationName()+" [options]"); arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); arguments.getApplicationUsage()->addCommandLineOption("qt","Display qualified tests."); arguments.getApplicationUsage()->addCommandLineOption("sizeof","Display sizeof tests."); arguments.getApplicationUsage()->addCommandLineOption("matrix","Display qualified tests."); if (arguments.argc()<=1) { arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); return 1; } bool printQualifiedTest = false; while (arguments.read("qt")) printQualifiedTest = true; bool printMatrixTest = false; while (arguments.read("matrix")) printMatrixTest = true; bool printSizeOfTest = false; while (arguments.read("sizeof")) printSizeOfTest = true; bool printQuatTest = false; while (arguments.read("quat")) printQuatTest = true; // if user request help write it out to cout. if (arguments.read("-h") || arguments.read("--help")) { std::cout<getCommandLineUsage()<write(std::cout,arguments.getApplicationUsage()->getCommandLineOptions()); return 1; } // any option left unread are converted into errors to write out later. arguments.reportRemainingOptionsAsUnrecognized(); // report any errors if they have occured when parsing the program aguments. if (arguments.errors()) { arguments.writeErrorMessages(std::cout); return 1; } if (printQuatTest) { testQuat(); } if (printMatrixTest) { std::cout<<"****** Running matrix tests ******"<accept( printer ); std::cout<accept( runner ); return 0; }