Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxFrameForest.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXFRAMEFOREST_H_
13 #define CXFRAMEFOREST_H_
14 
15 #include "cxResourceExport.h"
16 
17 #include "cxForwardDeclarations.h"
18 
19 #include <QDomDocument>
20 #include "cxTypeConversions.h"
21 
22 /*
23 
24 <root>
25  <frame uid="A">
26  <frame uid="MR1">
27  <frame uid="S1">
28  </frame>
29  <frame uid="S2">
30  </frame>
31  </frame>
32  <frame uid="CT1">
33  </frame>
34  </frame>
35  <frame uid="B">
36  <frame uid="MR2">
37  </frame>
38  </frame>
39 </root>
40 
41  */
42 
43 namespace cx
44 {
45 
64 class cxResource_EXPORT FrameForest
65 {
66 public:
67  explicit FrameForest(const std::map<QString, DataPtr>& source);
68  QDomNode getNode(QString frame);
69  QDomNode getOldestAncestor(QDomNode node);
70 
71  QDomNode getOldestAncestorNotCommonToRef(QDomNode child, QDomNode ref);
72  std::vector<QDomNode> getDescendantsAndSelf(QDomNode node);
73  std::vector<DataPtr> getDataFromDescendantsAndSelf(QDomNode node);
74  QDomDocument getDocument();
75 private:
76  bool isRootNode(QDomNode node);
77  QDomNode getNodeAnyway(QString frame);
78  bool isAncestorOf(QDomNode node, QDomNode ancestor);
79  void insertFrame(DataPtr data);
80  QDomDocument mDocument;
81 
82  std::map<QString, DataPtr> mSource;
83 };
84 
88 }
89 
90 #endif /* CXFRAMEFOREST_H_ */
A graph combining Space dependencies between all Data.Relations between coordinate spaces among Data ...
Definition: cxFrameForest.h:64
boost::shared_ptr< class Data > DataPtr
Namespace for all CustusX production code.