IGSTK
igstkPolarisTrackerTool.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkPolarisTrackerTool.h,v $
5  Language: C++
6  Date: $Date: 2008-04-21 20:29:36 $
7  Version: $Revision: 1.16 $
8 
9  Copyright (c) ISC Insight Software Consortium. All rights reserved.
10  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __igstkPolarisTrackerTool_h
19 #define __igstkPolarisTrackerTool_h
20 
21 #include "igstkTrackerTool.h"
22 
23 namespace igstk
24 {
25 
26 igstkEventMacro( PolarisTrackerToolEvent,StringEvent);
27 igstkEventMacro( PolarisTrackerToolErrorEvent, TrackerToolErrorEvent);
28 igstkEventMacro( InvalidPolarisPortNumberErrorEvent,
29  PolarisTrackerToolErrorEvent);
30 igstkEventMacro( InvalidPolarisSROMFilenameErrorEvent,
31  PolarisTrackerToolErrorEvent);
32 igstkEventMacro( InvalidPolarisPartNumberErrorEvent,
33  PolarisTrackerToolErrorEvent);
34 
35 class PolarisTracker;
36 
56 {
57 public:
58 
61 
62 
65  void RequestSetPortNumber( unsigned int portNumber );
66 
69 
72 
74  void RequestSetSROMFileName( const std::string & filename );
75 
77  void RequestSetPartNumber( const std::string & toolId );
78 
80  bool IsToolWirelessType() const;
81 
83  bool IsSROMFileNameSpecified() const;
84 
86  bool IsPartNumberSpecified() const;
87 
89  igstkGetStringMacro( SROMFileName );
90 
92  igstkGetMacro( PortNumber, unsigned int );
93 
95  igstkGetStringMacro( PartNumber );
96 
97 
98 protected:
99 
101  virtual ~PolarisTrackerTool();
102 
104  virtual void PrintSelf( std::ostream& os, ::itk::Indent indent ) const;
105 
106 private:
107 
109  void ReportWiredTrackerToolSelectedProcessing();
110 
112  void ReportWirelessTrackerToolSelectedProcessing();
113 
115  void SetPortNumberProcessing( );
116 
118  void ReportInValidPortNumberSpecifiedProcessing( );
119 
121  void SetSROMFileNameProcessing( );
122 
124  void ReportInValidSROMFileSpecifiedProcessing( );
125 
127  void SetPartNumberProcessing( );
128 
130  void ReportInValidPartNumberSpecifiedProcessing( );
131 
132  PolarisTrackerTool(const Self&); //purposely not implemented
133  void operator=(const Self&); //purposely not implemented
134 
137  virtual bool CheckIfTrackerToolIsConfigured() const;
138 
140  igstkGetMacro( SROMFileNameSpecified, bool );
141 
144  igstkGetMacro( PartNumberSpecified, bool );
145 
147  igstkDeclareStateMacro( Idle );
148  igstkDeclareStateMacro( WirelessTrackerToolSelected );
149  igstkDeclareStateMacro( WiredTrackerToolSelected );
150  igstkDeclareStateMacro( WiredTrackerToolPortNumberSpecified );
151  igstkDeclareStateMacro( WirelessTrackerToolSROMFileNameSpecified );
152  igstkDeclareStateMacro( WiredTrackerToolSROMFileNameSpecified );
153  igstkDeclareStateMacro( WirelessTrackerToolPartNumberSpecified );
154  igstkDeclareStateMacro( WiredTrackerToolPartNumberSpecified );
155 
157  igstkDeclareInputMacro( SelectWiredTrackerTool );
158  igstkDeclareInputMacro( SelectWirelessTrackerTool );
159  igstkDeclareInputMacro( ValidPortNumber );
160  igstkDeclareInputMacro( InValidPortNumber );
161  igstkDeclareInputMacro( ValidSROMFileName );
162  igstkDeclareInputMacro( InValidSROMFileName );
163  igstkDeclareInputMacro( ValidPartNumber);
164  igstkDeclareInputMacro( InValidPartNumber);
165 
167  unsigned int m_PortNumberToBeSet;
168  unsigned int m_PortNumber;
169 
171  std::string m_SROMFileNameToBeSet;
172  std::string m_SROMFileName;
173 
175  std::string m_PartNumberToBeSet;
176  std::string m_PartNumber;
177 
179  bool m_TrackerToolConfigured;
180 
182  bool m_PartNumberSpecified;
183 
185  bool m_SROMFileNameSpecified;
186 
189  bool m_WirelessTrackerToolSelected;
190 
191 };
192 
193 
194 } // namespace igstk
195 
196 
197 #endif // __igstk_PolarisTrackerTool_h_
#define igstkGetMacro(name, type)
Get built-in type.
Definition: igstkMacros.h:105
bool IsPartNumberSpecified() const
Check if Tool part number is specified.
Base class for all the IGSTK classes.
Definition: igstkObject.h:40
igstkEventMacro(AuroraTrackerToolEvent, StringEvent)
A Polaris-specific TrackerTool class.
Abstract superclass for concrete IGSTK TrackerTool classes.
igstkStandardClassTraitsMacro(PolarisTrackerTool, TrackerTool) void RequestSetPortNumber(unsigned int portNumber)
Macro with standard traits declarations.
bool IsSROMFileNameSpecified() const
Check if SROM file name specified.
bool IsToolWirelessType() const
Check if the tracker tool is wireless type.
igstkGetStringMacro(SROMFileName)
Get SROM file name.
void RequestSelectWirelessTrackerTool()
Set the TrackerTool to be wireless.
void RequestSetSROMFileName(const std::string &filename)
Request set the SROM file name.
virtual void PrintSelf(std::ostream &os,::itk::Indent indent) const
Print object information.
void RequestSelectWiredTrackerTool()
Set the TrackerTool to be wired.
void RequestSetPartNumber(const std::string &toolId)
Request set the PartNumber.