Skip to content

ENH: Add pauseRender() and resumeRender() functions to qMRMLLayoutManager

Sunderlandkyl requested to merge github/fork/Sunderlandkyl/pause_render into master

When modifying or setting up nodes that may trigger a render event, pauseRender can be called to temporarily stop the views from rendering intermediate steps. Once all modifications have been completed, calling resumeRender will restore the previously stored pause states.

Depends on

Edited by @jcfr:

To understand the motivation see and exchange between @finetjul and @lassoan copied from

From @finetjul : Please explain how different it is from renderEnabled.

From @lassoan Good point. There is a very important difference (rendering requests arriving while renderEnabled(false) makes rendering requests to be forgotten, while they are just delayed while rendering is paused) but it may not be obvious at first.

Another important advantage of pauseRender is that it can be called from high-level application code, where it is not clear if a certain change will eventually require re-rendering or not. When pauseRender is turned off, rendering will only be performed if it was requested while rendering was paused (in contrast, after renderEnabled(false) you must always re-render).

I think renderEnabled is mostly made obsolete by the new mechanism.

Cc: @ihnorton

Merge request reports