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

Method ResetGeometry

Modules/QtWidgets/src/QmitkRenderWindowWidget.cpp:317–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void 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}

Callers 1

OnResetGeometryMethod · 0.95

Calls 11

GetCrosshairPositionMethod · 0.95
GetStepperMethod · 0.80
GetSelectedTimePointMethod · 0.45
IsValidTimePointMethod · 0.45
TimePointToTimeStepMethod · 0.45
InitializeViewMethod · 0.45
GetRenderWindowMethod · 0.45
SelectSliceByPointMethod · 0.45
SetPosMethod · 0.45

Tested by

no test coverage detected