Mod: Use new addObject<T>(...) that requires additional changes

This commit is contained in:
Benjamin Nauck
2025-02-09 14:09:56 +01:00
parent a1c5767643
commit 8cc98b9a88
19 changed files with 60 additions and 82 deletions

View File

@@ -295,8 +295,7 @@ private:
pcFeature->purgeTouched();
}
else {
Points::Feature* pcFeature = static_cast<Points::Feature*>(
pcDoc->addObject("Points::Feature", file.fileNamePure().c_str()));
auto* pcFeature = pcDoc->addObject<Points::Feature>(file.fileNamePure().c_str());
pcFeature->Points.setValue(reader->getPoints());
pcDoc->recomputeFeature(pcFeature);
pcFeature->purgeTouched();
@@ -413,8 +412,8 @@ private:
if (!pcDoc) {
pcDoc = App::GetApplication().newDocument();
}
PointsPy* pPoints = static_cast<PointsPy*>(pcObj);
Points::Feature* pcFeature = pcDoc->addObject<Points::Feature>(name);
auto* pPoints = static_cast<PointsPy*>(pcObj);
auto* pcFeature = pcDoc->addObject<Points::Feature>(name);
// copy the data
pcFeature->Points.setValue(*(pPoints->getPointKernelPtr()));
return Py::asObject(pcFeature->getPyObject());