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

@@ -22,11 +22,11 @@ protected:
fileInfo.setFile(Base::FileInfo::getTempFileName() + ".stl");
const double value = 10.0;
cube1 = dynamic_cast<Mesh::Cube*>(document->addObject("Mesh::Cube", "Cube1"));
cube1 = document->addObject<Mesh::Cube>("Cube1");
cube1->Length.setValue(value);
cube1->Width.setValue(value);
cube1->Height.setValue(value);
cube2 = dynamic_cast<Mesh::Cube*>(document->addObject("Mesh::Cube", "Cube2"));
cube2 = document->addObject<Mesh::Cube>("Cube2");
cube2->Length.setValue(value);
cube2->Width.setValue(value);
cube2->Height.setValue(value);
@@ -130,7 +130,7 @@ TEST_F(ExporterTest, TestMeshesInPart)
// add extra scope because the file will be written when destroying the exporter
{
auto part = dynamic_cast<App::Part*>(getDocument()->addObject("App::Part", "Part"));
auto part = getDocument()->addObject<App::Part>("Part");
part->placement().setValue(plm);
part->addObjects(getObjects());
Mesh::MergeExporter exporter(getFileName(), MeshCore::MeshIO::Format::STL);