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

Method OnAddNegativePoint

Modules/Segmentation/src/Interactions/mitkMonaiLabelTool.cpp:133–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133void mitk::MonaiLabelTool::OnAddNegativePoint(StateMachineAction *, InteractionEvent *interactionEvent)
134{
135 if (nullptr == m_RequestParameters || "deepgrow" != m_RequestParameters->model.type)
136 {
137 return;
138 }
139 if (m_RequestParameters->model.Is2D() && (m_PointSetPositive->GetSize() == 0 ||
140 nullptr == this->GetWorkingPlaneGeometry() ||
141 !mitk::Equal(*(interactionEvent->GetSender()->GetCurrentWorldPlaneGeometry()),
142 *(this->GetWorkingPlaneGeometry()))))
143 {
144 return;
145 }
146 if (!this->IsUpdating() && m_PointSetNegative.IsNotNull())
147 {
148 const auto positionEvent = dynamic_cast<mitk::InteractionPositionEvent *>(interactionEvent);
149 if (positionEvent != nullptr)
150 {
151 m_PointSetNegative->InsertPoint(m_PointSetCount, positionEvent->GetPositionInWorld());
152 m_PointSetCount++;
153 this->UpdatePreview();
154 }
155 }
156}
157
158void mitk::MonaiLabelTool::OnDelete(StateMachineAction *, InteractionEvent *)
159{

Callers

nothing calls this directly

Calls 9

Is2DMethod · 0.80
GetSenderMethod · 0.80
IsUpdatingMethod · 0.80
IsNotNullMethod · 0.80
InsertPointMethod · 0.80
GetPositionInWorldMethod · 0.80
UpdatePreviewMethod · 0.80
EqualFunction · 0.50
GetSizeMethod · 0.45

Tested by

no test coverage detected