MCPcopy Create free account
hub / github.com/Kitware/VTK / LoadModelMetaDataFromFile

Method LoadModelMetaDataFromFile

IO/Geometry/vtkGLTFDocumentLoader.cxx:142–167  ·  view source on GitHub ↗

Metadata loading **/ ------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

140/** Metadata loading **/
141//------------------------------------------------------------------------------
142bool vtkGLTFDocumentLoader::LoadModelMetaDataFromFile(const std::string& fileName)
143{
144 // Setup file resource and URI loader
145 auto fullPath = vtksys::SystemTools::CollapseFullPath(fileName);
146 auto file = vtkSmartPointer<vtkFileResourceStream>::New();
147 if (!file->Open(fullPath.c_str()))
148 {
149 vtkErrorMacro("Failed to open file " << fullPath);
150 return false;
151 }
152
153 vtkNew<vtkURILoader> loader;
154 if (!loader->SetBaseFileName(fullPath))
155 {
156 vtkErrorMacro("Failed to set " << fullPath << " as base URI");
157 return false;
158 }
159
160 if (!this->LoadModelMetaDataFromStream(file, loader))
161 {
162 return false;
163 }
164
165 this->InternalModel->FileName = std::move(fullPath); // store filename
166 return true;
167}
168
169//------------------------------------------------------------------------------
170bool vtkGLTFDocumentLoader::LoadModelMetaDataFromStream(

Callers 2

RequestInformationMethod · 0.80
ImportBeginMethod · 0.80

Calls 5

SetBaseFileNameMethod · 0.80
NewFunction · 0.50
OpenMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected