[RESOLVED]: Issue LeftButtonPressEvent() to vtkRenderWindowInteractor with C++?

My C++ application displays an actor in a vtkRenderWindow, with an associated vtkGenericRenderWindowInteractor. If in “camera mode” and I left-click the mouse in the window at position x,y the surface is rendered from a different view angle (i.e. the camera is moved). I want to issue the equivalent through C++ such that the camera view is changed as if I manually clicked the mouse.

I tried this:

   interactor_->SetEventPosition(x, y);

But the camera doesn’t move. What else do I need to do?


I solved this problem by associating TrackBallCamera style with the render window interactor:

   renderWindowInteractor_ =


    vtkSmartPointer<vtkInteractorStyleTrackballCamera> style =

    renderWindowInteractor_->SetInteractorStyle( style );

Now issuing events to the interactor - e.g. LeftButtonPress or MouseMoveEvent with the left button held down - causes the camera angle to change as expected.