NorMIT-nav  22.09
An IGT application
cxTrackingSystemPlaybackService.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 #ifndef CXTRACKINGSYSTEMPLAYBACKSERVICE_H
12 #define CXTRACKINGSYSTEMPLAYBACKSERVICE_H
13 
14 #include "org_custusx_core_tracking_Export.h"
16 
17 namespace cx
18 {
19 typedef boost::shared_ptr<class PlaybackTime> PlaybackTimePtr;
20 typedef boost::shared_ptr<class PlaybackTool> PlaybackToolPtr;
21 
35 class org_custusx_core_tracking_EXPORT TrackingSystemPlaybackService : public TrackingSystemService
36 {
37 Q_OBJECT
38 
39 public:
40  TrackingSystemPlaybackService(PlaybackTimePtr controller, std::vector<TrackingSystemServicePtr> base, ManualToolPtr manual);
42 
43  virtual QString getUid() const { return "org.custusx.core.tracking.system.playback"; }
44  virtual std::vector<ToolPtr> getTools();
45  virtual ToolPtr getReference() { return ToolPtr(); }
46 
47  virtual Tool::State getState() const;
48  virtual void setState(const Tool::State val);
49 
50  virtual void setLoggingFolder(QString loggingFolder);
51  virtual TrackerConfigurationPtr getConfiguration();
52 
53  std::vector<TrackingSystemServicePtr> getBase() { return mBases; }
54 
55 public slots:
56  void onActiveToolChanged(const QString &uId);
57 
58 private slots:
59  void onToolPositionChanged(Transform3D matrix, double timestamp);
60 
61 private:
62  void start();
63  void stop();
64  bool forceBaseToConfiguredState();
65  void waitForState(TrackingSystemServicePtr base, Tool::State state, int timeout);
66  bool isRunning() const;
67 
68  std::vector<PlaybackToolPtr> mTools;
69  Tool::State mState;
70  PlaybackTimePtr mController;
71  ManualToolPtr mManual;
72  QString mActiveToolId;
73  std::vector<TrackingSystemServicePtr> mBases;
74 };
75 
76 
77 } // namespace cx
78 
79 
80 #endif // CXTRACKINGSYSTEMPLAYBACKSERVICE_H
cx::TrackingSystemPlaybackService::getUid
virtual QString getUid() const
Definition: cxTrackingSystemPlaybackService.h:43
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::TrackerConfigurationPtr
boost::shared_ptr< class TrackerConfiguration > TrackerConfigurationPtr
Definition: cxTrackerConfiguration.h:24
cx::TrackingSystemPlaybackService
Interface towards a playback tracking system.
Definition: cxTrackingSystemPlaybackService.h:35
cx::PlaybackTimePtr
boost::shared_ptr< class PlaybackTime > PlaybackTimePtr
Definition: cxTrackingSystemBronchoscopyService.h:42
cx::TrackingSystemService
Tracking System Service.
Definition: cxTrackingSystemService.h:35
cx::Transform3D
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Definition: cxLandmarkPatientRegistrationWidget.h:33
cx::PlaybackToolPtr
boost::shared_ptr< class PlaybackTool > PlaybackToolPtr
Definition: cxTrackingSystemPlaybackService.h:20
cx::TrackingSystemPlaybackService::getBase
std::vector< TrackingSystemServicePtr > getBase()
Definition: cxTrackingSystemPlaybackService.h:53
cx::TrackingSystemServicePtr
boost::shared_ptr< class TrackingSystemService > TrackingSystemServicePtr
Definition: cxTrackingImplService.h:36
cx::ManualToolPtr
boost::shared_ptr< class ManualTool > ManualToolPtr
Definition: cxForwardDeclarations.h:43
cx::Tool::State
State
Definition: cxTool.h:72
cx::TrackingSystemPlaybackService::getReference
virtual ToolPtr getReference()
reference tool used by entire tracking service - NOTE: system fails if several TrackingSystemServices...
Definition: cxTrackingSystemPlaybackService.h:45
cxTrackingSystemService.h
cx::ToolPtr
boost::shared_ptr< class Tool > ToolPtr
Definition: cxVideoConnectionWidget.h:43