From 9bde24d3d2fb9ee1a14b5beca4318a1b98942404 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 29 Sep 2010 12:38:56 +0000 Subject: [PATCH] Added command line option for writing out the scene graph to file. --- examples/osgtext/osgtext.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/osgtext/osgtext.cpp b/examples/osgtext/osgtext.cpp index 7412c6074..78f69eb7a 100644 --- a/examples/osgtext/osgtext.cpp +++ b/examples/osgtext/osgtext.cpp @@ -698,9 +698,12 @@ int main(int argc, char** argv) viewer.setSceneData(group); } -#if 0 - osgDB::writeNodeFile(*viewer.getSceneData(),"text.osg"); -#endif + std::string filename; + if (arguments.read("-o",filename)) + { + osgDB::writeNodeFile(*viewer.getSceneData(),filename); + return 0; + } viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); viewer.addEventHandler(new osgViewer::StatsHandler()); @@ -716,5 +719,7 @@ int main(int argc, char** argv) (*itr)->cancel(); } } + + return 0; }