MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkTrackingDevice.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
13
14#ifndef mitkTrackingDevice_h
15#define mitkTrackingDevice_h
16
17#include <MitkIGTExports.h>
18#include "itkObject.h"
19#include "mitkCommon.h"
20#include "mitkTrackingTypes.h"
22#include <mutex>
23
24namespace mitk {
25 class TrackingTool; // interface for a tool that can be tracked by the TrackingDevice
26
34 class MITKIGT_EXPORT TrackingDevice : public itk::Object
35 {
36 public:
38
52 enum RotationMode {RotationStandard, RotationTransposed};
53
54 enum TrackingDeviceState {Setup, Ready, Tracking};
61 virtual bool OpenConnection() = 0;
62
69 virtual bool CloseConnection() = 0;
70
78 virtual bool StartTracking() = 0;
79
87 virtual bool StopTracking();
88
94 virtual TrackingTool* GetTool(unsigned int toolNumber) const = 0;
95
102 virtual mitk::TrackingTool* GetToolByName(std::string name) const;
103
107 virtual unsigned int GetToolCount() const = 0;
108
115 virtual void SetRotationMode(RotationMode r);
116
121
125 TrackingDeviceState GetState() const;
126
130 TrackingDeviceType GetType() const;
134 void SetType(TrackingDeviceType type);
135
141 std::string GetTrackingDeviceName();
142
146 TrackingDeviceData GetData() const;
150 void SetData(TrackingDeviceData data);
151
167 virtual bool IsDeviceInstalled();
168
170 virtual bool AutoDetectToolsAvailable();
171
173 virtual bool AddSingleToolIsAvailable();
174
179 virtual mitk::NavigationToolStorage::Pointer AutoDetectTools();
180
181 private:
182 TrackingDeviceState m_State;
183 protected:
184
188 void SetState(TrackingDeviceState state);
189
190
192 ~TrackingDevice() override;
193
195
199 mutable std::mutex m_StateMutex;
201 };
202} // namespace mitk
203
204#endif
Interface for all Tracking Devices.
std::mutex m_TrackingFinishedMutex
mutex to manage control flow of StopTracking()
virtual bool CloseConnection()=0
Closes the connection to the device.
TrackingDeviceData m_Data
current device Data
std::mutex m_StateMutex
mutex to control access to m_State
itkGetConstMacro(RotationMode, RotationMode)
virtual unsigned int GetToolCount() const =0
Returns number of tracking tools.
RotationMode m_RotationMode
defines the rotation mode Standard or Transposed, Standard is default
virtual bool OpenConnection()=0
Opens a connection to the device.
mitkClassMacroItkParent(TrackingDevice, itk::Object)
virtual bool StartTracking()=0
start retrieving tracking data from the device.
bool m_StopTracking
signal stop to tracking thread
virtual TrackingTool * GetTool(unsigned int toolNumber) const =0
Return tool with index toolNumber.
std::mutex m_StopTrackingMutex
mutex to control access to m_StopTracking
Interface for all Tracking Tools.
IGT Exceptions.
std::string TrackingDeviceType