Fem: modernize type checking

This commit is contained in:
Florian Foinant-Willig
2023-10-15 21:39:02 +02:00
parent 24352a7f4c
commit 41080dec5b
10 changed files with 26 additions and 30 deletions

View File

@@ -71,7 +71,7 @@ PyObject* FemPostPipelinePy::load(PyObject* args)
}
App::DocumentObject* obj = static_cast<App::DocumentObjectPy*>(py)->getDocumentObjectPtr();
if (!obj->getTypeId().isDerivedFrom(FemResultObject::getClassTypeId())) {
if (!obj->isDerivedFrom<FemResultObject>()) {
PyErr_SetString(PyExc_TypeError, "object is not a result object");
return nullptr;
}
@@ -111,7 +111,7 @@ PyObject* FemPostPipelinePy::holdsPostObject(PyObject* args)
}
App::DocumentObject* obj = static_cast<App::DocumentObjectPy*>(py)->getDocumentObjectPtr();
if (!obj->getTypeId().isDerivedFrom(FemPostObject::getClassTypeId())) {
if (!obj->isDerivedFrom<FemPostObject>()) {
PyErr_SetString(PyExc_TypeError, "object is not a post-processing object");
return nullptr;
}