| 261 | } |
| 262 | |
| 263 | void 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 | |
| 286 | void mitk::EditableContourTool::OnMouseMoved(StateMachineAction*, InteractionEvent* interactionEvent) |
| 287 | { |
nothing calls this directly
no test coverage detected