|
1 | | -/*=Plus=header=begin====================================================== |
2 | | - Program: Plus |
3 | | - Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved. |
4 | | - See License.txt for details. |
5 | | -=========================================================Plus=header=end*/ |
6 | | - |
7 | | -#ifndef __vtkNDICertusTracker_h |
8 | | -#define __vtkNDICertusTracker_h |
9 | | - |
10 | | -#include "vtkPlusDevice.h" |
11 | | -#include <map> |
12 | | - |
13 | | -/*! the number of tools this class can handle */ |
14 | | -#define VTK_CERTUS_NTOOLS 12 |
15 | | - |
16 | | -/*! |
17 | | -\class vtkNDICertusTracker |
18 | | -\brief Interface for the NDI Optotrak Certus tracking device |
19 | | -
|
20 | | -The vtkNDICertusTracker class provides an interface to the Optotrak |
21 | | -Certus (Northern Digital Inc., Waterloo, Canada) |
22 | | -
|
23 | | -\ingroup PlusLibDataCollection |
24 | | -*/ |
25 | | -class VTK_EXPORT vtkNDICertusTracker : public vtkPlusDevice |
26 | | -{ |
27 | | -public: |
28 | | - |
| 1 | +/*=Plus=header=begin====================================================== |
| 2 | + Program: Plus |
| 3 | + Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved. |
| 4 | + See License.txt for details. |
| 5 | +=========================================================Plus=header=end*/ |
| 6 | + |
| 7 | +#ifndef __vtkNDICertusTracker_h |
| 8 | +#define __vtkNDICertusTracker_h |
| 9 | + |
| 10 | +#include "vtkPlusDevice.h" |
| 11 | +#include <map> |
| 12 | + |
| 13 | +/*! the number of tools this class can handle */ |
| 14 | +#define VTK_CERTUS_NTOOLS 12 |
| 15 | + |
| 16 | +/*! |
| 17 | +\class vtkNDICertusTracker |
| 18 | +\brief Interface for the NDI Optotrak Certus tracking device |
| 19 | +
|
| 20 | +The vtkNDICertusTracker class provides an interface to the Optotrak |
| 21 | +Certus (Northern Digital Inc., Waterloo, Canada) |
| 22 | +
|
| 23 | +\ingroup PlusLibDataCollection |
| 24 | +*/ |
| 25 | +class VTK_EXPORT vtkNDICertusTracker : public vtkPlusDevice |
| 26 | +{ |
| 27 | +public: |
| 28 | + |
29 | 29 | enum LedState |
30 | 30 | { |
31 | 31 | TR_LED_OFF = 0, |
32 | 32 | TR_LED_ON = 1, |
33 | 33 | TR_LED_FLASH = 2 |
34 | | - }; |
35 | | - |
36 | | - static vtkNDICertusTracker *New(); |
37 | | - vtkTypeMacro(vtkNDICertusTracker,vtkPlusDevice); |
38 | | - void PrintSelf(ostream& os, vtkIndent indent); |
39 | | - |
40 | | - /*! Hardware device SDK version. */ |
41 | | - virtual std::string GetSdkVersion(); |
42 | | - |
43 | | - /*! Connect to device */ |
44 | | - virtual PlusStatus InternalConnect(); |
45 | | - |
46 | | - /*! Disconnect from device */ |
47 | | - virtual PlusStatus InternalDisconnect(); |
48 | | - |
49 | | - /*! |
50 | | - Probe to check whether there is an attached Certus system that |
51 | | - is able to track. After Probe is called, you can call |
52 | | - GetVersion() to get information about the attached Certus system. |
53 | | - */ |
54 | | - PlusStatus Probe(); |
55 | | - |
56 | | - /*! Get the a string (perhaps a long one) describing the type and version of the device. */ |
57 | | - vtkGetStringMacro(Version); |
58 | | - |
59 | | - /*! Get an update from the tracking system and push the new transforms to the tools. */ |
60 | | - PlusStatus InternalUpdate(); |
61 | | - |
62 | | - virtual bool IsTracker() const { return true; } |
63 | | - |
64 | | - /*! Set the specified tool LED to the specified state. */ |
65 | | - PlusStatus SetToolLED(int portNumber, int led, LedState state); |
66 | | - |
67 | | -protected: |
68 | | - vtkNDICertusTracker(); |
69 | | - ~vtkNDICertusTracker(); |
70 | | - |
71 | | - /*! Set the version information. */ |
72 | | - vtkSetStringMacro(Version); |
73 | | - |
74 | | - /*! |
75 | | - Start the tracking system. The tracking system is brought from |
76 | | - its ground state into full tracking mode. The device will |
77 | | - only be reset if communication cannot be established without |
78 | | - a reset. |
79 | | - */ |
80 | | - PlusStatus InternalStartRecording(); |
81 | | - |
82 | | - /*! Stop the tracking system and bring it back to its ground state: Initialized, not tracking, at 9600 Baud. */ |
83 | | - PlusStatus InternalStopRecording(); |
84 | | - |
85 | | - /*! Initialize communication with the Certus system. */ |
86 | | - PlusStatus InitializeCertusSystem(); |
87 | | - |
88 | | - /*! Terminate communication with the Certus system. */ |
89 | | - PlusStatus ShutdownCertusSystem(); |
90 | | - |
91 | | - /*! Activate the markers for tracking. */ |
92 | | - PlusStatus ActivateCertusMarkers(); |
93 | | - |
94 | | - /*! Deactivate all markers. */ |
95 | | - PlusStatus DeActivateCertusMarkers(); |
96 | | - |
97 | | - /*! Methods for detecting which ports have tools in them, and auto-enabling those tools. */ |
98 | | - PlusStatus EnableToolPorts(); |
99 | | - PlusStatus DisableToolPorts(); |
100 | | - |
101 | | - /*! Find the tool for a specific port handle (-1 if not found). */ |
102 | | - int GetToolFromHandle(int handle); |
103 | | - |
104 | | - /*! Version information */ |
105 | | - char *Version; |
106 | | - |
107 | | - /*! Number of markers */ |
108 | | - int NumberOfMarkers; |
109 | | - |
110 | | - /*! Number of rigid bodies */ |
111 | | - int NumberOfRigidBodies; |
112 | | - |
113 | | - /*! Internal matrix used for storing the actual tool matrix */ |
114 | | - vtkMatrix4x4 *SendMatrix; |
115 | | - |
116 | | - /*! Container used for storing enabled tools */ |
117 | | - int PortEnabled[VTK_CERTUS_NTOOLS]; |
118 | | - |
119 | | - /*! Container used for storing tool handles */ |
120 | | - int PortHandle[VTK_CERTUS_NTOOLS]; |
121 | | - |
122 | | - /*! Container used for storing rigid body maps */ |
123 | | - std::map<int,int> RigidBodyMap; |
124 | | - |
125 | | -private: |
126 | | - vtkNDICertusTracker(const vtkNDICertusTracker&); |
127 | | - void operator=(const vtkNDICertusTracker&); |
128 | | -}; |
129 | | - |
130 | | -#endif |
131 | | - |
132 | | - |
133 | | - |
134 | | - |
135 | | - |
| 34 | + }; |
| 35 | + |
| 36 | + static vtkNDICertusTracker *New(); |
| 37 | + vtkTypeMacro(vtkNDICertusTracker,vtkPlusDevice); |
| 38 | + void PrintSelf(ostream& os, vtkIndent indent); |
| 39 | + |
| 40 | + /*! Hardware device SDK version. */ |
| 41 | + virtual std::string GetSdkVersion(); |
| 42 | + |
| 43 | + /*! Connect to device */ |
| 44 | + virtual PlusStatus InternalConnect(); |
| 45 | + |
| 46 | + /*! Disconnect from device */ |
| 47 | + virtual PlusStatus InternalDisconnect(); |
| 48 | + |
| 49 | + /*! |
| 50 | + Probe to check whether there is an attached Certus system that |
| 51 | + is able to track. After Probe is called, you can call |
| 52 | + GetVersion() to get information about the attached Certus system. |
| 53 | + */ |
| 54 | + PlusStatus Probe(); |
| 55 | + |
| 56 | + /*! Get the a string (perhaps a long one) describing the type and version of the device. */ |
| 57 | + vtkGetStringMacro(Version); |
| 58 | + |
| 59 | + /*! Get an update from the tracking system and push the new transforms to the tools. */ |
| 60 | + PlusStatus InternalUpdate(); |
| 61 | + |
| 62 | + virtual bool IsTracker() const { return true; } |
| 63 | + |
| 64 | + /*! Set the specified tool LED to the specified state. */ |
| 65 | + PlusStatus SetToolLED(int portNumber, int led, LedState state); |
| 66 | + |
| 67 | +protected: |
| 68 | + vtkNDICertusTracker(); |
| 69 | + ~vtkNDICertusTracker(); |
| 70 | + |
| 71 | + /*! Set the version information. */ |
| 72 | + vtkSetStringMacro(Version); |
| 73 | + |
| 74 | + /*! |
| 75 | + Start the tracking system. The tracking system is brought from |
| 76 | + its ground state into full tracking mode. The device will |
| 77 | + only be reset if communication cannot be established without |
| 78 | + a reset. |
| 79 | + */ |
| 80 | + PlusStatus InternalStartRecording(); |
| 81 | + |
| 82 | + /*! Stop the tracking system and bring it back to its ground state: Initialized, not tracking, at 9600 Baud. */ |
| 83 | + PlusStatus InternalStopRecording(); |
| 84 | + |
| 85 | + /*! Initialize communication with the Certus system. */ |
| 86 | + PlusStatus InitializeCertusSystem(); |
| 87 | + |
| 88 | + /*! Terminate communication with the Certus system. */ |
| 89 | + PlusStatus ShutdownCertusSystem(); |
| 90 | + |
| 91 | + /*! Activate the markers for tracking. */ |
| 92 | + PlusStatus ActivateCertusMarkers(); |
| 93 | + |
| 94 | + /*! Deactivate all markers. */ |
| 95 | + PlusStatus DeActivateCertusMarkers(); |
| 96 | + |
| 97 | + /*! Methods for detecting which ports have tools in them, and auto-enabling those tools. */ |
| 98 | + PlusStatus EnableToolPorts(); |
| 99 | + PlusStatus DisableToolPorts(); |
| 100 | + |
| 101 | + /*! Find the tool for a specific port handle (-1 if not found). */ |
| 102 | + int GetToolFromHandle(int handle); |
| 103 | + |
| 104 | + /*! Version information */ |
| 105 | + char *Version; |
| 106 | + |
| 107 | + /*! Number of markers */ |
| 108 | + int NumberOfMarkers; |
| 109 | + |
| 110 | + /*! Number of rigid bodies */ |
| 111 | + int NumberOfRigidBodies; |
| 112 | + |
| 113 | + /*! Internal matrix used for storing the actual tool matrix */ |
| 114 | + vtkMatrix4x4 *SendMatrix; |
| 115 | + |
| 116 | + /*! Container used for storing enabled tools */ |
| 117 | + int PortEnabled[VTK_CERTUS_NTOOLS]; |
| 118 | + |
| 119 | + /*! Container used for storing tool handles */ |
| 120 | + int PortHandle[VTK_CERTUS_NTOOLS]; |
| 121 | + |
| 122 | + /*! Container used for storing rigid body maps */ |
| 123 | + std::map<int,int> RigidBodyMap; |
| 124 | + |
| 125 | +private: |
| 126 | + vtkNDICertusTracker(const vtkNDICertusTracker&); |
| 127 | + void operator=(const vtkNDICertusTracker&); |
| 128 | +}; |
| 129 | + |
| 130 | +#endif |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | + |
0 commit comments