| 91 | } |
| 92 | |
| 93 | void QmitkDataGeneratorBase::OnFinalResultsAvailable(JobResultMapType results, const QmitkDataGenerationJobBase *job) const |
| 94 | { |
| 95 | auto resultnodes = mitk::DataStorage::SetOfObjects::New(); |
| 96 | |
| 97 | for (const auto &pos : results) |
| 98 | { |
| 99 | resultnodes->push_back(this->PrepareResultForStorage(pos.first, pos.second, job)); |
| 100 | } |
| 101 | |
| 102 | { |
| 103 | std::lock_guard<std::mutex> mutexguard(m_DataMutex); |
| 104 | auto storage = m_Storage.Lock(); |
| 105 | if (storage.IsNotNull()) |
| 106 | { |
| 107 | m_AddingToStorage = true; |
| 108 | for (auto pos = resultnodes->Begin(); pos != resultnodes->End(); ++pos) |
| 109 | { |
| 110 | storage->Add(pos->Value()); |
| 111 | } |
| 112 | m_AddingToStorage = false; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | emit NewDataAvailable(resultnodes.GetPointer()); |
| 117 | |
| 118 | if (!resultnodes->empty()) |
| 119 | { |
| 120 | this->EnsureRecheckingAndGeneration(); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | void QmitkDataGeneratorBase::NodeAddedOrModified(const mitk::DataNode* node) |
| 125 | { |
nothing calls this directly
no test coverage detected