Medical Imaging Interaction Toolkit  2018.4.99-b5518f0d
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"
21 #include "itkFastMutexLock.h"
23 
24 
25 namespace mitk {
26  class TrackingTool; // interface for a tool that can be tracked by the TrackingDevice
27 
35  class MITKIGT_EXPORT TrackingDevice : public itk::Object
36  {
37  public:
39 
53  enum RotationMode {RotationStandard, RotationTransposed};
54 
55  enum TrackingDeviceState {Setup, Ready, Tracking};
56 
62  virtual bool OpenConnection() = 0;
63 
70  virtual bool CloseConnection() = 0;
71 
79  virtual bool StartTracking() = 0;
80 
88  virtual bool StopTracking();
89 
95  virtual TrackingTool* GetTool(unsigned int toolNumber) const = 0;
96 
103  virtual mitk::TrackingTool* GetToolByName(std::string name) const;
104 
108  virtual unsigned int GetToolCount() const = 0;
109 
116  virtual void SetRotationMode(RotationMode r);
117 
121  itkGetConstMacro(RotationMode,RotationMode);
122 
126  TrackingDeviceState GetState() const;
127 
131  TrackingDeviceType GetType() const;
135  void SetType(TrackingDeviceType type);
136 
142  std::string GetTrackingDeviceName();
143 
147  TrackingDeviceData GetData() const;
151  void SetData(TrackingDeviceData data);
152 
168  virtual bool IsDeviceInstalled();
169 
171  virtual bool AutoDetectToolsAvailable();
172 
174  virtual bool AddSingleToolIsAvailable();
175 
180  virtual mitk::NavigationToolStorage::Pointer AutoDetectTools();
181 
182  private:
183  TrackingDeviceState m_State;
184  protected:
185 
189  void SetState(TrackingDeviceState state);
190 
191 
192  TrackingDevice();
193  ~TrackingDevice() override;
194 
196 
198  itk::FastMutexLock::Pointer m_StopTrackingMutex;
199  itk::FastMutexLock::Pointer m_TrackingFinishedMutex;
200  itk::FastMutexLock::Pointer m_StateMutex;
202  };
203 } // namespace mitk
204 
205 #endif /* MITKTRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2 */
RotationMode m_RotationMode
defines the rotation mode Standard or Transposed, Standard is default
Interface for all Tracking Tools.
itk::FastMutexLock::Pointer m_TrackingFinishedMutex
mutex to manage control flow of StopTracking()
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKIGT_EXPORT
itk::FastMutexLock::Pointer m_StateMutex
mutex to control access to m_State
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
bool m_StopTracking
signal stop to tracking thread
Interface for all Tracking Devices.
TrackingDeviceData m_Data
current device Data
std::string TrackingDeviceType
itk::FastMutexLock::Pointer m_StopTrackingMutex
mutex to control access to m_StopTracking