| 673 | } |
| 674 | |
| 675 | void 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 | |
| 718 | bool mitk::PlanarFigureInteractor::CheckPointValidity(const InteractionEvent *interactionEvent) |
| 719 | { |
nothing calls this directly
no test coverage detected