19 #include <itkMutexLockHolder.h>
25 m_TrackingError(0.0f),
53 Superclass::PrintSelf(os, indent);
55 os << indent <<
"Position: " << m_Position << std::endl;
56 os << indent <<
"Orientation: " << m_Orientation << std::endl;
57 os << indent <<
"TrackingError: " << m_TrackingError << std::endl;
58 os << indent <<
"Enabled: " << m_Enabled << std::endl;
59 os << indent <<
"DataValid: " << m_DataValid << std::endl;
60 os << indent <<
"ToolTip: " << m_ToolTip << std::endl;
61 os << indent <<
"ToolTipRotation: " << m_ToolTipRotation << std::endl;
62 os << indent <<
"ToolTipSet: " << m_ToolTipSet << std::endl;
67 itkDebugMacro(
"setting m_ToolName to " << _arg);
69 if ( _arg && (_arg == this->m_ToolName) )
75 this->m_ToolName= _arg;
87 this->SetToolName(_arg.c_str());
100 vnl_vector<mitk::ScalarType> pos_vnl = m_Position.GetVnlVector() + m_Orientation.rotate( m_ToolTip.GetVnlVector() ) ;
102 position[0] = pos_vnl[0];
103 position[1] = pos_vnl[1];
104 position[2] = pos_vnl[2];
108 position[0] = m_Position[0];
109 position[1] = m_Position[1];
110 position[2] = m_Position[2];
118 itkDebugMacro(
"setting m_Position to " << position);
121 m_Position = position;
136 orientation = m_Orientation * m_ToolTipRotation;
140 orientation = m_Orientation;
148 if ( !
Equal(m_ToolTip, toolTipPosition, eps) ||
149 !
Equal(m_ToolTipRotation, orientation, eps) )
151 if( (toolTipPosition[0] == 0) &&
152 (toolTipPosition[1] == 0) &&
153 (toolTipPosition[2] == 0) &&
154 (orientation.x() == 0) &&
155 (orientation.y() == 0) &&
156 (orientation.z() == 0) &&
157 (orientation.r() == 1))
159 m_ToolTipSet =
false;
165 m_ToolTip = toolTipPosition;
166 m_ToolTipRotation = orientation;
173 itkDebugMacro(
"setting m_Orientation to " << orientation);
176 m_Orientation = orientation;
184 itkDebugMacro(
"setting m_TrackingError to " << error);
186 if (error == m_TrackingError)
190 m_TrackingError = error;
198 float r = m_TrackingError;
206 if (m_Enabled ==
false)
208 this->m_Enabled =
true;
218 if (m_Enabled ==
true)
220 this->m_Enabled =
false;
248 itkDebugMacro(
"setting m_DataValid to " << _arg);
249 if (this->m_DataValid != _arg)
252 this->m_DataValid = _arg;
260 itkDebugMacro(
"setting m_ErrorMessage to " << _arg);
262 if ((_arg ==
nullptr) || (_arg == this->m_ErrorMessage))
266 this->m_ErrorMessage = _arg;
268 this->m_ErrorMessage =
"";
vnl_quaternion< ScalarType > Quaternion
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose)
Returns true if the example data structures are considered equal.
MITKCORE_EXPORT const ScalarType eps