diff --git a/src/Mod/Fem/App/FemConstraint.cpp b/src/Mod/Fem/App/FemConstraint.cpp index 84f5fb3477..16a61d26fa 100644 --- a/src/Mod/Fem/App/FemConstraint.cpp +++ b/src/Mod/Fem/App/FemConstraint.cpp @@ -462,19 +462,19 @@ const Base::Vector3d Constraint::getDirection(const App::PropertyLinkSub& direct return Base::Vector3d(0, 0, 0); } - if (obj->getTypeId().isDerivedFrom(App::Line::getClassTypeId())) { + if (obj->isDerivedFrom()) { Base::Vector3d vec(1.0, 0.0, 0.0); static_cast(obj)->Placement.getValue().multVec(vec, vec); return vec; } - if (obj->getTypeId().isDerivedFrom(App::Plane::getClassTypeId())) { + if (obj->isDerivedFrom()) { Base::Vector3d vec(0.0, 0.0, 1.0); static_cast(obj)->Placement.getValue().multVec(vec, vec); return vec; } - if (!obj->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { + if (!obj->isDerivedFrom()) { std::stringstream str; str << "Type is not a line, plane or Part object"; throw Base::TypeError(str.str()); diff --git a/src/Mod/Fem/App/FemPostPipelinePyImp.cpp b/src/Mod/Fem/App/FemPostPipelinePyImp.cpp index 485ee6e6ce..69e650e72e 100644 --- a/src/Mod/Fem/App/FemPostPipelinePyImp.cpp +++ b/src/Mod/Fem/App/FemPostPipelinePyImp.cpp @@ -71,7 +71,7 @@ PyObject* FemPostPipelinePy::load(PyObject* args) } App::DocumentObject* obj = static_cast(py)->getDocumentObjectPtr(); - if (!obj->getTypeId().isDerivedFrom(FemResultObject::getClassTypeId())) { + if (!obj->isDerivedFrom()) { 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(py)->getDocumentObjectPtr(); - if (!obj->getTypeId().isDerivedFrom(FemPostObject::getClassTypeId())) { + if (!obj->isDerivedFrom()) { PyErr_SetString(PyExc_TypeError, "object is not a post-processing object"); return nullptr; } diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index 49ff9f0d39..e3d8432398 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -603,7 +603,7 @@ App::DocumentObject* getObjectByType(const Base::Type type) if (obj->getTypeId() == type) { return obj; } - if (obj->getTypeId() == FemAnalysis::getClassTypeId()) { + if (obj->is()) { std::vector fem = (static_cast(obj))->Group.getValues(); for (const auto& it : fem) { if (it->getTypeId().isDerivedFrom(type)) { @@ -624,7 +624,7 @@ App::DocumentObject* createObjectByType(const Base::Type type) } App::DocumentObject* obj = pcDoc->getActiveObject(); - if (obj->getTypeId() == FemAnalysis::getClassTypeId()) { + if (obj->is()) { App::DocumentObject* newobj = pcDoc->addObject(type.getName()); static_cast(obj)->addObject(newobj); return newobj; diff --git a/src/Mod/Fem/Gui/AppFemGuiPy.cpp b/src/Mod/Fem/Gui/AppFemGuiPy.cpp index 045f222064..04ee5bd2c3 100644 --- a/src/Mod/Fem/Gui/AppFemGuiPy.cpp +++ b/src/Mod/Fem/Gui/AppFemGuiPy.cpp @@ -87,7 +87,7 @@ private: && object) { App::DocumentObject* obj = static_cast(object)->getDocumentObjectPtr(); - if (!obj || !obj->getTypeId().isDerivedFrom(Fem::FemAnalysis::getClassTypeId())) { + if (!obj || !obj->isDerivedFrom()) { throw Py::Exception(Base::PyExc_FC_GeneralError, "Active Analysis object have to be of type Fem::FemAnalysis!"); } diff --git a/src/Mod/Fem/Gui/Command.cpp b/src/Mod/Fem/Gui/Command.cpp index d759b4cb05..8d423da5ba 100644 --- a/src/Mod/Fem/Gui/Command.cpp +++ b/src/Mod/Fem/Gui/Command.cpp @@ -1091,7 +1091,7 @@ void CmdFemDefineNodesSet::activated(int) if (it == docObj.begin()) { Gui::Document* doc = getActiveGuiDocument(); Gui::MDIView* view = doc->getActiveView(); - if (view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) { + if (view->isDerivedFrom()) { Gui::View3DInventorViewer* viewer = ((Gui::View3DInventor*)view)->getViewer(); viewer->setEditing(true); viewer->startSelection(Gui::View3DInventorViewer::Clip); diff --git a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp index 1cd9a2af14..22c8e6dec5 100644 --- a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp +++ b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp @@ -91,7 +91,7 @@ void TaskCreateNodeSet::Poly() { Gui::Document* doc = Gui::Application::Instance->activeDocument(); Gui::MDIView* view = doc->getActiveView(); - if (view->getTypeId().isDerivedFrom(Gui::View3DInventor::getClassTypeId())) { + if (view->isDerivedFrom()) { Gui::View3DInventorViewer* viewer = ((Gui::View3DInventor*)view)->getViewer(); viewer->setEditing(true); viewer->startSelection(Gui::View3DInventorViewer::Clip); diff --git a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp index 8caed56810..58fc8bc491 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintFluidBoundary.cpp @@ -226,7 +226,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary( if (pcAnalysis) { std::vector fem = pcAnalysis->Group.getValues(); for (auto it : fem) { - if (it->getTypeId().isDerivedFrom(Fem::FemMeshObject::getClassTypeId())) { + if (it->isDerivedFrom()) { pcMesh = static_cast(it); } } @@ -238,7 +238,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary( } if (pcMesh) { App::Property* prop = pcMesh->getPropertyByName("Shape"); // PropertyLink - if (prop && prop->getTypeId().isDerivedFrom(App::PropertyLink::getClassTypeId())) { + if (prop && prop->isDerivedFrom()) { App::PropertyLink* pcLink = static_cast(prop); Part::Feature* pcPart = dynamic_cast(pcLink->getValue()); if (pcPart) { // deduct dimension from part_obj.Shape.ShapeType @@ -267,7 +267,7 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary( if (pcAnalysis) { std::vector fem = pcAnalysis->Group.getValues(); for (auto it : fem) { - if (it->getTypeId().isDerivedFrom(Fem::FemSolverObject::getClassTypeId())) { + if (it->isDerivedFrom()) { pcSolver = static_cast(it); } } diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.cpp b/src/Mod/Fem/Gui/TaskPostBoxes.cpp index 4695b8ee15..f19453608a 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.cpp +++ b/src/Mod/Fem/Gui/TaskPostBoxes.cpp @@ -1332,8 +1332,7 @@ void TaskPostClip::collectImplicitFunctions() if (!pipelines.empty()) { Fem::FemPostPipeline* pipeline = pipelines.front(); if (pipeline->Functions.getValue() - && pipeline->Functions.getValue()->getTypeId() - == Fem::FemPostFunctionProvider::getClassTypeId()) { + && pipeline->Functions.getValue()->is()) { ui->FunctionBox->clear(); QStringList items; @@ -1383,8 +1382,7 @@ void TaskPostClip::onFunctionBoxCurrentIndexChanged(int idx) if (!pipelines.empty()) { Fem::FemPostPipeline* pipeline = pipelines.front(); if (pipeline->Functions.getValue() - && pipeline->Functions.getValue()->getTypeId() - == Fem::FemPostFunctionProvider::getClassTypeId()) { + && pipeline->Functions.getValue()->is()) { const std::vector& funcs = static_cast(pipeline->Functions.getValue()) @@ -1617,8 +1615,7 @@ void TaskPostCut::collectImplicitFunctions() if (!pipelines.empty()) { Fem::FemPostPipeline* pipeline = pipelines.front(); if (pipeline->Functions.getValue() - && pipeline->Functions.getValue()->getTypeId() - == Fem::FemPostFunctionProvider::getClassTypeId()) { + && pipeline->Functions.getValue()->is()) { ui->FunctionBox->clear(); QStringList items; @@ -1668,8 +1665,7 @@ void TaskPostCut::onFunctionBoxCurrentIndexChanged(int idx) if (!pipelines.empty()) { Fem::FemPostPipeline* pipeline = pipelines.front(); if (pipeline->Functions.getValue() - && pipeline->Functions.getValue()->getTypeId() - == Fem::FemPostFunctionProvider::getClassTypeId()) { + && pipeline->Functions.getValue()->is()) { const std::vector& funcs = static_cast(pipeline->Functions.getValue()) diff --git a/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp b/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp index b1b9c051e2..6eff36df47 100644 --- a/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp +++ b/src/Mod/Fem/Gui/ViewProviderAnalysis.cpp @@ -223,32 +223,32 @@ bool ViewProviderFemAnalysis::canDragObject(App::DocumentObject* obj) const if (!obj) { return false; } - if (obj->getTypeId().isDerivedFrom(Fem::FemMeshObject::getClassTypeId())) { + if (obj->isDerivedFrom()) { return true; } - else if (obj->getTypeId().isDerivedFrom(Fem::FemSolverObject::getClassTypeId())) { + else if (obj->isDerivedFrom()) { return true; } - else if (obj->getTypeId().isDerivedFrom(Fem::FemResultObject::getClassTypeId())) { + else if (obj->isDerivedFrom()) { return true; } - else if (obj->getTypeId().isDerivedFrom(Fem::Constraint::getClassTypeId())) { + else if (obj->isDerivedFrom()) { return true; } - else if (obj->getTypeId().isDerivedFrom(Fem::FemSetObject::getClassTypeId())) { + else if (obj->isDerivedFrom()) { return true; } else if (obj->getTypeId().isDerivedFrom(Base::Type::fromName("Fem::FeaturePython"))) { return true; } - else if (obj->getTypeId().isDerivedFrom(App::MaterialObject::getClassTypeId())) { + else if (obj->isDerivedFrom()) { return true; } - else if (obj->getTypeId().isDerivedFrom(App::TextDocument::getClassTypeId())) { + else if (obj->isDerivedFrom()) { return true; } #ifdef FC_USE_VTK - else if (obj->getTypeId().isDerivedFrom(Fem::FemPostObject::getClassTypeId())) { + else if (obj->isDerivedFrom()) { return true; } #endif diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp index 98046c3f77..d1e8b0711e 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemPostObject.cpp @@ -930,7 +930,7 @@ void ViewProviderFemPostObject::hide() App::DocumentObject* firstVisiblePostObject = nullptr; // step through the objects for (auto it : ObjectsList) { - if (it->getTypeId().isDerivedFrom(Fem::FemPostObject::getClassTypeId())) { + if (it->isDerivedFrom()) { if (!firstVisiblePostObject && it->Visibility.getValue() && !it->isDerivedFrom(Fem::FemPostDataAtPointFilter::getClassTypeId())) { firstVisiblePostObject = it;