| 20 | #include <mitkBaseData.h> |
| 21 | |
| 22 | mitk::NodeUIDType mitk::EnsureUID(mitk::DataNode* node) |
| 23 | { |
| 24 | if (!node) |
| 25 | { |
| 26 | mitkThrow() << "Cannot ensure node UID. Passed node pointer is nullptr."; |
| 27 | } |
| 28 | |
| 29 | std::string propUID = ""; |
| 30 | if (!node->GetStringProperty(mitk::nodeProp_UID,propUID)) |
| 31 | { |
| 32 | mitk::UIDGenerator generator; |
| 33 | propUID = generator.GetUID(); |
| 34 | |
| 35 | node->SetStringProperty(mitk::nodeProp_UID,propUID.c_str()); |
| 36 | } |
| 37 | |
| 38 | return propUID; |
| 39 | }; |
| 40 | |
| 41 | bool mitk::CheckUID(const mitk::DataNode* node, const NodeUIDType& uid) |
| 42 | { |
nothing calls this directly
no test coverage detected