Added command line option for writing out the scene graph to file.

This commit is contained in:
Robert Osfield 2010-09-29 12:38:56 +00:00
parent b40acacf53
commit 9bde24d3d2

View File

@ -698,9 +698,12 @@ int main(int argc, char** argv)
viewer.setSceneData(group); viewer.setSceneData(group);
} }
#if 0 std::string filename;
osgDB::writeNodeFile(*viewer.getSceneData(),"text.osg"); if (arguments.read("-o",filename))
#endif {
osgDB::writeNodeFile(*viewer.getSceneData(),filename);
return 0;
}
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
viewer.addEventHandler(new osgViewer::StatsHandler()); viewer.addEventHandler(new osgViewer::StatsHandler());
@ -716,5 +719,7 @@ int main(int argc, char** argv)
(*itr)->cancel(); (*itr)->cancel();
} }
} }
return 0;
} }