[vtkusers] problem with vtk3DWidgets and observer order

Charl P. Botha c.p.botha at its.tudelft.nl
Mon May 13 16:58:21 EDT 2002


Dear VTKers,

It seems there's a problem with the vtk3DWidget and of course all its
descendants.  I have a theory about why this is happening, but let's first
reproduce it:

1. start /VTK/Examples/GUI/Tcl/ProbingWithPlaneWidget.tcl
2. press 'i' to activate the vtkPlaneWidget
3. try moving one of the balls at the corner (with left mouse button)
4. note that the ball does move, but the camera also rotates!
5. now press 't' for trackball mode, then 'j' to go back to joystick mode
6. try moving one of the balls at the corner
7. note that only the ball moves, not the camera; if you drag the left mouse
   button somewhere else though, the camera rotates: this is the desired
   behaviour with 3DWidgets I would think.
8. now deactivate the vtkPlaneWidget by pressing 'i' and reactivate by
   pressing 'i' again... we're back to bad behaviour.
   
Based on this observation and also my best attempts at unravelling the
observer code, it seems that when one activates the vtk3DWidget, it gets
added to the END of the observer chain for the interactor, so the aborts it
sends have no effect on the camera manipulation events.  When one changes
interactorstyle, the old gets removed from the observer list, and a new one
gets added to the end, which means when the widget aborts, no camera events
are performed.  De- and re-activating the 3DWidget puts it at the end of the
observer chain again, which means its aborts are ineffectual once again.

I hope one of the developers can make sense of this.  I would propose that
3DWidgets somehow always get added to the beginning of the observer chain
instead of being appended.  This would guarantee "desired" behaviour.

Regards,
Charl

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/



More information about the vtkusers mailing list