[vtkusers] Toggle surface/wireframe programatically

David Doria daviddoria at gmail.com
Fri Nov 11 07:14:59 EST 2011


On Thu, Nov 10, 2011 at 7:52 PM, totte_karlsson
<totte at dunescientific.com> wrote:
> Thanks for the tip.
> However, the example don't show how to switch between solid/wireframe mode
> in an already created 'scene'.
>
> Is there not a way to access the same function in the vtk framework that is
> invoked when pressing 's' or 'w' in a renderwindow?
>
> I guess I can manually iterate trough each actor and set its property to
> Wireframe/solid, but that logic should already be available somewhere, since
> pressing 'w' and 's' works out of the box? Or?
>
> -totte

You could iterate through all the props and set their properties:
http://www.vtk.org/doc/nightly/html/classvtkViewport.html#abed96fa68aa3089c0f6c770c06d7af26

This is exactly what is done when you press 'w' - you can find it on
line 752 (the case 'w' case of the OnChar() function) of
vtkInteractorStyle.cxx.

David



More information about the vtkusers mailing list