From 3eda026ecb10d7b8015b2c9da21bc60773ee49f0 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sat, 4 Nov 2023 22:03:13 +0100 Subject: [PATCH] Sketcher Gui: Fix dead code clang-tidy --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 5 +---- src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h | 4 ---- src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfParabola.h | 5 +---- src/Mod/Sketcher/Gui/DrawSketchHandlerEllipse.h | 2 +- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index e43cde4d60..1078587904 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -4499,9 +4499,7 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector& selSe case 2:// {SelEdge} case 3:// {SelExternalEdge} { - GeoId1 = GeoId2 = selSeq.at(0).GeoId; - PosId1 = Sketcher::PointPos::start; - PosId2 = Sketcher::PointPos::end; + GeoId1 = selSeq.at(0).GeoId; arebothpointsorsegmentsfixed = isPointOrSegmentFixed(Obj, GeoId1); @@ -4549,7 +4547,6 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector& selSe GeoId1 = selSeq.at(0).GeoId; GeoId2 = selSeq.at(1).GeoId; PosId1 = selSeq.at(0).PosId; - PosId2 = selSeq.at(1).PosId; Base::Vector3d pnt = Obj->getPoint(GeoId1, PosId1); const Part::Geometry* geom = Obj->getGeometry(GeoId2); diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h index 8e53bdc466..41995bb324 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfEllipse.h @@ -298,10 +298,6 @@ public: minAxisPoint = centerPoint + minAxisDir; endAngle += M_PI / 2; startAngle += M_PI / 2; - phi -= M_PI / 2; - double t = a; - a = b; - b = t; // swap a,b } int currentgeoid = getHighestCurveIndex(); diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfParabola.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfParabola.h index 79a90dc7bc..b4f78ecdbb 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfParabola.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerArcOfParabola.h @@ -221,12 +221,9 @@ public: double ustartpoint = (cos(phi) * (startingPoint.y - axisPoint.y) - (startingPoint.x - axisPoint.x) * sin(phi)); - double uendpoint = - (cos(phi) * (endPoint.y - axisPoint.y) - (endPoint.x - axisPoint.x) * sin(phi)); - double startAngle = ustartpoint; - double endAngle = uendpoint; + double endAngle; bool isOriginalArcCCW = true; diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandlerEllipse.h b/src/Mod/Sketcher/Gui/DrawSketchHandlerEllipse.h index 161395b7bd..21cc1cff8e 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandlerEllipse.h +++ b/src/Mod/Sketcher/Gui/DrawSketchHandlerEllipse.h @@ -746,7 +746,7 @@ private: int count = 0; int limit = 25; // no infinite loops! bool success = false; - double tempB = b; + double tempB; // adjust b until our mangled vectors produce a good ellipse in GC_MakeEllipse // and the mangled major and minor lines in LinePy::PyInit(...) are such that