Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef mitkSceneIO_h_included
00019 #define mitkSceneIO_h_included
00020
00021 #include "SceneSerializationExports.h"
00022
00023 #include "mitkDataStorage.h"
00024 #include "mitkNodePredicateBase.h"
00025
00026 #include <Poco/Zip/ZipLocalFileHeader.h>
00027
00028 class TiXmlElement;
00029
00030 namespace mitk
00031 {
00032
00033 class BaseData;
00034 class PropertyList;
00035
00036 class SceneSerialization_EXPORT SceneIO : public itk::Object
00037 {
00038 public:
00039
00040 mitkClassMacro( SceneIO, itk::Object );
00041 itkNewMacro(Self);
00042
00043 typedef DataStorage::SetOfObjects FailedBaseDataListType;
00044
00056 virtual DataStorage::Pointer LoadScene( const std::string& filename,
00057 DataStorage* storage = NULL,
00058 bool clearStorageFirst = false );
00059
00072 virtual bool SaveScene( DataStorage::SetOfObjects::ConstPointer sceneNodes, const DataStorage* storage,
00073 const std::string& filename);
00074
00081 const FailedBaseDataListType* GetFailedNodes();
00082
00094 const PropertyList* GetFailedProperties();
00095
00096 protected:
00097
00098 SceneIO();
00099 virtual ~SceneIO();
00100
00101 std::string CreateEmptyTempDirectory();
00102
00103 TiXmlElement* SaveBaseData( BaseData* data, const std::string& filenamehint, bool& error);
00104 TiXmlElement* SavePropertyList( PropertyList* propertyList, const std::string& filenamehint );
00105
00106 void OnUnzipError(const void* pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string>& info);
00107 void OnUnzipOk(const void* pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const Poco::Path>& info);
00108
00109 FailedBaseDataListType::Pointer m_FailedNodes;
00110 PropertyList::Pointer m_FailedProperties;
00111
00112 std::string m_WorkingDirectory;
00113 unsigned int m_UnzipErrors;
00114 };
00115
00116 }
00117
00118 #endif
00119