A re-init of the data nodes occurs often during a workflow. The mxn multi widget has some problems with that.
In a typical scenario the user opens a specific number of render windows, shows / hide certain data nodes of the storage to individually display different images. Maybe navigate individually in each render window (zoom, scroll).
If a reinit for all registered render windows is requested, this user defined preset will be reset to the node being reinitialized.
I propose to first gather different actions which lead to an update request.
**Multi Widget (Editor)**
- changing the preferences page of the std- / mxn- multiwidgeteditor
- `QmitkStdMultiWidgetEditor::OnPreferencesChanged`: `mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(GetDataStorage());` and `mitk::RenderingManager::GetInstance()->RequestUpdateAll();`
- `QmitkMxNMultiWidgetEditor::OnPreferencesChanged`: `mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(GetDataStorage());` and `
mitk::RenderingManager::GetInstance()->RequestUpdateAll();`
**Segmentation Plugin**
- creating a new segmentation via the segmentation view
- `QmitkSegmentationView::CreateNewSegmentation`: `mitk::RenderingManager::GetInstance()->InitializeViews(referenceImage->GetTimeGeometry(), mitk::RenderingManager::REQUEST_UPDATE_ALL, true);`
- if the contour marker is selected
- `QmitkSegmentationView::OnContourMarkerSelected`: `mitk::RenderingManager::GetInstance()->RequestUpdateAll();`
- changing the preferences page of the segmentation view
- `QmitkSegmentationView::OnPreferencesChanged`: `QmitkSegmentationView::ForceDisplayPreferencesUponAllImages` --> `mitk::RenderingManager::GetInstance()->RequestUpdateAll();`
**MultiLabel-Segmentation Plugin**
- updating the UI controls after a different reference (node) / segmentation (node) has been selected in the plugin's node selectors
- updating the UI controls after a layer has been deleted / changed
- `QmitkMultiLabelSegmentationView::UpdateControls`
- re-initializing the views after a new label has been created or after a different segmentation (node) has been selected in the plugin's node selector
- `QmitkMultiLabelSegmentationView::ReinitializeViews()`
--> also, e.g. `mitkMultiLabelSegmentationView::OnNewLabel()` there are three calls at the end of the function:
```
UpdateControls();
m_Controls.m_LabelSetWidget->ResetAllTableWidgetItems();
this->ReinitializeViews();
```
All of them perform some kind of RenderingRequest
- `QmitkMultiLabelSegmentationView::UpdateControls`: `this->RequestRenderWindowUpdate(mitk::RenderingManager::REQUEST_UPDATE_ALL);`
- `QmitkLabelSetWidget::ResetAllTableWidgetItems`: `mitk::RenderingManager::GetInstance()->RequestUpdateAll();`
- `QmitkMultiLabelSegmentationView::ReinitializeViews`: `mitk::RenderingManager::GetInstance()->InitializeViews(m_ReferenceNode->GetData()->GetTimeGeometry(), mitk::RenderingManager::REQUEST_UPDATE_ALL, true);`
--> three requests for the same thing
**Autocrop action**
- performing the autocrop action
- `QmitkAutocropAction::Run`: `mitk::RenderingManager::GetInstance()->InitializeViews(node->GetData()->GetTimeGeometry(), RenderingManager::REQUEST_UPDATE_ALL, true );` and `mitk::RenderingManager::GetInstance()->RequestUpdateAll();`
--> two request for the same thing (`InitializeViews` already performs a `RequestUpdateAll`)
There are also many calls to `RequestUpdateAll` without any given argument so the default parameter `RequestType type = REQUEST_UPDATE_ALL` is used.
However, in such cases only the rendering should be updated (e.g. color, layer, added / removed nodes), not the view / crosshair / camera orientation etc.
**Possible solutions**
- allow //locking// specific render windows
- use own rendering manager for the mxn multi widget (not the singleton one) so that the `mitk::RenderingManager::GetInstance()->RequestUpdateAll()` or `GetRenderingManager()->RequestUpdateAll()` calls do not affect the render windows of the mxn multi widget
- only initialize certain render windows (active / selected, related to used node, ...)