IGSTK
igstkAscensionTracker.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkAscensionTracker.h,v $
5  Language: C++
6  Date: $Date: 2009-02-02 17:32:02 $
7  Version: $Revision: 1.2 $
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 #ifndef __igstkAscensionTracker_h
18 #define __igstkAscensionTracker_h
19 
23 #include "igstkTracker.h"
24 
25 namespace igstk
26 {
38 class AscensionTracker : public Tracker
39 {
40 public:
41 
44 
45 public:
46 
48  typedef igstk::AscensionCommandInterpreter CommandInterpreterType;
49 
52 
55  void SetCommunication( CommunicationType *communication );
56 
58  igstkGetMacro( NumberOfTools, unsigned int );
59 
60 protected:
61 
62  AscensionTracker(void);
63 
64  virtual ~AscensionTracker(void);
65 
68 
70  virtual ResultType InternalOpen( void );
71 
73  virtual ResultType InternalClose( void );
74 
76  virtual ResultType InternalActivateTools( void );
77 
79  virtual ResultType InternalDeactivateTools( void );
80 
82  virtual ResultType InternalStartTracking( void );
83 
85  virtual ResultType InternalStopTracking( void );
86 
88  virtual ResultType InternalUpdateStatus( void );
89 
92  virtual ResultType InternalThreadedUpdateStatus( void );
93 
95  virtual ResultType VerifyTrackerToolInformation(
96  const TrackerToolType * trackerTool );
97 
99  virtual ResultType AddTrackerToolToInternalDataContainers( const
100  TrackerToolType * trackerTool );
101 
104  const TrackerToolType * trackerTool );
105 
107  virtual ResultType InternalReset( void );
108 
110  virtual void PrintSelf( std::ostream& os, ::itk::Indent indent ) const;
111 
112 private:
113 
114  AscensionTracker(const Self&); //purposely not implemented
115  void operator=(const Self&); //purposely not implemented
116 
119  typedef AscensionTrackerToolType::Pointer AscensionTrackerToolPointer;
120  typedef AscensionTrackerToolType::ConstPointer
121  AscensionTrackerToolConstPointer;
122 
125  void EnableToolPorts( void );
126 
128  void DisableToolPorts( void );
129 
131  unsigned int m_NumberOfTools;
132 
134  CommunicationType::Pointer m_Communication;
135 
137  CommandInterpreterType::Pointer m_CommandInterpreter;
138 
140  itk::MutexLock::Pointer m_BufferLock;
141 
143  //TransformType m_TransformBuffer[NumberOfPorts];
144 
146  typedef std::map< std::string, std::vector < double > >
147  TrackerToolTransformContainerType;
148 
149  TrackerToolTransformContainerType m_ToolTransformBuffer;
150 
152  typedef std::map< unsigned int, std::string> ErrorCodeContainerType;
153  static ErrorCodeContainerType m_ErrorCodeContainer;
154 
156  static bool m_ErrorCodeListCreated;
157 
159  std::map< std::string, int > m_ToolStatusContainer;
160 
161 };
162 
163 }
164 
165 #endif //__igstk_AscensionTracker_h_
Provides support for the Ascension trackers.
virtual ResultType InternalStopTracking(void)
Take the tracking device out of tracking mode.
#define igstkGetMacro(name, type)
Get built-in type.
Definition: igstkMacros.h:105
Base class for all the IGSTK classes.
Definition: igstkObject.h:40
void SetCommunication(CommunicationType *communication)
The SetCommunication method is used to attach a communication object to the tracker object...
virtual void PrintSelf(std::ostream &os,::itk::Indent indent) const
Print object information.
#define igstkStandardClassTraitsMacro(classname, superclassname)
Convenience macro for traits of a non-templated class.
Definition: igstkMacros.h:275
virtual ResultType VerifyTrackerToolInformation(const TrackerToolType *trackerTool)
Verify tracker tool information.
virtual ResultType InternalClose(void)
Close communication with the tracking device.
::itk::SmartPointer< Self > Pointer
Definition: igstkObject.h:50
A Ascension-specific TrackerTool class.
Abstract superclass for concrete IGSTK Tracker classes.
Definition: igstkTracker.h:96
virtual ResultType InternalActivateTools(void)
Activate the tools attached to the tracking device.
virtual ResultType InternalReset(void)
Reset the tracking device to put it back to its original state.
igstkStandardClassTraitsMacro(AscensionTracker, Tracker) public typedef igstk::SerialCommunication CommunicationType
Macro with standard traits declarations.
virtual ResultType RemoveTrackerToolFromInternalDataContainers(const TrackerToolType *trackerTool)
Remove tracker tool from internal containers.
virtual ResultType AddTrackerToolToInternalDataContainers(const TrackerToolType *trackerTool)
Add tracker tool entry from internal containers.
virtual ResultType InternalDeactivateTools(void)
Deactivate the tools attached to the tracking device.
This class implements communication over a serial port via RS-232.
igstkStandardAbstractClassTraitsMacro(Tracker, Object) public typedef TrackerTool TrackerToolType
Macro with standard traits declarations.
Definition: igstkTracker.h:101
::itk::SmartPointer< const Self > ConstPointer
Definition: igstkObject.h:51
virtual ResultType InternalUpdateStatus(void)
Update the status and the transforms for all TrackerTools.
virtual ResultType InternalStartTracking(void)
Put the tracking device into tracking mode.
virtual ResultType InternalOpen(void)
Open communication with the tracking device.
virtual ResultType InternalThreadedUpdateStatus(void)
Update the status and the transforms.