<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff size=2>Good
to know that I'm not alone, then!</FONT></SPAN></DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff size=2>Now, I
gave the problem some more thought since I my earlier post. Looks to me a
class design flaw in VTK. Here's why.</FONT></SPAN></DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff size=2>Though
the user is free to override vtkInteractorStyle and pass it polymorphically to
vtkRenderWindowInteractor::SetInteractorStyle(), the argument would most likely
be internally cached as vtkInteractorObserver (the base class). Which means, the
callback mechanism cannot and will not know about vtkInteractorStyle (or, the
derived class') members (and their overrides). </FONT></SPAN></DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff size=2>It's
quite possible that VTK may have a workaround for this, making it
not so much of a flaw! In which case, would</FONT></SPAN><SPAN
class=727045304-04102006><FONT face=Arial color=#0000ff size=2> any of the VTK
veterans / power-users please suggest a better/alternate (set of)
class(es) to accomplish what I'm trying to... ?</FONT></SPAN></DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff size=2>I'm
trying to:</FONT></SPAN></DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff size=2>
1. plug in my own event handlers into VTK, and</FONT></SPAN></DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff size=2>
2. have the ability to conditionally use (or not use) base class' (or the
default) version of the event handlers.</FONT></SPAN></DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff
size=2>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=727045304-04102006><FONT face=Arial color=#0000ff
size=2>-Nikhil.</FONT></SPAN></DIV>
<DIV><SPAN class=727045304-04102006></SPAN><SPAN
class=727045304-04102006></SPAN><SPAN class=727045304-04102006></SPAN><SPAN
class=727045304-04102006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=727045304-04102006></SPAN><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
vtkusers-bounces+pingnikhil=yahoo.com@vtk.org
[mailto:vtkusers-bounces+pingnikhil=yahoo.com@vtk.org]<B>On Behalf Of </B>Harry
Simons<BR><B>Sent:</B> Wednesday, October 04, 2006 9:01 a<BR><B>To:</B>
vtkusers@vtk.org<BR><B>Subject:</B> RE: [vtkusers] vtkInteractorStyle overrides
fail to fire!<BR><BR></DIV></FONT>
<BLOCKQUOTE>Yep, me too. Frustrated, gave up on this one
eventually.<BR><BR>> <BR>> Hello,<BR>> <BR>> I'm trying to
implement custom mouse event handling for my 2D (image<BR>> actor) as
follows. The image slice shows up fine but my event override <BR>> fails to
fire! Anything I'm missing?<BR>> <BR>> Regards,<BR>> A VTK
Newbie.<BR>> <BR>> <BR>> class MyInteractorStyle extends
vtkInteractorStyle {<BR>> public void
OnLeftButtonDown() {<BR>>
System.out.println("left button pressed");<BR>>
}<BR>> }<BR>> <BR>> // ...<BR>> myIS = new
MyInteractorStyle();<BR>> rwi = new vtkRenderWindowInteractor();<BR>>
rwi.SetInteractorStyle (myIS);<BR>> <BR>> // ...<BR>>
rwi.SetRenderWindow(renderWindow);<BR>> renderWindow.Render();<BR>>
rwi.Start();<BR>> <BR><BR></BLOCKQUOTE></BODY></HTML>
<p> 
                <hr size=1>Do you Yahoo!?<br>
Get on board. <a href="http://us.rd.yahoo.com/evt=40791/*http://advision.webevents.yahoo.com/mailbeta">You're invited</a> to try the new Yahoo! Mail.