<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
<BR>
<DIV><FONT size=2>
Hi again!!!<BR>
<BR>
I wrote about how to get the position of a tool with a Polaris Tracker.<BR>
I has received a response, with some code which define an observer, but i have a little problem with this part:<BR>
<BR>
typedef itk::ReceptorMemberCommand < Self > LoadedObserverType;<BR>
<BR>
What typedef is Self??????????<BR>
There is an error: Undeclared identifier<BR>
<BR>
The whole code received is:<BR>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<BR>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<BR>
// define an observer in your main class<BR>
#include "igstkEvents.h"<BR>
typedef itk::ReceptorMemberCommand < Self > LoadedObserverType;<BR>LoadedObserverType::Pointer m_TrackerToolUpdateObserver;<BR>// set a callback function to it<BR>m_TrackerToolUpdateObserver = LoadedObserverType::New();<BR>m_TrackerToolUpdateObserver->SetCallbackFunction( this, &MyClass::TrackingCallback );<BR>// the callback function<BR>
<BR>void MyClass::TrackingCallback(const itk::EventObject & event )<BR>{<BR> if ( igstk::TrackerToolTransformUpdateEvent().CheckEvent( &event ) )<BR> {<BR> typedef igstk::TransformObserver ObserverType;<BR> ObserverType::Pointer transformObserver = ObserverType::New();<BR> transformObserver->ObserveTransformEventsFrom( m_TrackerTool );<BR> transformObserver->Clear();<BR> m_TrackerTool->RequestComputeTransformTo( m_WorldReference ); // some reference e.g. igstk::AxesObject::Pointer m_WorldReference;<BR> if ( transformObserver->GotTransform() )<BR> {<BR> igstk::Transform::VectorType translation;<BR> // get the translational component<BR> translation = transformObserver->GetTransform().GetTranslation();<BR> // get the rotational component (quaternion)<BR> igstk::Transform::VersorType rotation;<BR> rotation= transformObserver->GetTransform().GetRotation();<BR> }<BR> }<BR>}<BR>// and don't forget to add the observer to the tracker tool<BR>m_TrackerTool->AddObserver( igstk::TrackerToolTransformUpdateEvent(), m_TrackerToolUpdateObserver);<BR>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<BR>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////<BR>
<BR>
<BR>
<BR>
I hope someone can help me please, or give me onother option to get coordinates of tools, please... :(<BR>
Thanks, i will be waiting for some response :D<BR>
<BR>
<BR>
<BR>
<BR>
<BR></FONT></DIV><br /><hr />Si no te acuerdas quién quedó en traer los hielos, te urge usar <a href='http://skydrive.live.com' target='_new'>Skydrive</a></body>
</html>