MCPcopy Create free account
hub / github.com/MITK/MITK / AddOverlay

Method AddOverlay

Modules/QtOverlays/src/QmitkOverlayController.cpp:306–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306void QmitkOverlayController::AddOverlay(QmitkOverlay *overlay)
307{
308 // if no renderwindow has been set, it's not possible to add overlays...
309 if (m_RenderWindow == nullptr)
310 {
311 MITK_ERROR << "invalid QmitkRenderWindow";
312 return;
313 }
314
315 if (overlay != nullptr)
316 {
317 // get desired position and layer of the overlay
318 QmitkOverlay::DisplayPosition pos = overlay->GetPosition();
319
320 // concatenate local propertyList and propertyList of the RenderingManager
321 // local properties have priority as they are not overwritten if preset in both
322 m_PropertyList->ConcatenatePropertyList(mitk::RenderingManager::GetInstance()->GetPropertyList(),
323 false);
324
325 // add the overlay to the OverlayContainer in the RenderWindow ...
326 overlay->GetWidget()->setParent(m_PositionedOverlays[pos]);
327
328 // ... and set it up with the correct properties
329 this->UpdateOverlayData(overlay);
330
331 // add overlay to list of all overlays and correctly put it into the layering
332 m_AllOverlays.push_back(overlay);
333 this->RestackOverlays(pos);
334
335 // ... and reset the position of the widgets
336 this->AdjustOverlayPosition(pos);
337 }
338}
339
340void QmitkOverlayController::UpdateOverlayData(QmitkOverlay *overlay)
341{

Callers

nothing calls this directly

Calls 7

UpdateOverlayDataMethod · 0.95
RestackOverlaysMethod · 0.95
AdjustOverlayPositionMethod · 0.95
GetPositionMethod · 0.45
GetPropertyListMethod · 0.45
GetWidgetMethod · 0.45

Tested by

no test coverage detected