diff --git a/package/fedora/tests/gui_tests.fmf b/package/fedora/tests/gui_tests.fmf index 44c1d1cfaa..886dba139f 100644 --- a/package/fedora/tests/gui_tests.fmf +++ b/package/fedora/tests/gui_tests.fmf @@ -57,8 +57,6 @@ test: xvfb-run /usr/bin/FreeCAD -t TestPartGui /TestPartDesignGui : test: xvfb-run /usr/bin/FreeCAD -t TestPartDesignGui - /TestSketcherGui : - test: xvfb-run /usr/bin/FreeCAD -t TestSketcherGui /TestTechDrawGui : test: xvfb-run /usr/bin/FreeCAD -t TestTechDrawGui /Workbench : diff --git a/src/Mod/Sketcher/App/AppSketcherPy.cpp b/src/Mod/Sketcher/App/AppSketcherPy.cpp index 194053d002..66e892a6d3 100644 --- a/src/Mod/Sketcher/App/AppSketcherPy.cpp +++ b/src/Mod/Sketcher/App/AppSketcherPy.cpp @@ -59,7 +59,6 @@ private: std::string EncodedName = std::string(Name); PyMem_Free(Name); - // Base::Console().log("Open in Part with %s",Name); Base::FileInfo file(EncodedName.c_str()); // extract extension @@ -82,7 +81,6 @@ private: PyMem_Free(Name); try { - // Base::Console().log("Insert in Part with %s",Name); Base::FileInfo file(EncodedName.c_str()); // extract extension diff --git a/src/Mod/Sketcher/App/GeometryFacade.cpp b/src/Mod/Sketcher/App/GeometryFacade.cpp index 5ff00968ca..e94873350a 100644 --- a/src/Mod/Sketcher/App/GeometryFacade.cpp +++ b/src/Mod/Sketcher/App/GeometryFacade.cpp @@ -63,8 +63,6 @@ std::unique_ptr GeometryFacade::getFacade(const Part::Geometry* else { return std::unique_ptr(nullptr); } - // make_unique has no access to private constructor - // return std::make_unique(geometry); } void GeometryFacade::setGeometry(Part::Geometry* geometry) @@ -84,9 +82,6 @@ void GeometryFacade::initExtension() if (!Geo->hasExtension(SketchGeometryExtension::getClassTypeId())) { getGeo()->setExtension(std::make_unique()); // Create getExtension - - // Base::Console().warning("%s\nSketcher Geometry without Extension: %s \n", - // boost::uuids::to_string(Geo->getTag()).c_str()); } SketchGeoExtension = std::static_pointer_cast( diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 4729872ca8..62398a1a0e 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -367,12 +367,6 @@ void Sketch::fixParametersAndDiagnose(std::vector& params_to_block) GCSsys.declareUnknowns(Parameters); GCSsys.declareDrivenParams(DrivenParameters); GCSsys.initSolution(defaultSolverRedundant); - /*GCSsys.getConflicting(Conflicting); - GCSsys.getRedundant(Redundant); - GCSsys.getPartlyRedundant(PartiallyRedundant); - GCSsys.getDependentParams(pDependentParametersList); - - calculateDependentParametersElements();*/ } } @@ -496,7 +490,6 @@ void Sketch::calculateDependentParametersElements() for (auto param : pDependentParametersList) { - // auto element = param2geoelement.at(param); auto element = param2geoelement.find(param); if (element != param2geoelement.end()) { @@ -1700,7 +1693,6 @@ int Sketch::addEllipse(const Part::GeomEllipse& elip, bool fixed) double dist_C_F = sqrt(radmaj * radmaj - radmin * radmin); // solver parameters Base::Vector3d focus1 = center + dist_C_F * radmajdir; //+x - // double *radmin; GCS::Point c; @@ -4593,12 +4585,6 @@ void Sketch::updateLineSegment(const GeoDef& def) void Sketch::updateArcOfCircle(const GeoDef& def) { GCS::Arc& myArc = Arcs[def.index]; - // the following 4 lines are redundant since these equations are already included in - // the arc constraints *myArc.start.x = *myArc.center.x + *myArc.rad * - // cos(*myArc.startAngle); *myArc.start.y = *myArc.center.y + *myArc.rad * - // sin(*myArc.startAngle); *myArc.end.x = *myArc.center.x + *myArc.rad * - // cos(*myArc.endAngle); *myArc.end.y = *myArc.center.y + *myArc.rad * - // sin(*myArc.endAngle); GeomArcOfCircle* aoc = static_cast(def.geo); aoc->setCenter(Vector3d(*Points[def.midPointId].x, *Points[def.midPointId].y, 0.0)); aoc->setRadius(*myArc.rad); @@ -5428,23 +5414,6 @@ TopoShape Sketch::toShape() const TopoShape result; std::vector::const_iterator it = Geoms.begin(); -#if 0 - - bool first = true; - for (; it!=Geoms.end(); ++it) { - if (!it->geo->Construction) { - TopoDS_Shape sh = it->geo->toShape(); - if (first) { - first = false; - result.setShape(sh); - } - else { - result.setShape(result.fuse(sh)); - } - } - } - return result; -#else std::list edge_list; std::list vertex_list; std::list wires; @@ -5528,7 +5497,6 @@ TopoShape Sketch::toShape() const } result.setShape(comp); } -#endif return result; } diff --git a/src/Mod/Sketcher/CMakeLists.txt b/src/Mod/Sketcher/CMakeLists.txt index 66871bcb7f..779da34ce2 100644 --- a/src/Mod/Sketcher/CMakeLists.txt +++ b/src/Mod/Sketcher/CMakeLists.txt @@ -25,7 +25,6 @@ set(Sketcher_TestScripts if(BUILD_GUI) list (APPEND Sketcher_Scripts InitGui.py - TestSketcherGui.py ) list (APPEND Sketcher_TestScripts SketcherTests/TestPlacementUpdate.py diff --git a/src/Mod/Sketcher/Gui/AppSketcherGui.cpp b/src/Mod/Sketcher/Gui/AppSketcherGui.cpp index 94adb4a6f1..3f3839553f 100644 --- a/src/Mod/Sketcher/Gui/AppSketcherGui.cpp +++ b/src/Mod/Sketcher/Gui/AppSketcherGui.cpp @@ -106,7 +106,6 @@ PyMOD_INIT_FUNC(SketcherGui) Gui::BitmapFactory().addPath(QStringLiteral(":/icons/elements")); Gui::BitmapFactory().addPath(QStringLiteral(":/icons/general")); Gui::BitmapFactory().addPath(QStringLiteral(":/icons/geometry")); - // Gui::BitmapFactory().addPath(QStringLiteral(":/icons/obsolete")); Gui::BitmapFactory().addPath(QStringLiteral(":/icons/pointers")); Gui::BitmapFactory().addPath(QStringLiteral(":/icons/splines")); Gui::BitmapFactory().addPath(QStringLiteral(":/icons/tools")); diff --git a/src/Mod/Sketcher/Gui/Command.cpp b/src/Mod/Sketcher/Gui/Command.cpp index 74f34f2dc2..23401ef7b2 100644 --- a/src/Mod/Sketcher/Gui/Command.cpp +++ b/src/Mod/Sketcher/Gui/Command.cpp @@ -236,8 +236,6 @@ void CmdSketcherNewSketch::activated(int iMsg) if (bAttach) { std::vector objects = Gui::Selection().getSelectionEx(); - // assert (objects.size() == 1); //should have been filtered out by SuggestAutoMapMode - // Gui::SelectionObject &sel_support = objects[0]; App::PropertyLinkSubList support; Gui::Selection().getAsPropertyLinkSubList(support); std::string supportString = support.getPyReprString(); diff --git a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp index 9b7a9f5744..382f163585 100644 --- a/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp +++ b/src/Mod/Sketcher/Gui/DrawSketchHandler.cpp @@ -922,8 +922,6 @@ void DrawSketchHandler::createAutoConstraints( if (createowncommand) { Gui::Command::commitCommand(); } - // Gui::Command::updateActive(); // There is already an recompute in each command - // creation, this is redundant. } } } diff --git a/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.cpp b/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.cpp index 8139d9b755..0793d91641 100644 --- a/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.cpp +++ b/src/Mod/Sketcher/Gui/EditModeInformationOverlayCoinConverter.cpp @@ -479,7 +479,6 @@ void EditModeInformationOverlayCoinConverter::addNode(const Result& result) SoSwitch* sw = new SoSwitch(); - // hGrpsk->GetBool("BSplineControlPolygonVisible", true) sw->whichChild = isVisible() ? SO_SWITCH_ALL : SO_SWITCH_NONE; SoSeparator* sep = new SoSeparator(); diff --git a/src/Mod/Sketcher/Gui/TaskSketcherCreateCommands.cpp b/src/Mod/Sketcher/Gui/TaskSketcherCreateCommands.cpp index 0ca991fbdd..2ed55f5cb5 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherCreateCommands.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherCreateCommands.cpp @@ -35,21 +35,6 @@ using namespace Gui::TaskView; TaskSketcherCreateCommands::TaskSketcherCreateCommands(QWidget* parent) : TaskBox(Gui::BitmapFactory().pixmap("document-new"), tr("Appearance"), true, parent) { - // we need a separate container widget to add all controls to - // proxy = new QWidget(this); - // ui = new Ui_TaskAppearance(); - // ui->setupUi(proxy); - // ui->textLabel1_3->hide(); - // ui->changePlot->hide(); - // QMetaObject::connectSlotsByName(this); - - // this->groupLayout()->addWidget(proxy); - - // std::vector views; - // setDisplayModes(views); - // setPointSize(views); - // setLineWidth(views); - // setTransparency(views); Gui::Selection().Attach(this); } @@ -62,9 +47,6 @@ TaskSketcherCreateCommands::~TaskSketcherCreateCommands() void TaskSketcherCreateCommands::changeEvent(QEvent* e) { TaskBox::changeEvent(e); - // if (e->type() == QEvent::LanguageChange) { - // ui->retranslateUi(proxy); - // } } /// @cond DOXERR diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 6de8c3c3d6..d13804cdde 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -780,11 +780,6 @@ void ViewProviderSketch::moveCursorToSketchPoint(Base::Vector2d point) QPoint newPos = viewer->getGLWidget()->mapToGlobal(QPoint(x, height - y)); - - // QScreen *screen = view->windowHandle()->screen(); - // QScreen *screen = QGuiApplication::primaryScreen(); - - // QCursor::setPos(screen, newPos); QCursor::setPos(newPos); } @@ -1014,22 +1009,18 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe case STATUS_NONE: { bool done = false; if (preselection.isPreselectPointValid()) { - // Base::Console().log("start dragging, point:%d\n",this->DragPoint); setSketchMode(STATUS_SELECT_Point); done = true; } else if (preselection.isPreselectCurveValid()) { - // Base::Console().log("start dragging, point:%d\n",this->DragPoint); setSketchMode(STATUS_SELECT_Edge); done = true; } else if (preselection.isCrossPreselected()) { - // Base::Console().log("start dragging, point:%d\n",this->DragPoint); setSketchMode(STATUS_SELECT_Cross); done = true; } else if (!preselection.PreselectConstraintSet.empty()) { - // Base::Console().log("start dragging, point:%d\n",this->DragPoint); setSketchMode(STATUS_SELECT_Constraint); done = true; } @@ -1078,7 +1069,6 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe switch (Mode) { case STATUS_SELECT_Point: if (pp) { - // Base::Console().log("Select Point:%d\n",this->DragPoint); // Do selection std::stringstream ss; ss << "Vertex" << preselection.getPreselectionVertexIndex(); @@ -1089,7 +1079,6 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe return true; case STATUS_SELECT_Edge: if (pp) { - // Base::Console().log("Select Point:%d\n",this->DragPoint); std::stringstream ss; if (preselection.isEdge()) ss << "Edge" << preselection.getPreselectionEdgeIndex(); @@ -1102,7 +1091,6 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe return true; case STATUS_SELECT_Cross: if (pp) { - // Base::Console().log("Select Point:%d\n",this->DragPoint); std::stringstream ss; switch (preselection.PreselectCross) { case Preselection::Axes::RootPoint: @@ -1216,19 +1204,15 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe switch (Mode) { case STATUS_NONE: { if (preselection.isPreselectPointValid()) { - // Base::Console().log("start dragging, point:%d\n",this->DragPoint); setSketchMode(STATUS_SELECT_Point); } else if (preselection.isPreselectCurveValid()) { - // Base::Console().log("start dragging, point:%d\n",this->DragPoint); setSketchMode(STATUS_SELECT_Edge); } else if (preselection.isCrossPreselected()) { - // Base::Console().log("start dragging, point:%d\n",this->DragPoint); setSketchMode(STATUS_SELECT_Cross); } else if (!preselection.PreselectConstraintSet.empty()) { - // Base::Console().log("start dragging, point:%d\n",this->DragPoint); setSketchMode(STATUS_SELECT_Constraint); } break; @@ -1258,7 +1242,6 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe return true; case STATUS_SELECT_Point: if (pp) { - // Base::Console().log("Select Point:%d\n",this->DragPoint); // Do selection std::stringstream ss; ss << "Vertex" << preselection.getPreselectionVertexIndex(); @@ -1270,7 +1253,6 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe return true; case STATUS_SELECT_Edge: if (pp) { - // Base::Console().log("Select Point:%d\n",this->DragPoint); std::stringstream ss; if (preselection.isEdge()) { ss << "Edge" << preselection.getPreselectionEdgeIndex(); @@ -1286,7 +1268,6 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe return true; case STATUS_SELECT_Cross: if (pp) { - // Base::Console().log("Select Point:%d\n",this->DragPoint); std::stringstream ss; switch (preselection.PreselectCross) { case Preselection::Axes::RootPoint: diff --git a/src/Mod/Sketcher/InitGui.py b/src/Mod/Sketcher/InitGui.py index 131edab53e..464c20d9c2 100644 --- a/src/Mod/Sketcher/InitGui.py +++ b/src/Mod/Sketcher/InitGui.py @@ -55,5 +55,3 @@ class SketcherWorkbench(Workbench): Gui.addWorkbench(SketcherWorkbench()) - -FreeCAD.__unit_test__ += ["TestSketcherGui"] diff --git a/src/Mod/Sketcher/Profiles.py b/src/Mod/Sketcher/Profiles.py index b358fde880..8b205634d8 100644 --- a/src/Mod/Sketcher/Profiles.py +++ b/src/Mod/Sketcher/Profiles.py @@ -27,9 +27,6 @@ if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore - # s=os.path.dirname(__file__) - # s=os.path.join(s,"ProfileLib") - # FreeCADGui.addIconPath(s) __title__ = "Sketcher profile lib handling" __author__ = "Juergen Riegel" @@ -44,9 +41,6 @@ def getSketch(): edit = FreeCADGui.ActiveDocument.getInEdit() if edit and edit.isDerivedFrom("SketcherGui::ViewProviderSketch"): return edit.Object - # act = FreeCAD.ActiveDocument.ActiveObject - # if act and act.isDerivedFrom('Sketcher::SketchObject'): - # return act return None diff --git a/src/Mod/Sketcher/SketcherTests/TestSketchFillet.py b/src/Mod/Sketcher/SketcherTests/TestSketchFillet.py index 1fe0054cf8..f5ee608c49 100644 --- a/src/Mod/Sketcher/SketcherTests/TestSketchFillet.py +++ b/src/Mod/Sketcher/SketcherTests/TestSketchFillet.py @@ -144,11 +144,6 @@ class TestSketchFillet(unittest.TestCase): SketchFeature.addConstraint(Sketcher.Constraint("Distance", 0, 2, 1, 1, 0.25)) self.Doc.recompute() - # SketchFeature.fillet(0,1, App.Vector(0.75,0.75,0), App.Vector(1.22,0.66,0), 0.25, True, True) - # Make sure the fillet happened - # self.Doc.recompute() - # self.assertAlmostEqual(SketchFeature.Geometry[2].Radius, 0.25) - # The following tests are mostly about verifying that transferFilletConstraints # does the right thing with pre-existing constraints when a fillet is created. diff --git a/src/Mod/Sketcher/TestSketcherGui.py b/src/Mod/Sketcher/TestSketcherGui.py index 9a9f3329c1..e69de29bb2 100644 --- a/src/Mod/Sketcher/TestSketcherGui.py +++ b/src/Mod/Sketcher/TestSketcherGui.py @@ -1,46 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later - -# ************************************************************************** -# Copyright (c) 2011 Juergen Riegel * -# * -# This file is part of the FreeCAD CAx development system. * -# * -# This program is free software; you can redistribute it and/or modify * -# it under the terms of the GNU Lesser General Public License (LGPL) * -# as published by the Free Software Foundation; either version 2 of * -# the License, or (at your option) any later version. * -# for detail see the LICENCE text file. * -# * -# FreeCAD is distributed in the hope that it will be useful, * -# but WITHOUT ANY WARRANTY; without even the implied warranty of * -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# GNU Library General Public License for more details. * -# * -# You should have received a copy of the GNU Library General Public * -# License along with FreeCAD; if not, write to the Free Software * -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * -# USA * -# ************************************************************************** - -# import FreeCAD, FreeCADGui, os, sys, unittest, Sketcher, SketcherGui - - -# --------------------------------------------------------------------------- -# define the test cases to test the FreeCAD Sketcher module -# --------------------------------------------------------------------------- - - -# class SketcherGuiTestCases(unittest.TestCase): -# 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")