- Timestamp:
- 12/24/03 00:55:06 (9 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgphotoalbum/osgphotoalbum.cpp
r2574 r2578 19 19 #include <osgUtil/Optimizer> 20 20 21 #include <osgDB/FileNameUtils> 22 21 23 #include <osgText/Text> 22 24 … … 448 450 for(int pos=1;pos<arguments.argc();++pos) 449 451 { 450 if (arguments.isString(pos)) fileList.push_back(arguments[pos]); 452 if (arguments.isString(pos)) 453 { 454 std::string filename(arguments[pos]); 455 if (osgDB::getLowerCaseFileExtension(filename)=="album") 456 { 457 PhotoArchive* photoArchive = PhotoArchive::open(filename); 458 if (photoArchive) 459 { 460 g_ImageReaderWriter.get()->addPhotoArchive(photoArchive); 461 photoArchive->getImageFileNameList(fileList); 462 } 463 464 } 465 else 466 { 467 fileList.push_back(arguments[pos]); 468 } 469 } 451 470 } 452 471 … … 653 672 arguments.getApplicationUsage()->addCommandLineOption("-a","Enter auto advance of image pairs on start up."); 654 673 arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); 674 arguments.getApplicationUsage()->addCommandLineOption("--create <filename>","Create an photo archive of specified files"); 655 675 656 676 … … 684 704 } 685 705 706 std::string archiveName; 707 while (arguments.read("--create",archiveName)) {} 708 686 709 // any option left unread are converted into errors to write out later. 687 710 arguments.reportRemainingOptionsAsUnrecognized(); … … 700 723 } 701 724 725 726 if (!archiveName.empty()) 727 { 728 // archive name set to create 729 PhotoArchive::FileNameList fileNameList; 730 for(int i=1;i<arguments.argc();++i) 731 { 732 if (arguments.isString(i)) fileNameList.push_back(std::string(arguments[i])); 733 } 734 735 PhotoArchive::buildArchive(archiveName,fileNameList); 736 737 return 0; 738 } 702 739 703 740
