- Timestamp:
- 06/14/11 18:50:40 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgocclusionquery/osgocclusionquery.cpp
r12292 r12528 538 538 else if (ea.getKey()=='o') 539 539 { 540 if (osgDB::writeNodeFile( _node, "saved_model.osg " ))541 osg::notify( osg::ALWAYS ) << "osgOQ: Wrote scene graph to \"saved_model.osg \"" << std::endl;540 if (osgDB::writeNodeFile( _node, "saved_model.osgt" )) 541 osg::notify( osg::ALWAYS ) << "osgOQ: Wrote scene graph to \"saved_model.osgt\"" << std::endl; 542 542 else 543 osg::notify( osg::ALWAYS ) << "osgOQ: Wrote failed for \"saved_model.osg \"" << std::endl;543 osg::notify( osg::ALWAYS ) << "osgOQ: Wrote failed for \"saved_model.osgt\"" << std::endl; 544 544 return true; 545 545 } … … 745 745 viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage())); 746 746 747 bool optimize = arguments.read( "--opt" ); 747 748 748 749 // load the specified model 749 osg::ref_ptr<osg::Node> root = osgDB::readNodeFiles( arguments ); 750 if (!root) 751 { 752 std::cout << arguments.getApplicationName() <<": No files specified, or can't load them." << std::endl; 750 osg::ref_ptr<osg::Node> root = 0; 751 752 if (arguments.argc()>1) 753 { 754 root = osgDB::readNodeFiles( arguments ); 755 if (root.valid()) 756 { 757 // Run a NodeVisitor to insert OcclusionQueryNodes in the scene graph. 758 OcclusionQueryVisitor oqv; 759 root->accept( oqv ); 760 } 761 else 762 { 763 std::cout << arguments.getApplicationName() <<": unable to load specified data." << std::endl; 764 return 1; 765 } 766 } 767 else 768 { 753 769 root = createStockScene().get(); 754 770 if (!root) … … 757 773 return 1; 758 774 } 759 std::cout << "Using stock scene instead." << std::endl; 760 } 761 else 762 { 763 // Run a NodeVisitor to insert OcclusionQueryNodes in the scene graph. 764 OcclusionQueryVisitor oqv; 765 root->accept( oqv ); 766 } 767 768 bool optimize = arguments.read( "--opt" ); 775 } 769 776 770 777 // any option left unread are converted into errors to write out later.
