<div dir="ltr"><div>Take a look at this example: <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ObserverMemberFunction">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ObserverMemberFunction</a> <br><br>
</div>It shows how you can use a member function as an observer.<br><br>David<br></div><div class="gmail_extra"><br clear="all"><div><br>David</div>
<br><br><div class="gmail_quote">On Fri, Mar 29, 2013 at 2:38 PM, harshanand <span dir="ltr">&lt;<a href="mailto:harsha.nyshadham@gmail.com" target="_blank">harsha.nyshadham@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Guys,<br>
<br>
I am new to programming and I am not sure how to fix this.<br>
<br>
I have a class GBConnecivity and would like to setup vtkcallback to use<br>
function from this class.<br>
<br>
This is what I am doing:<br>
<br>
&lt;.h&gt;<br>
class GBConnectivityApp<br>
{<br>
public:<br>
void ClickCallbackFunction (vtkObject* caller, long unsigned int eventId,<br>
void* clientData, void* callData);<br>
}<br>
<br>
&lt;.cpp&gt;<br>
void GBConnectivityApp::ClickCallbackFunction(vtkObject* vtkNotUsed(caller),<br>
long unsigned int vtkNotUsed(eventId), void* clientData, void*<br>
vtkNotUsed(callData))<br>
{<br>
.................some stuff<br>
}<br>
<br>
I am calling it like this from another function of same<br>
class(GBConnectivityApp)<br>
<br>
vtkSmartPointer&lt;vtkCallbackCommand&gt; clickCallback =<br>
                vtkSmartPointer&lt;vtkCallbackCommand&gt;::New();<br>
<br>
        clickCallback-&gt;SetCallback (ClickCallbackFunction );<br>
        ui.qvtkWidget-&gt;update();<br>
<br>
It would  not accept this, I tried GBConnectivityApp::ClickCallbackFunction<br>
, would not take it. I get the error missing parameters to functions. So I<br>
pass the parameters to cliclcallbackFunction, it would  not take it too.<br>
<br>
What am i doing wrong?<br>
<br>
Thanks for the help!!!<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/VTKcallbackcommand-passing-a-class-function-tp5719722.html" target="_blank">http://vtk.1045678.n5.nabble.com/VTKcallbackcommand-passing-a-class-function-tp5719722.html</a><br>

Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>