[vtkusers] bug with multiple render windows?
John Biddiscombe
john.biddiscombe at mirada-solutions.com
Tue Feb 25 04:51:59 EST 2003
If you render a single actors to different renderwindows or renderers, you must turn on immediate mode rendering. Does it still allocate tons of memory if you
map->SetImmediateModeRenderingOn();
or whatever the syntax is?
JB
-----Original Message-----
From: Frank Broicher [mailto:broicher at techinfo.rwth-aachen.de]
Sent: 25 February 2003 08:28
To: vtkusers at public.kitware.com
Subject: Re: [vtkusers] bug with multiple render windows?
Hi everybody, hi Nick, John, and Nigel
first of all I think I should introduce a minimal program that produces
the memory leak. As you can see there are two windows opened that render
the same scene. When the rendering starts, memory is allocated rapidly
(on an Athlon 1.2GHz approx. 6MB per second), so the render function is
our starting point.
With best regards
Frank
//////////////////////////////////////////////
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkSphereSource.h>
#include <vtkActor.h>
#include <vtkPolyDataMapper.h>
int main ()
{
vtkRenderWindow * renWin = vtkRenderWindow::New ();
vtkRenderWindow * renWin2 = vtkRenderWindow::New ();
vtkRenderer * ren1 = vtkRenderer::New();
vtkRenderer * ren2 = vtkRenderer::New();
vtkSphereSource *sphere;
vtkPolyDataMapper *map;
vtkActor *aSphere;
renWin ->AddRenderer(ren1);
renWin2->AddRenderer(ren2);
sphere = vtkSphereSource::New();
map = vtkPolyDataMapper::New();
map->SetInput(sphere->GetOutput());
aSphere = vtkActor::New();
aSphere->SetMapper(map);
ren1->AddActor(aSphere);
ren2->AddActor(aSphere);
while (1)
{
renWin ->Render();
renWin2->Render();
}
}
//////////////////////////////////////////////
--
Dipl.-Inform. F. H. Broicher
Chair of Technical Computer Science Lehrstuhl f. Technische Informatik
RWTH Aachen University RWTH-Aachen
Ahornstraße 55, Room 2226
D-52074 Aachen
------------------------------------------------------------------------
Tel.: +49 (241) 80 23636 mailto:broicher at techinfo.rwth-aachen.de
Fax.: +49 (241) 80 22308 mailto:frank.broicher at ieee.org
------------------------------------------------------------------------
Fate, it seems, is not without a sense of irony. (Morpheus, The Matrix)
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list