[vtkusers] Adding KeyPressEvent "r" in GUI

Dirk Boye body at nabla.org
Wed Nov 11 08:10:33 EST 2009


Hi John,

If you have a vtkRenderer called "renderer" (that gets rendered in your 
vtkRenderWindow), call 

renderer->ResetCamera();

when pressing the button.

Don't forget to render the scene again after that, else your 
renderwindow won't be updated.
If you are using a QVTKWidget called "qvtkwid"
call
qvtkwid->GetRenderWindow()->Render();

Cheers,
Dirk


On 11/09/2009 07:17:40 PM, John Durkin wrote:
> Dear vtkusers and developers,
> 
> 
> I am trying to implement the "reset view" action that occurs when
> typing "r"
> in the vtk window.  I am using a GUI made with QT and I want this to
> happen
> after hitting a button.  Is there some way I can manually invoke a
> keypressevent?  Or this there some function that can do this 
> resetting
> of
> the view?
> 
> Thanks,
> 
> 
> John
> 

------quoted attachment------
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 






More information about the vtkusers mailing list