Merge pull request #19142 from hyarion/refactor/add-template-addobject
Add new addObject<T>() function
This commit is contained in:
@@ -975,7 +975,7 @@ public:
|
||||
Gui::Document* gui = mesh->getDocument();
|
||||
App::Document* doc = gui->getDocument();
|
||||
|
||||
auto cpy = static_cast<Mesh::Feature*>(doc->addObject("Mesh::Feature"));
|
||||
auto cpy = doc->addObject<Mesh::Feature>();
|
||||
auto org = mesh->getObject<Mesh::Feature>();
|
||||
cpy->Label.setValue(org->Label.getValue());
|
||||
cpy->Mesh.setValue(org->Mesh.getValue());
|
||||
@@ -1630,7 +1630,7 @@ void ViewProviderMesh::splitMesh(const MeshCore::MeshKernel& toolMesh,
|
||||
removeFacets(indices);
|
||||
auto doc = App::GetApplication().getActiveDocument();
|
||||
const char* name = pcObject->getNameInDocument();
|
||||
auto splitMesh = dynamic_cast<Mesh::Feature*>(doc->addObject("Mesh::Feature", name));
|
||||
auto splitMesh = doc->addObject<Mesh::Feature>(name);
|
||||
// Note: deletes also kernel
|
||||
splitMesh->Mesh.setValuePtr(kernel);
|
||||
getObject()->purgeTouched();
|
||||
|
||||
Reference in New Issue
Block a user