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

@@ -87,7 +87,7 @@ private:
&& object) {
App::DocumentObject* obj =
static_cast<App::DocumentObjectPy*>(object)->getDocumentObjectPtr();
if (!obj || !obj->getTypeId().isDerivedFrom(Fem::FemAnalysis::getClassTypeId())) {
if (!obj || !obj->isDerivedFrom<Fem::FemAnalysis>()) {
throw Py::Exception(Base::PyExc_FC_GeneralError,
"Active Analysis object have to be of type Fem::FemAnalysis!");
}