An object of this class represents the interface to Polhemus trackers. All variables with the name "tool" start with index 1, which is the station number of Polhemus. Make sure to call functions in this class with parameter "1" if you want to loop over all tools. If you need to access an array (e.g. m_Hemisphere), you need to use "_tool -1" and adapt your index for loops...
More...
#include <mitkPolhemusInterface.h>
An object of this class represents the interface to Polhemus trackers. All variables with the name "tool" start with index 1, which is the station number of Polhemus. Make sure to call functions in this class with parameter "1" if you want to loop over all tools. If you need to access an array (e.g. m_Hemisphere), you need to use "_tool -1" and adapt your index for loops...
Documentation:
Definition at line 42 of file mitkPolhemusInterface.h.
◆ PolhemusInterface()
mitk::PolhemusInterface::PolhemusInterface |
( |
| ) |
|
|
protected |
◆ ~PolhemusInterface()
mitk::PolhemusInterface::~PolhemusInterface |
( |
| ) |
|
|
protected |
◆ AdjustHemisphere()
void mitk::PolhemusInterface::AdjustHemisphere |
( |
int |
_tool | ) |
|
Adjust the Hemisphere for this tool. User needs to make sure, that the tool is located in hemisphere (1|0|0) when calling this function. In contrast to SetHemisphere(1,0,0), this method restores the original HemisphereTracking settings at the end.
◆ AutoDetectTools()
std::vector<trackingData> mitk::PolhemusInterface::AutoDetectTools |
( |
| ) |
|
- Returns
- Returns a single frame with all tools, which could be auto detected.
◆ Clone()
Pointer mitk::PolhemusInterface::Clone |
( |
| ) |
const |
◆ Connect()
bool mitk::PolhemusInterface::Connect |
( |
| ) |
|
◆ Disconnect()
bool mitk::PolhemusInterface::Disconnect |
( |
| ) |
|
◆ GetFrame()
std::vector<trackingData> mitk::PolhemusInterface::GetFrame |
( |
| ) |
|
|
protected |
Convenient method to get a frame from the tracking device.
- Returns
- Returns a single OR the last frame depending on m_continuousTracking.
- Warning
- Don't use this function if you use different threads. You need to make sure, that you are still in the right mode!
◆ GetHemisphere()
Get the Hemisphere for _tool as mitk vector. -1 ("all tools") returns hemisphere of first tool. Index starts at "1" for the first tool (i.e. station number of Polhemus). Not 0!
◆ GetHemisphereTrackingEnabled()
bool mitk::PolhemusInterface::GetHemisphereTrackingEnabled |
( |
int |
_tool | ) |
|
Is Hemisphere Tracking Enabled for this tool? if tool is -1, this means "All Tools". We return true if HemiTracking is enabled for all tools, and false if it is off for at least one tool.
◆ GetLastFrame()
std::vector<trackingData> mitk::PolhemusInterface::GetLastFrame |
( |
| ) |
|
- Returns
- Returns the last frame when the tracking device is in continous tracking mode. Returns an empty vector in case of an error.
◆ GetNumberOfTools()
unsigned int mitk::PolhemusInterface::GetNumberOfTools |
( |
| ) |
|
- Returns
- Returns the number of tools. Returns 0 if no information is available.
◆ GetSingleFrame()
std::vector<trackingData> mitk::PolhemusInterface::GetSingleFrame |
( |
| ) |
|
- Returns
- Returns a single frame. Only works if the tracking device is not in continuous tracking mode. Returns an empty vector in case of an error.
◆ GetToolIndex()
int mitk::PolhemusInterface::GetToolIndex |
( |
int |
_tool | ) |
|
|
protected |
◆ GetToolPorts()
std::vector<int> mitk::PolhemusInterface::GetToolPorts |
( |
| ) |
|
Get the ports on which tools are connected. Returns empty vector if device is not connected!
◆ InitializeDevice()
bool mitk::PolhemusInterface::InitializeDevice |
( |
| ) |
|
|
protected |
◆ mitkClassMacroItkParent()
◆ New()
static Pointer mitk::PolhemusInterface::New |
( |
| ) |
|
|
static |
◆ ParsePolhemusRawData()
Parses polhemus raw data to a collection of tracking data of single tools.
◆ PrintStatus()
void mitk::PolhemusInterface::PrintStatus |
( |
| ) |
|
Convenient method to print the status of the tracking device (true/false) if connection is established. For debugging...
◆ SetHemisphere()
void mitk::PolhemusInterface::SetHemisphere |
( |
int |
_tool, |
|
|
mitk::Vector3D |
_hemisphere |
|
) |
| |
Sets the Hemisphere of tool _tool to the vector _hemisphere. "-1" sets all tools. Index starts at "1" for the first tool (i.e. station number of Polhemus). Not 0!
◆ SetHemisphereTrackingEnabled()
void mitk::PolhemusInterface::SetHemisphereTrackingEnabled |
( |
bool |
_HemisphereTrackingEnabled, |
|
|
int |
_tool = -1 |
|
) |
| |
Enables/disables hemisphere tracking for all stations/tools.
◆ SetupDevice()
bool mitk::PolhemusInterface::SetupDevice |
( |
| ) |
|
|
protected |
◆ StartTracking()
bool mitk::PolhemusInterface::StartTracking |
( |
| ) |
|
Opens the connection to the device and makes it ready to track tools.
- Returns
- Returns true if there is a connection to the device and the device is ready to track tools, false if not.
◆ StopTracking()
bool mitk::PolhemusInterface::StopTracking |
( |
| ) |
|
Clears all resources. After this method have been called the system isn't ready to track any longer.
- Returns
- Returns true if the operation was succesful, false if not.
◆ ToggleHemisphere()
void mitk::PolhemusInterface::ToggleHemisphere |
( |
int |
_tool = -1 | ) |
|
Toggles the current hemisphere. Parameter _tool describes, for which tool the hemisphere should change. Default -1 toggles all tools. Index starts at "1" for the first tool (i.e. station number of Polhemus). Not 0!
◆ m_pdiDev
CPDIdev* mitk::PolhemusInterface::m_pdiDev |
|
protected |
The documentation for this class was generated from the following file: