IGSTK
|
00001 /*========================================================================= 00002 00003 Program: Image Guided Surgery Software Toolkit 00004 Module: $RCSfile: igstkNDITracker.h,v $ 00005 Language: C++ 00006 Date: $Date: 2008-11-17 20:12:25 $ 00007 Version: $Revision: 1.4 $ 00008 00009 Copyright (c) ISC Insight Software Consortium. All rights reserved. 00010 See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm 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 #ifndef __igstkNDITracker_h 00019 #define __igstkNDITracker_h 00020 00021 #include "igstkSerialCommunication.h" 00022 #include "igstkNDICommandInterpreter.h" 00023 #include "igstkTrackerTool.h" 00024 #include "igstkTracker.h" 00025 00026 namespace igstk 00027 { 00035 class NDITracker : public Tracker 00036 { 00037 public: 00038 00040 igstkStandardAbstractClassTraitsMacro( NDITracker, Tracker ) 00041 00042 public: 00043 00045 typedef igstk::SerialCommunication CommunicationType; 00046 00049 void SetCommunication( CommunicationType *communication ); 00050 00051 protected: 00052 00053 NDITracker(void); 00054 00055 virtual ~NDITracker(void); 00056 00058 typedef igstk::NDICommandInterpreter CommandInterpreterType; 00059 00061 typedef Tracker::ResultType ResultType; 00062 00064 virtual ResultType InternalOpen( void ); 00065 00067 virtual ResultType InternalClose( void ); 00068 00070 virtual ResultType InternalStartTracking( void ); 00071 00073 virtual ResultType InternalStopTracking( void ); 00074 00076 virtual ResultType InternalUpdateStatus( void ); 00077 00080 virtual ResultType InternalThreadedUpdateStatus( void ); 00081 00083 virtual ResultType InternalReset( void ); 00084 00086 virtual ResultType 00087 VerifyTrackerToolInformation( const TrackerToolType * ) = 0; 00088 00091 virtual ResultType ValidateSpecifiedFrequency( double frequencyInHz ); 00092 00094 virtual ResultType RemoveTrackerToolFromInternalDataContainers( 00095 const TrackerToolType * trackerTool ); 00096 00098 virtual ResultType AddTrackerToolToInternalDataContainers( 00099 const TrackerToolType * trackerTool ); 00100 00102 virtual void PrintSelf( std::ostream& os, ::itk::Indent indent ) const; 00103 00106 CommandInterpreterType::Pointer GetCommandInterpreter() const; 00107 00109 ResultType CheckError( CommandInterpreterType * ) const; 00110 00112 igstkSetMacro( PortHandleToBeAdded, int ); 00113 00114 private: 00115 00116 NDITracker(const Self&); //purposely not implemented 00117 void operator=(const Self&); //purposely not implemented 00118 00120 ::itk::MutexLock::Pointer m_BufferLock; 00121 00123 CommunicationType::Pointer m_Communication; 00124 00126 CommunicationType::BaudRateType m_BaudRate; 00127 00129 CommandInterpreterType::Pointer m_CommandInterpreter; 00130 00133 typedef std::string PortIdentifierType; 00134 typedef std::map< PortIdentifierType, int > PortHandleContainerType; 00135 PortHandleContainerType m_PortHandleContainer; 00136 00138 typedef std::map< std::string, int > ToolAbsentStatusContainerType; 00139 ToolAbsentStatusContainerType m_ToolAbsentStatusContainer; 00140 00142 typedef std::map< std::string, int > ToolStatusContainerType; 00143 ToolStatusContainerType m_ToolStatusContainer; 00144 00146 typedef std::vector < double > InternalTransformType; 00147 typedef std::map< std::string , InternalTransformType > 00148 TrackerToolTransformContainerType; 00149 00150 TrackerToolTransformContainerType m_ToolTransformBuffer; 00151 00153 int m_PortHandleToBeAdded; 00154 00155 }; 00156 00157 } 00158 00159 #endif //__igstk_NDITracker_h_