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

Method TranslateObject

Modules/DataTypesExt/src/mitkAffineImageCropperInteractor.cpp:169–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169void mitk::AffineImageCropperInteractor::TranslateObject(StateMachineAction *, InteractionEvent *interactionEvent)
170{
171 auto *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
172 if (positionEvent == nullptr)
173 return;
174
175 Point3D currentPickedPoint = positionEvent->GetPositionInWorld();
176
177 Vector3D interactionMove;
178 interactionMove[0] = currentPickedPoint[0] - m_InitialPickedPoint[0];
179 interactionMove[1] = currentPickedPoint[1] - m_InitialPickedPoint[1];
180 interactionMove[2] = currentPickedPoint[2] - m_InitialPickedPoint[2];
181
182 mitk::Surface::Pointer surface = dynamic_cast<mitk::Surface *>(m_SelectedNode->GetData());
183 mitk::BaseGeometry::Pointer surGeo = surface->GetGeometry();
184 surGeo->SetOrigin(m_InitialOrigin);
185 surGeo->Translate(interactionMove);
186
187 RenderingManager::GetInstance()->RequestUpdateAll();
188}
189
190void mitk::AffineImageCropperInteractor::DeformObject(StateMachineAction *, InteractionEvent *interactionEvent)
191{

Callers

nothing calls this directly

Calls 6

GetPositionInWorldMethod · 0.80
GetGeometryMethod · 0.80
GetDataMethod · 0.45
SetOriginMethod · 0.45
TranslateMethod · 0.45
RequestUpdateAllMethod · 0.45

Tested by

no test coverage detected