| 315 | } |
| 316 | |
| 317 | void QmitkRenderWindowWidget::ResetGeometry(const mitk::TimeGeometry* referenceGeometry) |
| 318 | { |
| 319 | if (nullptr == referenceGeometry) |
| 320 | { |
| 321 | return; |
| 322 | } |
| 323 | |
| 324 | mitk::TimeStepType imageTimeStep = 0; |
| 325 | |
| 326 | // store the current position to set it again later, if the camera should not be reset |
| 327 | mitk::Point3D currentPosition = this->GetCrosshairPosition(); |
| 328 | |
| 329 | // store the current time step to set it again later, if the camera should not be reset |
| 330 | auto* renderingManager = mitk::RenderingManager::GetInstance(); |
| 331 | const mitk::TimePointType currentTimePoint = renderingManager->GetTimeNavigationController()->GetSelectedTimePoint(); |
| 332 | if (referenceGeometry->IsValidTimePoint(currentTimePoint)) |
| 333 | { |
| 334 | imageTimeStep = referenceGeometry->TimePointToTimeStep(currentTimePoint); |
| 335 | } |
| 336 | |
| 337 | const auto* baseRenderer = mitk::BaseRenderer::GetInstance(m_RenderWindow->renderWindow()); |
| 338 | renderingManager->InitializeView(baseRenderer->GetRenderWindow(), referenceGeometry, false); |
| 339 | |
| 340 | // reset position and time step |
| 341 | this->GetSliceNavigationController()->SelectSliceByPoint(currentPosition); |
| 342 | renderingManager->GetTimeNavigationController()->GetStepper()->SetPos(imageTimeStep); |
| 343 | } |
no test coverage detected