#include "clitkIO.h"
#include "vvMainWindow.h"
+#include "vvReadState.h"
#include "vvToolsList.h"
#include <vtkFileOutputWindow.h>
#include <vtkSmartPointer.h>
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();
i++;
}
vvReadState::vvReadState() : m_XmlReader(new QXmlStreamReader), m_File(new QFile)
{
+ m_NumImages = 0;
}
vvReadState::~vvReadState()
{
assert(vvWindow);
+ m_NumImages = 0;
m_File->setFileName(file.c_str());
m_File->open(QIODevice::ReadOnly);
m_XmlReader->setDevice(m_File.get());
}
}
}
+
+ if (!m_XmlReader->hasError())
+ m_NumImages++;
return value;
}
virtual ~vvReadState();
virtual void Run(vvMainWindow* vvWindow, const std::string& file);
+ int GetNumberOfImages() { return m_NumImages; }
protected:
std::auto_ptr<QFile> m_File;
vvMainWindow* m_Window;
int m_TreeItemCount;
+ int m_NumImages;
};
#endif // VVREADSTATE_H