<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Dear IGSTK users,<br>
<br>
I come to you following my difficulties to understand observers and events in IGSTK.<br>
<br>
Basically, what I want to do, is simply print the position of a tracker every time its position is updated.
<br>
<br>
So I think I have to do something like:<br>
<br>
myClassXY{<br>
<br>
    //in the constructor:<br>
    ObserverType myObs = ObserverType::New();<br>
    PolarisTrackerTool::Pointer myTrackerTool = PolarisTrackerTool::New();<br>
<br>
    myObs->SetCallbackFnct(this,&myCallbackMethod);<br>
    myTrackerTool->AddObserver(igstk::TrackerToolTransformUpdateEvent(), myObs);<br>
<br>
<br>
    //myCallbackMethod definition<br>
    void myCallbackMethod{<br>
        //print the position of myTrackerTool<br>
    }<br>
<br>
}<br>
<br>
But unfortunately, I am completely unsuccessful to implement it correctly. For example, I do not get how to create ObserverType.<br>
More generally, I would like to be able to link any igstkEvent to any personal callback method.<br>
<br>
Could anyone help me with this issue? I'm sure it is a basic thing, but I just can't figure out how to implement it...<br>
<br>
Thanks a lot for your help,<br>
Best,<br>
Steve<br>
</div>
</div>
</body>
</html>