Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxRecordSession.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 CXRecordSession_H_
13 #define CXRecordSession_H_
14 
15 #include "org_custusx_acquisition_Export.h"
16 
17 #include <QString>
18 #include <map>
19 #include <QDateTime>
20 #include "boost/shared_ptr.hpp"
21 #include "cxForwardDeclarations.h"
22 #include "cxTransform3D.h"
23 #include "cxTool.h"
24 
25 class QDomNode;
26 
27 namespace cx
28 {
35 typedef boost::shared_ptr<class RecordSession> RecordSessionPtr;
36 typedef std::map<double, Transform3D> TimedTransformMap;
37 
46 class org_custusx_acquisition_EXPORT RecordSession
47 {
48 public:
49  RecordSession();
50  RecordSession(int id, QString category);
51  virtual ~RecordSession();
52 
53  QString getUid() const;
54  QString getHumanDescription() const;
55  QString getDescription() const;
56  std::pair<QDateTime,QDateTime> getInterval(int i);
57  unsigned getIntervalCount() const;
58 
59  void startNewInterval();
60  void stopLastInterval();
61  void cancelLastInterval();
62 
63  void addXml(QDomNode& node);
64  void parseXml(QDomNode& node);
65 
66  static TimedTransformMap getToolHistory_prMt(ToolPtr tool, RecordSessionPtr session, bool verbose);
67  static std::map<double, ToolPositionMetadata> getToolHistory_metadata(ToolPtr tool, RecordSessionPtr session, bool verbose);
68 
69 protected:
70  QDateTime getTimestamp() const;
71 
72  typedef std::pair<QDateTime, QDateTime> IntervalType;
73  std::vector<IntervalType> mIntervals;
74  QDateTime mTimestamp;
75  QString mCategory;
76  int mId;
77 
78  QDateTime timestamp2datetime(QString in) const;
79  QString datetime2timestamp(QDateTime in) const;
80 
81  bool isOldStyleXmlFormat(QDomNode& node);
82  void parseXml_oldstyle(QDomNode& parentNode);
83  void setIdAndTimestampFromUid(QString uid);
84 };
85 
89 }//namespace cx
90 
91 #endif /* CXRecordSession_H_ */
std::pair< QDateTime, QDateTime > IntervalType
std::vector< IntervalType > mIntervals
boost::shared_ptr< class RecordSession > RecordSessionPtr
std::map< double, Transform3D > TimedTransformMap
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr