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

Method MoveFreely

Modules/Gizmo/src/mitkGizmoInteractor.cpp:258–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258void mitk::GizmoInteractor::MoveFreely(StateMachineAction *, InteractionEvent *interactionEvent)
259{
260 auto positionEvent = dynamic_cast<const InteractionPositionEvent *>(interactionEvent);
261 if (positionEvent == nullptr)
262 {
263 return;
264 }
265
266 Point2D currentPosition2D = positionEvent->GetPointerPositionOnScreen();
267
268 // re-use the initial z value to really move parallel to the camera plane
269 auto renderer = positionEvent->GetSender()->GetVtkRenderer();
270 renderer->SetDisplayPoint(currentPosition2D[0], currentPosition2D[1], m_InitialClickPosition2DZ);
271 renderer->DisplayToWorld();
272 vtkVector3d worldPointVTK(renderer->GetWorldPoint());
273 Point3D worldPointITK(worldPointVTK.GetData());
274 Vector3D movementITK(worldPointITK - m_InitialClickPosition3D);
275
276 ApplyTranslationToManipulatedObject(movementITK);
277 RenderingManager::GetInstance()->ForceImmediateUpdateAll();
278}
279
280void mitk::GizmoInteractor::ScaleEqually(StateMachineAction *, InteractionEvent *interactionEvent)
281{

Callers

nothing calls this directly

Calls 6

GetSenderMethod · 0.80
DisplayToWorldMethod · 0.80
GetVtkRendererMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected