Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's

Regex based changes, manually verified
This commit is contained in:
Benjamin Nauck
2025-01-16 21:27:50 +01:00
parent 6a3eb2ab49
commit 6f535f19fb
166 changed files with 484 additions and 497 deletions

View File

@@ -329,13 +329,12 @@ private:
}
Py::Sequence list(object);
Base::Type pointsId = Base::Type::fromName("Points::Feature");
for (Py::Sequence::iterator it = list.begin(); it != list.end(); ++it) {
PyObject* item = (*it).ptr();
if (PyObject_TypeCheck(item, &(App::DocumentObjectPy::Type))) {
App::DocumentObject* obj =
static_cast<App::DocumentObjectPy*>(item)->getDocumentObjectPtr();
if (obj->getTypeId().isDerivedFrom(pointsId)) {
if (obj->isDerivedFrom<Points::Feature>()) {
// get relative placement
Points::Feature* fea = static_cast<Points::Feature*>(obj);
Base::Placement globalPlacement = fea->globalPlacement();