Fraxinus  18.10
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 private slots:
56  void onToolPositionChanged(Transform3D matrix, double timestamp);
57 
58 private:
59  void start();
60  void stop();
61  bool forceBaseToConfiguredState();
62  void waitForState(TrackingSystemServicePtr base, Tool::State state, int timeout);
63  bool isRunning() const;
64 
65  std::vector<PlaybackToolPtr> mTools;
66  Tool::State mState;
67  PlaybackTimePtr mController;
68  ManualToolPtr mManual;
69  std::vector<TrackingSystemServicePtr> mBases;
70 };
71 
72 
73 } // namespace cx
74 
75 
76 #endif // CXTRACKINGSYSTEMPLAYBACKSERVICE_H
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
boost::shared_ptr< class PlaybackTool > PlaybackToolPtr
boost::shared_ptr< class ManualTool > ManualToolPtr
boost::shared_ptr< class PlaybackTime > PlaybackTimePtr
boost::shared_ptr< class TrackerConfiguration > TrackerConfigurationPtr
Tracking System Service.
virtual ToolPtr getReference()
reference tool used by entire tracking service - NOTE: system fails if several TrackingSystemServices...
std::vector< TrackingSystemServicePtr > getBase()
Interface towards a playback tracking system.Wraps another tracking system, enabling playback of the ...
Namespace for all CustusX production code.
boost::shared_ptr< class Tool > ToolPtr
boost::shared_ptr< class TrackingSystemService > TrackingSystemServicePtr