From 16abb8d5482d62cedac0a027a5a6f9e909e4b180 Mon Sep 17 00:00:00 2001 From: Uwe Date: Sat, 8 Oct 2022 03:35:59 +0200 Subject: [PATCH] [TD] DrawUtil: remove unused includes - also sort includes - also move a definition to it - also adapt two Gui files accordingly --- src/Mod/TechDraw/App/CMakeLists.txt | 1 - src/Mod/TechDraw/App/DrawProjectSplit.cpp | 4 +- src/Mod/TechDraw/App/DrawUtil.cpp | 74 ++++++++++------------- src/Mod/TechDraw/App/DrawUtil.h | 17 ++++-- src/Mod/TechDraw/App/EWTOLERANCE.h | 30 --------- src/Mod/TechDraw/App/EdgeWalker.cpp | 1 - src/Mod/TechDraw/Gui/TaskCenterLine.cpp | 20 ++---- src/Mod/TechDraw/Gui/TaskLeaderLine.cpp | 16 ++--- 8 files changed, 54 insertions(+), 109 deletions(-) delete mode 100644 src/Mod/TechDraw/App/EWTOLERANCE.h diff --git a/src/Mod/TechDraw/App/CMakeLists.txt b/src/Mod/TechDraw/App/CMakeLists.txt index 6f37a674d5..adc4cd507a 100644 --- a/src/Mod/TechDraw/App/CMakeLists.txt +++ b/src/Mod/TechDraw/App/CMakeLists.txt @@ -166,7 +166,6 @@ SET(TechDraw_SRCS TechDrawExport.h ProjectionAlgos.cpp ProjectionAlgos.h - EWTOLERANCE.h ) SET(Geometry_SRCS diff --git a/src/Mod/TechDraw/App/DrawProjectSplit.cpp b/src/Mod/TechDraw/App/DrawProjectSplit.cpp index 6511ba2bcd..76c3600a10 100644 --- a/src/Mod/TechDraw/App/DrawProjectSplit.cpp +++ b/src/Mod/TechDraw/App/DrawProjectSplit.cpp @@ -20,7 +20,6 @@ * * ***************************************************************************/ - #include "PreCompiled.h" #ifndef _PreComp_ @@ -85,13 +84,12 @@ #include "DrawUtil.h" #include "Geometry.h" #include "GeometryObject.h" -#include "EWTOLERANCE.h" #include "DrawProjectSplit.h" + using namespace TechDraw; using namespace std; - //=========================================================================== // DrawProjectSplit //=========================================================================== diff --git a/src/Mod/TechDraw/App/DrawUtil.cpp b/src/Mod/TechDraw/App/DrawUtil.cpp index ea05e0458a..ee2a925442 100644 --- a/src/Mod/TechDraw/App/DrawUtil.cpp +++ b/src/Mod/TechDraw/App/DrawUtil.cpp @@ -23,61 +23,49 @@ #include "PreCompiled.h" #ifndef _PreComp_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include #endif #include -#include #include -#include #include #include #include #include -#include -#include - - -#include "EWTOLERANCE.h" -#include "GeometryObject.h" #include "DrawUtil.h" +#include "GeometryObject.h" +#include "LineGroup.h" + using namespace TechDraw; diff --git a/src/Mod/TechDraw/App/DrawUtil.h b/src/Mod/TechDraw/App/DrawUtil.h index f287f196fa..772bab8c5f 100644 --- a/src/Mod/TechDraw/App/DrawUtil.h +++ b/src/Mod/TechDraw/App/DrawUtil.h @@ -23,8 +23,6 @@ #ifndef DrawUtil_h_ #define DrawUtil_h_ -#include - #include #include @@ -46,12 +44,11 @@ #include #include - -#include "LineGroup.h" +#include #ifndef M_2PI - #define M_2PI ((M_PI)*2.0) +# define M_2PI ((M_PI) * 2.0) #endif #define VERTEXTOLERANCE (2.0 * Precision::Confusion()) @@ -60,6 +57,16 @@ #define SVG_NS_URI "http://www.w3.org/2000/svg" #define FREECAD_SVG_NS_URI "http://www.freecadweb.org/wiki/index.php?title=Svg_Namespace" +//some shapes are being passed in where edges that should be connected are in fact +//separated by more than 2*Precision::Confusion (expected tolerance for 2 TopoDS_Vertex) +//this value is used in EdgeWalker, DrawProjectSplit and DrawUtil and needs to be in sync in +//all 3 files. +#define EWTOLERANCE 0.0001//arbitrary number that seems to give good results for drawing + +//a multiplier for EWTOLERANCE used in fuzzy fuse and common operations. +#define FUZZYADJUST 4.0 + + namespace TechDraw { diff --git a/src/Mod/TechDraw/App/EWTOLERANCE.h b/src/Mod/TechDraw/App/EWTOLERANCE.h deleted file mode 100644 index 24b37434aa..0000000000 --- a/src/Mod/TechDraw/App/EWTOLERANCE.h +++ /dev/null @@ -1,30 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2022 Wanderer Fan * - * * - * This file is part of the FreeCAD CAx development system. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * - * * - * This library 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 this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * - * * - ***************************************************************************/ - -//some shapes are being passed in where edges that should be connected are in fact -//separated by more than 2*Precision::Confusion (expected tolerance for 2 TopoDS_Vertex) -//this value is used in EdgeWalker, DrawProjectSplit and DrawUtil and needs to be in sync in -//all 3 files. -#define EWTOLERANCE 0.0001 //arbitrary number that seems to give good results for drawing - -//a multiplier for EWTOLERANCE used in fuzzy fuse and common operations. -#define FUZZYADJUST 4.0 diff --git a/src/Mod/TechDraw/App/EdgeWalker.cpp b/src/Mod/TechDraw/App/EdgeWalker.cpp index ba752f2071..b833a7ca39 100644 --- a/src/Mod/TechDraw/App/EdgeWalker.cpp +++ b/src/Mod/TechDraw/App/EdgeWalker.cpp @@ -44,7 +44,6 @@ #include "EdgeWalker.h" #include "DrawUtil.h" -#include "EWTOLERANCE.h" using namespace TechDraw; diff --git a/src/Mod/TechDraw/Gui/TaskCenterLine.cpp b/src/Mod/TechDraw/Gui/TaskCenterLine.cpp index 73c3ce22ea..8ee8dde616 100644 --- a/src/Mod/TechDraw/Gui/TaskCenterLine.cpp +++ b/src/Mod/TechDraw/Gui/TaskCenterLine.cpp @@ -22,20 +22,9 @@ #include "PreCompiled.h" -#ifndef _PreComp_ -#include -#include -#include -#include -#include -#include -#endif // #ifndef _PreComp_ - - #include #include #include - #include #include #include @@ -45,21 +34,20 @@ #include #include #include - +#include #include #include #include #include #include -#include - -#include +#include +#include "TaskCenterLine.h" +#include "ui_TaskCenterLine.h" #include "PreferencesGui.h" #include "QGIView.h" #include "ViewProviderViewPart.h" -#include "TaskCenterLine.h" using namespace Gui; using namespace TechDraw; diff --git a/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp b/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp index 0406a0dd21..1a76069e62 100644 --- a/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp +++ b/src/Mod/TechDraw/Gui/TaskLeaderLine.cpp @@ -28,12 +28,9 @@ #include #endif - +#include #include #include - -#include - #include #include #include @@ -43,15 +40,15 @@ #include #include #include - +#include +#include #include #include #include -#include -#include - -#include +#include +#include "TaskLeaderLine.h" +#include "ui_TaskLeaderLine.h" #include "DrawGuiUtil.h" #include "PreferencesGui.h" #include "QGSPage.h" @@ -66,7 +63,6 @@ #include "QGILeaderLine.h" #include "Rez.h" -#include "TaskLeaderLine.h" using namespace Gui; using namespace TechDraw;