Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
#include <mitkSceneIO.h>
Public Types | |
typedef DataStorage::SetOfObjects | FailedBaseDataListType |
Public Member Functions | |
mitkClassMacroItkParent (SceneIO, itk::Object) | |
Pointer | Clone () const |
virtual DataStorage::Pointer | LoadScene (const std::string &filename, DataStorage *storage=nullptr, bool clearStorageFirst=false) |
Load a scene of objects from file. More... | |
virtual DataStorage::Pointer | LoadSceneUnzipped (const std::string &indexfilename, DataStorage *storage=nullptr, bool clearStorageFirst=false) |
Load a scene of objects from directory. More... | |
virtual bool | SaveScene (DataStorage::SetOfObjects::ConstPointer sceneNodes, const DataStorage *storage, const std::string &filename) |
Save a scene of objects to file. More... | |
const FailedBaseDataListType * | GetFailedNodes () |
Get a list of nodes (BaseData containers) that failed to be read/written. More... | |
const PropertyList * | GetFailedProperties () |
Get a list of properties that failed to be read/written. More... | |
Static Public Member Functions | |
static Pointer | New () |
Protected Member Functions | |
SceneIO () | |
~SceneIO () override | |
std::string | CreateEmptyTempDirectory () |
TiXmlElement * | SaveBaseData (BaseData *data, const std::string &filenamehint, bool &error) |
TiXmlElement * | SavePropertyList (PropertyList *propertyList, const std::string &filenamehint) |
void | OnUnzipError (const void *pSender, std::pair< const Poco::Zip::ZipLocalFileHeader, const std::string > &info) |
void | OnUnzipOk (const void *pSender, std::pair< const Poco::Zip::ZipLocalFileHeader, const Poco::Path > &info) |
Protected Attributes | |
FailedBaseDataListType::Pointer | m_FailedNodes |
PropertyList::Pointer | m_FailedProperties |
std::string | m_WorkingDirectory |
unsigned int | m_UnzipErrors |
Definition at line 30 of file mitkSceneIO.h.
Definition at line 35 of file mitkSceneIO.h.
|
protected |
Definition at line 41 of file mitkSceneIO.cpp.
|
overrideprotected |
Definition at line 45 of file mitkSceneIO.cpp.
Pointer mitk::SceneIO::Clone | ( | ) | const |
|
protected |
Definition at line 49 of file mitkSceneIO.cpp.
References File, mitk::StandardFileLocations::GetInstance(), mitk::StandardFileLocations::GetOptionDirectory(), mitk::UIDGenerator::GetUID(), and MITK_ERROR.
Referenced by LoadScene(), and SaveScene().
const mitk::SceneIO::FailedBaseDataListType * mitk::SceneIO::GetFailedNodes | ( | ) |
Get a list of nodes (BaseData containers) that failed to be read/written.
FailedBaseDataListType hold all those nodes that contain BaseData objects which could not be read or written during the last call to LoadScene or SaveScene.
Definition at line 556 of file mitkSceneIO.cpp.
References m_FailedNodes.
const mitk::PropertyList * mitk::SceneIO::GetFailedProperties | ( | ) |
Get a list of properties that failed to be read/written.
Each entry corresponds to a property which could not be (de)serialized. The properties may come from either of
Definition at line 561 of file mitkSceneIO.cpp.
References m_FailedProperties.
|
virtual |
Load a scene of objects from file.
Attempts to read the provided file and create objects with parent/child relations into a DataStorage.
filename | full filename of the scene file |
storage | If given, this DataStorage is used instead of a newly created one |
clearStorageFirst | If set, the provided DataStorage will be cleared before populating it with the loaded objects |
Definition at line 84 of file mitkSceneIO.cpp.
References CreateEmptyTempDirectory(), File, mitk::IOUtil::GetDirectorySeparator(), LoadSceneUnzipped(), m_UnzipErrors, m_WorkingDirectory, MITK_ERROR, mitk::StandaloneDataStorage::New(), OnUnzipError(), and OnUnzipOk().
|
virtual |
Load a scene of objects from directory.
Does the same like LoadScene, but assumes that the given filename is the index.xml of the scene and the working directory is the directory of the given filename. This function can be used to load an already unpacked scene and create objects with parent/child relations into a DataStorage.
filename | full filename of the scene index file |
storage | If given, this DataStorage is used instead of a newly created one |
clearStorageFirst | If set, the provided DataStorage will be cleared before populating it with the loaded objects |
Definition at line 160 of file mitkSceneIO.cpp.
References mitk::IOUtil::GetDirectorySeparator(), MITK_ERROR, mitk::SceneReader::New(), and mitk::StandaloneDataStorage::New().
Referenced by LoadScene().
mitk::SceneIO::mitkClassMacroItkParent | ( | SceneIO | , |
itk::Object | |||
) |
|
static |
|
protected |
Definition at line 566 of file mitkSceneIO.cpp.
References m_UnzipErrors, and MITK_ERROR.
Referenced by LoadScene().
|
protected |
Definition at line 573 of file mitkSceneIO.cpp.
Referenced by LoadScene().
|
protected |
Definition at line 472 of file mitkSceneIO.cpp.
References m_WorkingDirectory, and MITK_ERROR.
Referenced by SaveScene().
|
protected |
Definition at line 523 of file mitkSceneIO.cpp.
References m_FailedProperties, m_WorkingDirectory, MITK_ERROR, and mitk::PropertyListSerializer::New().
Referenced by SaveScene().
|
virtual |
Save a scene of objects to file.
Attempts to write a scene file, which contains the nodes of the provided DataStorage, their parent/child relations, and properties.
storage | a DataStorage containing all nodes that should be saved |
filename | full filename of the scene file |
predicate | defining which items of the datastorage to use and which not |
Definition at line 217 of file mitkSceneIO.cpp.
References mitk::ProgressBar::AddStepsToDo(), CreateEmptyTempDirectory(), File, mitk::DataNode::GetData(), mitk::ProgressBar::GetInstance(), mitk::DataNode::GetName(), mitk::DataNode::GetPropertyList(), mitk::DataNode::GetPropertyListNames(), mitk::DataStorage::GetSources(), mitk::UIDGenerator::GetUID(), mitk::PropertyList::IsEmpty(), m_FailedNodes, m_FailedProperties, m_WorkingDirectory, MITK_ERROR, MITK_INFO, MITK_WARN, mitk::PropertyList::New(), mitk::ProgressBar::Progress(), SaveBaseData(), and SavePropertyList().
|
protected |
Definition at line 126 of file mitkSceneIO.h.
Referenced by GetFailedNodes(), and SaveScene().
|
protected |
Definition at line 127 of file mitkSceneIO.h.
Referenced by GetFailedProperties(), SavePropertyList(), and SaveScene().
|
protected |
Definition at line 130 of file mitkSceneIO.h.
Referenced by LoadScene(), and OnUnzipError().
|
protected |
Definition at line 129 of file mitkSceneIO.h.
Referenced by LoadScene(), SaveBaseData(), SavePropertyList(), and SaveScene().