Just show the contour, insert the first point. */
| 44 | Just show the contour, insert the first point. |
| 45 | */ |
| 46 | void mitk::ContourTool::OnMousePressed(StateMachineAction *, InteractionEvent *interactionEvent) |
| 47 | { |
| 48 | auto *positionEvent = dynamic_cast<mitk::InteractionPositionEvent *>(interactionEvent); |
| 49 | if (!positionEvent) |
| 50 | return; |
| 51 | |
| 52 | m_LastEventSender = positionEvent->GetSender(); |
| 53 | m_LastEventSlice = m_LastEventSender->GetSlice(); |
| 54 | |
| 55 | this->ClearsCurrentFeedbackContour(true); |
| 56 | mitk::Point3D point = positionEvent->GetPositionInWorld(); |
| 57 | this->AddVertexToCurrentFeedbackContour(point); |
| 58 | |
| 59 | FeedbackContourTool::SetFeedbackContourVisible(true); |
| 60 | auto renderWindow = positionEvent->GetSender()->GetRenderWindow(); |
| 61 | assert(renderWindow); |
| 62 | auto renderManager = mitk::RenderingManager::GetInstance(); |
| 63 | //This ensures that contour tools also make the renderwindow they interact with the focused |
| 64 | //window. For this tools it does not happen automatically as the mouse press event does not |
| 65 | //reach the RenderWindowManager. By Setting the focus it is possible to pass events like |
| 66 | //hot keys for time or slice cycling to the window |
| 67 | renderManager->SetRenderWindowFocus(renderWindow); |
| 68 | renderManager->RequestUpdate(renderWindow); |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | Insert the point to the feedback contour. |
nothing calls this directly
no test coverage detected