MCPcopy Create free account
hub / github.com/MITK/MITK / UpdateModelData

Method UpdateModelData

Modules/QtWidgets/src/QmitkDataStorageHistoryModel.cpp:34–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void QmitkDataStorageHistoryModel::UpdateModelData()
35{
36 std::vector<mitk::DataNode::Pointer> dataNodes;
37 auto dataStorage = m_DataStorage.Lock();
38 if (dataStorage.IsNotNull())
39 {
40 auto nodesCandidats = m_NodePredicate.IsNotNull()
41 ? dataStorage->GetSubset(m_NodePredicate)
42 : dataStorage->GetAll();
43
44 const std::lock_guard<std::mutex> lock(_historyMutex);
45
46 for (auto historyNode : _nodeHistory)
47 {
48 auto finding = std::find(nodesCandidats->begin(), nodesCandidats->end(), historyNode);
49 if (finding != nodesCandidats->end())
50 {
51 dataNodes.push_back(*finding);
52 }
53 }
54 }
55
56 // update the model, so that it will be filled with the nodes of the new data storage
57 beginResetModel();
58 m_DataNodes = dataNodes;
59 endResetModel();
60}
61
62void QmitkDataStorageHistoryModel::AddNodeToHistory(mitk::DataNode* node)
63{

Callers 1

OnNodeModifiedMethod · 0.45

Calls 6

IsNotNullMethod · 0.80
GetSubsetMethod · 0.80
GetAllMethod · 0.80
LockMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected