| 114 | } |
| 115 | |
| 116 | mitk::DataNode *mitk::DataStorage::GetNamedDerivedNode(const char *name, |
| 117 | const DataNode *sourceNode, |
| 118 | bool onlyDirectDerivations) const |
| 119 | { |
| 120 | if (name == nullptr) |
| 121 | return nullptr; |
| 122 | |
| 123 | StringProperty::Pointer s(StringProperty::New(name)); |
| 124 | NodePredicateProperty::Pointer p = NodePredicateProperty::New("name", s); |
| 125 | DataStorage::SetOfObjects::ConstPointer rs = this->GetDerivations(sourceNode, p, onlyDirectDerivations); |
| 126 | if (rs->Size() >= 1) |
| 127 | return rs->GetElement(0); |
| 128 | else |
| 129 | return nullptr; |
| 130 | } |
| 131 | |
| 132 | std::string mitk::DataStorage::GetUniqueName(const std::string& baseName, const DataNode* sourceNode, bool onlyDirectDerivations) const |
| 133 | { |