[vtkusers] How to "undo" GetRenderWindow()->Render()?
Dan Lipsa
dan.lipsa at kitware.com
Fri Nov 18 08:57:29 EST 2016
Jan,
To hide items in a scene you have to call SetVisible(false) on them. Is
this what you are trying to do?
Dan
On Fri, Nov 18, 2016 at 5:51 AM, Jan Niklas Hasse <jan-niklas.hasse at stw.de>
wrote:
> Hi,
>
> I'm using VTK 6.2 with Qt. I've created a class Plot2D which inherits from
> QVTKWidget. I now have a lot of these plots widgets in a tabbed view and
> want to only render the ones that are currently visible (otherwise I get an
> OpenGL crash).
>
> void Plot2D::showEvent(QShowEvent*) {
> view = vtkSmartPointer<vtkContextView>::New();
> view->GetRenderer()->SetBackground(1,1,1);
> view->SetRenderWindow(GetRenderWindow());
> view->GetRenderWindow()->SetSize(width(),height());
> view->GetScene()->AddItem(chart);
> view->GetRenderWindow()->SetMultiSamples(0);
> view->GetRenderWindow()->Render();
> }
>
> void Plot2D::hideEvent(QHideEvent*) {
> view = nullptr;
> }
>
> Unfortunately, deleting the vtkContextView isn't enough: The next time
> showEvent is called, I get a crash inside VTK because it seems that
> view->GetRenderWindow()->Render(); has set up some kind of timer in the
> background. How would I solve this?
>
> Thanks in advance :)
> Jan
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161118/cef7971d/attachment.html>
More information about the vtkusers
mailing list