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

Method SelectPoint

Modules/PlanarFigure/src/Interactions/mitkPlanarFigureInteractor.cpp:675–716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675void mitk::PlanarFigureInteractor::SelectPoint(StateMachineAction *, InteractionEvent *interactionEvent)
676{
677 auto positionEvent = dynamic_cast<InteractionPositionEvent*>(interactionEvent);
678 if (nullptr == positionEvent)
679 {
680 return;
681 }
682
683 auto planarFigure = dynamic_cast<PlanarFigure*>(GetDataNode()->GetData());
684 if (nullptr == planarFigure)
685 {
686 return;
687 }
688
689 auto planarFigureGeometry = planarFigure->GetPlaneGeometry();
690 if (nullptr == planarFigureGeometry)
691 {
692 return;
693 }
694
695 auto abstractTransformGeometry = dynamic_cast<AbstractTransformGeometry*>(planarFigure->GetGeometry(0));
696 if (nullptr != abstractTransformGeometry)
697 {
698 return;
699 }
700
701 const mitk::BaseRenderer *renderer = interactionEvent->GetSender();
702 const PlaneGeometry *projectionPlane = renderer->GetCurrentWorldPlaneGeometry();
703
704 const int pointIndex = mitk::PlanarFigureInteractor::IsPositionInsideMarker(
705 positionEvent, planarFigure, planarFigureGeometry, projectionPlane, renderer);
706
707 if (pointIndex >= 0)
708 {
709 // If mouse is above control point, mark it as selected
710 planarFigure->SelectControlPoint(pointIndex);
711 }
712 else
713 {
714 planarFigure->DeselectControlPoint();
715 }
716}
717
718bool mitk::PlanarFigureInteractor::CheckPointValidity(const InteractionEvent *interactionEvent)
719{

Callers

nothing calls this directly

Calls 6

GetGeometryMethod · 0.80
GetSenderMethod · 0.80
SelectControlPointMethod · 0.80
DeselectControlPointMethod · 0.80
GetDataMethod · 0.45
GetPlaneGeometryMethod · 0.45

Tested by

no test coverage detected