| 621 | } |
| 622 | |
| 623 | mitk::DataNode::Pointer mitk::FindTopmostVisibleNode(const DataStorage::SetOfObjects::ConstPointer nodes, |
| 624 | const Point3D worldPosition, |
| 625 | const TimePointType timePoint, |
| 626 | const BaseRenderer* baseRender) |
| 627 | { |
| 628 | if (nodes.IsNull()) |
| 629 | { |
| 630 | return nullptr; |
| 631 | } |
| 632 | |
| 633 | mitk::DataNode::Pointer topLayerNode = nullptr; |
| 634 | int maxLayer = std::numeric_limits<int>::min(); |
| 635 | |
| 636 | for (const auto &node : *nodes) |
| 637 | { |
| 638 | if (node.IsNull()) |
| 639 | { |
| 640 | continue; |
| 641 | } |
| 642 | |
| 643 | bool isHelperObject = false; |
| 644 | node->GetBoolProperty("helper object", isHelperObject); |
| 645 | if (isHelperObject) |
| 646 | { |
| 647 | continue; |
| 648 | } |
| 649 | |
| 650 | auto data = node->GetData(); |
| 651 | if (nullptr == data) |
| 652 | { |
| 653 | continue; |
| 654 | } |
| 655 | |
| 656 | auto geometry = data->GetGeometry(); |
| 657 | if (nullptr == geometry || !geometry->IsInside(worldPosition)) |
| 658 | { |
| 659 | continue; |
| 660 | } |
| 661 | |
| 662 | auto timeGeometry = data->GetUpdatedTimeGeometry(); |
| 663 | if (nullptr == timeGeometry) |
| 664 | { |
| 665 | continue; |
| 666 | } |
| 667 | |
| 668 | if (!timeGeometry->IsValidTimePoint(timePoint)) |
| 669 | { |
| 670 | continue; |
| 671 | } |
| 672 | |
| 673 | int layer = 0; |
| 674 | if (!node->GetIntProperty("layer", layer, baseRender)) |
| 675 | { |
| 676 | continue; |
| 677 | } |
| 678 | |
| 679 | if (layer <= maxLayer) |
| 680 | { |
nothing calls this directly
no test coverage detected