Medical Imaging Interaction Toolkit  2022.04.99-b2814023
Medical Imaging Interaction Toolkit
mitkTrackingDevice.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef MITKTRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2
15 #define MITKTRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2
16 
17 #include <MitkIGTExports.h>
18 #include "itkObject.h"
19 #include "mitkCommon.h"
20 #include "mitkTrackingTypes.h"
22 #include <mutex>
23 
24 namespace 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};
55 
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 
120  itkGetConstMacro(RotationMode,RotationMode);
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 
191  TrackingDevice();
192  ~TrackingDevice() override;
193 
195 
197  std::mutex m_StopTrackingMutex;
199  mutable std::mutex m_StateMutex;
201  };
202 } // namespace mitk
203 
204 #endif /* MITKTRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2 */
RotationMode m_RotationMode
defines the rotation mode Standard or Transposed, Standard is default
Interface for all Tracking Tools.
std::mutex m_StopTrackingMutex
mutex to control access to m_StopTracking
DataCollection - Class to facilitate loading/accessing structured data.
std::mutex m_TrackingFinishedMutex
mutex to manage control flow of StopTracking()
#define MITKIGT_EXPORT
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
bool m_StopTracking
signal stop to tracking thread
Interface for all Tracking Devices.
TrackingDeviceData m_Data
current device Data
std::string TrackingDeviceType
std::mutex m_StateMutex
mutex to control access to m_State