]> Creatis software - clitk.git/blobdiff - vv/vv.cxx
more refined abort-on-exception mechanism
[clitk.git] / vv / vv.cxx
index 981105095d68a80934280b6e332895cc1d42fa9a..7f640a52a0579d660b251643a0357c8a7ad42327 100644 (file)
--- a/vv/vv.cxx
+++ b/vv/vv.cxx
@@ -30,6 +30,7 @@
 
 #include "clitkIO.h"
 #include "vvMainWindow.h"
+#include "vvReadState.h"
 #include "vvToolsList.h"
 #include <vtkFileOutputWindow.h>
 #include <vtkSmartPointer.h>
@@ -168,7 +169,14 @@ int main( int argc, char** argv )
           vtk_log->FlushOn();
           vtk_log->AppendOn();
           vtkOutputWindow::SetInstance(vtk_log);
+        } else if (current == "--state") {
+          //window.ReadSavedStateFile(argv[i+1]);
+          vvReadState read_state;
+          read_state.Run(&window, argv[i+1]);
+          n_image_loaded += read_state.GetNumberOfImages();
+          i++;
         }
+        
       } else if (parse_mode == P_SEQUENCE) {
         sequence_filenames.push_back(current);
       } else if (parse_mode == P_WINDOW) {
@@ -196,10 +204,13 @@ int main( int argc, char** argv )
     window.ApplyWindowLevelToAllImages();
   }
 
+
+  int ret = app.exec();
+  
 #ifndef _WIN32
   // restoring the locale, just to be clean...
   setlocale(LC_NUMERIC, old_locale.c_str());
 #endif
 
-  return app.exec();
+  return ret;
 }