<div dir="ltr">here is a part of my code. when i write the name of callback function myCallBack as "myCallBack" in parameter list of AddObserver, it is not recognized. does anyone have an idea? or is there any faulty statement?<br>
<br>----------------------------------------------------------------------------------------------------------------<br>public class SimpleTexture {<br> ...<br> public SimpleTexture() {<br> vtkRenderer ren = new vtkRenderer();<br>
...<br> vtkActor planeActor = new vtkActor();<br> ...<br> planeActor.AddObserver("LeftButtonPressEvent", this, "myCallBack");<br> ren.AddActor(planeActor);<br> ...<br>
}<br> ...<br> private void myCallBack(){<br> System.out.println("Hello");<br> } <br> ...<br> public static void main(String[] args) {<br> SimpleTexture simpleTexture = new SimpleTexture();<br>
}<br>}<br>----------------------------------------------------------------------------------------------------------------<br><br>Thanks...<br><br>Gökhan<br><br><br><br><div class="gmail_quote">2008/8/22 Gerrick Bivins <span dir="ltr"><<a href="mailto:gbivins@objectreservoir.com">gbivins@objectreservoir.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><br>
Hi Gokhan,<br>
For wrapped languages you need to use the AddObserver interface that takes strings instead of enums.<br>
For example in java I use:<br>
abc->AddObserver("InteractionEvent",this,"myCallBack")<br>
<br>
Where<br>
InteractionEvent ==> event name to detect<br>
this==> class where callback function is defined (I think)<br>
myCallBack==> The name of the callback function/method<br>
<br>
There's a chapter in the VTK users guide that goes into more detail.<br>
Hope that helps.<br>
Gerrick<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
On 8/22/08 10:46 AM, "Gökhan ERSOY" <<a href="mailto:goksoy66@gmail.com" target="_blank">goksoy66@gmail.com</a>> wrote:<br>
<br>
</div></div></span></font></font><blockquote><font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><div><div></div><div class="Wj3C7c">Hello,<br>
<br>
vtkCommand class doesnt exist in Java? I am trying to call <br>
<br>
abc->AddObserver(<b>vtkCommand::InteractionEvent</b>, myCallBack)<br>
<br>
but i cant find vtkCommand class.<br>
<br>
<br>
<br>
Gökhan<br>
<br>
</div></div><hr size="3" width="95%" align="center"></span></font><font face="Consolas, Courier New, Courier"><span style="font-size: 10pt;">_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><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>
</span></font></font></blockquote>
</div>
</blockquote></div><br></div>