Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkSceneIO.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkSceneIO_h_included
18 #define mitkSceneIO_h_included
19 
21 
22 #include "mitkDataStorage.h"
23 #include "mitkNodePredicateBase.h"
24 
25 #include <Poco/Zip/ZipLocalFileHeader.h>
26 
27 class TiXmlElement;
28 
29 namespace mitk
30 {
31  class BaseData;
32  class PropertyList;
33 
34  class MITKSCENESERIALIZATION_EXPORT SceneIO : public itk::Object
35  {
36  public:
37  mitkClassMacroItkParent(SceneIO, itk::Object);
38  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
39 
40  typedef DataStorage::SetOfObjects FailedBaseDataListType;
41 
55  virtual DataStorage::Pointer LoadScene(const std::string &filename,
56  DataStorage *storage = NULL,
57  bool clearStorageFirst = false);
58 
73  virtual bool SaveScene(DataStorage::SetOfObjects::ConstPointer sceneNodes,
74  const DataStorage *storage,
75  const std::string &filename);
76 
83  const FailedBaseDataListType *GetFailedNodes();
84 
96  const PropertyList *GetFailedProperties();
97 
98  protected:
99  SceneIO();
100  virtual ~SceneIO();
101 
102  std::string CreateEmptyTempDirectory();
103 
104  TiXmlElement *SaveBaseData(BaseData *data, const std::string &filenamehint, bool &error);
105  TiXmlElement *SavePropertyList(PropertyList *propertyList, const std::string &filenamehint);
106 
107  void OnUnzipError(const void *pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> &info);
108  void OnUnzipOk(const void *pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const Poco::Path> &info);
109 
110  FailedBaseDataListType::Pointer m_FailedNodes;
111  PropertyList::Pointer m_FailedProperties;
112 
113  std::string m_WorkingDirectory;
114  unsigned int m_UnzipErrors;
115  };
116 }
117 
118 #endif
Data management class that handles 'was created by' relations.
Base of all data objects.
Definition: mitkBaseData.h:39
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
Key-value list holding instances of BaseProperty.
static void info(const char *fmt,...)
Definition: svm.cpp:100
static const std::string filename
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
DataStorage::SetOfObjects FailedBaseDataListType
Definition: mitkSceneIO.h:40
#define MITKSCENESERIALIZATION_EXPORT