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

Method FindTopmostVisibleNode

Modules/Core/src/DataManagement/mitkDataStorage.cpp:623–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621}
622
623mitk::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 {

Callers

nothing calls this directly

Calls 9

GetGeometryMethod · 0.80
IsNullMethod · 0.45
GetBoolPropertyMethod · 0.45
GetDataMethod · 0.45
IsInsideMethod · 0.45
IsValidTimePointMethod · 0.45
GetIntPropertyMethod · 0.45
IsVisibleMethod · 0.45

Tested by

no test coverage detected