[vtkusers] BreakLoopFlag in vtkXRenderWindowInteractor
myers at tc.cornell.edu
Wed Oct 4 16:40:49 EDT 2000
I saw in the recent changes log that the vtkXRenderWindowInteractor
has finally been fixed to return gracefully rather than exiting
date: 2000/10/03 15:50:40; author: berk; state: Exp; lines: +20 -3
Changed Start() so that it returns instead of calling exit()
I've downloaded the latest nightly release, and indeed, the Interactor
returns instead of calling exit(), as advertised. This is particularly
useful inside an interpreter like Python.
Unfortunately, a subsequent call to vtkXRenderWindowInteractor::Start()
does not restart the interactor, because the internal BreakLoopFlag
is still set to 1 (from the previous exit) and the interactor just
turns around and returns again.
To be really useful, there needs to be some way of resetting the
BreakLoopFlag to 0 so that control can be returned to the interactor
once more. Here are some possibilities:
(1) Put an explicit call to this->BreakLoopFlag=0 inside
vtkXRenderWindowInteractor::Start() before entering the do-while
loop that checks the value of BreakLoopFlag.
(2) Provide a new Restart() method on vtkXRenderWindowInteractor that
sets the flag back to 0 and calls Start() again.
(3) Expose the SetBreakLoopFlag method to the wrapped Python interface
so that the user can reset it before calling Start() again.
Option (1) worked for me when I tried it. (It seemed to be the
simplest and quickest thing to try.) Option (3) seems to be the least
preferable. Any of the three is preferable to nothing at all. It
would be nice if a decision could be made, and the code updated.
Cornell Theory Center
636 Rhodes Hall email: myers at tc.cornell.edu
Cornell University phone: (607) 255-5894 / fax: (607) 254-8888
Ithaca, NY 14853 http://www.tc.cornell.edu/~myers
More information about the vtkusers