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

Method OnEndDrawing

Modules/Segmentation/src/Interactions/mitkEditableContourTool.cpp:263–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263void mitk::EditableContourTool::OnEndDrawing(StateMachineAction*, InteractionEvent* interactionEvent)
264{
265 auto* positionEvent = dynamic_cast<mitk::InteractionPositionEvent*>(interactionEvent);
266 if (!positionEvent)
267 return;
268
269 auto contour = this->GetContour();
270 auto controlVs = contour->GetControlVertices(0);
271 if (!controlVs.empty())
272 { //add the last control point (after that the draw part start)
273 m_CurrentRestrictedArea->AddVertex(controlVs.back()->Coordinates);
274 }
275 m_PreviewContourNode->SetVisibility(true);
276 contour->SetControlVertexAt(contour->GetNumberOfVertices() - 1);
277
278 //add the just created/set last control point (with it the draw part ends)
279 m_CurrentRestrictedArea->AddVertex(contour->GetVertexAt(contour->GetNumberOfVertices() - 1)->Coordinates);
280
281 this->InitializePreviewContour(positionEvent->GetPositionInWorld());
282
283 mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow());
284}
285
286void mitk::EditableContourTool::OnMouseMoved(StateMachineAction*, InteractionEvent* interactionEvent)
287{

Callers

nothing calls this directly

Calls 14

GetContourMethod · 0.95
backMethod · 0.80
SetControlVertexAtMethod · 0.80
GetNumberOfVerticesMethod · 0.80
GetPositionInWorldMethod · 0.80
GetSenderMethod · 0.80
GetControlVerticesMethod · 0.45
emptyMethod · 0.45
AddVertexMethod · 0.45
SetVisibilityMethod · 0.45
GetVertexAtMethod · 0.45

Tested by

no test coverage detected