diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index 671ddcaaf..dbad28ea8 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -51,6 +51,7 @@ #include +#include #include @@ -1847,8 +1848,55 @@ int main( int argc, char **argv ) { if (!arguments.isOption(pos)) { - // not an option so assume string is a filename. - image_3d = osgDB::readImageFile( arguments[pos]); + std::string filename = arguments[pos]; + + osgDB::FileType fileType = osgDB::fileType(filename); + if (fileType == osgDB::FILE_NOT_FOUND) + { + filename = osgDB::findDataFile(filename); + fileType = osgDB::fileType(filename); + } + + if (fileType == osgDB::DIRECTORY) + { + osgDB::DirectoryContents contents = osgDB::getDirectoryContents(filename); + + std::sort(contents.begin(), contents.end()); + + ImageList imageList; + for(osgDB::DirectoryContents::iterator itr = contents.begin(); + itr != contents.end(); + ++itr) + { + std::string localFile = filename + "/" + *itr; + std::cout<<"contents = "<