| 586 | } |
| 587 | |
| 588 | mitk::BaseProperty::ConstPointer mitk::DataNode::GetConstProperty(const std::string &propertyKey, const std::string &contextName, bool fallBackOnDefaultContext) const |
| 589 | { |
| 590 | if (propertyKey.empty()) |
| 591 | return nullptr; |
| 592 | |
| 593 | if (!contextName.empty()) |
| 594 | { |
| 595 | auto propertyListIter = m_MapOfPropertyLists.find(contextName); |
| 596 | |
| 597 | if (m_MapOfPropertyLists.end() != propertyListIter) |
| 598 | { |
| 599 | BaseProperty::ConstPointer property = propertyListIter->second->GetProperty(propertyKey); |
| 600 | |
| 601 | if (property.IsNotNull()) |
| 602 | return property; |
| 603 | } |
| 604 | } |
| 605 | |
| 606 | if (contextName.empty() || fallBackOnDefaultContext) |
| 607 | { |
| 608 | BaseProperty::ConstPointer property = m_PropertyList->GetProperty(propertyKey); |
| 609 | |
| 610 | if (property.IsNull() && m_Data.IsNotNull()) |
| 611 | property = m_Data->GetProperty(propertyKey.c_str()); |
| 612 | |
| 613 | return property; |
| 614 | } |
| 615 | |
| 616 | return nullptr; |
| 617 | } |
| 618 | |
| 619 | mitk::BaseProperty * mitk::DataNode::GetNonConstProperty(const std::string &propertyKey, const std::string &contextName, bool fallBackOnDefaultContext) |
| 620 | { |