- read/save only images and overlays for now
- menu option to read/save state
- "--state XMLFILE" to read state from cmd line
#include "clitkIO.h"
#include "vvMainWindow.h"
#include "clitkIO.h"
#include "vvMainWindow.h"
+#include "vvReadState.h"
#include "vvToolsList.h"
#include <vtkFileOutputWindow.h>
#include <vtkSmartPointer.h>
#include "vvToolsList.h"
#include <vtkFileOutputWindow.h>
#include <vtkSmartPointer.h>
vtk_log->AppendOn();
vtkOutputWindow::SetInstance(vtk_log);
} else if (current == "--state") {
vtk_log->AppendOn();
vtkOutputWindow::SetInstance(vtk_log);
} else if (current == "--state") {
- window.ReadSavedStateFile(argv[i+1]);
+ //window.ReadSavedStateFile(argv[i+1]);
+ vvReadState read_state;
+ read_state.Run(&window, argv[i+1]);
+ n_image_loaded += read_state.GetNumberOfImages();
vvReadState::vvReadState() : m_XmlReader(new QXmlStreamReader), m_File(new QFile)
{
vvReadState::vvReadState() : m_XmlReader(new QXmlStreamReader), m_File(new QFile)
{
}
vvReadState::~vvReadState()
}
vvReadState::~vvReadState()
m_File->setFileName(file.c_str());
m_File->open(QIODevice::ReadOnly);
m_XmlReader->setDevice(m_File.get());
m_File->setFileName(file.c_str());
m_File->open(QIODevice::ReadOnly);
m_XmlReader->setDevice(m_File.get());
+
+ if (!m_XmlReader->hasError())
+ m_NumImages++;
virtual ~vvReadState();
virtual void Run(vvMainWindow* vvWindow, const std::string& file);
virtual ~vvReadState();
virtual void Run(vvMainWindow* vvWindow, const std::string& file);
+ int GetNumberOfImages() { return m_NumImages; }
std::auto_ptr<QFile> m_File;
vvMainWindow* m_Window;
int m_TreeItemCount;
std::auto_ptr<QFile> m_File;
vvMainWindow* m_Window;
int m_TreeItemCount;
};
#endif // VVREADSTATE_H
};
#endif // VVREADSTATE_H