<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi,<br><br>Thank you for your answer.<br>I don't think that's important but actually I'm using a personnal class which inherits from vtkInteractorStyleTrackballCamera.<br>I don't know if I need to do something special in the constructor of this class.<br>For the moment, I just initialize the class member variables.<br><br>So to answer your question, I tried to making my InteractorStyle inheriting from another InteractorStyle without being successfull.<br>If you have any idea I take it !.<br><br><br>BL.<br><br><br><br><br><br><br>&gt; From: sean@rogue-research.com<br>&gt; To: laurentbenoist@hotmail.com; vtkusers@vtk.org<br>&gt; Subject: Re: [vtkusers] MouseMoveEvent bug in Cocoa<br>&gt; Date: Tue, 4 Aug 2009 15:53:53 -0400<br>&gt; <br>&gt; On 7/23/09 9:01 AM, Benoist Laurent said:<br>&gt; <br>&gt; &gt;I'm going crazy since a few weeks with the MouseMoveEvent.<br>&gt; &gt;Originally, I wanted to display a VTK view in a Cocoa Window.<br>&gt; &gt;I've already posted a message on vtkusers because I hadn't a real time<br>&gt; &gt;access to the mouse position : the OnMouseMove() function was called on<br>&gt; &gt;a drag movement and not every time the mouse moves.<br>&gt; &gt;I've just found why : it seems that integration of the VTK view in the<br>&gt; &gt;Cocoa window doesn't work as well as expected.<br>&gt; &gt;<br>&gt; &gt;To perform a good integration, I call the two functions SetWindowId()<br>&gt; &gt;and SetDisplayId(), as recommanded by VTK.<br>&gt; <br>&gt; That's correct.<br>&gt; <br>&gt; &gt;This generates 2 warning messages "invalid drawable" at the beginning of<br>&gt; &gt;the program but the program is still running and, except the problem of<br>&gt; &gt;mouse position,<br>&gt; &gt;everything run as expected.<br>&gt; <br>&gt; The "invalid drawable" message is harmless.<br>&gt; <br>&gt; &gt;If I don't call these functions, then the VTK view appears in a<br>&gt; &gt;separated window.<br>&gt; <br>&gt; That's expected.<br>&gt; <br>&gt; &gt;There is no more warning message and I've a real time access to the<br>&gt; &gt;mouse position.<br>&gt; &gt;<br>&gt; &gt;Below the code of initialisation of the VTK view window, written in<br>&gt; &gt;Objective-C++ (optimal with Cocoa).<br>&gt; &gt;<br>&gt; &gt;- (id) initWithFrame:(NSRect) frame {<br>&gt; &gt;    self = [super initWithFrame:frame];<br>&gt; &gt;    if (self) {<br>&gt; &gt;        renderer = vtkRenderer::New();<br>&gt; &gt;        rendererWindow = vtkCocoaRenderWindow::New();<br>&gt; &gt;        renWinInt = vtkCocoaRenderWindowInteractor::New();<br>&gt; &gt;        vtkSmartPointer &lt;vtkInteractorStyleSwitch&gt; intStyle =<br>&gt; &gt;vtkSmartPointer&lt;vtkInteractorStyleSwitch&gt;::New();<br>&gt; &gt;<br>&gt; &gt;        intStyle -&gt; SetCurrentStyleToTrackballCamera();<br>&gt; &gt;        renWinInt -&gt; SetInteractorStyle(intStyle);<br>&gt; &gt;        <br>&gt; &gt;        rendererWindow -&gt; SetWindowId([self window]);<br>&gt; &gt;        rendererWindow -&gt; SetDisplayId(self);<br>&gt; &gt;        rendererWindow -&gt; AddRenderer(renderer);<br>&gt; &gt;        renWinInt -&gt; SetRenderWindow(rendererWindow);<br>&gt; &gt;        renWinInt -&gt; CreateRepeatingTimer (1);<br>&gt; &gt;<br>&gt; &gt;        [self setVTKRenderWindow:rendererWindow];<br>&gt; &gt;        <br>&gt; &gt;        if (!renWinInt -&gt; GetInitialized()) renWinInt -&gt; Initialize();<br>&gt; &gt;    }<br>&gt; &gt;    return self;<br>&gt; &gt;}<br>&gt; <br>&gt; That looks basically right.  Do you have the same problem with different<br>&gt; interactor styles?<br>&gt; <br>&gt; -- <br>&gt; ____________________________________________________________<br>&gt; Sean McBride, B. Eng                 sean@rogue-research.com<br>&gt; Rogue Research                        www.rogue-research.com <br>&gt; Mac Software Developer              Montréal, Québec, Canada<br>&gt; <br>&gt; <br><br /><hr />Votre correspondant a choisi Hotmail et profite d'un stockage quasiment illimité. <a href='http://www.windowslive.fr/hotmail/default.asp' target='_new'> Créez un compte Hotmail gratuitement !</a></body>
</html>