[vtk-developers] 3D widgets

Will Schroeder will.schroeder at kitware.com
Tue Mar 26 09:40:35 EST 2002


Hi Folks-

There have been some recent changes (by Bill Hoffman) to VTK to enable 3D 
widgets (Command/Observer related changes), and I've added one 3D widget 
(vtkBoxWidget) plus an abstract superclass (vtk3DWidget). A 3D widget is 
something that you can interact with, it has a representation in the scene, 
and it usually provides some information that can be used to manipulate 
other VTK classes. For example, the vtkBoxWidget provides a linear 
transform (which can be used to control an actor or transform filter) as 
well as a vtkPlanes implicit function (that can be used for clipping, 
cutting, etc.).

The changes to Command/Observer allows events to be precessed in priority 
order, as well as the possibility of aborting event processing. What this 
means is that you can combine 3D widgets (as many as you want), plus an 
interactor style (which are now event driven) all running simultaneously. 
In the case of the vtkBoxWidget, if you select the widget it handles the 
event and then does an abort (so the interactor does not see it). If you 
pick outside of the widget, then no abort is called so the interactor sees 
the event and does its dance.

There is a simple example: Hybrid/Testing/Tcl/TestBoxWidget.tcl that you 
can play with. I've checked the stuff in to see how it does on the 
dashboard....once I get the defects out I'll try and figure out how to test 
the damn thing and move some code into VTK/Examples as well.

Sebastien asked me if the widget works with the pure Tcl interactors: I 
have no idea. We'll have to look into that.

Comments? Suggestions? before we announce it to the users list?

Will




More information about the vtk-developers mailing list