[vtkusers] vtkRenderWindowInteractor and mouse events

David Doria daviddoria at gmail.com
Thu Aug 15 14:56:15 EDT 2013


> 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



More information about the vtkusers mailing list