diff --git a/src/Mod/TechDraw/App/DrawComplexSection.cpp b/src/Mod/TechDraw/App/DrawComplexSection.cpp index ebcfb76901..6fde6bec10 100644 --- a/src/Mod/TechDraw/App/DrawComplexSection.cpp +++ b/src/Mod/TechDraw/App/DrawComplexSection.cpp @@ -877,8 +877,7 @@ gp_Ax2 DrawComplexSection::getCSFromBase(const std::string sectionName) const // Base::Console().Message("DCS::getCSFromBase()\n"); App::DocumentObject* base = BaseView.getValue(); if (!base - || !base->getTypeId().isDerivedFrom( - TechDraw::DrawViewPart::getClassTypeId())) {//is second clause necessary? + || !base->isDerivedFrom()) {//is second clause necessary? //if this DCS does not have a baseView, we must use the existing SectionCS return getSectionCS(); } @@ -966,7 +965,7 @@ bool DrawComplexSection::isBaseValid() const //complex section is not based on an existing DVP return true; } - if (!base->getTypeId().isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) { + if (!base->isDerivedFrom()) { //this is probably an error somewhere. the valid options are base = a DVP, //or no base return false; diff --git a/src/Mod/TechDraw/App/DrawProjGroupItem.cpp b/src/Mod/TechDraw/App/DrawProjGroupItem.cpp index f331a4dbd6..17755f4ea8 100644 --- a/src/Mod/TechDraw/App/DrawProjGroupItem.cpp +++ b/src/Mod/TechDraw/App/DrawProjGroupItem.cpp @@ -183,7 +183,7 @@ DrawProjGroup* DrawProjGroupItem::getPGroup() const { std::vector parent = getInList(); for (std::vector::iterator it = parent.begin(); it != parent.end(); ++it) { - if ((*it)->getTypeId().isDerivedFrom(DrawProjGroup::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { DrawProjGroup* result = dynamic_cast(*it); return result; } diff --git a/src/Mod/TechDraw/App/DrawTemplate.cpp b/src/Mod/TechDraw/App/DrawTemplate.cpp index c8faadd5d7..35709cd26e 100644 --- a/src/Mod/TechDraw/App/DrawTemplate.cpp +++ b/src/Mod/TechDraw/App/DrawTemplate.cpp @@ -86,7 +86,7 @@ DrawPage* DrawTemplate::getParentPage() const TechDraw::DrawPage* page(nullptr); std::vector parents = getInList(); for (auto& obj : parents) { - if (obj->getTypeId().isDerivedFrom(DrawPage::getClassTypeId())) { + if (obj->isDerivedFrom()) { page = static_cast(obj); break; } diff --git a/src/Mod/TechDraw/App/DrawView.cpp b/src/Mod/TechDraw/App/DrawView.cpp index 99a0e2eecb..fd7d6545ab 100644 --- a/src/Mod/TechDraw/App/DrawView.cpp +++ b/src/Mod/TechDraw/App/DrawView.cpp @@ -303,7 +303,7 @@ int DrawView::countParentPages() const parentAll.erase(last, parentAll.end()); for (auto& parent : parentAll) { - if (parent->getTypeId().isDerivedFrom(DrawPage::getClassTypeId())) { + if (parent->isDerivedFrom()) { count++; } } @@ -320,9 +320,9 @@ DrawPage* DrawView::findParentPage() const DrawViewCollection *collection = nullptr; std::vector parentsAll = getInList(); for (auto& parent : parentsAll) { - if (parent->getTypeId().isDerivedFrom(DrawPage::getClassTypeId())) { + if (parent->isDerivedFrom()) { page = static_cast(parent); - } else if (parent->getTypeId().isDerivedFrom(DrawViewCollection::getClassTypeId())) { + } else if (parent->isDerivedFrom()) { collection = static_cast(parent); page = collection->findParentPage(); } @@ -344,9 +344,9 @@ std::vector DrawView::findAllParentPages() const std::vector parentsAll = getInList(); for (auto& parent : parentsAll) { - if (parent->getTypeId().isDerivedFrom(DrawPage::getClassTypeId())) { + if (parent->isDerivedFrom()) { page = static_cast(parent); - } else if (parent->getTypeId().isDerivedFrom(DrawViewCollection::getClassTypeId())) { + } else if (parent->isDerivedFrom()) { collection = static_cast(parent); page = collection->findParentPage(); } @@ -368,7 +368,7 @@ bool DrawView::isInClip() { std::vector parent = getInList(); for (std::vector::iterator it = parent.begin(); it != parent.end(); ++it) { - if ((*it)->getTypeId().isDerivedFrom(DrawViewClip::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { return true; } } @@ -380,7 +380,7 @@ DrawViewClip* DrawView::getClipGroup() std::vector parent = getInList(); App::DocumentObject* obj = nullptr; for (std::vector::iterator it = parent.begin(); it != parent.end(); ++it) { - if ((*it)->getTypeId().isDerivedFrom(DrawViewClip::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { obj = (*it); DrawViewClip* result = dynamic_cast(obj); return result; @@ -486,7 +486,7 @@ std::vector DrawView::getLeaders() const std::vector result; std::vector children = getInList(); for (std::vector::iterator it = children.begin(); it != children.end(); ++it) { - if ((*it)->getTypeId().isDerivedFrom(DrawLeaderLine::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { TechDraw::DrawLeaderLine* lead = dynamic_cast(*it); result.push_back(lead); } diff --git a/src/Mod/TechDraw/App/DrawViewClip.cpp b/src/Mod/TechDraw/App/DrawViewClip.cpp index d489c0c13d..4596b8f228 100644 --- a/src/Mod/TechDraw/App/DrawViewClip.cpp +++ b/src/Mod/TechDraw/App/DrawViewClip.cpp @@ -113,7 +113,7 @@ App::DocumentObjectExecReturn *DrawViewClip::execute() std::vector children = Views.getValues(); for (std::vector::iterator it = children.begin(); it != children.end(); ++it) { - if ((*it)->getTypeId().isDerivedFrom(DrawView::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { TechDraw::DrawView *view = static_cast(*it); view->requestPaint(); } @@ -142,7 +142,7 @@ std::vector DrawViewClip::getChildViewNames() std::vector childNames; std::vector children = Views.getValues(); for (std::vector::iterator it = children.begin(); it != children.end(); ++it) { - if ((*it)->getTypeId().isDerivedFrom(DrawView::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { std::string name = (*it)->getNameInDocument(); childNames.push_back(name); } diff --git a/src/Mod/TechDraw/App/DrawViewCollection.cpp b/src/Mod/TechDraw/App/DrawViewCollection.cpp index 314cb24aa5..e90160e95a 100644 --- a/src/Mod/TechDraw/App/DrawViewCollection.cpp +++ b/src/Mod/TechDraw/App/DrawViewCollection.cpp @@ -114,7 +114,7 @@ void DrawViewCollection::rebuildViewList() std::vector newViews; std::vector children = getOutList(); for (std::vector::iterator it = children.begin(); it != children.end(); ++it) { - if ((*it)->getTypeId().isDerivedFrom(DrawView::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { bool found = false; for (auto& v:currViews) { if (v == (*it)) { @@ -140,7 +140,7 @@ int DrawViewCollection::countChildren() const std::vector &views = Views.getValues(); for(std::vector::const_iterator it = views.begin(); it != views.end(); ++it) { - if((*it)->getTypeId().isDerivedFrom(TechDraw::DrawViewCollection::getClassTypeId())) { + if((*it)->isDerivedFrom()) { TechDraw::DrawViewCollection *viewCollection = static_cast(*it); numChildren += viewCollection->countChildren() + 1; } else { diff --git a/src/Mod/TechDraw/App/DrawViewDetail.cpp b/src/Mod/TechDraw/App/DrawViewDetail.cpp index 5f5cab16a3..56308c31fd 100644 --- a/src/Mod/TechDraw/App/DrawViewDetail.cpp +++ b/src/Mod/TechDraw/App/DrawViewDetail.cpp @@ -141,7 +141,7 @@ App::DocumentObjectExecReturn* DrawViewDetail::execute() return DrawView::execute(); } - if (!baseObj->getTypeId().isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) { + if (!baseObj->isDerivedFrom()) { //this can only happen via scripting? return DrawView::execute(); } diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index c0cd5402ca..17b605da75 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -723,7 +723,7 @@ std::vector DrawViewPart::getHatches() const std::vector result; std::vector children = getInList(); for (auto& child : children) { - if (child->getTypeId().isDerivedFrom(DrawHatch::getClassTypeId()) && !child->isRemoving()) { + if (child->isDerivedFrom() && !child->isRemoving()) { TechDraw::DrawHatch* hatch = dynamic_cast(child); result.push_back(hatch); } @@ -737,7 +737,7 @@ std::vector DrawViewPart::getGeomHatches() const std::vector result; std::vector children = getInList(); for (auto& child : children) { - if (child->getTypeId().isDerivedFrom(DrawGeomHatch::getClassTypeId()) + if (child->isDerivedFrom() && !child->isRemoving()) { TechDraw::DrawGeomHatch* geom = dynamic_cast(child); result.push_back(geom); @@ -757,7 +757,7 @@ std::vector DrawViewPart::getDimensions() const std::vector::iterator newEnd = std::unique(children.begin(), children.end()); for (std::vector::iterator it = children.begin(); it != newEnd; ++it) { - if ((*it)->getTypeId().isDerivedFrom(DrawViewDimension::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { TechDraw::DrawViewDimension* dim = dynamic_cast(*it); result.push_back(dim); } @@ -773,7 +773,7 @@ std::vector DrawViewPart::getBalloons() const std::vector::iterator newEnd = std::unique(children.begin(), children.end()); for (std::vector::iterator it = children.begin(); it != newEnd; ++it) { - if ((*it)->getTypeId().isDerivedFrom(DrawViewBalloon::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { TechDraw::DrawViewBalloon* balloon = dynamic_cast(*it); result.push_back(balloon); } @@ -1164,7 +1164,7 @@ std::vector DrawViewPart::getSectionRefs() const std::vector result; std::vector inObjs = getInList(); for (auto& o : inObjs) { - if (o->getTypeId().isDerivedFrom(DrawViewSection::getClassTypeId())) { + if (o->isDerivedFrom()) { result.push_back(static_cast(o)); } } @@ -1176,7 +1176,7 @@ std::vector DrawViewPart::getDetailRefs() const std::vector result; std::vector inObjs = getInList(); for (auto& o : inObjs) { - if (o->getTypeId().isDerivedFrom(DrawViewDetail::getClassTypeId())) { + if (o->isDerivedFrom()) { if (!o->isRemoving()) { result.push_back(static_cast(o)); } diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index cb72d0d190..2d35be7d8c 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -319,8 +319,7 @@ void DrawViewSection::onChanged(const App::Property* prop) else if (prop == &BaseView) { // if the BaseView is a Section, then the option of using UsePreviousCut is // valid. - if (BaseView.getValue() && BaseView.getValue()->getTypeId().isDerivedFrom( - TechDraw::DrawViewSection::getClassTypeId())) { + if (BaseView.getValue() && BaseView.getValue()->isDerivedFrom()) { UsePreviousCut.setStatus(App::Property::ReadOnly, false); } else { @@ -346,18 +345,18 @@ TopoDS_Shape DrawViewSection::getShapeToCut() } TopoDS_Shape shapeToCut; - if (base->getTypeId().isDerivedFrom(TechDraw::DrawViewSection::getClassTypeId())) { + if (base->isDerivedFrom()) { dvs = static_cast(base); shapeToCut = dvs->getShapeToCut(); if (UsePreviousCut.getValue()) { shapeToCut = dvs->getCutShapeRaw(); } } - else if (base->getTypeId().isDerivedFrom(TechDraw::DrawViewDetail::getClassTypeId())) { + else if (base->isDerivedFrom()) { dvd = static_cast(base); shapeToCut = dvd->getDetailShape(); } - else if (base->getTypeId().isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) { + else if (base->isDerivedFrom()) { dvp = static_cast(base); shapeToCut = dvp->getSourceShape(); if (FuseBeforeCut.getValue()) { @@ -430,7 +429,7 @@ App::DocumentObjectExecReturn* DrawViewSection::execute() bool DrawViewSection::isBaseValid() const { App::DocumentObject* base = BaseView.getValue(); - if (base && base->getTypeId().isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) { + if (base && base->isDerivedFrom()) { return true; } return false; @@ -683,7 +682,7 @@ void DrawViewSection::postSectionCutTasks() // Base::Console().Message("DVS::postSectionCutTasks()\n"); std::vector children = getInList(); for (auto& c : children) { - if (c->getTypeId().isDerivedFrom(DrawViewPart::getClassTypeId())) { + if (c->isDerivedFrom()) { // details or sections of this need cut shape c->recomputeFeature(); } @@ -1191,7 +1190,7 @@ TopoDS_Face DrawViewSection::getSectionTopoDSFace(int i) TechDraw::DrawViewPart* DrawViewSection::getBaseDVP() const { App::DocumentObject* base = BaseView.getValue(); - if (base && base->getTypeId().isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) { + if (base && base->isDerivedFrom()) { TechDraw::DrawViewPart* baseDVP = static_cast(base); return baseDVP; } diff --git a/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp b/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp index 2671a8df98..328d9512fd 100644 --- a/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp +++ b/src/Mod/TechDraw/App/DrawViewSpreadsheet.cpp @@ -100,7 +100,7 @@ App::DocumentObjectExecReturn *DrawViewSpreadsheet::execute() std::string scellend = CellEnd.getValue(); if (!link) return new App::DocumentObjectExecReturn("No spreadsheet linked"); - if (!link->getTypeId().isDerivedFrom(Spreadsheet::Sheet::getClassTypeId())) + if (!link->isDerivedFrom()) return new App::DocumentObjectExecReturn("The linked object is not a spreadsheet"); if (scellstart.empty() || scellend.empty()) return new App::DocumentObjectExecReturn("Empty cell value"); diff --git a/src/Mod/TechDraw/App/DrawWeldSymbol.cpp b/src/Mod/TechDraw/App/DrawWeldSymbol.cpp index f172875ca0..05b17e800d 100644 --- a/src/Mod/TechDraw/App/DrawWeldSymbol.cpp +++ b/src/Mod/TechDraw/App/DrawWeldSymbol.cpp @@ -127,7 +127,7 @@ std::vector DrawWeldSymbol::getTiles() const } for(std::vector::iterator it = tiles.begin(); it != tiles.end(); it++) { - if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawTileWeld::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { App::DocumentObject* doTemp = (*it); DrawTileWeld* temp = static_cast(doTemp); result.push_back(temp); diff --git a/src/Mod/TechDraw/App/FeatureProjection.cpp b/src/Mod/TechDraw/App/FeatureProjection.cpp index 139bce3691..41d0a7a019 100644 --- a/src/Mod/TechDraw/App/FeatureProjection.cpp +++ b/src/Mod/TechDraw/App/FeatureProjection.cpp @@ -67,7 +67,7 @@ App::DocumentObjectExecReturn *FeatureProjection::execute() App::DocumentObject* link = Source.getValue(); if (!link) return new App::DocumentObjectExecReturn("No object linked"); - if (!link->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) + if (!link->isDerivedFrom()) return new App::DocumentObjectExecReturn("Linked object is not a Part object"); const TopoDS_Shape& shape = static_cast(link)->Shape.getShape().getShape(); if (shape.IsNull()) diff --git a/src/Mod/TechDraw/App/ShapeExtractor.cpp b/src/Mod/TechDraw/App/ShapeExtractor.cpp index 51595262eb..b71765cfac 100644 --- a/src/Mod/TechDraw/App/ShapeExtractor.cpp +++ b/src/Mod/TechDraw/App/ShapeExtractor.cpp @@ -68,14 +68,14 @@ std::vector ShapeExtractor::getShapes2d(const std::vector objs = gex->Group.getValues(); for (auto& d: objs) { if (is2dObject(d)) { - if (d->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { + if (d->isDerivedFrom()) { shapes2d.push_back(getLocatedShape(d)); } } } } else { if (is2dObject(l)) { - if (l->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { + if (l->isDerivedFrom()) { shapes2d.push_back(getLocatedShape(l)); } // other 2d objects would go here - Draft objects? } @@ -95,7 +95,7 @@ TopoDS_Shape ShapeExtractor::getShapes(const std::vector l if (is2dObject(l) && !include2d) { continue; } - if (l->getTypeId().isDerivedFrom(App::Link::getClassTypeId())) { + if (l->isDerivedFrom()) { App::Link* xLink = dynamic_cast(l); std::vector xShapes = getXShapes(xLink); if (!xShapes.empty()) { @@ -170,7 +170,7 @@ std::vector ShapeExtractor::getXShapes(const App::Link* xLink) bool childNeedsTransform = false; Base::Placement childPlm; Base::Matrix4D childScale; - if (l->getTypeId().isDerivedFrom(App::LinkElement::getClassTypeId())) { + if (l->isDerivedFrom()) { App::LinkElement* cLinkElem = static_cast(l); if (cLinkElem->hasPlacement()) { childPlm = cLinkElem->getLinkPlacementProperty()->getValue(); @@ -254,7 +254,7 @@ std::vector ShapeExtractor::getShapesFromObject(const App::Documen const App::GroupExtension* gex = dynamic_cast(docObj); App::Property* gProp = docObj->getPropertyByName("Group"); App::Property* sProp = docObj->getPropertyByName("Shape"); - if (docObj->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId())) { + if (docObj->isDerivedFrom()) { result.push_back(getLocatedShape(docObj)); } else if (gex) { //is a group extension std::vector objs = gex->Group.getValues(); diff --git a/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp b/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp index 2d84b30700..ca183898b1 100644 --- a/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp +++ b/src/Mod/TechDraw/Gui/AppTechDrawGuiPy.cpp @@ -132,7 +132,7 @@ private: PyObject* item = (*it).ptr(); if (PyObject_TypeCheck(item, &(App::DocumentObjectPy::Type))) { App::DocumentObject* obj = static_cast(item)->getDocumentObjectPtr(); - if (obj->getTypeId().isDerivedFrom(TechDraw::DrawPage::getClassTypeId())) { + if (obj->isDerivedFrom()) { page = static_cast(obj); Gui::Document* activeGui = Gui::Application::Instance->getDocument(page->getDocument()); Gui::ViewProvider* vp = activeGui->getViewProvider(obj); diff --git a/src/Mod/TechDraw/Gui/QGIProjGroup.cpp b/src/Mod/TechDraw/Gui/QGIProjGroup.cpp index 474e5c1f63..e3e5f7aabc 100644 --- a/src/Mod/TechDraw/Gui/QGIProjGroup.cpp +++ b/src/Mod/TechDraw/Gui/QGIProjGroup.cpp @@ -98,7 +98,7 @@ QVariant QGIProjGroup::itemChange(GraphicsItemChange change, const QVariant &val QGIView* gView = dynamic_cast(childItem); if(gView) { TechDraw::DrawView *fView = gView->getViewObject(); - if(fView->getTypeId().isDerivedFrom(TechDraw::DrawProjGroupItem::getClassTypeId())) { + if(fView->isDerivedFrom()) { TechDraw::DrawProjGroupItem *projItemPtr = static_cast(fView); QString type = QString::fromLatin1(projItemPtr->Type.getValueAsString()); diff --git a/src/Mod/TechDraw/Gui/QGSPage.cpp b/src/Mod/TechDraw/Gui/QGSPage.cpp index c2b0391ed2..d788a2086f 100644 --- a/src/Mod/TechDraw/Gui/QGSPage.cpp +++ b/src/Mod/TechDraw/Gui/QGSPage.cpp @@ -910,7 +910,7 @@ void QGSPage::findMissingViews(const std::vector& list, if (!hasQView(*it)) missing.push_back(*it); - if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawViewCollection::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { std::vector missingChildViews; TechDraw::DrawViewCollection* collection = dynamic_cast(*it); diff --git a/src/Mod/TechDraw/Gui/ViewProviderAnnotation.cpp b/src/Mod/TechDraw/Gui/ViewProviderAnnotation.cpp index 0a7790b96a..9d05f13b7a 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderAnnotation.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderAnnotation.cpp @@ -69,10 +69,10 @@ std::vector ViewProviderAnnotation::claimChildren() const try { for (std::vector::const_iterator it = views.begin(); it != views.end(); ++it) { - if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawViewBalloon::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { temp.push_back((*it)); } - else if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawLeaderLine::getClassTypeId())) { + else if ((*it)->isDerivedFrom()) { temp.push_back((*it)); } } diff --git a/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp b/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp index ca43f23f5f..a5d8f8639a 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp @@ -135,7 +135,7 @@ void ViewProviderDrawingView::show() if (!obj || obj->isRestoring()) return; - if (obj->getTypeId().isDerivedFrom(TechDraw::DrawView::getClassTypeId())) { + if (obj->isDerivedFrom()) { QGIView* qView = getQView(); if (qView) { qView->draw(); @@ -151,7 +151,7 @@ void ViewProviderDrawingView::hide() if (!obj || obj->isRestoring()) return; - if (obj->getTypeId().isDerivedFrom(TechDraw::DrawView::getClassTypeId())) { + if (obj->isDerivedFrom()) { QGIView* qView = getQView(); if (qView) { //note: hiding an item in the scene clears its selection status diff --git a/src/Mod/TechDraw/Gui/ViewProviderLeader.cpp b/src/Mod/TechDraw/Gui/ViewProviderLeader.cpp index b499ce78b3..f3cad5c2ee 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderLeader.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderLeader.cpp @@ -142,9 +142,9 @@ std::vector ViewProviderLeader::claimChildren() const const std::vector &views = getFeature()->getInList(); try { for(std::vector::const_iterator it = views.begin(); it != views.end(); ++it) { - if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawRichAnno::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { temp.push_back((*it)); - } else if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawWeldSymbol::getClassTypeId())) { + } else if ((*it)->isDerivedFrom()) { temp.push_back((*it)); } } diff --git a/src/Mod/TechDraw/Gui/ViewProviderViewClip.cpp b/src/Mod/TechDraw/Gui/ViewProviderViewClip.cpp index fef98af60c..af7b8513b0 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderViewClip.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderViewClip.cpp @@ -64,7 +64,7 @@ void ViewProviderViewClip::show() App::DocumentObject* obj = getObject(); if (!obj || obj->isRestoring()) return; - if (obj->getTypeId().isDerivedFrom(TechDraw::DrawViewClip::getClassTypeId())) { + if (obj->isDerivedFrom()) { std::vector inp = obj->getInList(); for (std::vector::iterator it = inp.begin(); it != inp.end(); ++it) (*it)->touch(); @@ -79,7 +79,7 @@ void ViewProviderViewClip::hide() App::DocumentObject* obj = getObject(); if (!obj || obj->isRestoring()) return; - if (obj->getTypeId().isDerivedFrom(TechDraw::DrawViewClip::getClassTypeId())) { + if (obj->isDerivedFrom()) { std::vector inp = obj->getInList(); for (std::vector::iterator it = inp.begin(); it != inp.end(); ++it) (*it)->touch(); diff --git a/src/Mod/TechDraw/Gui/ViewProviderViewPart.cpp b/src/Mod/TechDraw/Gui/ViewProviderViewPart.cpp index 847d07edb9..1cb8c28ce9 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderViewPart.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderViewPart.cpp @@ -199,7 +199,7 @@ std::vector ViewProviderViewPart::claimChildren() const const std::vector &views = getViewPart()->getInList(); try { for(std::vector::const_iterator it = views.begin(); it != views.end(); ++it) { - if((*it)->getTypeId().isDerivedFrom(TechDraw::DrawViewDimension::getClassTypeId())) { + if((*it)->isDerivedFrom()) { //TODO: make a list, then prune it. should be faster? bool skip = false; std::string dimName = (*it)->getNameInDocument(); @@ -213,15 +213,15 @@ std::vector ViewProviderViewPart::claimChildren() const if (!skip) { temp.push_back(*it); } - } else if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawHatch::getClassTypeId())) { + } else if ((*it)->isDerivedFrom()) { temp.push_back((*it)); - } else if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawGeomHatch::getClassTypeId())) { + } else if ((*it)->isDerivedFrom()) { temp.push_back((*it)); - } else if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawViewBalloon::getClassTypeId())) { + } else if ((*it)->isDerivedFrom()) { temp.push_back((*it)); - } else if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawRichAnno::getClassTypeId())) { + } else if ((*it)->isDerivedFrom()) { temp.push_back((*it)); - } else if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawLeaderLine::getClassTypeId())) { + } else if ((*it)->isDerivedFrom()) { temp.push_back((*it)); } } diff --git a/src/Mod/TechDraw/Gui/ViewProviderWeld.cpp b/src/Mod/TechDraw/Gui/ViewProviderWeld.cpp index 9002e12f20..8b046d7f2b 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderWeld.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderWeld.cpp @@ -82,7 +82,7 @@ std::vector ViewProviderWeld::claimChildren() const const std::vector &tiles = getFeature()->getInList(); try { for(std::vector::const_iterator it = tiles.begin(); it != tiles.end(); ++it) { - if ((*it)->getTypeId().isDerivedFrom(TechDraw::DrawTile::getClassTypeId())) { + if ((*it)->isDerivedFrom()) { temp.push_back((*it)); } }