<div dir="ltr">i found the solution. i should apply observer to interactor, not to actor. :) thats it.<br><br>Gökhan<br><br><br><br><div class="gmail_quote">2008/8/22 Gökhan ERSOY <span dir="ltr"><<a href="mailto:goksoy66@gmail.com">goksoy66@gmail.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 dir="ltr">ok, the problem was "private". :) now callback function is recognized. but now, it doesn't work. :) i am pressing LeftButton of mouse, but there is no result.<div>
<div></div><div class="Wj3C7c"><br><br>Gökhan<br> <br><br><div class="gmail_quote">
2008/8/22 Gerrick Bivins <span dir="ltr"><<a href="mailto:gbivins@objectreservoir.com" target="_blank">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>
The callback needs to be public rather than private.<div><div></div><div><br>
Gerrick<br>
<br>
On 8/22/08 11:27 AM, "Gökhan ERSOY" <<a href="mailto:goksoy66@gmail.com" target="_blank">goksoy66@gmail.com</a>> wrote:<br>
<br>
</div></div></span></font></font><div><div></div><div><blockquote><font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">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>
2008/8/22 Gerrick Bivins <<a href="mailto:gbivins@objectreservoir.com" target="_blank">gbivins@objectreservoir.com</a>><br>
</span></font></font><blockquote><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<br>
<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>
</span></font></font><blockquote><font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;">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>
<hr align="center" size="3" width="95%"></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><font size="4"><font face="Calibri, Verdana, Helvetica, Arial"><span style="font-size: 11pt;"><br>
<br>
</span></font></font></blockquote></blockquote>
</div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>