| 304 | } |
| 305 | |
| 306 | void 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 | |
| 340 | void QmitkOverlayController::UpdateOverlayData(QmitkOverlay *overlay) |
| 341 | { |
nothing calls this directly
no test coverage detected