Part: modernize type checking

This commit is contained in:
Florian Foinant-Willig
2023-10-15 21:38:52 +02:00
parent fbf0d48dd8
commit 02731c7816
22 changed files with 46 additions and 46 deletions

View File

@@ -805,7 +805,7 @@ private:
PyObject* item = (*it).ptr();
if (PyObject_TypeCheck(item, &(App::DocumentObjectPy::Type))) {
App::DocumentObject* obj = static_cast<App::DocumentObjectPy*>(item)->getDocumentObjectPtr();
if (obj->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) {
if (obj->isDerivedFrom<Part::Feature>()) {
Part::Feature* part = static_cast<Part::Feature*>(obj);
const TopoDS_Shape& shape = part->Shape.getValue();
if (!shape.IsNull())