Hi, I loading data to QVTKWidget<br>I have some inicialization method. <br><br><span style="font-family: courier new,monospace;">void GUI::widgetInicialization(QVTKWidget *widget, vtkRenderer *ren)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> vtkRenderWindow *renwin = vtkRenderWindow::New();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> ren = vtkRenderer::New();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> renwin->AddRenderer(ren);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> widget->SetRenderWindow(renwin);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> widget->update();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> renwin->Delete();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><br><br>Then I load some data and display it...<br>
<br><span style="font-family: courier new,monospace;"> vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> renderer->AddActor(actor);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> widget->GetRenderWindow()->AddRenderer(renderer);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> widget->GetRenderWindow()->Render();</span><br>
<br>But when I load some data previous data stay in renderer? How to delete renderer? <br>I try before each data loading call this method...<br><br><span style="font-family: courier new,monospace;">void GUI::widgetInicialization(QVTKWidget *widget, vtkRenderer *ren)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">{</span><br><span style="font-family: courier new,monospace;"> try</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> widget->GetRenderWindow()->Delete();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> catch(...)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> {}</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">
vtkRenderWindow *renwin = vtkRenderWindow::New();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> ren = vtkRenderer::New();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> renwin->AddRenderer(ren);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> widget->SetRenderWindow(renwin);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> widget->update();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> renwin->Delete();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br><br>but any reasons :(<br>Do you hepl me please how to delete renderers?<br><br>Thank you<br>