From 875f9eaad6a59abd70775c0b67a7f10d92128a5a Mon Sep 17 00:00:00 2001 From: luz paz Date: Wed, 16 Nov 2022 17:53:42 -0500 Subject: [PATCH] Sketcher: remove trailing whitespace --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 2 +- .../Gui/PropertyConstraintListItem.cpp | 2 +- src/Mod/Sketcher/Gui/TaskSketcherValidation.h | 2 +- src/Mod/Sketcher/InitGui.py | 2 +- src/Mod/Sketcher/ProfileLib/RegularPolygon.py | 8 +++---- src/Mod/Sketcher/Profiles.py | 2 +- .../SketcherTests/TestSketchExpression.py | 4 ++-- .../SketcherTests/TestSketchFillet.py | 4 ++-- .../SketcherTests/TestSketcherSolver.py | 3 ++- src/Mod/Sketcher/TestSketcherGui.py | 24 +++++++++---------- 10 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 5238dd568a..6afa2a92c6 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -2073,7 +2073,7 @@ void CmdSketcherConstrainCoincident::applyConstraint(std::vector &sel case 4: // {SelExternalEdge, SelEdge} //Concentric for circles, ellipse, arc, arcofEllipse only. if (!isGeoConcentricCompatible(Obj->getGeometry(GeoId1)) || !isGeoConcentricCompatible(Obj->getGeometry(GeoId2))) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), QObject::tr("Select two vertices from the sketch for a coincident constraint, or two circles, ellipses, arcs or arcs of ellipse for a concentric constraint.")); return; } diff --git a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp index 411cb4fe3f..c89aa89853 100644 --- a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp +++ b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp @@ -109,7 +109,7 @@ void PropertyConstraintListItem::initialize() item->setObjectName(internalName); this->appendChild(item); } - + item->bind(list->createPath(id-1)); item->setAutoApply(false); } diff --git a/src/Mod/Sketcher/Gui/TaskSketcherValidation.h b/src/Mod/Sketcher/Gui/TaskSketcherValidation.h index 2b7cc58b27..fdcb49c65b 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherValidation.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherValidation.h @@ -32,7 +32,7 @@ #include class SoGroup; -namespace Sketcher { class SketchObject; } +namespace Sketcher { class SketchObject; } namespace SketcherGui { diff --git a/src/Mod/Sketcher/InitGui.py b/src/Mod/Sketcher/InitGui.py index c3247cb21a..f48c26b0c0 100644 --- a/src/Mod/Sketcher/InitGui.py +++ b/src/Mod/Sketcher/InitGui.py @@ -47,7 +47,7 @@ class SketcherWorkbench ( Workbench ): import Profiles except ImportError: print("Error in Profiles module") - + def GetClassName(self): return "SketcherGui::Workbench" diff --git a/src/Mod/Sketcher/ProfileLib/RegularPolygon.py b/src/Mod/Sketcher/ProfileLib/RegularPolygon.py index 3d7deeca91..8db24642b1 100644 --- a/src/Mod/Sketcher/ProfileLib/RegularPolygon.py +++ b/src/Mod/Sketcher/ProfileLib/RegularPolygon.py @@ -31,9 +31,9 @@ App = FreeCAD Gui = FreeCADGui def makeRegularPolygon( - sketch, - sides, - centerPoint=App.Vector(0,0,0), + sketch, + sides, + centerPoint=App.Vector(0,0,0), firstCornerPoint=App.Vector(-20.00,34.64,0), construction=False): @@ -58,7 +58,7 @@ def makeRegularPolygon( 0 )) geoList = [] - for i in range(0,sides-1): + for i in range(0,sides-1): geoList.append(Part.LineSegment(pointList[i],pointList[i+1])) geoList.append(Part.LineSegment(pointList[sides-1],pointList[0])) geoList.append(Part.Circle(centerPoint,App.Vector(0,0,1),diffVec.Length)) diff --git a/src/Mod/Sketcher/Profiles.py b/src/Mod/Sketcher/Profiles.py index 53ef998a91..f990ae0c39 100644 --- a/src/Mod/Sketcher/Profiles.py +++ b/src/Mod/Sketcher/Profiles.py @@ -54,7 +54,7 @@ class _CommandProfileHexagon1: 'Accel': "", 'CmdType': "ForEdit", 'ToolTip': QtCore.QT_TRANSLATE_NOOP("Sketcher_ProfilesHexagon1","Creates a hexagonal profile in the sketch")} - + def Activated(self): FreeCAD.ActiveDocument.openTransaction("Create hexagon profile") FreeCADGui.addModule("ProfileLib.Hexagon") diff --git a/src/Mod/Sketcher/SketcherTests/TestSketchExpression.py b/src/Mod/Sketcher/SketcherTests/TestSketchExpression.py index 6c3c0dc50f..1662a38b68 100644 --- a/src/Mod/Sketcher/SketcherTests/TestSketchExpression.py +++ b/src/Mod/Sketcher/SketcherTests/TestSketchExpression.py @@ -56,8 +56,8 @@ class TestSketchExpression(unittest.TestCase): sketch.addConstraint(conList) del geoList, conList - length = sketch.addConstraint(Sketcher.Constraint('Distance',0,6.0)) - height = sketch.addConstraint(Sketcher.Constraint('Distance',3,5.0)) + length = sketch.addConstraint(Sketcher.Constraint('Distance',0,6.0)) + height = sketch.addConstraint(Sketcher.Constraint('Distance',3,5.0)) sketch.renameConstraint(length, u'Length') sketch.setExpression('Constraints[{}]'.format(height), u'.Constraints.Length') diff --git a/src/Mod/Sketcher/SketcherTests/TestSketchFillet.py b/src/Mod/Sketcher/SketcherTests/TestSketchFillet.py index 2c076613dc..c10dac09ea 100644 --- a/src/Mod/Sketcher/SketcherTests/TestSketchFillet.py +++ b/src/Mod/Sketcher/SketcherTests/TestSketchFillet.py @@ -45,7 +45,7 @@ def BoxCircle(SketchFeature): right_midpoint = App.Vector(2, 1, 0) circle = int(SketchFeature.GeometryCount) SketchFeature.addGeometry(Part.Circle(App.Vector(0,0,0), App.Vector(0,0,1), 1),False) - SketchFeature.addConstraint(Sketcher.Constraint('Radius',circle,1)) + SketchFeature.addConstraint(Sketcher.Constraint('Radius',circle,1)) SketchFeature.addConstraint(Sketcher.Constraint('Coincident',top_edge,2,circle,3)) # Since the circle center is coincident with the corner, there are three coincident points # and thus the simpler fillet() call would get confused. Instead we'll need to point at the two @@ -59,7 +59,7 @@ def PointOnObject(SketchFeature): CreateRectangleSketch(SketchFeature, [0, 0], [2, 2]) circle = int(SketchFeature.GeometryCount) SketchFeature.addGeometry(Part.Circle(App.Vector(12,3,0), App.Vector(0,0,1), 1),False) - SketchFeature.addConstraint(Sketcher.Constraint('Radius',circle,1)) + SketchFeature.addConstraint(Sketcher.Constraint('Radius',circle,1)) SketchFeature.addConstraint(Sketcher.Constraint('PointOnObject',top_edge,2,circle)) SketchFeature.fillet(top_edge, 2, 0.25, True, True) diff --git a/src/Mod/Sketcher/SketcherTests/TestSketcherSolver.py b/src/Mod/Sketcher/SketcherTests/TestSketcherSolver.py index 327b3aceb2..8b34f0d542 100644 --- a/src/Mod/Sketcher/SketcherTests/TestSketcherSolver.py +++ b/src/Mod/Sketcher/SketcherTests/TestSketcherSolver.py @@ -1,4 +1,5 @@ -# (c) Juergen Riegel (FreeCAD@juergen-riegel.net) 2011 LGPL * +#************************************************************************** +# Copyright (c) 2011 Juergen Riegel * # * # This file is part of the FreeCAD CAx development system. * # * diff --git a/src/Mod/Sketcher/TestSketcherGui.py b/src/Mod/Sketcher/TestSketcherGui.py index f701887072..8f97f212f0 100644 --- a/src/Mod/Sketcher/TestSketcherGui.py +++ b/src/Mod/Sketcher/TestSketcherGui.py @@ -28,16 +28,16 @@ #class SketcherGuiTestCases(unittest.TestCase): -# def setUp(self): -# self.Doc = FreeCAD.newDocument("SketchGuiTest") +# def setUp(self): +# self.Doc = FreeCAD.newDocument("SketchGuiTest") # -# def testBoxCase(self): -# self.Box = self.Doc.addObject('Sketcher::SketchObject','SketchBox') -# self.Box.addGeometry(Part.LineSegment(App.Vector(-99.230339,36.960674,0),App.Vector(69.432587,36.960674,0))) -# self.Box.addGeometry(Part.LineSegment(App.Vector(69.432587,36.960674,0),App.Vector(69.432587,-53.196629,0))) -# self.Box.addGeometry(Part.LineSegment(App.Vector(69.432587,-53.196629,0),App.Vector(-99.230339,-53.196629,0))) -# self.Box.addGeometry(Part.LineSegment(App.Vector(-99.230339,-53.196629,0),App.Vector(-99.230339,36.960674,0))) -# -# def tearDown(self): -# #closing doc -# FreeCAD.closeDocument("SketchGuiTest") +# def testBoxCase(self): +# self.Box = self.Doc.addObject('Sketcher::SketchObject','SketchBox') +# self.Box.addGeometry(Part.LineSegment(App.Vector(-99.230339,36.960674,0),App.Vector(69.432587,36.960674,0))) +# self.Box.addGeometry(Part.LineSegment(App.Vector(69.432587,36.960674,0),App.Vector(69.432587,-53.196629,0))) +# self.Box.addGeometry(Part.LineSegment(App.Vector(69.432587,-53.196629,0),App.Vector(-99.230339,-53.196629,0))) +# self.Box.addGeometry(Part.LineSegment(App.Vector(-99.230339,-53.196629,0),App.Vector(-99.230339,36.960674,0))) +# +# def tearDown(self): +# #closing doc +# FreeCAD.closeDocument("SketchGuiTest")