[vtkusers] growing RAM memory

G G greenlander1986 at gmail.com
Thu Apr 28 08:11:46 EDT 2011


Hi, I loading data to QVTKWidget
I have some inicialization method.

void GUI::widgetInicialization(QVTKWidget *widget, vtkRenderer *ren)
{
    vtkRenderWindow *renwin = vtkRenderWindow::New();
    ren = vtkRenderer::New();
    renwin->AddRenderer(ren);
    widget->SetRenderWindow(renwin);
    widget->update();
    renwin->Delete();
}

Then I load some data and display it...

    vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
    renderer->AddActor(actor);
    widget->GetRenderWindow()->AddRenderer(renderer);
    widget->GetRenderWindow()->Render();

But when I load some data previous data stay in renderer? How to delete
renderer?
I try before each data loading call this method...

void GUI::widgetInicialization(QVTKWidget *widget, vtkRenderer *ren)
{
    try
    {
        widget->GetRenderWindow()->Delete();
    }
    catch(...)
    {}
    vtkRenderWindow *renwin = vtkRenderWindow::New();
    ren = vtkRenderer::New();
    renwin->AddRenderer(ren);
    widget->SetRenderWindow(renwin);
    widget->update();
    renwin->Delete();
}

but any reasons :(
Do you hepl me please how to delete renderers?

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110428/7a7d7008/attachment.htm>


More information about the vtkusers mailing list