[vtk-developers] 3D Widget changes
Will Schroeder
will.schroeder at kitware.com
Thu Mar 28 15:32:38 EST 2002
Hi Folks-
After conferring with the design maestro (Ken) and looking your feedback,
I've reworked the 3D widgets.
One thing we realized is that these family of things have different
characteristics: while they all listen for events from
vtkRenderWindowInteractor, some have a representation in 3D space (and
require an indication of where to be placed), some may not have a
representation or may be window based (e.g., probing, selection or
measuring in the window), and vtkInteractorStyles are actually a type of
these things and should be part of the framework.
We've added a new superclass: vtkInteractorObserver. It has a
SetInteractor() method. It observes the keypress and delete events invoked
by the render window interactor. The keypress activation value for a widget
is now 'i' (although this can be programmed). vtkInteractorObserver has the
state ivar Enabled. All subclasses must have the SetEnabled(int) method.
Convenience methods like On(), Off(), EnabledOn(), and EnabledOff() are
available. The state of the interactor observer is obtained using
GetEnabled(). The SetEnabled(1) method adds observers to watch the
interactor (appropriate to the particular interactor observer) ;
SetEnabled(0) removes the observers . There are two new events: EnableEvent
and DisableEvent which are invoked by the SetEnabled() method.
Things that require placement in space (with PlaceWidget()) are subclasses
of vtk3DWidget, which inherits from vtkInteractorObserver. The vtkBoxWidget
and vtkLineWidget inherit from vtk3DWidget.
Interactor styles will become a subclass of vtkInteractorObserver. They
should remain backward compatible. We are looking to creating a general
solution so that the wrapper languages (Tcl, Python. Java) can be cleanly
interfaced with this stuff.
I still have a list of others things that people suggested, I'll get to
them soon. Sebastien suggested creating a separate Widgets/ directory. It's
a good idea, but I want to hold off for a bit to see how all this settles out.
Please give feedback and suggestions. We want to get this right, its going
to be used pretty heavily in VTK.
Will
More information about the vtk-developers
mailing list