| 188 | } |
| 189 | |
| 190 | void mitk::AffineImageCropperInteractor::DeformObject(StateMachineAction *, InteractionEvent *interactionEvent) |
| 191 | { |
| 192 | auto *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent); |
| 193 | if (positionEvent == nullptr) |
| 194 | return; |
| 195 | |
| 196 | Point3D currentPickedPoint = positionEvent->GetPositionInWorld(); |
| 197 | Vector3D interactionMove = currentPickedPoint - m_InitialPickedPoint; |
| 198 | |
| 199 | mitk::Surface::Pointer surface = dynamic_cast<mitk::Surface *>(m_SelectedNode->GetData()); |
| 200 | surface->SetGeometry(m_OriginalGeometry); |
| 201 | mitk::BaseGeometry::Pointer surGeo = surface->GetGeometry(); |
| 202 | |
| 203 | surGeo->WorldToIndex(interactionMove, interactionMove); |
| 204 | Point3D scale; |
| 205 | for (int i = 0; i < 3; ++i) |
| 206 | { |
| 207 | scale[i] = (interactionMove[i] * surGeo->GetMatrixColumn(i).magnitude()) - 1; |
| 208 | } |
| 209 | |
| 210 | mitk::Point3D anchorPoint = surGeo->GetCenter(); |
| 211 | |
| 212 | auto *doOp = new mitk::ScaleOperation(OpSCALE, scale, anchorPoint); |
| 213 | surGeo->ExecuteOperation(doOp); |
| 214 | |
| 215 | mitk::RenderingManager::GetInstance()->RequestUpdateAll(); |
| 216 | } |
| 217 | |
| 218 | void mitk::AffineImageCropperInteractor::RotateObject(StateMachineAction *, InteractionEvent *interactionEvent) |
| 219 | { |
nothing calls this directly
no test coverage detected