[TD] DrawUtil: remove unused includes

- also sort includes
- also move a definition to it
- also adapt two Gui files accordingly
This commit is contained in:
Uwe
2022-10-08 03:35:59 +02:00
parent 5dc30b159c
commit 16abb8d548
8 changed files with 54 additions and 109 deletions

View File

@@ -166,7 +166,6 @@ SET(TechDraw_SRCS
TechDrawExport.h
ProjectionAlgos.cpp
ProjectionAlgos.h
EWTOLERANCE.h
)
SET(Geometry_SRCS

View File

@@ -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
//===========================================================================

View File

@@ -23,61 +23,49 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <sstream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <exception>
#include <boost/regex.hpp>
#include <QString>
#include <QStringList>
#include <QChar>
#include <QPointF>
# include <cmath>
# include <cstdlib>
# include <cstring>
# include <sstream>
#include <BRep_Tool.hxx>
#include <gp_Ax3.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
#include <gp_Elips.hxx>
#include <Precision.hxx>
#include <BRep_Builder.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <BRepGProp.hxx>
#include <BRepLProp_CLProps.hxx>
#include <BRepLProp_CurveTool.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <GProp_GProps.hxx>
#include <GeomLProp_SLProps.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepLProp_SLProps.hxx>
#include <BRepGProp_Face.hxx>
#include <BRepTools.hxx>
# include <boost/regex.hpp>
# include <QChar>
# include <QPointF>
# include <QString>
# include <BRep_Builder.hxx>
# include <BRep_Tool.hxx>
# include <BRepAdaptor_Curve.hxx>
# include <BRepAdaptor_Surface.hxx>
# include <BRepExtrema_DistShapeShape.hxx>
# include <BRepLProp_CLProps.hxx>
# include <BRepLProp_CurveTool.hxx>
# include <BRepLProp_SLProps.hxx>
# include <BRepTools.hxx>
# include <GCPnts_AbscissaPoint.hxx>
# include <gp_Ax3.hxx>
# include <gp_Dir.hxx>
# include <gp_Elips.hxx>
# include <gp_Pnt.hxx>
# include <gp_Vec.hxx>
# include <Precision.hxx>
# include <TopExp.hxx>
# include <TopExp_Explorer.hxx>
# include <TopTools_IndexedMapOfShape.hxx>
#endif
#include <App/Application.h>
#include <App/Material.h>
#include <Base/Console.h>
#include <Base/Exception.h>
#include <Base/FileInfo.h>
#include <Base/Parameter.h>
#include <Base/Stream.h>
#include <Base/Vector3D.h>
#include <Mod/Part/App/PartFeature.h>
#include <Mod/Part/App/TopoShape.h>
#include "EWTOLERANCE.h"
#include "GeometryObject.h"
#include "DrawUtil.h"
#include "GeometryObject.h"
#include "LineGroup.h"
using namespace TechDraw;

View File

@@ -23,8 +23,6 @@
#ifndef DrawUtil_h_
#define DrawUtil_h_
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <string>
#include <QByteArray>
@@ -46,12 +44,11 @@
#include <Base/Vector3D.h>
#include <Mod/Part/App/PartFeature.h>
#include "LineGroup.h"
#include <Mod/TechDraw/TechDrawGlobal.h>
#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
{

View File

@@ -1,30 +0,0 @@
/***************************************************************************
* Copyright (c) 2022 Wanderer Fan <wandererfan@gmail.com> *
* *
* 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

View File

@@ -44,7 +44,6 @@
#include "EdgeWalker.h"
#include "DrawUtil.h"
#include "EWTOLERANCE.h"
using namespace TechDraw;

View File

@@ -22,20 +22,9 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <cmath>
#include <BRepBndLib.hxx>
#include <Bnd_Box.hxx>
#include <QButtonGroup>
#include <QStatusBar>
#include <QGraphicsScene>
#endif // #ifndef _PreComp_
#include <Base/Console.h>
#include <Base/Tools.h>
#include <Base/UnitsApi.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
@@ -45,21 +34,20 @@
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/WaitCursor.h>
#include <Mod/TechDraw/App/Cosmetic.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawViewPart.h>
#include <Mod/TechDraw/App/Geometry.h>
#include <Mod/TechDraw/App/Cosmetic.h>
#include <Mod/TechDraw/Gui/ui_TaskCenterLine.h>
#include <Mod/TechDraw/App/LineGroup.h>
#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;

View File

@@ -28,12 +28,9 @@
#include <QGraphicsScene>
#endif
#include <App/Document.h>
#include <Base/Console.h>
#include <Base/Tools.h>
#include <App/Document.h>
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/Command.h>
@@ -43,15 +40,15 @@
#include <Gui/Selection.h>
#include <Gui/ViewProvider.h>
#include <Gui/WaitCursor.h>
#include <Mod/TechDraw/App/ArrowPropEnum.h>
#include <Mod/TechDraw/App/DrawLeaderLine.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawUtil.h>
#include <Mod/TechDraw/App/DrawView.h>
#include <Mod/TechDraw/App/DrawLeaderLine.h>
#include <Mod/TechDraw/App/ArrowPropEnum.h>
#include <Mod/TechDraw/Gui/ui_TaskLeaderLine.h>
#include <Mod/TechDraw/App/LineGroup.h>
#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;