[vtkusers] Closing a renderwindow

Charl P. Botha c.p.botha at ewi.tudelft.nl
Tue Jul 13 07:23:16 EDT 2004


a.meijster at rc.rug.nl wrote:
> I'm searching for a way to close a render window.
> There must be some kind of method that does this,
> but I cannot find it. Pressing 'q' or 'e' (quit/exit)
> simply kills the application, and if you look in the
> interactor code you'll see that this is simply
> caused by exit(). There must be a more graceful
> way of closing a window and continue.

It follows the same convention as all other VTK objects.  When its 
reference count reaches zero, the window should close.  In other words, 
once you call Delete() on the RenderWindow and there are no other 
objects referring to it that you have references to, it should close.  A

If you are writing a more complete application, it might be a very good 
idea to look at one of the widget set / VTK combinations, e.g. 
vtkFlRenderWindowInteractor[1], or vtkFLTK[2] or vtkQt NL variant[3] or 
vtkQt DE variant[4].  Keep in mind that all of these have problems with 
window destruction vs. VTK reference counting.  This is due to a pending 
change in VTK and will be fixed Real Soon Now(tm).

[1] http://cpbotha.net/vtkFlRenderWindowInteractor.html
[2] http://vtkfltk.sf.net/
[3] http://carol.science.uva.nl/~dshamoni/ (go to downloads)
[4] http://www.matthias-koenig.net/vtkqt/


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



More information about the vtkusers mailing list