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

Method DoRead

Modules/SceneSerialization/autoload/IO/mitkSceneJsonFileReader.cpp:65–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 std::vector<BaseData::Pointer> SceneJsonFileReader::DoRead()
66 {
67 // The AbstractFileReader::DoRead contract returns BaseData only, so
68 // node properties and parent/child relationships are intentionally
69 // lost on this code path. Callers that need the scene graph should
70 // use Read(DataStorage&) instead. Data-less nodes are skipped here
71 // to avoid handing nullptrs back to IOUtil::Load.
72 std::vector<BaseData::Pointer> result;
73
74 DataStorage::Pointer ds = StandaloneDataStorage::New().GetPointer();
75 this->Read(*ds);
76 DataStorage::SetOfObjects::ConstPointer dataNodes = ds->GetAll();
77 for (DataStorage::SetOfObjects::ConstIterator iter = dataNodes->Begin(), iterEnd = dataNodes->End();
78 iter != iterEnd;
79 ++iter)
80 {
81 if (BaseData::Pointer data = iter.Value()->GetData())
82 {
83 result.push_back(data);
84 }
85 }
86 return result;
87 }
88
89 SceneJsonFileReader *SceneJsonFileReader::Clone() const { return new SceneJsonFileReader(*this); }
90}

Callers

nothing calls this directly

Calls 8

ReadMethod · 0.95
GetPointerMethod · 0.80
GetAllMethod · 0.80
ValueMethod · 0.80
NewFunction · 0.50
BeginMethod · 0.45
EndMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected