<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>> From: sean@rogue-research.com<br>> To: laurentbenoist@hotmail.com; vtkusers@vtk.org<br>> Subject: Re: [vtkusers] MouseMoveEvent bug in Cocoa<br>> Date: Tue, 4 Aug 2009 15:53:53 -0400<br>> <br>> On 7/23/09 9:01 AM, Benoist Laurent said:<br>> <br>> >I'm going crazy since a few weeks with the MouseMoveEvent.<br>> >Originally, I wanted to display a VTK view in a Cocoa Window.<br>> >I've already posted a message on vtkusers because I hadn't a real time<br>> >access to the mouse position : the OnMouseMove() function was called on<br>> >a drag movement and not every time the mouse moves.<br>> >I've just found why : it seems that integration of the VTK view in the<br>> >Cocoa window doesn't work as well as expected.<br>> ><br>> >To perform a good integration, I call the two functions SetWindowId()<br>> >and SetDisplayId(), as recommanded by VTK.<br>> <br>> That's correct.<br>> <br>> >This generates 2 warning messages "invalid drawable" at the beginning of<br>> >the program but the program is still running and, except the problem of<br>> >mouse position,<br>> >everything run as expected.<br>> <br>> The "invalid drawable" message is harmless.<br>> <br>> >If I don't call these functions, then the VTK view appears in a<br>> >separated window.<br>> <br>> That's expected.<br>> <br>> >There is no more warning message and I've a real time access to the<br>> >mouse position.<br>> ><br>> >Below the code of initialisation of the VTK view window, written in<br>> >Objective-C++ (optimal with Cocoa).<br>> ><br>> >- (id) initWithFrame:(NSRect) frame {<br>> > self = [super initWithFrame:frame];<br>> > if (self) {<br>> > renderer = vtkRenderer::New();<br>> > rendererWindow = vtkCocoaRenderWindow::New();<br>> > renWinInt = vtkCocoaRenderWindowInteractor::New();<br>> > vtkSmartPointer <vtkInteractorStyleSwitch> intStyle =<br>> >vtkSmartPointer<vtkInteractorStyleSwitch>::New();<br>> ><br>> > intStyle -> SetCurrentStyleToTrackballCamera();<br>> > renWinInt -> SetInteractorStyle(intStyle);<br>> > <br>> > rendererWindow -> SetWindowId([self window]);<br>> > rendererWindow -> SetDisplayId(self);<br>> > rendererWindow -> AddRenderer(renderer);<br>> > renWinInt -> SetRenderWindow(rendererWindow);<br>> > renWinInt -> CreateRepeatingTimer (1);<br>> ><br>> > [self setVTKRenderWindow:rendererWindow];<br>> > <br>> > if (!renWinInt -> GetInitialized()) renWinInt -> Initialize();<br>> > }<br>> > return self;<br>> >}<br>> <br>> That looks basically right. Do you have the same problem with different<br>> interactor styles?<br>> <br>> -- <br>> ____________________________________________________________<br>> Sean McBride, B. Eng sean@rogue-research.com<br>> Rogue Research www.rogue-research.com <br>> Mac Software Developer Montréal, Québec, Canada<br>> <br>> <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>