| 211 | } |
| 212 | |
| 213 | void mitk::GizmoInteractor::MoveAlongAxis(StateMachineAction *, InteractionEvent *interactionEvent) |
| 214 | { |
| 215 | auto positionEvent = dynamic_cast<const InteractionPositionEvent *>(interactionEvent); |
| 216 | if (positionEvent == nullptr) |
| 217 | { |
| 218 | return; |
| 219 | } |
| 220 | |
| 221 | Point2D currentPosition2D = positionEvent->GetPointerPositionOnScreen(); |
| 222 | |
| 223 | // re-use the initial z value to calculate movements parallel to the camera plane |
| 224 | auto renderer = positionEvent->GetSender()->GetVtkRenderer(); |
| 225 | renderer->SetDisplayPoint(currentPosition2D[0], currentPosition2D[1], m_InitialClickPosition2DZ); |
| 226 | renderer->DisplayToWorld(); |
| 227 | vtkVector3d worldPointVTK(renderer->GetWorldPoint()); |
| 228 | Point3D worldPointITK(worldPointVTK.GetData()); |
| 229 | Vector3D freeMouseMovement3D(worldPointITK - m_InitialClickPosition3D); |
| 230 | |
| 231 | double projectedMouseMovement3D = freeMouseMovement3D * m_AxisOfMovement; |
| 232 | Vector3D appliedMovement3D = projectedMouseMovement3D * m_AxisOfMovement; |
| 233 | |
| 234 | ApplyTranslationToManipulatedObject(appliedMovement3D); |
| 235 | RenderingManager::GetInstance()->ForceImmediateUpdateAll(); |
| 236 | } |
| 237 | |
| 238 | void mitk::GizmoInteractor::RotateAroundAxis(StateMachineAction *, InteractionEvent *interactionEvent) |
| 239 | { |
nothing calls this directly
no test coverage detected