00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef MITKTRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2 00020 #define MITKTRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2 00021 00022 #include <MitkIGTExports.h> 00023 #include "itkObject.h" 00024 #include "mitkCommon.h" 00025 #include "mitkTrackingTypes.h" 00026 #include "itkFastMutexLock.h" 00027 00028 00029 namespace mitk { 00030 class TrackingTool; // interface for a tool that can be tracked by the TrackingDevice 00031 00039 class MitkIGT_EXPORT TrackingDevice : public itk::Object 00040 { 00041 public: 00042 mitkClassMacro(TrackingDevice, itk::Object); 00043 00044 enum TrackingDeviceState {Setup, Ready, Tracking}; 00045 00051 virtual bool OpenConnection() = 0; 00052 00059 virtual bool CloseConnection() = 0; 00060 00068 virtual bool StartTracking() = 0; 00069 00077 virtual bool StopTracking(); 00078 00084 virtual TrackingTool* GetTool(unsigned int toolNumber) const = 0; 00085 00092 virtual mitk::TrackingTool* GetToolByName(std::string name) const; 00093 00097 virtual unsigned int GetToolCount() const = 0; 00098 00102 itkGetStringMacro(ErrorMessage); 00106 TrackingDeviceState GetState() const; 00107 00111 itkGetConstMacro(Type,TrackingDeviceType); 00115 itkSetMacro(Type,TrackingDeviceType); 00116 00117 protected: 00121 itkSetStringMacro(ErrorMessage); 00125 void SetState(TrackingDeviceState state); 00126 00127 00128 TrackingDevice(); 00129 virtual ~TrackingDevice(); 00130 00131 TrackingDeviceType m_Type; 00132 TrackingDeviceState m_State; 00133 bool m_StopTracking; 00134 itk::FastMutexLock::Pointer m_StopTrackingMutex; 00135 itk::FastMutexLock::Pointer m_TrackingFinishedMutex; 00136 itk::FastMutexLock::Pointer m_StateMutex; 00137 std::string m_ErrorMessage; 00138 }; 00139 } // namespace mitk 00140 00141 #endif /* MITKTRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2 */