From 8d8852bc23663f5387f5fb93667c423f989b0be0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 25 Aug 2008 09:53:24 +0000 Subject: [PATCH] Added command line arguments to Viewer constructor, and added meaningful error message when no 3d image is provided --- examples/osgvolume/osgvolume.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index b8066e8a5..d1883d4cf 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -1495,7 +1495,7 @@ int main( int argc, char **argv ) // arguments.getApplicationUsage()->addCommandLineOption("--raw ","read a raw image data"); // construct the viewer. - osgViewer::Viewer viewer; + osgViewer::Viewer viewer(arguments); // if user request help write it out to cout. if (arguments.read("-h") || arguments.read("--help")) @@ -1620,7 +1620,11 @@ int main( int argc, char **argv ) } } - if (!image_3d) return 0; + if (!image_3d) + { + std::cout<<"No model loaded, please specify and volumetric image file on the command line."<