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

Method DeformObject

Modules/DataTypesExt/src/mitkAffineImageCropperInteractor.cpp:190–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190void 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
218void mitk::AffineImageCropperInteractor::RotateObject(StateMachineAction *, InteractionEvent *interactionEvent)
219{

Callers

nothing calls this directly

Calls 9

GetPositionInWorldMethod · 0.80
GetGeometryMethod · 0.80
GetMatrixColumnMethod · 0.80
GetCenterMethod · 0.80
GetDataMethod · 0.45
SetGeometryMethod · 0.45
WorldToIndexMethod · 0.45
ExecuteOperationMethod · 0.45
RequestUpdateAllMethod · 0.45

Tested by

no test coverage detected