MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / getModelByPath

Method getModelByPath

src/Mod/Material/App/ModelManagerLocal.cpp:187–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187std::shared_ptr<Model> ModelManagerLocal::getModelByPath(const QString& path) const
188{
189 QString cleanPath = QDir::cleanPath(path);
190
191 for (auto& library : *_libraryList) {
192 if (library->isLocal()) {
193 auto localLibrary = std::static_pointer_cast<Materials::ModelLibraryLocal> (library);
194 if (cleanPath.startsWith(localLibrary->getDirectory(), localLibrary->caseSensitivity())) {
195 return localLibrary->getModelByPath(cleanPath);
196 }
197 }
198 }
199
200 throw ModelNotFound();
201}
202
203std::shared_ptr<Model> ModelManagerLocal::getModelByPath(const QString& path,
204 const QString& lib) const

Callers

nothing calls this directly

Calls 6

ModelNotFoundClass · 0.85
isLocalMethod · 0.80
startsWithMethod · 0.80
caseSensitivityMethod · 0.80
getLibraryFunction · 0.70
getDirectoryMethod · 0.45

Tested by

no test coverage detected