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

Method addModel

src/Mod/Material/App/ModelLibrary.cpp:138–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138std::shared_ptr<Model> ModelLibraryLocal::addModel(const Model& model, const QString& path)
139{
140 QString filePath = getRelativePath(path);
141 QFileInfo info(filePath);
142 std::shared_ptr<Model> newModel = std::make_shared<Model>(model);
143 newModel->setLibrary(getptr());
144 newModel->setDirectory(getLibraryPath(filePath, info.fileName()));
145 newModel->setFilename(info.fileName());
146
147 (*_modelPathMap)[filePath] = newModel;
148
149 return newModel;
150}

Callers

nothing calls this directly

Calls 4

getptrFunction · 0.70
setDirectoryMethod · 0.45
fileNameMethod · 0.45
setFilenameMethod · 0.45

Tested by

no test coverage detected