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

Method OnAddPoint

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

Source from the content-addressed store, hash-verified

220}
221
222void mitk::EditableContourTool::OnAddPoint(StateMachineAction*, InteractionEvent* interactionEvent)
223{
224 auto positionEvent = dynamic_cast<mitk::InteractionPositionEvent*>(interactionEvent);
225
226 if (nullptr == positionEvent)
227 return;
228
229 if (m_PlaneGeometry.IsNotNull())
230 {
231 // Check if the point is in the correct slice
232 if (m_PlaneGeometry->DistanceFromPlane(positionEvent->GetPositionInWorld()) > mitk::sqrteps)
233 return;
234 }
235
236 this->FinalizePreviewContour(positionEvent->GetPositionInWorld());
237
238 // Merge contours
239 auto contour = this->GetContour();
240 contour->Concatenate(m_PreviewContour);
241
242 this->InitializePreviewContour(positionEvent->GetPositionInWorld());
243
244 mitk::RenderingManager::GetInstance()->RequestUpdate(positionEvent->GetSender()->GetRenderWindow());
245}
246
247void mitk::EditableContourTool::OnDrawing(StateMachineAction*, InteractionEvent* interactionEvent)
248{

Callers

nothing calls this directly

Calls 10

GetContourMethod · 0.95
IsNotNullMethod · 0.80
DistanceFromPlaneMethod · 0.80
GetPositionInWorldMethod · 0.80
GetSenderMethod · 0.80
ConcatenateMethod · 0.45
RequestUpdateMethod · 0.45
GetRenderWindowMethod · 0.45

Tested by

no test coverage detected