Import 2017-06-07 23:51:09: master 24f9016a

Author Committer Branch Timestamp Parent
msmolens msmolens master 2016-07-18 10:17:00 master b09de614
Changeset

BUG: Fix OpenGL errors in py_RSNA2012ProstateDemo test

Debug builds showed OpenGL errors while running the py_RSNA2012ProstateDemo
test.

The problem is that vtkMRMLAnnotationDisplayableManager could directly call
vtkRenderer::Render() in some cases, but only vtkRenderWindow should call that
method. The errors occur when OpenGL functions are called before an OpenGL
context has been initialized. When the VTK OpenGL2 backend is enabled, running
the py_RSNA2012ProstateDemo test leads to a crash.

See the documentation for vtkRenderer::Render():
https://github.com/Kitware/VTK/blob/5f52c1a91a9e9fbfc1efe0d14b3c11b548c7acb1/Rendering/Core/vtkRenderer.h#L231-L236

This commit replaces the direct call to vtkRenderer::Render() with a call to the
displayable manager's RequestRender() method. This queues a render request to be
handled by the framework at an appropriate time.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@25237 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Modules/Loadable/Annotations/MRMLDM/vtkMRMLAnnotationDisplayableManager.cxx Diff File