[vtkusers] Mouse scroll event and overloading interactor style methods

Kerry Loux louxkr at gmail.com
Mon Aug 4 18:58:37 EDT 2008


Yes, I am calling RenderWindowInteractor->SetInteractorStyle(myStyle).
Here's the snippet:

InteractorStyle = (INTERACTOR_STYLE *)INTERACTOR_STYLE::New();// actual
return type is vtkInteractorStyleTrackballCamera
SetInteractorStyle(InteractorStyle);

called within the constructor of my RenderWindowInteractor (it's actually
derived from wxVTKRenderWindowInteractor).

I did solve the scroll wheel problem by adding a SetFocus() to the top of
the OnButtonUp function in the wxVTKRenderWindowInteractor.

Thanks,

Kerry

On Sun, Aug 3, 2008 at 9:57 PM, Karthik Krishnan <
karthik.krishnan at kitware.com> wrote:

> Kerry Loux wrote:
>
>> Hello all,
>>
>> I've got two questions today:  First, I'm having a difficult time figuring
>> out why my mouse scroll events are not being captured.  When I start my app,
>> everything works fine, but if I select another control, then select the
>> render window interactor again, I loose my scroll events.  Any ideas?  It's
>> probably worth mentioning that I'm using a wxVTKRenderWindowInteractor (MSW,
>> wx 2.8.7, and vtk 5.0.4).
>>
>> Second, I derived a class from vtkInteractorStyleTrackballCamera and I
>> overloaded some of the event handling functions (OnButtonDown, etc.).  My
>> overloaded functions are not being called.  When I step through the app. in
>> debug, it just goes right to the vtk functions.  Am I missing something?  Is
>> it more complicated than just overloading the function?
>>
> Silly question, but just to check: You are setting an instance of your
> derived interactor style on the RenderWindowInteractor being used as in:
>    renderWindow->GetInteractor()->SetInteractorStyle(myStyle);
>
>
>> Thanks,
>>
>> Kerry
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080804/03d8ebd9/attachment.htm>


More information about the vtkusers mailing list