[vtk-developers] 3D Widget changes

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Thu Mar 28 23:39:06 EST 2002


Hi,

>>>>> "WS" == Will Schroeder <will.schroeder at kitware.com> writes:

    WS> Hi Folks- After conferring with the design maestro (Ken) and
    WS> looking your feedback, I've reworked the 3D widgets.

I just looked at the 3DWidget yesterday and yes it is very nice.  As
Jeff said there are difficulties using this with wrapped languages.  I
thought about the problem and seem to have some idea of how to get it
done.  I'm not sure if the idea is sane or not but thought I'd share
it anyway.

AFAIK, the vtkRenderWindowInteractor does not work with other GUI
toolkits because of the event loop problems.  I was thinking that the
class could simply have functions that are called when a particular
event occurs.  These functions internally setup the correct commands
(which is what vtkXRenderWindowInteractor does anyway).  That is, the
callback (vtkXRenderWindowInteractorCallback) is merely opened up into
several functions with the necessary arguments.  Something like so:

class vtkRenderWindowInteractor
...
virtual void ExposeEvent();
virtual void MapNotify();
virtual void ConfigureEvent(const int width, const int height);
virtual void ButtonPressEvent(...);

etc.  Then a RenderWindowInteractor in a scripting language will
simply create functions that generate the arguments to be passed to
the interactor function and calls the function.  The toolkit will bind
the right functions to the right set of events.

This way the event capturing and generation is left to the user and is
very general.  It should also make wrapping various GUI toolkits
*very* easy because all the Rotation, Pan code is done by the
InteractorStyles and the wrapper code simply embeds a vtkRenderWindow
into a native widget and sets up the events correctly.

I am not sure this idea is the best but think that it should work and
should be pretty easy to implement.

prabhu



More information about the vtk-developers mailing list