From e9187412d9b3b372ee4c1d7e2fc7a0bf08a2e647 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 7 Oct 2023 09:38:42 +0200 Subject: [PATCH] Sketcher: Example new type checking template function usage =========================================================== Just two small refactor examples of how to use the type checking template functions. --- src/Mod/Sketcher/App/SketchObject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 87fad0f0ff..3773396bc2 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -914,7 +914,7 @@ int SketchObject::movePoint(int GeoId, PointPos PosId, const Base::Vector3d& toP Base::Vector3d SketchObject::getPoint(const Part::Geometry *geo, PointPos PosId) { - if (geo->getTypeId() == Part::GeomPoint::getClassTypeId()) { + if (geo->is()) { const Part::GeomPoint *p = static_cast(geo); if (PosId == PointPos::start || PosId == PointPos::mid || PosId == PointPos::end) return p->getPoint(); @@ -2108,8 +2108,8 @@ int SketchObject::fillet(int GeoId1, int GeoId2, const Base::Vector3d& refPnt1, return 0; } - else if (geo1->isDerivedFrom(Part::GeomBoundedCurve::getClassTypeId()) - && geo2->isDerivedFrom(Part::GeomBoundedCurve::getClassTypeId())) { + else if (geo1->isDerivedFrom() + && geo2->isDerivedFrom()) { auto distancetorefpoints = [](Base::Vector3d ip1, Base::Vector3d ip2, Base::Vector3d ref1, Base::Vector3d ref2) {