Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkSceneReaderV1.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 #include "mitkSceneReader.h"
18 
19 namespace mitk
20 {
21  class SceneReaderV1 : public SceneReader
22  {
23  public:
25  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
26 
27  virtual bool LoadScene(TiXmlDocument &document,
28  const std::string &workingDirectory,
29  DataStorage *storage) override;
30 
31  protected:
35  DataNode::Pointer LoadBaseDataFromDataTag(TiXmlElement *dataElement,
36  const std::string &workingDirectory,
37  bool &error);
38 
42  bool DecorateNodeWithProperties(DataNode *node, TiXmlElement *nodeElement, const std::string &workingDirectory);
43 
56 
63  TiXmlElement *baseDataNodeElem,
64  const std::string &workingDir);
65 
66  typedef std::pair<DataNode::Pointer, std::list<std::string>> NodesAndParentsPair;
67  typedef std::list<NodesAndParentsPair> OrderedNodesList;
68  typedef std::map<std::string, DataNode *> IDToNodeMappingType;
69  typedef std::map<DataNode *, std::string> NodeToIDMappingType;
70 
71  OrderedNodesList m_OrderedNodePairs;
72  IDToNodeMappingType m_NodeForID;
73  NodeToIDMappingType m_IDForNode;
74 
76  };
77 }
Data management class that handles 'was created by' relations.
Generated unique IDs.
DataCollection - Class to facilitate loading/accessing structured data.
std::pair< DataNode::Pointer, std::list< std::string > > NodesAndParentsPair
Key-value list holding instances of BaseProperty.
void ClearNodePropertyListWithExceptions(DataNode &node, PropertyList &propertyList)
Clear a default property list and handle some exceptions.
NodeToIDMappingType m_IDForNode
std::map< DataNode *, std::string > NodeToIDMappingType
bool DecorateBaseDataWithProperties(BaseData::Pointer data, TiXmlElement *baseDataNodeElem, const std::string &workingDir)
reads all properties assigned to a base data element and assigns the list to the base data object ...
IDToNodeMappingType m_NodeForID
OrderedNodesList m_OrderedNodePairs
std::list< NodesAndParentsPair > OrderedNodesList
std::map< std::string, DataNode * > IDToNodeMappingType
bool DecorateNodeWithProperties(DataNode *node, TiXmlElement *nodeElement, const std::string &workingDirectory)
reads all the properties from the XML document and recreates them in node
mitkClassMacro(SceneReaderV1, SceneReader)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
virtual bool LoadScene(TiXmlDocument &document, const std::string &workingDirectory, DataStorage *storage) override
DataNode::Pointer LoadBaseDataFromDataTag(TiXmlElement *dataElement, const std::string &workingDirectory, bool &error)
tries to create one DataNode from a given XML element