diff --git a/src/Mod/Path/App/FeaturePathCompound.cpp b/src/Mod/Path/App/FeaturePathCompound.cpp index f93bc21572..9b70b6f133 100644 --- a/src/Mod/Path/App/FeaturePathCompound.cpp +++ b/src/Mod/Path/App/FeaturePathCompound.cpp @@ -49,7 +49,7 @@ App::DocumentObjectExecReturn *FeatureCompound::execute() Path::Toolpath result; for (std::vector::const_iterator it= Paths.begin();it!=Paths.end();++it) { - if ((*it)->getTypeId().isDerivedFrom(Path::Feature::getClassTypeId())){ + if ((*it)->isDerivedFrom()){ const std::vector &cmds = static_cast(*it)->Path.getValue().getCommands(); const Base::Placement pl = static_cast(*it)->Placement.getValue(); for (std::vector::const_iterator it2= cmds.begin();it2!=cmds.end();++it2) { diff --git a/src/Mod/Path/App/FeaturePathCompoundPyImp.cpp b/src/Mod/Path/App/FeaturePathCompoundPyImp.cpp index 5d62b84258..0d87b1a00c 100644 --- a/src/Mod/Path/App/FeaturePathCompoundPyImp.cpp +++ b/src/Mod/Path/App/FeaturePathCompoundPyImp.cpp @@ -58,10 +58,10 @@ PyObject* FeaturePathCompoundPy::addObject(PyObject *args) FeatureCompound* comp = getFeaturePathCompoundPtr(); - if (comp->getTypeId().isDerivedFrom(Path::FeatureCompoundPython::getClassTypeId())) { + if (comp->isDerivedFrom()) { FeatureCompoundPython* comppy = static_cast(comp); App::Property* proxy = comppy->getPropertyByName("Proxy"); - if (proxy && proxy->getTypeId() == App::PropertyPythonObject::getClassTypeId()) { + if (proxy && proxy->is()) { Py::Object vp = static_cast(proxy)->getValue(); if (vp.hasAttr(std::string("addObject"))) { Py::Callable method(vp.getAttr(std::string("addObject"))); @@ -99,10 +99,10 @@ PyObject* FeaturePathCompoundPy::removeObject(PyObject *args) FeatureCompound* comp = getFeaturePathCompoundPtr(); - if (comp->getTypeId().isDerivedFrom(Path::FeatureCompoundPython::getClassTypeId())) { + if (comp->isDerivedFrom()) { FeatureCompoundPython* comppy = static_cast(comp); App::Property* proxy = comppy->getPropertyByName("Proxy"); - if (proxy && proxy->getTypeId() == App::PropertyPythonObject::getClassTypeId()) { + if (proxy && proxy->is()) { Py::Object vp = static_cast(proxy)->getValue(); if (vp.hasAttr(std::string("removeObject"))) { Py::Callable method(vp.getAttr(std::string("removeObject"))); diff --git a/src/Mod/Path/Gui/Command.cpp b/src/Mod/Path/Gui/Command.cpp index 0d817c5c74..0af7ec5ef9 100644 --- a/src/Mod/Path/Gui/Command.cpp +++ b/src/Mod/Path/Gui/Command.cpp @@ -66,7 +66,7 @@ void CmdPathArea::activated(int iMsg) if(addView && !areaName.empty()) addView = false; if(subnames.empty()) { - if(addView && pcObj->getTypeId().isDerivedFrom(Path::FeatureArea::getClassTypeId())) + if(addView && pcObj->isDerivedFrom()) areaName = pcObj->getNameInDocument(); sources << "FreeCAD.activeDocument()." << pcObj->getNameInDocument() << ","; continue; @@ -151,7 +151,7 @@ void CmdPathAreaWorkplane::activated(int iMsg) } const Part::Feature *pcObj = static_cast(selObj.getObject()); if(subnames.empty()) { - if(pcObj->getTypeId().isDerivedFrom(Path::FeatureArea::getClassTypeId())) { + if(pcObj->isDerivedFrom()) { if(!areaName.empty()){ Base::Console().Error("Please select one FeatureArea only\n"); return; @@ -232,7 +232,7 @@ void CmdPathCompound::activated(int iMsg) cmd << "["; Path::Feature *pcPathObject; for (std::vector::const_iterator it=Sel.begin();it!=Sel.end();++it) { - if ((*it).pObject->getTypeId().isDerivedFrom(Path::Feature::getClassTypeId())) { + if ((*it).pObject->isDerivedFrom()) { pcPathObject = static_cast((*it).pObject); cmd << "FreeCAD.activeDocument()." << pcPathObject->getNameInDocument() << ","; } else { diff --git a/src/Mod/Path/Gui/ViewProviderArea.cpp b/src/Mod/Path/Gui/ViewProviderArea.cpp index 8a2cca3282..40d0f6588a 100644 --- a/src/Mod/Path/Gui/ViewProviderArea.cpp +++ b/src/Mod/Path/Gui/ViewProviderArea.cpp @@ -54,7 +54,7 @@ bool ViewProviderArea::canDragObjects() const bool ViewProviderArea::canDragObject(App::DocumentObject* obj) const { - return obj && obj->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()); + return obj && obj->isDerivedFrom(); } void ViewProviderArea::dragObject(App::DocumentObject* obj) @@ -91,7 +91,7 @@ void ViewProviderArea::dropObject(App::DocumentObject* obj) void ViewProviderArea::updateData(const App::Property* prop) { PartGui::ViewProviderPart::updateData(prop); - if (prop->getTypeId().isDerivedFrom(App::PropertyLinkList::getClassTypeId())) { + if (prop->isDerivedFrom()) { std::vector pShapes = static_cast(prop)->getValues(); for (std::vector::iterator it = pShapes.begin(); it != pShapes.end(); ++it) { if (*it) @@ -141,7 +141,7 @@ bool ViewProviderAreaView::canDragObjects() const bool ViewProviderAreaView::canDragObject(App::DocumentObject* obj) const { - return obj && obj->getTypeId().isDerivedFrom(Path::FeatureArea::getClassTypeId()); + return obj && obj->isDerivedFrom(); } void ViewProviderAreaView::dragObject(App::DocumentObject* ) @@ -169,7 +169,7 @@ void ViewProviderAreaView::dropObject(App::DocumentObject* obj) void ViewProviderAreaView::updateData(const App::Property* prop) { PartGui::ViewProviderPlaneParametric::updateData(prop); - if (prop->getTypeId().isDerivedFrom(App::PropertyLink::getClassTypeId())) + if (prop->isDerivedFrom()) Gui::Application::Instance->hideViewProvider( static_cast(prop)->getValue()); } diff --git a/src/Mod/Path/Gui/ViewProviderPathShape.cpp b/src/Mod/Path/Gui/ViewProviderPathShape.cpp index cb0b45cdf3..f8e559695d 100644 --- a/src/Mod/Path/Gui/ViewProviderPathShape.cpp +++ b/src/Mod/Path/Gui/ViewProviderPathShape.cpp @@ -52,7 +52,7 @@ bool ViewProviderPathShape::canDragObjects() const bool ViewProviderPathShape::canDragObject(App::DocumentObject* obj) const { - return obj && obj->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()); + return obj && obj->isDerivedFrom(); } void ViewProviderPathShape::dragObject(App::DocumentObject* obj) @@ -89,7 +89,7 @@ void ViewProviderPathShape::dropObject(App::DocumentObject* obj) void ViewProviderPathShape::updateData(const App::Property* prop) { PathGui::ViewProviderPath::updateData(prop); - if (prop->getTypeId().isDerivedFrom(App::PropertyLinkList::getClassTypeId())) { + if (prop->isDerivedFrom()) { std::vector pShapes = static_cast(prop)->getValues(); for (std::vector::iterator it = pShapes.begin(); it != pShapes.end(); ++it) { if (*it)