CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxTrackingService.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 CXTRACKINGSERVICE_H
13 #define CXTRACKINGSERVICE_H
14 
15 #include "cxResourceExport.h"
16 
17 #include <QObject>
18 #include <boost/shared_ptr.hpp>
19 #include "cxTransform3D.h"
20 #include "cxTool.h"
21 
22 #define TrackingService_iid "cx::TrackingService"
23 
24 class QDomNode;
25 
26 namespace cx
27 {
28 
29 typedef std::map<double, Transform3D> TimedTransformMap;
30 typedef boost::shared_ptr<class Tool> ToolPtr;
31 typedef std::map<ToolPtr, TimedTransformMap> SessionToolHistoryMap;
32 typedef boost::shared_ptr<class Landmarks> LandmarksPtr;
33 typedef boost::shared_ptr<class PlaybackTime> PlaybackTimePtr;
34 typedef boost::shared_ptr<class TrackerConfiguration> TrackerConfigurationPtr;
35 
36 typedef boost::shared_ptr<class TrackingSystemService> TrackingSystemServicePtr;
37 typedef boost::shared_ptr<class TrackingService> TrackingServicePtr;
38 typedef boost::shared_ptr<class DummyTool> DummyToolPtr;
39 typedef boost::shared_ptr<class ManualTool> ManualToolPtr;
40 
49 class cxResource_EXPORT TrackingService : public QObject
50 {
51  Q_OBJECT
52 
53 public:
54  typedef std::map<QString, ToolPtr> ToolMap;
55 
56  virtual ~TrackingService() {}
57 
58  virtual Tool::State getState() const = 0;
59  virtual void setState(const Tool::State val) = 0;
60 
61  virtual ToolPtr getTool(const QString& uid) = 0;
62  virtual ToolPtr getActiveTool() = 0;
63  virtual void setActiveTool(const QString& uid) = 0;
64  virtual void clearActiveTool() = 0;
65  virtual ToolPtr getFirstProbe() = 0;
66 
67  virtual ToolPtr getReferenceTool() const = 0;
68  virtual ToolPtr getManualTool() = 0;
69 
70  virtual ToolMap getTools() = 0;
71 
72  virtual bool isPlaybackMode() const = 0;
73  virtual void setPlaybackMode(PlaybackTimePtr controller) = 0;
74 
75  virtual SessionToolHistoryMap getSessionHistory(double startTime, double stopTime) = 0;
76  virtual void runDummyTool(DummyToolPtr tool) = 0;
77  virtual std::vector<TrackerConfigurationPtr> getConfigurations() = 0;
78  //virtual TrackerConfigurationPtr getConfiguration(QString trackingSystemImplementation) = 0;//Set as private in TrackingImplService for now
79  virtual TrackerConfigurationPtr getConfiguration() = 0;
80  virtual void setCurrentTrackingSystemImplementation(QString trackingSystemImplementation) = 0;
81  virtual QString getCurrentTrackingSystemImplementation() = 0;
82 
83  virtual void installTrackingSystem(TrackingSystemServicePtr system) = 0;
84  virtual void unInstallTrackingSystem(TrackingSystemServicePtr system) = 0;
85  virtual std::vector<TrackingSystemServicePtr> getTrackingSystems() = 0;
86  virtual void resetTimeSynchronization() = 0;
87 
88  virtual bool isNull() = 0;
89  static TrackingServicePtr getNullObject();
90 
91 signals:
92  void stateChanged();
93  void activeToolChanged(const QString& uId);
94 
95 };
96 
97 } //cx
98 Q_DECLARE_INTERFACE(cx::TrackingService, TrackingService_iid)
99 
100 #endif // CXTRACKINGSERVICE_H
std::map< ToolPtr, TimedTransformMap > SessionToolHistoryMap
boost::shared_ptr< class TrackingService > TrackingServicePtr
boost::shared_ptr< class ManualTool > ManualToolPtr
boost::shared_ptr< class Landmarks > LandmarksPtr
Definition: cxData.h:41
boost::shared_ptr< class PlaybackTime > PlaybackTimePtr
boost::shared_ptr< class DummyTool > DummyToolPtr
boost::shared_ptr< class TrackerConfiguration > TrackerConfigurationPtr
#define TrackingService_iid
Service providing tools and tracking systems.
std::map< QString, ToolPtr > ToolMap
std::map< double, Transform3D > TimedTransformMap
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr
boost::shared_ptr< class TrackingSystemService > TrackingSystemServicePtr