[vtkusers] How to abort a rendering that is in progess

Jean M. Favre jfavre at cscs.ch
Wed Nov 30 10:22:32 EST 2005


Peter wrote:
> what programme language are you using?
>  
> i am using tcl/tk and what i do is ....
>  
>  
> trigger your application from command line. i assume you are using Windows.
> then you use vtk to run your programme in command line (DOS),
> if the rendering process takes too long or halts in half way. then you
> just presse ctrl + c to terminate the programme.

There is a much cleaner way to interrupt your rendering without killing
your application. Suppose you are doing ray-tracing which takes a long
time and you want to change the view point before the end of the rendering.

Tell your vtkRenderWindow to check for the so-called AbortCheckEvent.
Here is the syntax. With this, your tcl application will be able to
abort the rendering in process and start a new one after interaction
with the mouse:


vtkRenderWindow renWin

proc TkCheckAbort {} {
  set foo [renWin GetEventPending]
  if {$foo != 0} { renWin SetAbortRender 1}
}
renWin AddObserver AbortCheckEvent {TkCheckAbort}



-- 
Dr. Jean M. Favre,                            email:favre @ cscs.ch
http://www.cscs.ch/about/Favre.php
CSCS, Swiss National Supercomputing Centre  | Tel:  +41 (91) 610.82.40
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82



More information about the vtkusers mailing list