[vtkusers] How to close VTKRenderWindow automatically

David Doria daviddoria at gmail.com
Tue Nov 26 10:04:23 EST 2013


On Tue, Nov 26, 2013 at 9:13 AM, alykhantejani
<alykhan.tejani06 at imperial.ac.uk> wrote:
> I am using some simple code to render a mesh in a loop. In practice on each
> iteration I will change the viewpoint and save an image of the rendering. I
> have reduced this to a small compilable example below:
>
> The problem is, when I run this many vtkWindow icons appear on my taskbar
> and eventually bring the pc to a halt. It appears as though on each loop the
> rendering window stays alive. However, when I click on an icon the window
> doesn't actually appear.
>
> Is there something I am missing that will clean up the render windows on
> each iteration.
>
> Thanks,
> Aly
>
> BTW, I am running under Ubntu with vtk 5.8
>

It doesn't seem necessary to create a new window for every rotation.
You could use a timer to periodically rotate the actor and then save
the window. Take a look at some of these:

http://www.vtk.org/Wiki/VTK/Examples/Cxx#Animation

David


More information about the vtkusers mailing list