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

Method IsClosedContour

Modules/Core/src/Interactions/mitkPointSetDataInteractor.cpp:242–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242void mitk::PointSetDataInteractor::IsClosedContour(StateMachineAction *, InteractionEvent *interactionEvent)
243{
244 unsigned int timeStep = interactionEvent->GetSender()->GetTimeStep(GetDataNode()->GetData());
245
246 auto *positionEvent = dynamic_cast<InteractionPositionEvent *>(interactionEvent);
247 if (positionEvent != nullptr)
248 {
249 Point3D point = positionEvent->GetPositionInWorld();
250 // iterate over point set and check if it contains a point close enough to the pointer to be selected
251 if (GetPointIndexByPosition(point, timeStep) != -1 && m_PointSet->GetSize(timeStep) >= 3)
252 {
253 InternalEvent::Pointer event = InternalEvent::New(nullptr, this, "ClosedContour");
254 positionEvent->GetSender()->GetDispatcher()->QueueEvent(event.GetPointer());
255 }
256 }
257}
258
259void mitk::PointSetDataInteractor::MovePoint(StateMachineAction *stateMachineAction, InteractionEvent *interactionEvent)
260{

Callers

nothing calls this directly

Calls 9

GetSenderMethod · 0.80
GetPositionInWorldMethod · 0.80
QueueEventMethod · 0.80
GetPointerMethod · 0.80
NewFunction · 0.50
GetTimeStepMethod · 0.45
GetDataMethod · 0.45
GetSizeMethod · 0.45
GetDispatcherMethod · 0.45

Tested by

no test coverage detected