IGSTK
igstkNDITracker.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkNDITracker.h,v $
5  Language: C++
6  Date: $Date: 2008-11-17 20:12:25 $
7  Version: $Revision: 1.4 $
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 __igstkNDITracker_h
19 #define __igstkNDITracker_h
20 
23 #include "igstkTrackerTool.h"
24 #include "igstkTracker.h"
25 
26 namespace igstk
27 {
35 class NDITracker : public Tracker
36 {
37 public:
38 
41 
42 public:
43 
45  typedef igstk::SerialCommunication CommunicationType;
46 
49  void SetCommunication( CommunicationType *communication );
50 
51 protected:
52 
53  NDITracker(void);
54 
55  virtual ~NDITracker(void);
56 
59 
62 
64  virtual ResultType InternalOpen( void );
65 
67  virtual ResultType InternalClose( void );
68 
70  virtual ResultType InternalStartTracking( void );
71 
73  virtual ResultType InternalStopTracking( void );
74 
76  virtual ResultType InternalUpdateStatus( void );
77 
81 
83  virtual ResultType InternalReset( void );
84 
86  virtual ResultType
88 
91  virtual ResultType ValidateSpecifiedFrequency( double frequencyInHz );
92 
95  const TrackerToolType * trackerTool );
96 
99  const TrackerToolType * trackerTool );
100 
102  virtual void PrintSelf( std::ostream& os, ::itk::Indent indent ) const;
103 
107 
110 
112  igstkSetMacro( PortHandleToBeAdded, int );
113 
114 private:
115 
116  NDITracker(const Self&); //purposely not implemented
117  void operator=(const Self&); //purposely not implemented
118 
120  ::itk::MutexLock::Pointer m_BufferLock;
121 
123  CommunicationType::Pointer m_Communication;
124 
126  CommunicationType::BaudRateType m_BaudRate;
127 
129  CommandInterpreterType::Pointer m_CommandInterpreter;
130 
133  typedef std::string PortIdentifierType;
134  typedef std::map< PortIdentifierType, int > PortHandleContainerType;
135  PortHandleContainerType m_PortHandleContainer;
136 
138  typedef std::map< std::string, int > ToolAbsentStatusContainerType;
139  ToolAbsentStatusContainerType m_ToolAbsentStatusContainer;
140 
142  typedef std::map< std::string, int > ToolStatusContainerType;
143  ToolStatusContainerType m_ToolStatusContainer;
144 
146  typedef std::vector < double > InternalTransformType;
147  typedef std::map< std::string , InternalTransformType >
148  TrackerToolTransformContainerType;
149 
150  TrackerToolTransformContainerType m_ToolTransformBuffer;
151 
153  int m_PortHandleToBeAdded;
154 
155 };
156 
157 }
158 
159 #endif //__igstk_NDITracker_h_
Mediate between a Tracker and its Communication object.
#define igstkStandardAbstractClassTraitsMacro(classname, superclassname)
Convenience macro for traits of an abstract non-templated class.
Definition: igstkMacros.h:270
virtual ResultType InternalStopTracking(void)
Take the tracking device out of tracking mode.
virtual ResultType InternalOpen(void)
Open communication with the tracking device.
virtual ResultType InternalThreadedUpdateStatus(void)
Update the status and the transforms.
virtual ~NDITracker(void)
Base class for all the IGSTK classes.
Definition: igstkObject.h:40
virtual ResultType RemoveTrackerToolFromInternalDataContainers(const TrackerToolType *trackerTool)
Remove tracker tool entry from internal containers.
CommandInterpreterType::Pointer GetCommandInterpreter() const
Get method for the command interpreter This will method will be used by the derived classes...
Provides support for the NDI trackers.
::itk::SmartPointer< Self > Pointer
Definition: igstkObject.h:50
virtual ResultType InternalUpdateStatus(void)
Update the status and the transforms for all TrackerTools.
virtual ResultType InternalReset(void)
Reset the tracking device to put it back to its original state.
Abstract superclass for concrete IGSTK Tracker classes.
Definition: igstkTracker.h:96
virtual ResultType ValidateSpecifiedFrequency(double frequencyInHz)
The "ValidateSpecifiedFrequency" method checks if the specified frequency is valid for the tracking d...
This class implements communication over a serial port via RS-232.
virtual ResultType InternalStartTracking(void)
Put the tracking device into tracking mode.
igstkStandardAbstractClassTraitsMacro(Tracker, Object) public typedef TrackerTool TrackerToolType
Macro with standard traits declarations.
Definition: igstkTracker.h:101
virtual ResultType AddTrackerToolToInternalDataContainers(const TrackerToolType *trackerTool)
Add tracker tool entry to internal containers.
#define igstkSetMacro(name, type)
Set built-in type.
Definition: igstkMacros.h:93
virtual void PrintSelf(std::ostream &os,::itk::Indent indent) const
Print object information.
virtual ResultType VerifyTrackerToolInformation(const TrackerToolType *)=0
Verify tracker tool information.
Tracker::ResultType ResultType
typedef for internal boolean return type
virtual ResultType InternalClose(void)
Close communication with the tracking device.
ResultType CheckError(CommandInterpreterType *) const
Helper function for reporting interpreter errors.
igstk::NDICommandInterpreter CommandInterpreterType
typedef for command interpreter