Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkSceneReader.h"
14 
15 namespace mitk
16 {
17  class SceneReaderV1 : public SceneReader
18  {
19  public:
21  itkFactorylessNewMacro(Self);
22  itkCloneMacro(Self);
23 
24  bool LoadScene(TiXmlDocument &document,
25  const std::string &workingDirectory,
26  DataStorage *storage) override;
27 
28  protected:
32  DataNode::Pointer LoadBaseDataFromDataTag(TiXmlElement *dataElement,
33  const std::string &workingDirectory,
34  bool &error);
35 
39  bool DecorateNodeWithProperties(DataNode *node, TiXmlElement *nodeElement, const std::string &workingDirectory);
40 
53 
60  TiXmlElement *baseDataNodeElem,
61  const std::string &workingDir);
62 
63  typedef std::pair<DataNode::Pointer, std::list<std::string>> NodesAndParentsPair;
64  typedef std::list<NodesAndParentsPair> OrderedNodesList;
65  typedef std::map<std::string, DataNode *> IDToNodeMappingType;
66  typedef std::map<DataNode *, std::string> NodeToIDMappingType;
67 
68  OrderedNodesList m_OrderedNodePairs;
69  IDToNodeMappingType m_NodeForID;
70  NodeToIDMappingType m_IDForNode;
71 
73  };
74 }
Data management class that handles &#39;was created by&#39; 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:57
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 <node> element