implements TrackingTool interface More...
#include <mitkInternalTrackingTool.h>
Public Types | |
typedef InternalTrackingTool | Self |
typedef TrackingTool | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer < const Self > | ConstPointer |
Public Member Functions | |
virtual const char * | GetClassName () const |
virtual void | GetPosition (mitk::Point3D &position) const |
returns the current position of the tool as an array of three floats (in the tracking device coordinate system) | |
virtual void | GetOrientation (mitk::Quaternion &orientation) const |
returns the current orientation of the tool as a quaternion (in the tracking device coordinate system) | |
virtual bool | Enable () |
enablea the tool, so that it will be tracked. Returns true if enabling was successfull | |
virtual bool | Disable () |
disables the tool, so that it will not be tracked anymore. Returns true if disabling was successfull | |
virtual bool | IsEnabled () const |
returns whether the tool is enabled or disabled | |
virtual bool | IsDataValid () const |
returns true if the current position data is valid (no error during tracking, tracking error below threshold, ...) | |
virtual float | GetTrackingError () const |
return one value that corresponds to the overall tracking error. The dimension of this value is specific to each tracking device | |
virtual void | SetToolName (const std::string _arg) |
Sets the name of the tool. | |
virtual void | SetToolName (const char *_arg) |
Sets the name of the tool. | |
virtual void | SetPosition (mitk::Point3D position) |
sets the position | |
virtual void | SetOrientation (mitk::Quaternion orientation) |
sets the orientation as a quaternion | |
virtual void | SetTrackingError (float error) |
sets the tracking error | |
virtual void | SetDataValid (bool _arg) |
sets if the tracking data (position & Orientation) is valid | |
virtual void | SetErrorMessage (const char *_arg) |
sets the error message | |
Protected Member Functions | |
InternalTrackingTool () | |
virtual | ~InternalTrackingTool () |
Static Protected Member Functions | |
static Pointer | New () |
Protected Attributes | |
Point3D | m_Position |
holds the position of the tool | |
Quaternion | m_Orientation |
holds the orientation of the tool | |
float | m_TrackingError |
holds the tracking error of the tool | |
bool | m_Enabled |
if true, tool is enabled and should receive tracking updates from the tracking device | |
bool | m_DataValid |
if true, data in m_Position and m_Orientation is valid, e.g. true tracking data | |
Friends | |
class | MicroBirdTrackingDevice |
implements TrackingTool interface
Documentation This class is a complete TrackingTool implementation. It can either be used directly by TrackingDevices, or be subclassed for more specific implementations. mitk::MicroBirdTrackingDevice uses this class to manage its tools. Other tracking devices uses specialized versions of this class (e.g. mitk::NDITrackingTool)
Definition at line 40 of file mitkInternalTrackingTool.h.
typedef itk::SmartPointer<const Self> mitk::InternalTrackingTool::ConstPointer |
Reimplemented from mitk::TrackingTool.
Reimplemented in mitk::ClaronTool, mitk::MicroBirdTool, mitk::NDIPassiveTool, mitk::VirtualTrackingTool, ClaronToolTestClass, InternalTrackingToolTestClass, and NDIPassiveToolTestClass.
Definition at line 44 of file mitkInternalTrackingTool.h.
typedef itk::SmartPointer<Self> mitk::InternalTrackingTool::Pointer |
Reimplemented from mitk::TrackingTool.
Reimplemented in mitk::ClaronTool, mitk::MicroBirdTool, mitk::NDIPassiveTool, mitk::VirtualTrackingTool, ClaronToolTestClass, InternalTrackingToolTestClass, and NDIPassiveToolTestClass.
Definition at line 44 of file mitkInternalTrackingTool.h.
Reimplemented from mitk::TrackingTool.
Reimplemented in mitk::ClaronTool, mitk::MicroBirdTool, mitk::NDIPassiveTool, mitk::VirtualTrackingTool, ClaronToolTestClass, InternalTrackingToolTestClass, and NDIPassiveToolTestClass.
Definition at line 44 of file mitkInternalTrackingTool.h.
Reimplemented from mitk::TrackingTool.
Reimplemented in mitk::ClaronTool, mitk::MicroBirdTool, mitk::NDIPassiveTool, mitk::VirtualTrackingTool, ClaronToolTestClass, InternalTrackingToolTestClass, and NDIPassiveToolTestClass.
Definition at line 44 of file mitkInternalTrackingTool.h.
mitk::InternalTrackingTool::InternalTrackingTool | ( | ) | [protected] |
Definition at line 24 of file mitkInternalTrackingTool.cpp.
References m_Orientation, and m_Position.
: TrackingTool(), m_TrackingError(0.0f), m_Enabled(true), m_DataValid(false) { m_Position[0] = 0.0f; m_Position[1] = 0.0f; m_Position[2] = 0.0f; m_Orientation[0] = 0.0f; m_Orientation[1] = 0.0f; m_Orientation[2] = 0.0f; m_Orientation[3] = 0.0f; }
mitk::InternalTrackingTool::~InternalTrackingTool | ( | ) | [protected, virtual] |
Definition at line 39 of file mitkInternalTrackingTool.cpp.
{ }
bool mitk::InternalTrackingTool::Disable | ( | ) | [virtual] |
disables the tool, so that it will not be tracked anymore. Returns true if disabling was successfull
Implements mitk::TrackingTool.
Definition at line 147 of file mitkInternalTrackingTool.cpp.
{ MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex if (m_Enabled == true) { this->m_Enabled = false; this->Modified(); } return true; }
bool mitk::InternalTrackingTool::Enable | ( | ) | [virtual] |
enablea the tool, so that it will be tracked. Returns true if enabling was successfull
Implements mitk::TrackingTool.
Definition at line 135 of file mitkInternalTrackingTool.cpp.
{ MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex if (m_Enabled == false) { this->m_Enabled = true; this->Modified(); } return true; }
virtual const char* mitk::InternalTrackingTool::GetClassName | ( | ) | const [virtual] |
Reimplemented from mitk::TrackingTool.
Reimplemented in mitk::ClaronTool, mitk::MicroBirdTool, mitk::NDIPassiveTool, mitk::VirtualTrackingTool, ClaronToolTestClass, InternalTrackingToolTestClass, and NDIPassiveToolTestClass.
void mitk::InternalTrackingTool::GetOrientation | ( | mitk::Quaternion & | orientation ) | const [virtual] |
returns the current orientation of the tool as a quaternion (in the tracking device coordinate system)
Implements mitk::TrackingTool.
Definition at line 94 of file mitkInternalTrackingTool.cpp.
{ MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex orientation = m_Orientation; }
void mitk::InternalTrackingTool::GetPosition | ( | mitk::Point3D & | position ) | const [virtual] |
returns the current position of the tool as an array of three floats (in the tracking device coordinate system)
Implements mitk::TrackingTool.
Definition at line 70 of file mitkInternalTrackingTool.cpp.
{ MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex position[0] = m_Position[0]; position[1] = m_Position[1]; position[2] = m_Position[2]; this->Modified(); }
float mitk::InternalTrackingTool::GetTrackingError | ( | ) | const [virtual] |
return one value that corresponds to the overall tracking error. The dimension of this value is specific to each tracking device
Implements mitk::TrackingTool.
Definition at line 127 of file mitkInternalTrackingTool.cpp.
{ MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex float r = m_TrackingError; return r; }
bool mitk::InternalTrackingTool::IsDataValid | ( | ) | const [virtual] |
returns true if the current position data is valid (no error during tracking, tracking error below threshold, ...)
Implements mitk::TrackingTool.
Definition at line 166 of file mitkInternalTrackingTool.cpp.
{ MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex return m_DataValid; }
bool mitk::InternalTrackingTool::IsEnabled | ( | ) | const [virtual] |
returns whether the tool is enabled or disabled
Implements mitk::TrackingTool.
Definition at line 159 of file mitkInternalTrackingTool.cpp.
Referenced by mitk::NDITrackingDevice::InitializeWiredTools().
{ MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex return m_Enabled; }
static Pointer mitk::InternalTrackingTool::New | ( | ) | [static, protected] |
Reimplemented in mitk::ClaronTool, mitk::MicroBirdTool, mitk::NDIPassiveTool, mitk::VirtualTrackingTool, ClaronToolTestClass, InternalTrackingToolTestClass, and NDIPassiveToolTestClass.
Referenced by QmitkIGTExampleView::ConfigureTrackingDevice().
void mitk::InternalTrackingTool::SetDataValid | ( | bool | _arg ) | [virtual] |
sets if the tracking data (position & Orientation) is valid
Definition at line 173 of file mitkInternalTrackingTool.cpp.
Referenced by mitk::MicroBirdTrackingDevice::TrackTools().
{ itkDebugMacro("setting m_DataValid to " << _arg); if (this->m_DataValid != _arg) { MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex this->m_DataValid = _arg; this->Modified(); } }
void mitk::InternalTrackingTool::SetErrorMessage | ( | const char * | _arg ) | [virtual] |
sets the error message
Definition at line 185 of file mitkInternalTrackingTool.cpp.
{ itkDebugMacro("setting m_ErrorMessage to " << _arg); MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex if ((_arg == NULL) || (_arg == this->m_ErrorMessage)) return; if (_arg != NULL) this->m_ErrorMessage = _arg; else this->m_ErrorMessage = ""; this->Modified(); }
void mitk::InternalTrackingTool::SetOrientation | ( | mitk::Quaternion | orientation ) | [virtual] |
sets the orientation as a quaternion
Definition at line 101 of file mitkInternalTrackingTool.cpp.
Referenced by mitk::MicroBirdTrackingDevice::TrackTools().
{ itkDebugMacro("setting m_Orientation to " << orientation); MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex if (mitk::Equal(orientation, m_Orientation)) { return; } m_Orientation = orientation; this->Modified(); }
void mitk::InternalTrackingTool::SetPosition | ( | mitk::Point3D | position ) | [virtual] |
sets the position
Definition at line 80 of file mitkInternalTrackingTool.cpp.
Referenced by mitk::MicroBirdTrackingDevice::TrackTools().
{ itkDebugMacro("setting m_Position to " << position); MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex if (mitk::Equal(position, m_Position)) { return; } m_Position = position; this->Modified(); }
void mitk::InternalTrackingTool::SetToolName | ( | const std::string | _arg ) | [virtual] |
Sets the name of the tool.
Definition at line 64 of file mitkInternalTrackingTool.cpp.
Referenced by QmitkNDIConfigurationWidget::UpdateTrackerFromToolTable().
{ this->SetToolName(_arg.c_str()); }
void mitk::InternalTrackingTool::SetToolName | ( | const char * | _arg ) | [virtual] |
Sets the name of the tool.
Definition at line 44 of file mitkInternalTrackingTool.cpp.
{ itkDebugMacro("setting m_ToolName to " << _arg); MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex if ( _arg && (_arg == this->m_ToolName) ) { return; } if (_arg) { this->m_ToolName= _arg; } else { this->m_ToolName= ""; } this->Modified(); }
void mitk::InternalTrackingTool::SetTrackingError | ( | float | error ) | [virtual] |
sets the tracking error
Definition at line 114 of file mitkInternalTrackingTool.cpp.
Referenced by mitk::MicroBirdTrackingDevice::TrackTools().
{ itkDebugMacro("setting m_TrackingError to " << error); MutexLockHolder lock(*m_MyMutex); // lock and unlock the mutex if (error == m_TrackingError) { return; } m_TrackingError = error; this->Modified(); }
friend class MicroBirdTrackingDevice [friend] |
Definition at line 42 of file mitkInternalTrackingTool.h.
bool mitk::InternalTrackingTool::m_DataValid [protected] |
if true, data in m_Position and m_Orientation is valid, e.g. true tracking data
Definition at line 70 of file mitkInternalTrackingTool.h.
bool mitk::InternalTrackingTool::m_Enabled [protected] |
if true, tool is enabled and should receive tracking updates from the tracking device
Definition at line 69 of file mitkInternalTrackingTool.h.
Quaternion mitk::InternalTrackingTool::m_Orientation [protected] |
holds the orientation of the tool
Definition at line 67 of file mitkInternalTrackingTool.h.
Referenced by InternalTrackingTool().
Point3D mitk::InternalTrackingTool::m_Position [protected] |
holds the position of the tool
Definition at line 66 of file mitkInternalTrackingTool.h.
Referenced by InternalTrackingTool().
float mitk::InternalTrackingTool::m_TrackingError [protected] |
holds the tracking error of the tool
Definition at line 68 of file mitkInternalTrackingTool.h.