[vtkusers] vtkRenderWindowInteractor and mouse events

Gib Bogle g.bogle at auckland.ac.nz
Thu Aug 15 16:27:23 EDT 2013


On 16/08/2013 6:56 a.m., David Doria wrote:
>> What I didn't realize immediately is that doing this:
>>
>> vtkSmartPointer<vtkInteractorStyle> style =
>> vtkSmartPointer<vtkInteractorStyle>::New();
>> renderWindowInteractor->setInteractorStyle(style);
>>
>> removes all the vtkInteractor behaviour.  I just want to stop the
>> left-button-down-and-mouse-moved effects.
> You should not instantiate a vtkInteractorStyle directly. Similar to
> this: http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/MouseEvents
> where you are creating MouseInteractorStyle4 that derives from
> vtkInteractorStyleTrackballCamera, then you instantiate and use a
> MouseInteractorStyle4.
>
>    vtkSmartPointer<MouseInteractorStyle4> style =
>      vtkSmartPointer<MouseInteractorStyle4>::New();
>    renderWindowInteractor->SetInteractorStyle( style );
>
> David
I don't know what I was thinking when I said that pan (shift-leftbutton) still 
works.  Of course it doesn't.  Is it possible to check if the shift key is 
depressed when processing OnLeftButtonDown?

Gib



More information about the vtkusers mailing list