| 256 | } |
| 257 | |
| 258 | void 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 | |
| 280 | void mitk::GizmoInteractor::ScaleEqually(StateMachineAction *, InteractionEvent *interactionEvent) |
| 281 | { |
nothing calls this directly
no test coverage detected