* @brief Get the correct set of property keys for a given scope. * * Uses IPropertyProvider::GetPropertyKeys() which returns only keys owned by * the respective provider (no fall-through from node to data or vice versa). * * @pre node must not be nullptr. */
| 102 | * @pre node must not be nullptr. |
| 103 | */ |
| 104 | std::vector<std::string> GetPropertyKeysForScope( |
| 105 | const mitk::DataNode* node, |
| 106 | const std::string& contextName, |
| 107 | mitk::PropertyScope scope) |
| 108 | { |
| 109 | // Get data-level keys (needed for Data and All scopes) |
| 110 | std::vector<std::string> dataKeys; |
| 111 | if (scope != mitk::PropertyScope::Node && node->GetData() != nullptr) |
| 112 | { |
| 113 | dataKeys = node->GetData()->GetPropertyKeys(contextName); |
| 114 | } |
| 115 | |
| 116 | if (scope == mitk::PropertyScope::Data) |
| 117 | return dataKeys; |
| 118 | |
| 119 | auto nodeKeys = node->GetPropertyKeys(contextName); |
| 120 | |
| 121 | if (scope == mitk::PropertyScope::Node) |
| 122 | return nodeKeys; |
| 123 | |
| 124 | // Scope::All — union of node + data keys |
| 125 | if (!dataKeys.empty()) |
| 126 | { |
| 127 | std::set<std::string> allKeySet(nodeKeys.begin(), nodeKeys.end()); |
| 128 | allKeySet.insert(dataKeys.begin(), dataKeys.end()); |
| 129 | return std::vector<std::string>(allKeySet.begin(), allKeySet.end()); |
| 130 | } |
| 131 | |
| 132 | return nodeKeys; |
| 133 | } |
| 134 | |
| 135 | std::string GenerateTimestampString() |
| 136 | { |
no test coverage detected