IGSTK
/tmp/buildd/igstk-4.4.0/Source/igstkAscensionTracker.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Image Guided Surgery Software Toolkit
00004   Module:    $RCSfile: igstkAscensionTracker.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-02-02 17:32:02 $
00007   Version:   $Revision: 1.2 $
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 #ifndef __igstkAscensionTracker_h
00018 #define __igstkAscensionTracker_h
00019 
00020 #include "igstkSerialCommunication.h"
00021 #include "igstkAscensionTrackerTool.h"
00022 #include "igstkAscensionCommandInterpreter.h"
00023 #include "igstkTracker.h"
00024 
00025 namespace igstk
00026 {
00038 class AscensionTracker : public Tracker
00039 {
00040 public:
00041 
00043   igstkStandardClassTraitsMacro( AscensionTracker, Tracker )
00044 
00045 public:
00046 
00048   typedef igstk::AscensionCommandInterpreter CommandInterpreterType;
00049 
00051   typedef igstk::SerialCommunication     CommunicationType;
00052 
00055   void SetCommunication( CommunicationType *communication );
00056 
00058   igstkGetMacro( NumberOfTools, unsigned int );
00059 
00060 protected:
00061 
00062   AscensionTracker(void);
00063 
00064   virtual ~AscensionTracker(void);
00065 
00067   typedef Tracker::ResultType   ResultType;
00068 
00070   virtual ResultType InternalOpen( void );
00071 
00073   virtual ResultType InternalClose( void );
00074 
00076   virtual ResultType InternalActivateTools( void );
00077 
00079   virtual ResultType InternalDeactivateTools( void );
00080 
00082   virtual ResultType InternalStartTracking( void );
00083 
00085   virtual ResultType InternalStopTracking( void );
00086 
00088   virtual ResultType InternalUpdateStatus( void );
00089 
00092   virtual ResultType InternalThreadedUpdateStatus( void );
00093 
00095   virtual ResultType VerifyTrackerToolInformation( 
00096     const TrackerToolType * trackerTool );
00097 
00099   virtual ResultType AddTrackerToolToInternalDataContainers( const
00100     TrackerToolType * trackerTool );
00101 
00103   virtual ResultType RemoveTrackerToolFromInternalDataContainers( 
00104     const TrackerToolType * trackerTool );
00105 
00107   virtual ResultType InternalReset( void );
00108 
00110   virtual void PrintSelf( std::ostream& os, ::itk::Indent indent ) const; 
00111 
00112 private:
00113 
00114   AscensionTracker(const Self&);   //purposely not implemented
00115   void operator=(const Self&);        //purposely not implemented
00116 
00118   typedef igstk::AscensionTrackerTool       AscensionTrackerToolType;
00119   typedef AscensionTrackerToolType::Pointer AscensionTrackerToolPointer;
00120   typedef AscensionTrackerToolType::ConstPointer
00121                                      AscensionTrackerToolConstPointer;
00122 
00125   void EnableToolPorts( void );
00126 
00128   void DisableToolPorts( void );
00129 
00131   unsigned int   m_NumberOfTools;
00132 
00134   CommunicationType::Pointer       m_Communication;
00135 
00137   CommandInterpreterType::Pointer  m_CommandInterpreter;
00138 
00140   itk::MutexLock::Pointer  m_BufferLock;  
00141 
00143   //TransformType m_TransformBuffer[NumberOfPorts];
00144 
00146   typedef std::map< std::string, std::vector < double > >
00147       TrackerToolTransformContainerType;
00148 
00149   TrackerToolTransformContainerType     m_ToolTransformBuffer;
00150 
00152   typedef std::map< unsigned int, std::string>  ErrorCodeContainerType;
00153   static ErrorCodeContainerType   m_ErrorCodeContainer;
00154 
00156   static bool m_ErrorCodeListCreated;
00157 
00159   std::map< std::string, int >  m_ToolStatusContainer;
00160 
00161 };
00162 
00163 }
00164 
00165 #endif //__igstk_AscensionTracker_h_