Mod: Use new addObject<T>(...) using regex

This commit is contained in:
Benjamin Nauck
2025-01-19 01:49:04 +01:00
parent 6d28a19a3e
commit 265b58c034
57 changed files with 125 additions and 159 deletions

View File

@@ -303,8 +303,7 @@ private:
pcDoc = App::GetApplication().newDocument();
}
MeshPy* pMesh = static_cast<MeshPy*>(pcObj);
Mesh::Feature* pcFeature =
static_cast<Mesh::Feature*>(pcDoc->addObject("Mesh::Feature", name));
Mesh::Feature* pcFeature = pcDoc->addObject<Mesh::Feature>(name);
Mesh::MeshObject* mo = pMesh->getMeshObjectPtr();
if (!mo) {
throw Py::Exception(PyExc_ReferenceError, "object doesn't reference a valid mesh");

View File

@@ -119,8 +119,7 @@ void Importer::createMeshFromSegments(const std::string& name,
Feature* Importer::createMesh(const std::string& name, MeshObject& mesh)
{
Mesh::Feature* pcFeature =
static_cast<Mesh::Feature*>(document->addObject("Mesh::Feature", name.c_str()));
Mesh::Feature* pcFeature = document->addObject<Mesh::Feature>(name.c_str());
pcFeature->Label.setValue(name);
pcFeature->Mesh.swapMesh(mesh);
return pcFeature;