IGSTK
/tmp/buildd/igstk-4.4.0/Source/igstkPolarisTrackerTool.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Image Guided Surgery Software Toolkit
00004   Module:    $RCSfile: igstkPolarisTrackerTool.h,v $
00005   Language:  C++
00006   Date:      $Date: 2008-04-21 20:29:36 $
00007   Version:   $Revision: 1.16 $
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 __igstkPolarisTrackerTool_h
00019 #define __igstkPolarisTrackerTool_h
00020 
00021 #include "igstkTrackerTool.h"
00022 
00023 namespace igstk
00024 {
00025 
00026 igstkEventMacro( PolarisTrackerToolEvent,StringEvent);
00027 igstkEventMacro( PolarisTrackerToolErrorEvent, TrackerToolErrorEvent);
00028 igstkEventMacro( InvalidPolarisPortNumberErrorEvent,
00029                                                 PolarisTrackerToolErrorEvent);
00030 igstkEventMacro( InvalidPolarisSROMFilenameErrorEvent,
00031                                                 PolarisTrackerToolErrorEvent);
00032 igstkEventMacro( InvalidPolarisPartNumberErrorEvent,
00033                                                 PolarisTrackerToolErrorEvent);
00034 
00035 class PolarisTracker;
00036 
00055 class PolarisTrackerTool : public TrackerTool
00056 {
00057 public:
00058 
00060   igstkStandardClassTraitsMacro( PolarisTrackerTool, TrackerTool )
00061 
00062   
00065   void RequestSetPortNumber( unsigned int portNumber );
00066 
00068   void RequestSelectWiredTrackerTool(); 
00069 
00071   void RequestSelectWirelessTrackerTool();
00072 
00074   void RequestSetSROMFileName( const std::string & filename );
00075 
00077   void RequestSetPartNumber( const std::string & toolId );
00078 
00080   bool IsToolWirelessType() const;
00081 
00083   bool IsSROMFileNameSpecified() const;
00084 
00086   bool IsPartNumberSpecified() const;
00087 
00089   igstkGetStringMacro( SROMFileName );
00090 
00092   igstkGetMacro( PortNumber, unsigned int );
00093 
00095   igstkGetStringMacro( PartNumber );
00096 
00097 
00098 protected:
00099 
00100   PolarisTrackerTool();
00101   virtual ~PolarisTrackerTool();
00102 
00104   virtual void PrintSelf( std::ostream& os, ::itk::Indent indent ) const; 
00105 
00106 private:
00107 
00109   void ReportWiredTrackerToolSelectedProcessing();
00110 
00112   void ReportWirelessTrackerToolSelectedProcessing();
00113 
00115   void SetPortNumberProcessing( );
00116 
00118   void ReportInValidPortNumberSpecifiedProcessing( );
00119 
00121   void SetSROMFileNameProcessing( );
00122 
00124   void ReportInValidSROMFileSpecifiedProcessing( );
00125 
00127   void SetPartNumberProcessing( );
00128 
00130   void ReportInValidPartNumberSpecifiedProcessing( );
00131 
00132   PolarisTrackerTool(const Self&);   //purposely not implemented
00133   void operator=(const Self&);       //purposely not implemented
00134 
00137   virtual bool CheckIfTrackerToolIsConfigured() const; 
00138 
00140   igstkGetMacro( SROMFileNameSpecified, bool );
00141 
00144   igstkGetMacro( PartNumberSpecified, bool );
00145 
00147   igstkDeclareStateMacro( Idle );
00148   igstkDeclareStateMacro( WirelessTrackerToolSelected );
00149   igstkDeclareStateMacro( WiredTrackerToolSelected );
00150   igstkDeclareStateMacro( WiredTrackerToolPortNumberSpecified );
00151   igstkDeclareStateMacro( WirelessTrackerToolSROMFileNameSpecified );
00152   igstkDeclareStateMacro( WiredTrackerToolSROMFileNameSpecified );
00153   igstkDeclareStateMacro( WirelessTrackerToolPartNumberSpecified );
00154   igstkDeclareStateMacro( WiredTrackerToolPartNumberSpecified );
00155 
00157   igstkDeclareInputMacro( SelectWiredTrackerTool );
00158   igstkDeclareInputMacro( SelectWirelessTrackerTool );
00159   igstkDeclareInputMacro( ValidPortNumber );
00160   igstkDeclareInputMacro( InValidPortNumber );
00161   igstkDeclareInputMacro( ValidSROMFileName );
00162   igstkDeclareInputMacro( InValidSROMFileName );
00163   igstkDeclareInputMacro( ValidPartNumber);
00164   igstkDeclareInputMacro( InValidPartNumber);
00165 
00167   unsigned int m_PortNumberToBeSet;
00168   unsigned int m_PortNumber;
00169 
00171   std::string m_SROMFileNameToBeSet;
00172   std::string m_SROMFileName;
00173 
00175   std::string m_PartNumberToBeSet;
00176   std::string m_PartNumber;
00177 
00179   bool m_TrackerToolConfigured;
00180 
00182   bool m_PartNumberSpecified;
00183 
00185   bool m_SROMFileNameSpecified;
00186 
00189   bool m_WirelessTrackerToolSelected;
00190 
00191 };  
00192 
00193 
00194 } // namespace igstk
00195 
00196 
00197 #endif  // __igstk_PolarisTrackerTool_h_