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

Method Move

Modules/Core/src/Interactions/mitkDisplayActionEventBroadcast.cpp:463–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463void mitk::DisplayActionEventBroadcast::Move(StateMachineAction* /*stateMachineAction*/, InteractionEvent* interactionEvent)
464{
465 const auto* positionEvent = dynamic_cast<InteractionPositionEvent*>(interactionEvent);
466 if (nullptr == positionEvent)
467 {
468 return;
469 }
470
471 BaseRenderer* sender = interactionEvent->GetSender();
472 Vector2D moveVector = m_LastDisplayCoordinate - positionEvent->GetPointerPositionOnScreen();
473
474 if (m_InvertMoveDirection)
475 {
476 moveVector *= -1.0;
477 }
478
479 moveVector *= sender->GetScaleFactorMMPerDisplayUnit(); // #TODO: put here?
480
481 // store new display coordinate
482 m_LastDisplayCoordinate = positionEvent->GetPointerPositionOnScreen();
483
484 // propagate move event with computed geometry values
485 InvokeEvent(DisplayMoveEvent(interactionEvent, moveVector));
486}
487
488void mitk::DisplayActionEventBroadcast::SetCrosshair(StateMachineAction* /*stateMachineAction*/, InteractionEvent* interactionEvent)
489{

Callers

nothing calls this directly

Calls 4

DisplayMoveEventFunction · 0.85
GetSenderMethod · 0.80

Tested by

no test coverage detected