| 282 | } |
| 283 | |
| 284 | mitk::PropertyRelationRuleBase::RelationUIDVectorType mitk::PropertyRelationRuleBase::GetRelationUIDs( |
| 285 | const IPropertyProvider *source, const IPropertyProvider *destination) const |
| 286 | { |
| 287 | if (!source) |
| 288 | { |
| 289 | mitkThrow() << "Error. Passed source pointer is NULL"; |
| 290 | } |
| 291 | if (!destination) |
| 292 | { |
| 293 | mitkThrow() << "Error. Passed destination pointer is NULL"; |
| 294 | } |
| 295 | |
| 296 | RelationUIDVectorType relUIDs_id; |
| 297 | |
| 298 | auto instanceIDs = this->GetInstanceID_IDLayer(source, destination); |
| 299 | for (const auto& instanceID : instanceIDs) |
| 300 | { |
| 301 | relUIDs_id.push_back(this->GetRelationUIDByInstanceID(source, instanceID)); |
| 302 | } |
| 303 | |
| 304 | DataRelationUIDVectorType relationUIDandRuleID_Data = this->GetRelationUIDs_DataLayer(source,destination,instanceIDs); |
| 305 | RelationUIDVectorType relUIDs_Data; |
| 306 | std::transform(relationUIDandRuleID_Data.begin(), relationUIDandRuleID_Data.end(), std::back_inserter(relUIDs_Data), |
| 307 | [](const DataRelationUIDVectorType::value_type& v) { return v.first; }); |
| 308 | |
| 309 | std::sort(relUIDs_id.begin(), relUIDs_id.end()); |
| 310 | std::sort(relUIDs_Data.begin(), relUIDs_Data.end()); |
| 311 | |
| 312 | RelationUIDVectorType result; |
| 313 | std::set_union(relUIDs_id.begin(), relUIDs_id.end(), relUIDs_Data.begin(), relUIDs_Data.end(), std::back_inserter(result)); |
| 314 | |
| 315 | return result; |
| 316 | } |
| 317 | |
| 318 | mitk::PropertyRelationRuleBase::RelationUIDType |
| 319 | mitk::PropertyRelationRuleBase::GetRelationUID(const IPropertyProvider *source, const IPropertyProvider *destination) const |