NorMIT-nav  16.5
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 #ifndef CXTRACKINGSERVICE_H
34 #define CXTRACKINGSERVICE_H
35 
36 #include "cxResourceExport.h"
37 
38 #include <QObject>
39 #include <boost/shared_ptr.hpp>
40 #include "cxTransform3D.h"
41 #include "cxTool.h"
42 
43 #define TrackingService_iid "cx::TrackingService"
44 
45 class QDomNode;
46 
47 namespace cx
48 {
49 
50 typedef std::map<double, Transform3D> TimedTransformMap;
51 typedef boost::shared_ptr<class Tool> ToolPtr;
52 typedef std::map<ToolPtr, TimedTransformMap> SessionToolHistoryMap;
53 typedef boost::shared_ptr<class Landmarks> LandmarksPtr;
54 typedef boost::shared_ptr<class PlaybackTime> PlaybackTimePtr;
55 typedef boost::shared_ptr<class TrackerConfiguration> TrackerConfigurationPtr;
56 
57 typedef boost::shared_ptr<class TrackingSystemService> TrackingSystemServicePtr;
58 typedef boost::shared_ptr<class TrackingService> TrackingServicePtr;
59 typedef boost::shared_ptr<class DummyTool> DummyToolPtr;
60 typedef boost::shared_ptr<class ManualTool> ManualToolPtr;
61 
70 class cxResource_EXPORT TrackingService : public QObject
71 {
72  Q_OBJECT
73 
74 public:
75  typedef std::map<QString, ToolPtr> ToolMap;
76 
77  virtual ~TrackingService() {}
78 
79  virtual Tool::State getState() const = 0;
80  virtual void setState(const Tool::State val) = 0;
81 
82  virtual ToolPtr getTool(const QString& uid) = 0;
83  virtual ToolPtr getActiveTool() = 0;
84  virtual void setActiveTool(const QString& uid) = 0;
85  virtual ToolPtr getFirstProbe() = 0;
86 
87  virtual ToolPtr getReferenceTool() const = 0;
88  virtual ToolPtr getManualTool() = 0;
89 
90  virtual ToolMap getTools() = 0;
91 
92  virtual bool isPlaybackMode() const = 0;
93  virtual void setPlaybackMode(PlaybackTimePtr controller) = 0;
94 
95  virtual SessionToolHistoryMap getSessionHistory(double startTime, double stopTime) = 0;
96  virtual void runDummyTool(DummyToolPtr tool) = 0;
97  virtual TrackerConfigurationPtr getConfiguration() = 0;
98 
99  virtual void installTrackingSystem(TrackingSystemServicePtr system) = 0;
100  virtual void unInstallTrackingSystem(TrackingSystemServicePtr system) = 0;
101  virtual std::vector<TrackingSystemServicePtr> getTrackingSystems() = 0;
102 
103  virtual bool isNull() = 0;
104  static TrackingServicePtr getNullObject();
105 
106 signals:
107  void stateChanged();
108  void activeToolChanged(const QString& uId);
109 
110 };
111 
112 } //cx
113 Q_DECLARE_INTERFACE(cx::TrackingService, TrackingService_iid)
114 
115 #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:61
boost::shared_ptr< class PlaybackTime > PlaybackTimePtr
boost::shared_ptr< class DummyTool > DummyToolPtr
boost::shared_ptr< class TrackerConfiguration > TrackerConfigurationPtr
#define TrackingService_iid
std::map< QString, ToolPtr > ToolMap
Service providing tools and tracking systems.
std::map< QString, ToolPtr > ToolMap
std::map< double, Transform3D > TimedTransformMap
boost::shared_ptr< class Tool > ToolPtr
boost::shared_ptr< class TrackingSystemService > TrackingSystemServicePtr