From ff77ffe7d1054d032565843fb780154ff17441ec Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 28 Dec 2020 21:37:33 +0100 Subject: [PATCH 01/11] Sketcher: check for BSpline knot instead of construction point ============================================================== Previously construction points was used to code bspline knots. Now construction points are normal sketcher points, which can be made defining. This commit renames and adapts the checks for fixed geometry. fixes: https://forum.freecadweb.org/posting.php?mode=quote&f=3&p=461472#pr461472 --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 32 ++++++++++----------- src/Mod/Sketcher/Gui/CommandConstraints.h | 4 +-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index ea9e640ddb..87c21b987c 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -145,13 +145,13 @@ bool SketcherGui::checkBothExternal(int GeoId1, int GeoId2) return (GeoId1 < 0 && GeoId2 < 0); } -bool SketcherGui::checkBothExternalOrConstructionPoints(const Sketcher::SketchObject* Obj,int GeoId1, int GeoId2) +bool SketcherGui::checkBothExternalOrBSplinePoints(const Sketcher::SketchObject* Obj,int GeoId1, int GeoId2) { if (GeoId1 == Constraint::GeoUndef || GeoId2 == Constraint::GeoUndef) return false; else - return (GeoId1 < 0 && GeoId2 < 0) || (isConstructionPoint(Obj,GeoId1) && isConstructionPoint(Obj,GeoId2)) || - (GeoId1 < 0 && isConstructionPoint(Obj,GeoId2)) || (GeoId2 < 0 && isConstructionPoint(Obj,GeoId1)); + return (GeoId1 < 0 && GeoId2 < 0) || (isBsplineKnot(Obj,GeoId1) && isBsplineKnot(Obj,GeoId2)) || + (GeoId1 < 0 && isBsplineKnot(Obj,GeoId2)) || (GeoId2 < 0 && isBsplineKnot(Obj,GeoId1)); } bool SketcherGui::isPointOrSegmentFixed(const Sketcher::SketchObject* Obj, int GeoId) @@ -161,7 +161,7 @@ bool SketcherGui::isPointOrSegmentFixed(const Sketcher::SketchObject* Obj, int G if (GeoId == Constraint::GeoUndef) return false; else - return checkConstraint(vals, Sketcher::Block, GeoId, Sketcher::none) || GeoId <= Sketcher::GeoEnum::RtPnt || isConstructionPoint(Obj,GeoId); + return checkConstraint(vals, Sketcher::Block, GeoId, Sketcher::none) || GeoId <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId); } bool SketcherGui::areBothPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj, int GeoId1, int GeoId2) @@ -171,8 +171,8 @@ bool SketcherGui::areBothPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj if (GeoId1 == Constraint::GeoUndef || GeoId2 == Constraint::GeoUndef) return false; else - return ((checkConstraint(vals, Sketcher::Block, GeoId1, Sketcher::none) || GeoId1 <= Sketcher::GeoEnum::RtPnt || isConstructionPoint(Obj,GeoId1)) && - (checkConstraint(vals, Sketcher::Block, GeoId2, Sketcher::none) || GeoId2 <= Sketcher::GeoEnum::RtPnt || isConstructionPoint(Obj,GeoId2))); + return ((checkConstraint(vals, Sketcher::Block, GeoId1, Sketcher::none) || GeoId1 <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId1)) && + (checkConstraint(vals, Sketcher::Block, GeoId2, Sketcher::none) || GeoId2 <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId2))); } bool SketcherGui::areAllPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj, int GeoId1, int GeoId2, int GeoId3) @@ -182,9 +182,9 @@ bool SketcherGui::areAllPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj, if (GeoId1 == Constraint::GeoUndef || GeoId2 == Constraint::GeoUndef || GeoId3 == Constraint::GeoUndef) return false; else - return ((checkConstraint(vals, Sketcher::Block, GeoId1, Sketcher::none) || GeoId1 <= Sketcher::GeoEnum::RtPnt || isConstructionPoint(Obj,GeoId1)) && - (checkConstraint(vals, Sketcher::Block, GeoId2, Sketcher::none) || GeoId2 <= Sketcher::GeoEnum::RtPnt || isConstructionPoint(Obj,GeoId2)) && - (checkConstraint(vals, Sketcher::Block, GeoId3, Sketcher::none) || GeoId3 <= Sketcher::GeoEnum::RtPnt || isConstructionPoint(Obj,GeoId3))); + return ((checkConstraint(vals, Sketcher::Block, GeoId1, Sketcher::none) || GeoId1 <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId1)) && + (checkConstraint(vals, Sketcher::Block, GeoId2, Sketcher::none) || GeoId2 <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId2)) && + (checkConstraint(vals, Sketcher::Block, GeoId3, Sketcher::none) || GeoId3 <= Sketcher::GeoEnum::RtPnt || isBsplineKnot(Obj,GeoId3))); } void SketcherGui::getIdsFromName(const std::string &name, const Sketcher::SketchObject* Obj, @@ -235,10 +235,10 @@ bool SketcherGui::isSimpleVertex(const Sketcher::SketchObject* Obj, int GeoId, P return false; } -bool SketcherGui::isConstructionPoint(const Sketcher::SketchObject* Obj, int GeoId) +bool SketcherGui::isBsplineKnot(const Sketcher::SketchObject* Obj, int GeoId) { - const Part::Geometry * geo = Obj->getGeometry(GeoId); - return (geo && geo->getTypeId() == Part::GeomPoint::getClassTypeId() && GeometryFacade::getConstruction(geo)); + auto gf = Obj->getGeometryFacade(GeoId); + return (gf && gf->getInternalType() == Sketcher::InternalType::BSplineKnotPoint); } bool SketcherGui::IsPointAlreadyOnCurve(int GeoIdCurve, int GeoIdPoint, Sketcher::PointPos PosIdPoint, Sketcher::SketchObject* Obj) @@ -1614,7 +1614,7 @@ void CmdSketcherConstrainLock::activated(int iMsg) lastconstraintindex+=2; if (edgeisblocked || GeoId[0] <= Sketcher::GeoEnum::RefExt - || isConstructionPoint(Obj,GeoId[0]) + || isBsplineKnot(Obj,GeoId[0]) || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving @@ -2409,7 +2409,7 @@ void CmdSketcherConstrainDistance::activated(int iMsg) // it is a constraint on a external line, make it non-driving if (arebothpointsorsegmentsfixed || GeoId1 <= Sketcher::GeoEnum::RefExt || - isConstructionPoint(Obj,GeoId1) || constraintCreationMode==Reference) { + isBsplineKnot(Obj,GeoId1) || constraintCreationMode==Reference) { const std::vector &ConStr = Obj->Constraints.getValues(); Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)", @@ -2502,7 +2502,7 @@ void CmdSketcherConstrainDistance::applyConstraint(std::vector &selSe if (arebothpointsorsegmentsfixed || GeoId1 <= Sketcher::GeoEnum::RefExt - || isConstructionPoint(Obj,GeoId1) + || isBsplineKnot(Obj,GeoId1) || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving const std::vector &ConStr = Obj->Constraints.getValues(); @@ -3189,7 +3189,7 @@ void CmdSketcherConstrainDistanceY::activated(int iMsg) GeoId1,PosId1,ActY); if (GeoId1 <= Sketcher::GeoEnum::RefExt - || isConstructionPoint(Obj,GeoId1) + || isBsplineKnot(Obj,GeoId1) || constraintCreationMode==Reference) { // it is a constraint on a external line, make it non-driving const std::vector &ConStr = Obj->Constraints.getValues(); diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.h b/src/Mod/Sketcher/Gui/CommandConstraints.h index f6a08d3632..d1e90de378 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.h +++ b/src/Mod/Sketcher/Gui/CommandConstraints.h @@ -31,7 +31,7 @@ namespace SketcherGui { bool checkBothExternal(int GeoId1, int GeoId2); -bool checkBothExternalOrConstructionPoints(const Sketcher::SketchObject* Obj,int GeoId1, int GeoId2); +bool checkBothExternalOrBSplinePoints(const Sketcher::SketchObject* Obj,int GeoId1, int GeoId2); bool isPointOrSegmentFixed(const Sketcher::SketchObject* Obj, int GeoId); @@ -47,7 +47,7 @@ bool inline isEdge(int GeoId, Sketcher::PointPos PosId); bool isSimpleVertex(const Sketcher::SketchObject* Obj, int GeoId, Sketcher::PointPos PosId); -bool isConstructionPoint(const Sketcher::SketchObject* Obj, int GeoId); +bool isBsplineKnot(const Sketcher::SketchObject* Obj, int GeoId); bool IsPointAlreadyOnCurve(int GeoIdCurve, int GeoIdPoint, Sketcher::PointPos PosIdPoint, Sketcher::SketchObject* Obj); From 98f63ba60f093db50eafc6ac1c360bd1b09b72bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Skowro=C5=84ski?= Date: Mon, 28 Dec 2020 19:15:57 +0100 Subject: [PATCH 02/11] Fix build warnings from deprecated Boost headers (they are used internally by Boost). Thanks @wwmayer for the hint. --- src/App/Application.h | 2 +- src/App/Document.h | 2 +- src/App/DocumentObject.h | 2 +- src/App/DocumentObserver.h | 2 +- src/App/DocumentObserverPython.h | 2 +- src/App/GroupExtension.h | 2 +- src/App/Link.h | 2 +- src/App/MergeDocuments.h | 2 +- src/App/PreCompiled.h | 2 +- src/App/PropertyExpressionEngine.h | 2 +- src/App/PropertyLinks.h | 2 +- src/App/TextDocument.cpp | 2 +- src/App/TextDocument.h | 2 +- src/Base/Tools.h | 2 +- src/Gui/Action.cpp | 2 +- src/Gui/Application.cpp | 2 +- src/Gui/AutoSaver.h | 2 +- src/Gui/DAGView/DAGModel.h | 2 +- src/Gui/DAGView/DAGModelGraph.h | 2 +- src/Gui/DlgDisplayPropertiesImp.cpp | 2 +- src/Gui/Document.cpp | 2 +- src/Gui/DocumentModel.cpp | 2 +- src/Gui/DocumentObserver.h | 2 +- src/Gui/DocumentObserverPython.h | 2 +- src/Gui/ExpressionBinding.h | 2 +- src/Gui/GraphvizView.h | 2 +- src/Gui/MDIView.cpp | 2 +- src/Gui/ManualAlignment.h | 2 +- src/Gui/MergeDocuments.h | 2 +- src/Gui/Placement.h | 2 +- src/Gui/PreCompiled.h | 2 +- src/Gui/PropertyView.h | 2 +- src/Gui/Selection.h | 2 +- src/Gui/TaskView/TaskAppearance.h | 2 +- src/Gui/TaskView/TaskView.h | 2 +- src/Gui/TextDocumentEditorView.cpp | 2 +- src/Gui/TextDocumentEditorView.h | 2 +- src/Gui/ViewProvider.h | 2 +- src/Mod/Drawing/Gui/TaskOrthoViews.h | 2 +- src/Mod/Fem/Gui/ViewProviderFemPostFunction.h | 2 +- src/Mod/Mesh/Gui/MeshEditor.h | 2 +- src/Mod/Part/App/PreCompiled.h | 2 +- src/Mod/Part/Gui/DlgBooleanOperation.h | 2 +- src/Mod/Part/Gui/PreCompiled.h | 2 +- src/Mod/Part/Gui/TaskFaceColors.cpp | 2 +- src/Mod/PartDesign/App/Body.h | 2 +- src/Mod/PartDesign/App/ShapeBinder.h | 2 +- src/Mod/PartDesign/Gui/TaskTransformedMessages.h | 2 +- src/Mod/PartDesign/Gui/WorkflowManager.h | 2 +- src/Mod/Path/libarea/PythonStuff.cpp | 2 +- src/Mod/Sketcher/App/PropertyConstraintList.h | 2 +- src/Mod/Sketcher/Gui/TaskDlgEditSketch.h | 2 +- src/Mod/Sketcher/Gui/TaskSketcherConstrains.h | 2 +- src/Mod/Sketcher/Gui/TaskSketcherElements.h | 2 +- src/Mod/Sketcher/Gui/TaskSketcherGeneral.h | 2 +- src/Mod/Sketcher/Gui/TaskSketcherMessages.h | 2 +- src/Mod/Sketcher/Gui/ViewProviderSketch.h | 2 +- src/Mod/TechDraw/App/DrawPage.h | 2 +- src/Mod/TechDraw/App/DrawView.h | 2 +- src/Mod/TechDraw/Gui/MDIViewPage.cpp | 2 +- src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp | 2 +- src/Mod/TechDraw/Gui/ViewProviderDrawingView.h | 2 +- src/Mod/TechDraw/Gui/ViewProviderPage.cpp | 2 +- src/Mod/TechDraw/Gui/ViewProviderPage.h | 2 +- src/boost_python.hpp | 9 +++++++++ src/boost_signals2.hpp | 9 +++++++++ 66 files changed, 82 insertions(+), 64 deletions(-) create mode 100644 src/boost_python.hpp create mode 100644 src/boost_signals2.hpp diff --git a/src/App/Application.h b/src/App/Application.h index f03dc97f99..317d4ca9a1 100644 --- a/src/App/Application.h +++ b/src/App/Application.h @@ -24,7 +24,7 @@ #ifndef APP_APPLICATION_H #define APP_APPLICATION_H -#include +#include #include #include diff --git a/src/App/Document.h b/src/App/Document.h index 33084d221f..b1d57cb28f 100644 --- a/src/App/Document.h +++ b/src/App/Document.h @@ -37,7 +37,7 @@ #include #include -#include +#include namespace Base { class Writer; diff --git a/src/App/DocumentObject.h b/src/App/DocumentObject.h index dec9f52540..e9f32386e8 100644 --- a/src/App/DocumentObject.h +++ b/src/App/DocumentObject.h @@ -36,7 +36,7 @@ #include #include -#include +#include namespace App { diff --git a/src/App/DocumentObserver.h b/src/App/DocumentObserver.h index 2b79752fed..1a163d37c2 100644 --- a/src/App/DocumentObserver.h +++ b/src/App/DocumentObserver.h @@ -25,7 +25,7 @@ #define APP_DOCUMENTOBSERVER_H #include -#include +#include #include #include diff --git a/src/App/DocumentObserverPython.h b/src/App/DocumentObserverPython.h index c1ee595cf1..3c9957836b 100644 --- a/src/App/DocumentObserverPython.h +++ b/src/App/DocumentObserverPython.h @@ -26,7 +26,7 @@ #include -#include +#include #include #include diff --git a/src/App/GroupExtension.h b/src/App/GroupExtension.h index e5a3e7f52a..9940f44352 100644 --- a/src/App/GroupExtension.h +++ b/src/App/GroupExtension.h @@ -24,7 +24,7 @@ #ifndef APP_GROUPEXTENSION_H #define APP_GROUPEXTENSION_H -#include +#include #include "FeaturePython.h" #include "DocumentObject.h" #include "PropertyLinks.h" diff --git a/src/App/Link.h b/src/App/Link.h index 143c44f573..25edbf1e8b 100644 --- a/src/App/Link.h +++ b/src/App/Link.h @@ -24,7 +24,7 @@ #define APP_LINK_H #include -#include +#include #include #include #include diff --git a/src/App/MergeDocuments.h b/src/App/MergeDocuments.h index dc89f1db16..3f807e2bfd 100644 --- a/src/App/MergeDocuments.h +++ b/src/App/MergeDocuments.h @@ -24,7 +24,7 @@ #ifndef APP_MERGEDOCUMENTS_H #define APP_MERGEDOCUMENTS_H -#include +#include #include namespace zipios { diff --git a/src/App/PreCompiled.h b/src/App/PreCompiled.h index ef5fe98b67..634cfe55a4 100644 --- a/src/App/PreCompiled.h +++ b/src/App/PreCompiled.h @@ -80,7 +80,7 @@ #include // Boost -#include +#include #include #include diff --git a/src/App/PropertyExpressionEngine.h b/src/App/PropertyExpressionEngine.h index b1701034e2..4b63a8b147 100644 --- a/src/App/PropertyExpressionEngine.h +++ b/src/App/PropertyExpressionEngine.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/App/PropertyLinks.h b/src/App/PropertyLinks.h index 6d5bf6e83c..5e63a648b0 100644 --- a/src/App/PropertyLinks.h +++ b/src/App/PropertyLinks.h @@ -25,7 +25,7 @@ #define APP_PROPERTYLINKS_H // Std. configurations -#include +#include #include #include diff --git a/src/App/TextDocument.cpp b/src/App/TextDocument.cpp index 63cd196882..82e4416d8c 100644 --- a/src/App/TextDocument.cpp +++ b/src/App/TextDocument.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include "DocumentObject.h" #include "TextDocument.h" diff --git a/src/App/TextDocument.h b/src/App/TextDocument.h index 5f89ff3b48..2a57b301df 100644 --- a/src/App/TextDocument.h +++ b/src/App/TextDocument.h @@ -26,7 +26,7 @@ #include -#include +#include #include "DocumentObject.h" #include "PropertyStandard.h" diff --git a/src/Base/Tools.h b/src/Base/Tools.h index 1dfabd1ba2..e0f007f1fa 100644 --- a/src/Base/Tools.h +++ b/src/Base/Tools.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index cdc92643d1..368b06bce3 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -24,7 +24,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +# include # include # include # include diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index ea4c6a76d9..e301134f9a 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -25,7 +25,7 @@ #ifndef _PreComp_ # include "InventorAll.h" -# include +# include # include # include # include diff --git a/src/Gui/AutoSaver.h b/src/Gui/AutoSaver.h index 6766f763b5..0c6c36bd3b 100644 --- a/src/Gui/AutoSaver.h +++ b/src/Gui/AutoSaver.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include namespace App { class Document; diff --git a/src/Gui/DAGView/DAGModel.h b/src/Gui/DAGView/DAGModel.h index 022f3c3401..d362fa8497 100644 --- a/src/Gui/DAGView/DAGModel.h +++ b/src/Gui/DAGView/DAGModel.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/src/Gui/DAGView/DAGModelGraph.h b/src/Gui/DAGView/DAGModelGraph.h index b605872d87..cd48bff21e 100644 --- a/src/Gui/DAGView/DAGModelGraph.h +++ b/src/Gui/DAGView/DAGModelGraph.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include "DAGRectItem.h" diff --git a/src/Gui/DlgDisplayPropertiesImp.cpp b/src/Gui/DlgDisplayPropertiesImp.cpp index f3812d158e..2a52d7db4a 100644 --- a/src/Gui/DlgDisplayPropertiesImp.cpp +++ b/src/Gui/DlgDisplayPropertiesImp.cpp @@ -25,7 +25,7 @@ #ifndef _PreComp_ # include # include -# include +# include # include #endif diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index 51e97c648a..4b28736248 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -33,7 +33,7 @@ # include # include # include -# include +# include # include # include # include diff --git a/src/Gui/DocumentModel.cpp b/src/Gui/DocumentModel.cpp index 228e5a0df7..4f2e03faec 100644 --- a/src/Gui/DocumentModel.cpp +++ b/src/Gui/DocumentModel.cpp @@ -26,7 +26,7 @@ #ifndef _PreComp_ # include # include -# include +# include # include #endif diff --git a/src/Gui/DocumentObserver.h b/src/Gui/DocumentObserver.h index d09ea3c382..9e4fca62f2 100644 --- a/src/Gui/DocumentObserver.h +++ b/src/Gui/DocumentObserver.h @@ -25,7 +25,7 @@ #define GUI_DOCUMENTOBSERVER_H #include -#include +#include namespace App { class Property; } namespace Gui diff --git a/src/Gui/DocumentObserverPython.h b/src/Gui/DocumentObserverPython.h index 96d9196008..16713c001c 100644 --- a/src/Gui/DocumentObserverPython.h +++ b/src/Gui/DocumentObserverPython.h @@ -26,7 +26,7 @@ #include -#include +#include #include namespace Gui diff --git a/src/Gui/ExpressionBinding.h b/src/Gui/ExpressionBinding.h index 40c1604fb2..db486bb993 100644 --- a/src/Gui/ExpressionBinding.h +++ b/src/Gui/ExpressionBinding.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include namespace App { class Expression; diff --git a/src/Gui/GraphvizView.h b/src/Gui/GraphvizView.h index 0fc516dbb4..d13bc240f9 100644 --- a/src/Gui/GraphvizView.h +++ b/src/Gui/GraphvizView.h @@ -26,7 +26,7 @@ #include "MDIView.h" #include -#include +#include class QGraphicsScene; diff --git a/src/Gui/MDIView.cpp b/src/Gui/MDIView.cpp index 0e64d1a7e5..a571aaccf4 100644 --- a/src/Gui/MDIView.cpp +++ b/src/Gui/MDIView.cpp @@ -24,7 +24,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +# include # include # include # include diff --git a/src/Gui/ManualAlignment.h b/src/Gui/ManualAlignment.h index 121c3b7ee3..83416e5ed8 100644 --- a/src/Gui/ManualAlignment.h +++ b/src/Gui/ManualAlignment.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include class SbVec3f; class SoPickedPoint; diff --git a/src/Gui/MergeDocuments.h b/src/Gui/MergeDocuments.h index d4d1be0f3d..1539e9d0ea 100644 --- a/src/Gui/MergeDocuments.h +++ b/src/Gui/MergeDocuments.h @@ -24,7 +24,7 @@ #ifndef GUI_MERGEDOCUMENTS_H #define GUI_MERGEDOCUMENTS_H -#include +#include #include namespace zipios { diff --git a/src/Gui/Placement.h b/src/Gui/Placement.h index 7437bd5d02..e71fa61dcb 100644 --- a/src/Gui/Placement.h +++ b/src/Gui/Placement.h @@ -29,7 +29,7 @@ #include #include -#include +#include class QSignalMapper; diff --git a/src/Gui/PreCompiled.h b/src/Gui/PreCompiled.h index 7163d51450..4aef35543a 100644 --- a/src/Gui/PreCompiled.h +++ b/src/Gui/PreCompiled.h @@ -79,7 +79,7 @@ #include // Boost -#include +#include #include #include #include diff --git a/src/Gui/PropertyView.h b/src/Gui/PropertyView.h index bac0dde71c..9d052ff76a 100644 --- a/src/Gui/PropertyView.h +++ b/src/Gui/PropertyView.h @@ -28,7 +28,7 @@ #include "DockWindow.h" #include "Selection.h" -#include +#include class QPixmap; class QTabWidget; diff --git a/src/Gui/Selection.h b/src/Gui/Selection.h index 90f4df024b..da62babcd2 100644 --- a/src/Gui/Selection.h +++ b/src/Gui/Selection.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/Gui/TaskView/TaskAppearance.h b/src/Gui/TaskView/TaskAppearance.h index b637053f33..cf0975db30 100644 --- a/src/Gui/TaskView/TaskAppearance.h +++ b/src/Gui/TaskView/TaskAppearance.h @@ -26,7 +26,7 @@ #include "TaskView.h" #include -#include +#include namespace App { diff --git a/src/Gui/TaskView/TaskView.h b/src/Gui/TaskView/TaskView.h index 20463eee64..852a9f261f 100644 --- a/src/Gui/TaskView/TaskView.h +++ b/src/Gui/TaskView/TaskView.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #if !defined (QSINT_ACTIONPANEL) diff --git a/src/Gui/TextDocumentEditorView.cpp b/src/Gui/TextDocumentEditorView.cpp index 4f8481d3e6..257a97b47b 100644 --- a/src/Gui/TextDocumentEditorView.cpp +++ b/src/Gui/TextDocumentEditorView.cpp @@ -32,7 +32,7 @@ # include # include # include -# include +# include #endif diff --git a/src/Gui/TextDocumentEditorView.h b/src/Gui/TextDocumentEditorView.h index 9c5def6e2a..f53f03f7eb 100644 --- a/src/Gui/TextDocumentEditorView.h +++ b/src/Gui/TextDocumentEditorView.h @@ -25,7 +25,7 @@ #define GUI_TEXTDOCUMENTEDITORVIEW_H #include -#include +#include #include #include diff --git a/src/Gui/ViewProvider.h b/src/Gui/ViewProvider.h index 6543c00ac9..9c489e55eb 100644 --- a/src/Gui/ViewProvider.h +++ b/src/Gui/ViewProvider.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/Mod/Drawing/Gui/TaskOrthoViews.h b/src/Mod/Drawing/Gui/TaskOrthoViews.h index ccab188d51..5e19f1d24f 100644 --- a/src/Mod/Drawing/Gui/TaskOrthoViews.h +++ b/src/Mod/Drawing/Gui/TaskOrthoViews.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include diff --git a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h index 0956f77adf..a5d240be98 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h +++ b/src/Mod/Fem/Gui/ViewProviderFemPostFunction.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include class SoScale; class SoSurroundScale; diff --git a/src/Mod/Mesh/Gui/MeshEditor.h b/src/Mod/Mesh/Gui/MeshEditor.h index 9d5b248ff4..6675d73620 100644 --- a/src/Mod/Mesh/Gui/MeshEditor.h +++ b/src/Mod/Mesh/Gui/MeshEditor.h @@ -25,7 +25,7 @@ #include #include -#include +#include class SoCoordinate3; class SoFaceSet; diff --git a/src/Mod/Part/App/PreCompiled.h b/src/Mod/Part/App/PreCompiled.h index 16377c8016..a7cc360af3 100644 --- a/src/Mod/Part/App/PreCompiled.h +++ b/src/Mod/Part/App/PreCompiled.h @@ -76,7 +76,7 @@ #include // Boost -#include +#include #include #include diff --git a/src/Mod/Part/Gui/DlgBooleanOperation.h b/src/Mod/Part/Gui/DlgBooleanOperation.h index 03e8d1cbf2..0a5a624a8c 100644 --- a/src/Mod/Part/Gui/DlgBooleanOperation.h +++ b/src/Mod/Part/Gui/DlgBooleanOperation.h @@ -25,7 +25,7 @@ #include #include -#include +#include class QTreeWidgetItem; diff --git a/src/Mod/Part/Gui/PreCompiled.h b/src/Mod/Part/Gui/PreCompiled.h index c9de57fc46..beff950e4d 100644 --- a/src/Mod/Part/Gui/PreCompiled.h +++ b/src/Mod/Part/Gui/PreCompiled.h @@ -177,7 +177,7 @@ #include // Boost -#include +#include #include // Qt Toolkit diff --git a/src/Mod/Part/Gui/TaskFaceColors.cpp b/src/Mod/Part/Gui/TaskFaceColors.cpp index 980a12b5b7..d7195a65be 100644 --- a/src/Mod/Part/Gui/TaskFaceColors.cpp +++ b/src/Mod/Part/Gui/TaskFaceColors.cpp @@ -24,7 +24,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +# include # include # include # include diff --git a/src/Mod/PartDesign/App/Body.h b/src/Mod/PartDesign/App/Body.h index 5cbd717f53..3ba7bfbbc7 100644 --- a/src/Mod/PartDesign/App/Body.h +++ b/src/Mod/PartDesign/App/Body.h @@ -27,7 +27,7 @@ #include #include -#include +#include namespace App { class Origin; diff --git a/src/Mod/PartDesign/App/ShapeBinder.h b/src/Mod/PartDesign/App/ShapeBinder.h index 8cb528a65b..ba7c548cd4 100644 --- a/src/Mod/PartDesign/App/ShapeBinder.h +++ b/src/Mod/PartDesign/App/ShapeBinder.h @@ -25,7 +25,7 @@ #define PARTDESIGN_DATUMSHAPE_H #include -#include +#include #include #include diff --git a/src/Mod/PartDesign/Gui/TaskTransformedMessages.h b/src/Mod/PartDesign/Gui/TaskTransformedMessages.h index e95aa9f73d..ad1b349488 100644 --- a/src/Mod/PartDesign/Gui/TaskTransformedMessages.h +++ b/src/Mod/PartDesign/Gui/TaskTransformedMessages.h @@ -25,7 +25,7 @@ #define GUI_TASKVIEW_TaskTransformedMessages_H #include -#include +#include class Ui_TaskTransformedMessages; typedef boost::signals2::connection Connection; diff --git a/src/Mod/PartDesign/Gui/WorkflowManager.h b/src/Mod/PartDesign/Gui/WorkflowManager.h index 4ff9ca643e..a66e7e10d1 100644 --- a/src/Mod/PartDesign/Gui/WorkflowManager.h +++ b/src/Mod/PartDesign/Gui/WorkflowManager.h @@ -23,7 +23,7 @@ #ifndef WORKFLOWMANAGER_H_PB7A5GCM #define WORKFLOWMANAGER_H_PB7A5GCM -#include +#include #include namespace App { diff --git a/src/Mod/Path/libarea/PythonStuff.cpp b/src/Mod/Path/libarea/PythonStuff.cpp index 9f531086de..d82715b1e8 100644 --- a/src/Mod/Path/libarea/PythonStuff.cpp +++ b/src/Mod/Path/libarea/PythonStuff.cpp @@ -35,7 +35,7 @@ //#include //#include #include -#include +#include #include #include #include diff --git a/src/Mod/Sketcher/App/PropertyConstraintList.h b/src/Mod/Sketcher/App/PropertyConstraintList.h index 10c6c0bee2..27ff8aec6f 100644 --- a/src/Mod/Sketcher/App/PropertyConstraintList.h +++ b/src/Mod/Sketcher/App/PropertyConstraintList.h @@ -32,7 +32,7 @@ #include #include #include "Constraint.h" -#include +#include #include namespace Base { diff --git a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h index 6138dab26d..e99900e13d 100644 --- a/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h +++ b/src/Mod/Sketcher/Gui/TaskDlgEditSketch.h @@ -32,7 +32,7 @@ #include "TaskSketcherGeneral.h" #include "TaskSketcherMessages.h" #include "TaskSketcherSolverAdvanced.h" -#include +#include typedef boost::signals2::connection Connection; diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.h b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.h index 94f1a3e553..fc52458bf1 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include namespace App { diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.h b/src/Mod/Sketcher/Gui/TaskSketcherElements.h index 3eb325fd23..86e69c47e3 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherElements.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.h b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.h index 974318a1c8..1cdd92923a 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherGeneral.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherGeneral.h @@ -26,7 +26,7 @@ #include #include -#include +#include class Ui_TaskSketcherGeneral; diff --git a/src/Mod/Sketcher/Gui/TaskSketcherMessages.h b/src/Mod/Sketcher/Gui/TaskSketcherMessages.h index 3e230f1d24..09193959d6 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherMessages.h +++ b/src/Mod/Sketcher/Gui/TaskSketcherMessages.h @@ -26,7 +26,7 @@ #include #include -#include +#include class Ui_TaskSketcherMessages; typedef boost::signals2::connection Connection; diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.h b/src/Mod/Sketcher/Gui/ViewProviderSketch.h index 6d42806956..40333868da 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.h +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include "ShortcutListener.h" diff --git a/src/Mod/TechDraw/App/DrawPage.h b/src/Mod/TechDraw/App/DrawPage.h index e298f52078..17b2c383bd 100644 --- a/src/Mod/TechDraw/App/DrawPage.h +++ b/src/Mod/TechDraw/App/DrawPage.h @@ -24,7 +24,7 @@ #ifndef _DrawPage_h_ #define _DrawPage_h_ -#include +#include #include #include diff --git a/src/Mod/TechDraw/App/DrawView.h b/src/Mod/TechDraw/App/DrawView.h index 696f4af4a6..170ad493ab 100644 --- a/src/Mod/TechDraw/App/DrawView.h +++ b/src/Mod/TechDraw/App/DrawView.h @@ -23,7 +23,7 @@ #ifndef _DrawView_h_ #define _DrawView_h_ -#include +#include #include #include diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.cpp b/src/Mod/TechDraw/Gui/MDIViewPage.cpp index 097adf5b7e..1cfe08c1a6 100644 --- a/src/Mod/TechDraw/Gui/MDIViewPage.cpp +++ b/src/Mod/TechDraw/Gui/MDIViewPage.cpp @@ -39,7 +39,7 @@ #include #include #include - #include + #include #include #endif // #ifndef _PreComp_ diff --git a/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp b/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp index 8c345713bc..c43049cd1f 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderDrawingView.cpp @@ -25,7 +25,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ -#include +#include #include #include diff --git a/src/Mod/TechDraw/Gui/ViewProviderDrawingView.h b/src/Mod/TechDraw/Gui/ViewProviderDrawingView.h index f1828c713d..b778363843 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderDrawingView.h +++ b/src/Mod/TechDraw/Gui/ViewProviderDrawingView.h @@ -25,7 +25,7 @@ #ifndef TECHDRAWGUI_VIEWPROVIDERVIEW_H #define TECHDRAWGUI_VIEWPROVIDERVIEW_H -#include +#include #include #include diff --git a/src/Mod/TechDraw/Gui/ViewProviderPage.cpp b/src/Mod/TechDraw/Gui/ViewProviderPage.cpp index 524df6912a..09263fa216 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderPage.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderPage.cpp @@ -32,7 +32,7 @@ # include # include # include -# include +# include # include # include diff --git a/src/Mod/TechDraw/Gui/ViewProviderPage.h b/src/Mod/TechDraw/Gui/ViewProviderPage.h index 13bb28b023..443feb3047 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderPage.h +++ b/src/Mod/TechDraw/Gui/ViewProviderPage.h @@ -28,7 +28,7 @@ #include #include -#include +#include namespace TechDraw{ class DrawPage; diff --git a/src/boost_python.hpp b/src/boost_python.hpp new file mode 100644 index 0000000000..6144219310 --- /dev/null +++ b/src/boost_python.hpp @@ -0,0 +1,9 @@ +#ifndef FREECAD_BOOST_PYTHON_HPP_WORKAROUND +#define FREECAD_BOOST_PYTHON_HPP_WORKAROUND + +// Workaround for boost >= 1.74 +#define BOOST_ALLOW_DEPRECATED_HEADERS +#include +#undef BOOST_ALLOW_DEPRECATED_HEADERS + +#endif // #ifndef FREECAD_BOOST_PYTHON_HPP_WORKAROUND diff --git a/src/boost_signals2.hpp b/src/boost_signals2.hpp new file mode 100644 index 0000000000..8034a2c92c --- /dev/null +++ b/src/boost_signals2.hpp @@ -0,0 +1,9 @@ +#ifndef FREECAD_SIGNALS2_HPP_WORKAROUND +#define FREECAD_SIGNALS2_HPP_WORKAROUND + +// Workaround for boost >= 1.74 +#define BOOST_ALLOW_DEPRECATED_HEADERS +#include +#undef BOOST_ALLOW_DEPRECATED_HEADERS + +#endif // #ifndef FREECAD_SIGNALS2_HPP_WORKAROUND From 402a009f42a956fc486718c1e6f6f3928d447e0d Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 29 Dec 2020 10:36:07 +0100 Subject: [PATCH 03/11] SMESH: [skip ci] fix -Wdelete-non-virtual-dtor --- src/3rdParty/salomesmesh/inc/SMESH_Controls.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdParty/salomesmesh/inc/SMESH_Controls.hxx b/src/3rdParty/salomesmesh/inc/SMESH_Controls.hxx index ee7c742f53..5f42b5b66b 100644 --- a/src/3rdParty/salomesmesh/inc/SMESH_Controls.hxx +++ b/src/3rdParty/salomesmesh/inc/SMESH_Controls.hxx @@ -53,7 +53,7 @@ namespace SMESH{ class SMESHCONTROLS_EXPORT Functor { public: - ~Functor(){} + virtual ~Functor(){} virtual void SetMesh( const SMDS_Mesh* theMesh ) = 0; virtual SMDSAbs_ElementType GetType() const = 0; }; From eac4062b3f90744a914cd04a334f0dce63946ae3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 29 Dec 2020 15:34:25 +0100 Subject: [PATCH 04/11] Boost: [skip ci] Fix build warnings from deprecated Boost headers (v1.75) --- src/App/Document.cpp | 2 +- src/App/PreCompiled.h | 2 +- src/App/PropertyExpressionEngine.cpp | 1 - src/App/PropertyExpressionEngine.h | 2 +- src/Gui/DAGView/DAGModel.cpp | 2 +- src/Gui/DAGView/DAGModelGraph.h | 4 ++-- src/Gui/PreCompiled.h | 2 +- src/Mod/Part/App/PreCompiled.h | 2 +- src/Mod/Sketcher/App/planegcs/GCS.cpp | 2 +- src/Mod/TechDraw/App/EdgeWalker.h | 2 +- src/boost_graph_adjacency_list.hpp | 9 +++++++++ src/boost_graph_reverse_graph.hpp | 9 +++++++++ 12 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 src/boost_graph_adjacency_list.hpp create mode 100644 src/boost_graph_reverse_graph.hpp diff --git a/src/App/Document.cpp b/src/App/Document.cpp index e985aa1b47..73610f58b6 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -70,7 +70,7 @@ recompute path. Also, it enables more complicated dependencies beyond trees. #include -#include +#include #include #include #include diff --git a/src/App/PreCompiled.h b/src/App/PreCompiled.h index 634cfe55a4..115e397830 100644 --- a/src/App/PreCompiled.h +++ b/src/App/PreCompiled.h @@ -86,7 +86,7 @@ #include #include -#include +#include #include //namespace po = boost::program_options; diff --git a/src/App/PropertyExpressionEngine.cpp b/src/App/PropertyExpressionEngine.cpp index b380624599..3801f475b8 100644 --- a/src/App/PropertyExpressionEngine.cpp +++ b/src/App/PropertyExpressionEngine.cpp @@ -36,7 +36,6 @@ #include #include #include -#include using namespace App; diff --git a/src/App/PropertyExpressionEngine.h b/src/App/PropertyExpressionEngine.h index 4b63a8b147..1b343628ea 100644 --- a/src/App/PropertyExpressionEngine.h +++ b/src/App/PropertyExpressionEngine.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/Gui/DAGView/DAGModel.cpp b/src/Gui/DAGView/DAGModel.cpp index 96efd9dab2..d299c0a14a 100644 --- a/src/Gui/DAGView/DAGModel.cpp +++ b/src/Gui/DAGView/DAGModel.cpp @@ -24,7 +24,7 @@ #ifndef _PreComp_ #include #include -#include +#include #include #include diff --git a/src/Gui/DAGView/DAGModelGraph.h b/src/Gui/DAGView/DAGModelGraph.h index cd48bff21e..ca5c264155 100644 --- a/src/Gui/DAGView/DAGModelGraph.h +++ b/src/Gui/DAGView/DAGModelGraph.h @@ -26,9 +26,9 @@ #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/src/Gui/PreCompiled.h b/src/Gui/PreCompiled.h index 4aef35543a..23d89e9e5d 100644 --- a/src/Gui/PreCompiled.h +++ b/src/Gui/PreCompiled.h @@ -84,7 +84,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/Mod/Part/App/PreCompiled.h b/src/Mod/Part/App/PreCompiled.h index a7cc360af3..80a5cf2aa5 100644 --- a/src/Mod/Part/App/PreCompiled.h +++ b/src/Mod/Part/App/PreCompiled.h @@ -81,7 +81,7 @@ #include #include -#include +#include #include //namespace po = boost::program_options; diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index abccb0b9a0..16d7974eda 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -98,7 +98,7 @@ #include #include -#include +#include #include typedef Eigen::FullPivHouseholderQR::IntDiagSizeVectorType MatrixIndexType; diff --git a/src/Mod/TechDraw/App/EdgeWalker.h b/src/Mod/TechDraw/App/EdgeWalker.h index 3fa02b6f2e..4dcc5b502c 100644 --- a/src/Mod/TechDraw/App/EdgeWalker.h +++ b/src/Mod/TechDraw/App/EdgeWalker.h @@ -29,7 +29,7 @@ #define TECHDRAW_EDGEWALKER_H #include -#include +#include #include #include #include diff --git a/src/boost_graph_adjacency_list.hpp b/src/boost_graph_adjacency_list.hpp new file mode 100644 index 0000000000..313a38ca60 --- /dev/null +++ b/src/boost_graph_adjacency_list.hpp @@ -0,0 +1,9 @@ +#ifndef FREECAD_ADJACENCY_LIST_HPP_WORKAROUND +#define FREECAD_ADJACENCY_LIST_HPP_WORKAROUND + +// Workaround for boost >= 1.75 +#define BOOST_ALLOW_DEPRECATED_HEADERS +#include +#undef BOOST_ALLOW_DEPRECATED_HEADERS + +#endif // #ifndef FREECAD_ADJACENCY_LIST_HPP_WORKAROUND diff --git a/src/boost_graph_reverse_graph.hpp b/src/boost_graph_reverse_graph.hpp new file mode 100644 index 0000000000..6a0cf88d74 --- /dev/null +++ b/src/boost_graph_reverse_graph.hpp @@ -0,0 +1,9 @@ +#ifndef FREECAD_REVERSE_GRAPH_HPP_WORKAROUND +#define FREECAD_REVERSE_GRAPH_HPP_WORKAROUND + +// Workaround for boost >= 1.75 +#define BOOST_ALLOW_DEPRECATED_HEADERS +#include +#undef BOOST_ALLOW_DEPRECATED_HEADERS + +#endif // #ifndef FREECAD_REVERSE_GRAPH_HPP_WORKAROUND From ae68147d0b6781a92ef423650cb6b44ed0149f72 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 28 Dec 2020 18:24:50 +0100 Subject: [PATCH 05/11] LinearPattern: Support 1 occurrence When using linear pattern with expression, this can be usefull to have only one occurence (the original one), which can't be done with the following implemenation. This commit change this behaviour by allowing this value. --- src/Mod/PartDesign/App/FeatureLinearPattern.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureLinearPattern.cpp b/src/Mod/PartDesign/App/FeatureLinearPattern.cpp index adc2918ab3..463339fd2b 100644 --- a/src/Mod/PartDesign/App/FeatureLinearPattern.cpp +++ b/src/Mod/PartDesign/App/FeatureLinearPattern.cpp @@ -73,12 +73,10 @@ const std::list LinearPattern::getTransformations(const std::vector LinearPattern::getTransformations(const std::vector 1) { + double offset = distance / (occurrences - 1); + for (int i = 1; i < occurrences; i++) { + trans.SetTranslation(direction * i * offset); + transformations.push_back(trans); + } } return transformations; From 665a1106f7ac5257b2b454a0d4e6a70af6e46c1b Mon Sep 17 00:00:00 2001 From: donovaly Date: Mon, 28 Dec 2020 16:37:33 +0100 Subject: [PATCH 06/11] [TD] fix bug with angular and small values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * angular as reported here: https://forum.freecadweb.org/viewtopic.php?f=35&t=53473&start=10#p461507 * small values: since we convert to e.g. mm, we must then not output e.g. 'µm' * also a code optimization, fix a typo, removal of a meanwhile misleading comment --- src/Mod/TechDraw/App/DrawViewDimension.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawViewDimension.cpp b/src/Mod/TechDraw/App/DrawViewDimension.cpp index ac0e18714c..46edf77d99 100644 --- a/src/Mod/TechDraw/App/DrawViewDimension.cpp +++ b/src/Mod/TechDraw/App/DrawViewDimension.cpp @@ -485,7 +485,7 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void) } m_arcPoints = pts; m_hasGeometry = true; - } else if(Type.isValue("Angle")){ + } else if (Type.isValue("Angle")){ if (getRefType() != twoEdge) { Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); return App::DocumentObject::StdReturn; @@ -529,7 +529,7 @@ App::DocumentObjectExecReturn *DrawViewDimension::execute(void) pts.vertex = apex; m_anglePoints = pts; m_hasGeometry = true; - } else if(Type.isValue("Angle3Pt")){ + } else if (Type.isValue("Angle3Pt")){ if (getRefType() != threeVertex) { Base::Console().Log("Error: DVD - %s - 2D references are corrupt\n",getNameInDocument()); return App::DocumentObject::StdReturn; @@ -629,8 +629,6 @@ std::string DrawViewDimension::formatValue(qreal value, QString qFormatSpec, int QString qUserString = asQuantity.getUserString(); // this handles mm to inch/km/parsec etc // and decimal positions but won't give more than // Global_Decimals precision - // really should be able to ask units for value - // in appropriate UoM!! //units api: get schema to figure out if this is multi-value schema(Imperial1, ImperialBuilding, etc) //if it is multi-unit schema, don't even try to use Alt Decimals @@ -664,7 +662,7 @@ std::string DrawViewDimension::formatValue(qreal value, QString qFormatSpec, int formattedValue = qMultiValueStr; } else { if (formatSpecifier.isEmpty()) { - Base::Console().Warning("Warning - no numeric format in formatSpec %s - %s\n", + Base::Console().Warning("Warning - no numeric format in Format Spec %s - %s\n", qPrintable(qFormatSpec), getNameInDocument()); return Base::Tools::toStdString(qFormatSpec); } @@ -693,7 +691,16 @@ std::string DrawViewDimension::formatValue(qreal value, QString qFormatSpec, int // get the conversion factor for the unit double convertValue = Base::Quantity::parse(QString::fromLatin1("1") + QString::fromStdString(BaseLengthUnit)).getValue(); // the result is now just val / convertValue because val is always in the base unit - double userVal = asQuantity.getValue() / convertValue; + // don't do this for angular values since they are not in the BaseLengthUnit + double userVal; + if (!angularMeasure) { + userVal = asQuantity.getValue() / convertValue; + // since we converted to the BaseLengthUnit we must assure it is also used for qUserStringUnits + qUserStringUnits = QChar::fromLatin1(' ') + QString::fromStdString(BaseLengthUnit); + } + else { + userVal = asQuantity.getValue(); + } // we reformat the value // the user can overwrite the decimal settings, so we must in every case use the formatSpecifier @@ -751,7 +758,7 @@ std::string DrawViewDimension::formatValue(qreal value, QString qFormatSpec, int Base::Tools::toStdString(formatSuffix); } else if (partial == 2) { // just the unit - if ((Type.isValue("Angle")) || (Type.isValue("Angle3Pt"))) { + if (angularMeasure) { // remove space between dimension and unit if unit is not "deg" if ( !qUserStringUnits.contains(QString::fromLatin1("deg")) ) { QRegExp space(QString::fromUtf8("\\s")); From e20a21a97dfc715bfacf6062d61e0f3f3555afa2 Mon Sep 17 00:00:00 2001 From: Aapo Date: Mon, 28 Dec 2020 01:10:28 +0200 Subject: [PATCH 07/11] [TD] DrawViewDimension Tolerances, print zero tolerances without plus sign and decimals. --- src/Mod/TechDraw/App/DrawViewDimension.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawViewDimension.cpp b/src/Mod/TechDraw/App/DrawViewDimension.cpp index 46edf77d99..7db00ca15c 100644 --- a/src/Mod/TechDraw/App/DrawViewDimension.cpp +++ b/src/Mod/TechDraw/App/DrawViewDimension.cpp @@ -786,8 +786,16 @@ std::pair DrawViewDimension::getFormattedToleranceValu underTolerance = underFormatSpec; overTolerance = overFormatSpec; } else { - underTolerance = QString::fromUtf8(formatValue(UnderTolerance.getValue(), underFormatSpec, partial).c_str()); - overTolerance = QString::fromUtf8(formatValue(OverTolerance.getValue(), overFormatSpec, partial).c_str()); + if (DrawUtil::fpCompare(UnderTolerance.getValue(), 0.0)) { + underTolerance = QString::fromUtf8(formatValue(UnderTolerance.getValue(), QString::fromUtf8("%.0f"), partial).c_str()); + } else { + underTolerance = QString::fromUtf8(formatValue(UnderTolerance.getValue(), underFormatSpec, partial).c_str()); + } + if (DrawUtil::fpCompare(OverTolerance.getValue(), 0.0)) { + overTolerance = QString::fromUtf8(formatValue(OverTolerance.getValue(), QString::fromUtf8("%.0f"), partial).c_str()); + } else { + overTolerance = QString::fromUtf8(formatValue(OverTolerance.getValue(), overFormatSpec, partial).c_str()); + } } tolerances.first = underTolerance.toStdString(); From c0e06f7f19f52c6971262f6e2d700fc9d633fea0 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Mon, 28 Dec 2020 16:40:59 +0100 Subject: [PATCH 08/11] Sketcher/GCS: New Block constraint fixes ======================================== Previous versions relied on a heuristic that proved insufficient for cummulative use of the Block constraint. The effect is that Block constraints stopped blocking, which is a major bug, as it lead to inadvertedly moving geometry that was supposed to be blocked. Fixes: https://forum.freecadweb.org/viewtopic.php?f=13&t=53515&start=30#p461215 (Thanks Chaospilot) Know problems with old block constraint (v0.18): 1. If driving constraints were present, they were ignored if inserted before the block constraint (to avoid redundancy/conflicting). They resulted in Principles of Working of the new block constraint: 1. Handling of the new block constraint is based two processes, a pre-analysis and a post-analysis. Pre-analysis works *before* diagnosing the system in the solver. Post-analysis works *after* diagnosing the system in the solver. 2. Pre-analysis is directed to detect geometries affected *exclusively* by a block constraint. This is important because these geometries can be pre-fixed when creating the solver geometry and constraints before GCS::diagnose() via initSolution() AND because if no other constraint affects the geometry, the geometry parameters won't even appear in the Jacobian of GCS, so they won't be reported as dependent parameters (for which post-analysis would be of no use). 3. Post-analysis is directed to detect Geometries affected *not only* by a block constraint. This is important because pre-fixing these geometries would lead to redundant constraints. The post-analysis, enables to fix just the parameters that fulfil the dependacy groups. 4. Post-analysis basically identifies which parameters shall be fixed to make geometries having blocking constraints fixed, while not leading to redundant/conflicting constraints. These parameters must belong to blocked geometry. This is, groups may comprise parameters belonging to blocked geometry and parameters belonging to unconstrained geometry. It is licit that the latter remain as dependent parameters. The former are referred to as "blockable parameters". Extending this concept, there may be unsatisfiable groups (because they do not comprise any bloackable parameter), and it is the desired outcome NOT to satisfy such groups. It must be emphasised that there is not a single combination of fixed parameters from the blockable parameters that satisfy all the dependency groups. However: 1) some combinations do not satisfy all the dependency groups that must be satisfied (e.g. fixing one group containing two blockable parameters with a given one may result in another group, fixable only by the former, not to be satisfied). This leads, in a subsequent diagnosis, to satisfiable unsatisfied groups. 2) some combinations lead to partially redundant constraints, that the solver will silently drop in a subsequent diagnosis, thereby reducing the rank of the system fixing less than it should. 5. The implementation rationale is as follows: 1) The implementation is on the order of the groups provided by the QR decomposition used to reveal the parameters (see System::identifyDependentParameters in GCS). Zeros are made over the pilot of the full R matrix of the QR decomposition, which is a top triangular matrix.This, together with the permutation matrix, allow to know groups of dependent parameters (cols between rank and full size). Each group refers to a new parameter not affected by the rank in combination with other free parameters intervening in the rank (because of the triangular shape of the R matrix). This results in that each the first column between the rank and the full size, may only depend on a number of parameters, while the last full size colum may dependent on any amount of previously introduced parameters. 2) Thus the rationale is to start from the last group (having **potentially** the larger amount of parameters) and selecting as blocking for that group the latest blockable parameter. Because previous groups do not have access to the last parameter, this can never interfere with previous groups. However, because the last parameter may not be a blockable one, there is a risk of selecting a parameter common with other group, albeit the probability is reduced and probably (I have not demonstrated it though and I am not sure), it systematically leads to the right solution in one iteration. GCS: Change dependency group from std::set to std::vector to prevent reordering of parameters. --- src/Mod/Sketcher/App/Sketch.cpp | 401 ++++++++++++++++---------- src/Mod/Sketcher/App/Sketch.h | 65 +++++ src/Mod/Sketcher/App/planegcs/GCS.cpp | 36 ++- src/Mod/Sketcher/App/planegcs/GCS.h | 4 +- 4 files changed, 353 insertions(+), 153 deletions(-) diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 645ee33621..87569bcf53 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -130,6 +130,85 @@ void Sketch::clear(void) malformedConstraints = false; } +bool Sketch::analyseBlockedGeometry( const std::vector &internalGeoList, + const std::vector &constraintList, + std::vector &onlyblockedGeometry, + std::vector &blockedGeoIds) const +{ + bool isSomethingBlocked = false; + bool doesBlockAffectOtherConstraints = false; + + int geoindex = 0; + for(auto g : internalGeoList) { + if(GeometryFacade::getBlocked(g)) { + // is it only affected by one constraint, the block constraint (and this is driving), or by any other driving constraint ? + bool blockOnly = true; + bool blockisDriving = false; + + for(auto c : constraintList) { + // is block driving + if( c->Type == Sketcher::Block && c->isDriving && c->First == geoindex) + blockisDriving = true; + + if( c->Type != Sketcher::Block && c->isDriving && + (c->First == geoindex || c->Second == geoindex || c->Third == geoindex) ) + blockOnly = false; + } + + if(blockisDriving) { + if(blockOnly) { + onlyblockedGeometry[geoindex] = true; // we pre-fix this geometry + isSomethingBlocked = true; + } + else { + // we will have to pos-analyse the first diagnose result for these geometries + // in order to avoid redundant constraints + isSomethingBlocked = true; + doesBlockAffectOtherConstraints = true; + blockedGeoIds.push_back(geoindex); + } + } + + } + geoindex++; + } + + if(isSomethingBlocked) { + + // look for internal geometry linked IAs + for(auto c : constraintList) { + if(c->Type == InternalAlignment) { + + auto geoit = std::find(blockedGeoIds.begin(),blockedGeoIds.end(),c->Second); + + if(geoit != blockedGeoIds.end() || onlyblockedGeometry[c->Second]) { // internal alignment geometry found, add to list + // check if pre-fix or post-analyses + bool blockAffectedOnly = true; + + for(auto ic : constraintList) { + // there is another driving constraint + if( ic->Type != Sketcher::Block && ic->isDriving && + (ic->First == c->First || ic->Second == c->First || ic->Third == c->First)) + blockAffectedOnly = false; + } + + if(blockAffectedOnly) { + onlyblockedGeometry[c->Second] = true; // we pre-fix this geometry + } + else { + // we will have to post-analyse the first diagnose result for these geometries + // in order to avoid redundant constraints + doesBlockAffectOtherConstraints = true; + blockedGeoIds.push_back(*geoit); + } + } + } + } + } + + return doesBlockAffectOtherConstraints; +} + int Sketch::setUpSketch(const std::vector &GeoList, const std::vector &ConstraintList, int extGeoCount) @@ -144,13 +223,43 @@ int Sketch::setUpSketch(const std::vector &GeoList, for (int i=int(GeoList.size())-extGeoCount; i < int(GeoList.size()); i++) extGeoList.push_back(GeoList[i]); - std::vector blockedGeometry(intGeoList.size(),false); // these geometries are blocked, frozen and sent as fixed parameters to the solver + std::vector onlyBlockedGeometry(intGeoList.size(),false); // these geometries are blocked, frozen and sent as fixed parameters to the solver std::vector unenforceableConstraints(ConstraintList.size(),false); // these constraints are unenforceable due to a Blocked constraint + /* This implements the old block constraint. I have decided not to remove it at this time while the new is tested, just in case the change + * needs to be reverted */ /*if(!intGeoList.empty()) getBlockedGeometry(blockedGeometry, unenforceableConstraints, ConstraintList);*/ - addGeometry(intGeoList,blockedGeometry); + // Pre-analysis of blocked geometry (new block constraint) to fix geometry only affected by a block constraint (see comment in Sketch.h) + std::vector blockedGeoIds; + bool doesBlockAffectOtherConstraints = analyseBlockedGeometry( intGeoList, + ConstraintList, + onlyBlockedGeometry, + blockedGeoIds); + +#ifdef DEBUG_BLOCK_CONSTRAINT + if(doesBlockAffectOtherConstraints) + Base::Console().Log("\n Block interferes with other constraints: Post-analysis required"); + + Base::Console().Log("\nOnlyBlocked GeoIds:"); + size_t i = 0; + for(; i < onlyBlockedGeometry.size(); i++) { + if(onlyBlockedGeometry[i]) + Base::Console().Log("\n GeoId=%d", i); + } + if( i == 0) + Base::Console().Log("\n None"); + + Base::Console().Log("\nNotOnlyBlocked GeoIds:"); + i = 0; + for(; i < blockedGeoIds.size(); i++) + Base::Console().Log("\n GeoId=%d", blockedGeoIds[i]); + if( i == 0) + Base::Console().Log("\n None"); +#endif //DEBUG_BLOCK_CONSTRAINT + + addGeometry(intGeoList,onlyBlockedGeometry); int extStart=Geoms.size(); addGeometry(extGeoList, true); int extEnd=Geoms.size()-1; @@ -165,158 +274,43 @@ int Sketch::setUpSketch(const std::vector &GeoList, GCSsys.declareUnknowns(Parameters); GCSsys.declareDrivenParams(DrivenParameters); GCSsys.initSolution(defaultSolverRedundant); - GCSsys.getConflicting(Conflicting); - GCSsys.getRedundant(Redundant); - GCSsys.getDependentParams(pDependentParametersList); - calculateDependentParametersElements(); + // Post-analysis + // Now that we have all the parameters information, we deal properly with the block constraints if necessary + if(doesBlockAffectOtherConstraints) { - // Now that we have all the parameters information, we deal properly with the block constraint - - bool isSomethingBlocked = false; - std::vector blockedGeoIds; - - int geoindex = 0; - for(auto & g : Geoms) { - if(!g.external && GeometryFacade::getBlocked(g.geo)) { - isSomethingBlocked = true; - blockedGeoIds.push_back(geoindex); - } - geoindex++; - } - - if(isSomethingBlocked) { - - // 0. look for internal geometry linked IAs - for(auto c : ConstraintList) { - if(c->Type == InternalAlignment) { - - auto geoit = std::find(blockedGeoIds.begin(),blockedGeoIds.end(),c->Second); - - if(geoit != blockedGeoIds.end()) { // internal alignment geometry found, add to list - blockedGeoIds.push_back(*geoit); - } - } - } - - - // 1. Look what needs blocking std::vector params_to_block; - std::vector < std::set < double*>> groups; - GCSsys.getDependentParamsGroups(groups); - if(GCSsys.isEmptyDiagnoseMatrix()) { // special case in which no other driving constraint is in the system - for(auto geoid : blockedGeoIds) { - switch(Geoms[geoid].type) { - case Point: - params_to_block.push_back(Points[Geoms[geoid].index].x); - params_to_block.push_back(Points[Geoms[geoid].index].y); - break; - case Line: - Lines[Geoms[geoid].index].PushOwnParams(params_to_block); - break; - case Arc: - Arcs[Geoms[geoid].index].PushOwnParams(params_to_block); - break; - case Circle: - Circles[Geoms[geoid].index].PushOwnParams(params_to_block); - break; - case Ellipse: - Ellipses[Geoms[geoid].index].PushOwnParams(params_to_block); - break; - case ArcOfEllipse: - ArcsOfEllipse[Geoms[geoid].index].PushOwnParams(params_to_block); - break; - case ArcOfHyperbola: - ArcsOfHyperbola[Geoms[geoid].index].PushOwnParams(params_to_block); - break; - case ArcOfParabola: - ArcsOfParabola[Geoms[geoid].index].PushOwnParams(params_to_block); - break; - case BSpline: - BSplines[Geoms[geoid].index].PushOwnParams(params_to_block); - break; - case None: - break; - } + bool unsatisfied_groups = analyseBlockedConstraintDependentParameters(blockedGeoIds, params_to_block); + + // I am unsure if more than one QR iterations are needed with the current implementation. + // + // With previous implementations mostly one QR iteration was enough, but if block constraint is abused, more + // iterations were needed. + int index = 0; + while(unsatisfied_groups) { + // We tried hard not to arrive to an unsatisfied group, so we try harder + // This loop has the advantage that the user will notice increased effort to solve, + // so may understand he is abusing the block constraint, while guaranteing that wrong + // behaviour of the block constraint is not undetected. + + // Another QR iteration + fixParametersAndDiagnose(params_to_block); + + unsatisfied_groups = analyseBlockedConstraintDependentParameters(blockedGeoIds,params_to_block); + + if (debugMode==GCS::IterationLevel) { + Base::Console().Log("Sketcher::setUpSketch()-BlockConstraint-PostAnalysis:%d\n",index); } - + index++; } - else { -#ifdef DEBUG_BLOCK_CONSTRAINT - for(size_t i = 0; i < groups.size(); i++) { - Base::Console().Log("\nDepParams: Group %d:",i); - for(size_t j = 0; j < groups[i].size(); j++) - Base::Console().Log("\n Param=%x ,GeoId=%d, GeoPos=%d", - param2geoelement.find(*std::next(groups[i].begin(), j))->first, - param2geoelement.find(*std::next(groups[i].begin(), j))->second.first, - param2geoelement.find(*std::next(groups[i].begin(), j))->second.second); - } -#endif //DEBUG_BLOCK_CONSTRAINT - - for(size_t i = 0; i < groups.size(); i++) { - for(size_t j = 0; j < groups[i].size(); j++) { - - double * thisparam = *std::next(groups[i].begin(), j); - - auto element = param2geoelement.find(thisparam); - - if (element != param2geoelement.end()) { - - auto blocked = std::find(blockedGeoIds.begin(),blockedGeoIds.end(),element->second.first); - - if( blocked != blockedGeoIds.end()) { - // This dependent parameter group contains a parameter that should be blocked. - // - // One parameter per group is enough to fix the group, but it must be a different one for each group or - // it will create a different dependency group - auto already_in = std::find(params_to_block.begin(),params_to_block.end(), thisparam); - - if( already_in == params_to_block.end()) { - params_to_block.push_back(thisparam); - -#ifdef DEBUG_BLOCK_CONSTRAINT - Base::Console().Log("\nBlocking: Param=%x ,GeoId=%d, GeoPos=%d", - element->first, - element->second.first, - element->second.second); -#endif //DEBUG_BLOCK_CONSTRAINT - - break; - } - } - } - } - } - } // if(!GCSsys.isEmptyDiagnoseMatrix()) // 2. If something needs blocking, block-it - if(params_to_block.size() > 0) { - - for( auto p : params_to_block ) { - auto findparam = std::find(Parameters.begin(),Parameters.end(), p); - - if(findparam != Parameters.end()) { - FixParameters.push_back(*findparam); - Parameters.erase(findparam); - } - - } - - pDependencyGroups.clear(); - clearTemporaryConstraints(); - GCSsys.invalidatedDiagnosis(); - GCSsys.declareUnknowns(Parameters); - GCSsys.declareDrivenParams(DrivenParameters); - GCSsys.initSolution(defaultSolverRedundant); - GCSsys.getConflicting(Conflicting); - GCSsys.getRedundant(Redundant); - GCSsys.getDependentParams(pDependentParametersList); - - calculateDependentParametersElements(); + fixParametersAndDiagnose(params_to_block); #ifdef DEBUG_BLOCK_CONSTRAINT - std::vector < std::set < double*>> groups; + if(params_to_block.size() > 0) { + std::vector < std::vector < double*>> groups; GCSsys.getDependentParamsGroups(groups); // Debug code block @@ -328,10 +322,17 @@ int Sketch::setUpSketch(const std::vector &GeoList, param2geoelement.find(*std::next(groups[i].begin(), j))->second.first, param2geoelement.find(*std::next(groups[i].begin(), j))->second.second); } -#endif //DEBUG_BLOCK_CONSTRAINT } +#endif //DEBUG_BLOCK_CONSTRAINT } + // Now we set the Sketch status with the latest solver information + GCSsys.getConflicting(Conflicting); + GCSsys.getRedundant(Redundant); + GCSsys.getDependentParams(pDependentParametersList); + + calculateDependentParametersElements(); + if (debugMode==GCS::Minimal || debugMode==GCS::IterationLevel) { Base::TimeInfo end_time; @@ -341,6 +342,112 @@ int Sketch::setUpSketch(const std::vector &GeoList, return GCSsys.dofsNumber(); } +void Sketch::fixParametersAndDiagnose(std::vector ¶ms_to_block) +{ + if(params_to_block.size() > 0) { // only there are parameters to fix + for( auto p : params_to_block ) { + auto findparam = std::find(Parameters.begin(),Parameters.end(), p); + + if(findparam != Parameters.end()) { + FixParameters.push_back(*findparam); + Parameters.erase(findparam); + } + } + + pDependencyGroups.clear(); + clearTemporaryConstraints(); + GCSsys.invalidatedDiagnosis(); + GCSsys.declareUnknowns(Parameters); + GCSsys.declareDrivenParams(DrivenParameters); + GCSsys.initSolution(defaultSolverRedundant); + /*GCSsys.getConflicting(Conflicting); + GCSsys.getRedundant(Redundant); + GCSsys.getDependentParams(pDependentParametersList); + + calculateDependentParametersElements();*/ + } +} + +bool Sketch::analyseBlockedConstraintDependentParameters(std::vector &blockedGeoIds, std::vector ¶ms_to_block) const +{ + // 1. Retrieve solver information + std::vector < std::vector < double*>> groups; + GCSsys.getDependentParamsGroups(groups); + + // 2. Determine blockable parameters for each group (see documentation in header file). + struct group { + std::vector blockable_params_in_group; + double * blocking_param_in_group = nullptr; + }; + + std::vector prop_groups(groups.size()); + +#ifdef DEBUG_BLOCK_CONSTRAINT + for(size_t i = 0; i < groups.size(); i++) { + Base::Console().Log("\nDepParams: Group %d:",i); + for(size_t j = 0; j < groups[i].size(); j++) + Base::Console().Log("\n Param=%x ,GeoId=%d, GeoPos=%d", + param2geoelement.find(*std::next(groups[i].begin(), j))->first, + param2geoelement.find(*std::next(groups[i].begin(), j))->second.first, + param2geoelement.find(*std::next(groups[i].begin(), j))->second.second); + } +#endif //DEBUG_BLOCK_CONSTRAINT + + for(size_t i = 0; i < groups.size(); i++) { + for(size_t j = 0; j < groups[i].size(); j++) { + + double * thisparam = *std::next(groups[i].begin(), j); + + auto element = param2geoelement.find(thisparam); + + if (element != param2geoelement.end()) { + + auto blockable = std::find(blockedGeoIds.begin(),blockedGeoIds.end(),element->second.first); + + if( blockable != blockedGeoIds.end()) { + // This dependent parameter group contains at least one parameter that should be blocked, so added to the blockable list. + prop_groups[i].blockable_params_in_group.push_back(thisparam); + } + } + } + } + + // 3. Apply heuristic - pick the last blockable param available to block the group, starting from the last group + for(size_t i = prop_groups.size(); i--> 0;) { + for(size_t j = prop_groups[i].blockable_params_in_group.size(); j-->0; ) { + // check if parameter is already satisfying one group + double * thisparam = prop_groups[i].blockable_params_in_group[j]; + auto pos = std::find(params_to_block.begin(), params_to_block.end(), thisparam); + + if( pos == params_to_block.end()) { // not found, so add + params_to_block.push_back(thisparam); + prop_groups[i].blocking_param_in_group = thisparam; +#ifdef DEBUG_BLOCK_CONSTRAINT + Base::Console().Log("\nTentatively blocking group %d, with param=%x", i, thisparam); +#endif //DEBUG_BLOCK_CONSTRAINT + break; + } + } + } + + // 4. Check if groups are satisfied or are licitly unsatisfiable and thus deemed as satisfied + bool unsatisfied_groups = false; + for(size_t i = 0; i < prop_groups.size(); i++) { + // 4.1. unsatisfiable group + if(prop_groups[i].blockable_params_in_group.size() == 0) { + // this group does not contain any blockable parameter, so it is by definition satisfied (or impossible to satisfy by block constraints) + continue; + } + // 4.2. satisfiable and not satisfied + if(prop_groups[i].blocking_param_in_group == nullptr) { + unsatisfied_groups = true; + } + } + + return unsatisfied_groups; +} + + void Sketch::clearTemporaryConstraints(void) { GCSsys.clearByTag(GCS::DefaultTemporaryConstraint); @@ -390,7 +497,7 @@ void Sketch::calculateDependentParametersElements(void) } } - std::vector < std::set < double*>> groups; + std::vector < std::vector < double*>> groups; GCSsys.getDependentParamsGroups(groups); pDependencyGroups.resize(groups.size()); @@ -399,7 +506,7 @@ void Sketch::calculateDependentParametersElements(void) for(size_t i = 0; i < groups.size(); i++) { for(size_t j = 0; j < groups[i].size(); j++) { - auto element = param2geoelement.find(*std::next(groups[i].begin(), j)); + auto element = param2geoelement.find(groups[i][j]); if (element != param2geoelement.end()) { pDependencyGroups[i].insert(element->second); diff --git a/src/Mod/Sketcher/App/Sketch.h b/src/Mod/Sketcher/App/Sketch.h index be04c5521e..f23150afda 100644 --- a/src/Mod/Sketcher/App/Sketch.h +++ b/src/Mod/Sketcher/App/Sketch.h @@ -499,6 +499,71 @@ private: int checkGeoId(int geoId) const; GCS::Curve* getGCSCurveByGeoId(int geoId); const GCS::Curve* getGCSCurveByGeoId(int geoId) const; + + // Block constraints + + /** This function performs a pre-analysis of blocked geometries, separating them into: + * + * 1) onlyblockedGeometry : Geometries affected exclusively by a block constraint. + * + * 2) blockedGeoIds : Geometries affected notonly by a block constraint. + * + * This is important because 1) can be pre-fixed when creating geometry and constraints + * before GCS::diagnose() via initSolution(). This is important because if no other constraint + * affect the geometry, the geometry parameters won't even appear in the Jacobian, and they won't + * be reported as dependent parameters. + * + * On the contrary 2) cannot be pre-fixed because it would lead to redundant constraints and requires + * a post-analysis, see analyseBlockedConstraintDependentParameters, to fix just the parameters that + * fulfil the dependacy groups. + */ + bool analyseBlockedGeometry( const std::vector &internalGeoList, + const std::vector &constraintList, + std::vector &onlyblockedGeometry, + std::vector &blockedGeoIds) const; + + /* This function performs a post-analysis of blocked geometries (see analyseBlockedGeometry for more detail + * on the pre-analysis). + * + * Basically identifies which parameters shall be fixed to make geometries having blocking constraints fixed, + * while not leading to redundant/conflicting constraints. These parameters must belong to blocked geometry. This + * is, groups may comprise parameters belonging to blocked geometry and parameters belonging to unconstrained geometry. + * It is licit that the latter remain as dependent parameters. The former are referred to as "blockable parameters". + * + * Extending this concept, there may be unsatisfiable groups (because they do not comprise any bloackable parameter), + * and it is the desired outcome NOT to satisfy such groups. + * + * There is not a single combination of fixed parameters from the blockable parameters that satisfy all the dependency + * groups. However: + * + * 1) some combinations do not satisfy all the dependency groups that must be satisfied (e.g. fixing one + * group containing two blockable parameters with a given one may result in another group, fixable only by the former, not + * to be satisfied). This leads, in a subsequent diagnosis, to satisfiable unsatisfied groups. + * + * 2) some combinations lead to partially redundant constraints, that the solver will silently drop in a subsequent diagnosis, + * thereby reducing the rank of the system fixing less than it should. + * + * Implementation rationale (at this time): + * + * The implementation is on the order of the groups provided by the QR decomposition used to reveal the parameters + * (see System::identifyDependentParameters in GCS). Zeros are made over the pilot of the full R matrix of the QR decomposition, + * which is a top triangular matrix.This, together with the permutation matrix, allow to know groups of dependent parameters + * (cols between rank and full size). Each group refers to a new parameter not affected by the rank in combination with other free + * parameters intervening in the rank (because of the triangular shape of the R matrix). This results in that each the first column + * between the rank and the full size, may only depend on a number of parameters, while the last full size colum may dependent on + * any amount of previously introduced parameters. + * + * Thus the rationale is start from the last group (having **potentially** the larger amount of parameters) and selecting as blocking + * for that group the latest blockable parameter. Because previous groups do not have access to the last parameter, this can never + * interfere with previous groups. However, because the last parameter may not be a blockable one, there is a risk of selecting a parameter + * common with other group, albeit the probability is reduced and probably (I have not demonstrated it though and I am not sure), it leads + * to the right solution in one iteration. + * + */ + bool analyseBlockedConstraintDependentParameters(std::vector &blockedGeoIds, std::vector ¶ms_to_block) const; + + /// utility function refactoring fixing the provided parameters and running a new diagnose + void fixParametersAndDiagnose(std::vector ¶ms_to_block); }; } //namespace Part diff --git a/src/Mod/Sketcher/App/planegcs/GCS.cpp b/src/Mod/Sketcher/App/planegcs/GCS.cpp index 16d7974eda..5d43564bba 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.cpp +++ b/src/Mod/Sketcher/App/planegcs/GCS.cpp @@ -226,6 +226,7 @@ public: void LogQRSystemInformation(const System &system, int paramsNum = 0, int constrNum = 0, int rank = 0); void LogGroupOfConstraints(const std::string & str, std::vector< std::vector > constraintgroups); + void LogGroupOfParameters(const std::string & str, std::vector< std::vector > parametergroups); void LogMatrix(const std::string str, Eigen::MatrixXd matrix); void LogMatrix(const std::string str, MatrixIndexType matrix); @@ -367,6 +368,23 @@ void SolverReportingManager::LogGroupOfConstraints(const std::string & str, std: LogString(tempstream.str()); } +void SolverReportingManager::LogGroupOfParameters(const std::string & str, std::vector< std::vector > parametergroups) +{ + std::stringstream tempstream; + + tempstream << str << ":" << '\n'; + + for(size_t i = 0; i < parametergroups.size(); i++) { + tempstream << "["; + + for(auto p : parametergroups[i]) + tempstream << std::hex << p << " "; + + tempstream << "]" << '\n'; + } + + LogString(tempstream.str()); +} #ifdef _GCS_DEBUG void SolverReportingManager::LogMatrix(const std::string str, Eigen::MatrixXd matrix) @@ -4017,9 +4035,9 @@ SolverReportingManager::Manager().LogToFile("GCS::System::diagnose()\n"); // // Debug: // auto fut = std::async(std::launch::deferred,&System::identifyDependentParametersSparseQR,this,J,jacobianconstraintmap, pdiagnoselist, false); - auto fut = std::async(&System::identifyDependentParametersSparseQR,this,J,jacobianconstraintmap, pdiagnoselist, false); + auto fut = std::async(&System::identifyDependentParametersSparseQR,this,J,jacobianconstraintmap, pdiagnoselist, /*silent=*/true); - makeSparseQRDecomposition( J, jacobianconstraintmap, SqrJT, rank, R); + makeSparseQRDecomposition( J, jacobianconstraintmap, SqrJT, rank, R, /*transposed=*/true, /*silent=*/false); int paramsNum = SqrJT.rows(); int constrNum = SqrJT.cols(); @@ -4260,21 +4278,31 @@ void System::identifyDependentParameters( T & qrJ, if(!silent) SolverReportingManager::Manager().LogMatrix("Rparams_nonzeros_over_pilot", Rparams); #endif + pDependentParametersGroups.resize(qrJ.cols()-rank); for (int j=rank; j < qrJ.cols(); j++) { for (int row=0; row < rank; row++) { if (fabs(Rparams(row,j)) > 1e-10) { int origCol = qrJ.colsPermutation().indices()[row]; - pDependentParametersGroups[j-rank].insert(pdiagnoselist[origCol]); + pDependentParametersGroups[j-rank].push_back(pdiagnoselist[origCol]); pDependentParameters.push_back(pdiagnoselist[origCol]); } } int origCol = qrJ.colsPermutation().indices()[j]; - pDependentParametersGroups[j-rank].insert(pdiagnoselist[origCol]); + pDependentParametersGroups[j-rank].push_back(pdiagnoselist[origCol]); pDependentParameters.push_back(pdiagnoselist[origCol]); } + +#ifdef _GCS_DEBUG + if(!silent) { + SolverReportingManager::Manager().LogMatrix("PermMatrix", (Eigen::MatrixXd)qrJ.colsPermutation()); + + SolverReportingManager::Manager().LogGroupOfParameters("ParameterGroups",pDependentParametersGroups); + } + +#endif } void System::identifyDependentGeometryParametersInTransposedJacobianDenseQRDecomposition( diff --git a/src/Mod/Sketcher/App/planegcs/GCS.h b/src/Mod/Sketcher/App/planegcs/GCS.h index 7c5f3ee916..506fd8f4a8 100644 --- a/src/Mod/Sketcher/App/planegcs/GCS.h +++ b/src/Mod/Sketcher/App/planegcs/GCS.h @@ -106,7 +106,7 @@ namespace GCS // This is a map of primary and secondary identifiers that are found dependent by the solver // GCS ignores from a type point - std::vector< std::set > pDependentParametersGroups; + std::vector< std::vector > pDependentParametersGroups; std::vector clist; std::map c2p; // constraint to parameter adjacency list @@ -363,7 +363,7 @@ namespace GCS { redundantOut = hasDiagnosis ? redundantTags : VEC_I(0); } void getDependentParams(VEC_pD &pdependentparameterlist) const { pdependentparameterlist = pDependentParameters;} - void getDependentParamsGroups(std::vector> &pdependentparametergroups) const + void getDependentParamsGroups(std::vector> &pdependentparametergroups) const { pdependentparametergroups = pDependentParametersGroups;} bool isEmptyDiagnoseMatrix() const {return emptyDiagnoseMatrix;} void invalidatedDiagnosis(); From 8e871412a9fd4d2a3b22d2ba792217cf6a454ae4 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Wed, 30 Dec 2020 17:14:51 +0100 Subject: [PATCH 09/11] Sketcher: Fix lock constraint reference mode ============================================ Fixes: https://forum.freecadweb.org/viewtopic.php?p=461600#p461517 --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 130 ++++++++++---------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 87c21b987c..d93ecb8b56 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -1194,81 +1194,81 @@ void CmdSketcherConstrainHorizontal::applyConstraint(std::vector &sel Sketcher::SketchObject* Obj = sketchgui->getSketchObject(); switch (seqIndex) { - case 0: // {Edge} - { - // create the constraint - const std::vector< Sketcher::Constraint * > &vals = Obj->Constraints.getValues(); + case 0: // {Edge} + { + // create the constraint + const std::vector< Sketcher::Constraint * > &vals = Obj->Constraints.getValues(); - int CrvId = selSeq.front().GeoId; - if (CrvId != -1) { - const Part::Geometry *geo = Obj->getGeometry(CrvId); - if (geo->getTypeId() != Part::GeomLineSegment::getClassTypeId()) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), - QObject::tr("The selected edge is not a line segment")); + int CrvId = selSeq.front().GeoId; + if (CrvId != -1) { + const Part::Geometry *geo = Obj->getGeometry(CrvId); + if (geo->getTypeId() != Part::GeomLineSegment::getClassTypeId()) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), + QObject::tr("The selected edge is not a line segment")); + return; + } + + // check if the edge already has a Horizontal/Vertical/Block constraint + for (std::vector< Sketcher::Constraint * >::const_iterator it= vals.begin(); + it != vals.end(); ++it) { + if ((*it)->Type == Sketcher::Horizontal && (*it)->First == CrvId && (*it)->FirstPos == Sketcher::none){ + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Double constraint"), + QObject::tr("The selected edge already has a horizontal constraint!")); + return; + } + if ((*it)->Type == Sketcher::Vertical && (*it)->First == CrvId && (*it)->FirstPos == Sketcher::none) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), + QObject::tr("The selected edge already has a vertical constraint!")); + return; + } + // check if the edge already has a Block constraint + if ((*it)->Type == Sketcher::Block && (*it)->First == CrvId && (*it)->FirstPos == Sketcher::none) { + QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), + QObject::tr("The selected edge already has a Block constraint!")); + return; + } + } + + // undo command open + Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add horizontal constraint")); + // issue the actual commands to create the constraint + Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Horizontal',%d)) ",CrvId); + // finish the transaction and update + Gui::Command::commitCommand(); + + tryAutoRecompute(Obj); + } + + break; + } + + case 1 : // {SelVertex, SelVertexOrRoot} + case 2 : // {SelRoot, SelVertex} + { + int GeoId1, GeoId2; + Sketcher::PointPos PosId1, PosId2; + GeoId1 = selSeq.at(0).GeoId; GeoId2 = selSeq.at(1).GeoId; + PosId1 = selSeq.at(0).PosId; PosId2 = selSeq.at(1).PosId; + + if ( areBothPointsOrSegmentsFixed(Obj, GeoId1, GeoId2) ) { + showNoConstraintBetweenFixedGeometry(); return; } - // check if the edge already has a Horizontal/Vertical/Block constraint - for (std::vector< Sketcher::Constraint * >::const_iterator it= vals.begin(); - it != vals.end(); ++it) { - if ((*it)->Type == Sketcher::Horizontal && (*it)->First == CrvId && (*it)->FirstPos == Sketcher::none){ - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Double constraint"), - QObject::tr("The selected edge already has a horizontal constraint!")); - return; - } - if ((*it)->Type == Sketcher::Vertical && (*it)->First == CrvId && (*it)->FirstPos == Sketcher::none) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), - QObject::tr("The selected edge already has a vertical constraint!")); - return; - } - // check if the edge already has a Block constraint - if ((*it)->Type == Sketcher::Block && (*it)->First == CrvId && (*it)->FirstPos == Sketcher::none) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), - QObject::tr("The selected edge already has a Block constraint!")); - return; - } - } - // undo command open - Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add horizontal constraint")); + Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add horizontal alignment")); // issue the actual commands to create the constraint - Gui::cmdAppObjectArgs(sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Horizontal',%d)) ",CrvId); + Gui::cmdAppObjectArgs(sketchgui->getObject() + ,"addConstraint(Sketcher.Constraint('Horizontal',%d,%d,%d,%d)) " + ,GeoId1,PosId1,GeoId2,PosId2); // finish the transaction and update Gui::Command::commitCommand(); tryAutoRecompute(Obj); + + break; + } - - break; - } - - case 1 : // {SelVertex, SelVertexOrRoot} - case 2 : // {SelRoot, SelVertex} - { - int GeoId1, GeoId2; - Sketcher::PointPos PosId1, PosId2; - GeoId1 = selSeq.at(0).GeoId; GeoId2 = selSeq.at(1).GeoId; - PosId1 = selSeq.at(0).PosId; PosId2 = selSeq.at(1).PosId; - - if ( areBothPointsOrSegmentsFixed(Obj, GeoId1, GeoId2) ) { - showNoConstraintBetweenFixedGeometry(); - return; - } - - // undo command open - Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add horizontal alignment")); - // issue the actual commands to create the constraint - Gui::cmdAppObjectArgs(sketchgui->getObject() - ,"addConstraint(Sketcher.Constraint('Horizontal',%d,%d,%d,%d)) " - ,GeoId1,PosId1,GeoId2,PosId2); - // finish the transaction and update - Gui::Command::commitCommand(); - - tryAutoRecompute(Obj); - - break; - - } } } @@ -1619,7 +1619,7 @@ void CmdSketcherConstrainLock::activated(int iMsg) // it is a constraint on a external line, make it non-driving Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)", - lastconstraintindex-2,"False"); + lastconstraintindex-1,"False"); Gui::cmdAppObjectArgs(selection[0].getObject(), "setDriving(%i,%s)", lastconstraintindex,"False"); From 4011e7f129451334eebc44f6ac5337cb3604f059 Mon Sep 17 00:00:00 2001 From: donovaly Date: Mon, 28 Dec 2020 02:07:59 +0100 Subject: [PATCH 10/11] [TD] cleanup preferences as discussed here: https://forum.freecadweb.org/viewtopic.php?f=35&t=53680&p=461356#p461349 * change default tolerance scale to 0.8 * the tolerance scale is directly applied, thus it must have non-italic label * move tolerance scale to "Dimensions" tab * move Fuzz settings to "Advanced" tab * move Conventions to General tab since e.g. the projection angle is an important general setting * add a note for the label font that this is also used for dimensions and that it there only has an effect for new ones * use more useful step size of 0.1 for some scaling spinboxes * sort UI fields in the C++ code to avoid doubled or missing entries (there were 2 doubled entries) * uniform width of all preferences dialogs * better alignment for the HLR dialog --- .../TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui | 523 +++++++++++------- .../Gui/DlgPrefsTechDrawAdvancedImp.cpp | 30 +- .../Gui/DlgPrefsTechDrawAnnotation.ui | 2 +- .../TechDraw/Gui/DlgPrefsTechDrawColors.ui | 4 +- .../Gui/DlgPrefsTechDrawDimensions.ui | 440 ++++++--------- .../Gui/DlgPrefsTechDrawDimensionsImp.cpp | 18 +- .../TechDraw/Gui/DlgPrefsTechDrawGeneral.ui | 166 +++++- .../Gui/DlgPrefsTechDrawGeneralImp.cpp | 77 +-- src/Mod/TechDraw/Gui/DlgPrefsTechDrawHLR.ui | 358 ++++++------ src/Mod/TechDraw/Gui/DlgPrefsTechDrawScale.ui | 338 ++--------- .../TechDraw/Gui/DlgPrefsTechDrawScaleImp.cpp | 20 +- 11 files changed, 994 insertions(+), 982 deletions(-) diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui index 45859a070e..9fe3d3cf4f 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui @@ -6,8 +6,8 @@ 0 0 - 460 - 318 + 440 + 333 @@ -40,7 +40,95 @@ - + + + + + 0 + 20 + + + + Include 2D Objects in projection + + + Show Loose 2D Geom + + + false + + + ShowLoose2d + + + Mod/TechDraw/General + + + + + + + + 0 + 0 + + + + Include edges with unexpected geometry (zero length etc.) in results + + + Allow Crazy Edges + + + allowCrazyEdge + + + Mod/TechDraw/debug + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Edge Fuzz + + + + + + + + 0 + 20 + + + + Override automatic dimension format + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + formatSpec + + + /Mod/TechDraw/Dimensions + + + + @@ -86,7 +174,136 @@ Only change unless you know what you are doing! - + + + + + 0 + 0 + + + + + 0 + 20 + + + + + true + + + + Perform a fuse operation on input shape(s) before Section view processing + + + Fuse Before Section + + + SectionFuseFirst + + + Mod/TechDraw/General + + + + + + + + true + + + + Dimension Format + + + + + + + + true + + + + Line End Cap Shape + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + Dump intermediate results during Detail view processing + + + Debug Detail + + + debugDetail + + + Mod/TechDraw/debugDetail + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + Highlights border of section cut in section views + + + Show Section Edges + + + true + + + ShowSectionEdges + + + /Mod/TechDraw/General + + + + @@ -122,146 +339,21 @@ Then you need to increase the tile limit. - - - - - 0 - 0 - - - - - 0 - 20 - - - - Dump intermediate results during Detail view processing - + + - Debug Detail - - - debugDetail - - - Mod/TechDraw/debugDetail + Max SVG Hatch Tiles - - - - - 0 - 20 - - - - Include 2D Objects in projection - + + - Show Loose 2D Geom - - - false - - - ShowLoose2d - - - Mod/TechDraw/General + Max PAT Hatch Segments - - - - - 0 - 0 - - - - Dump intermediate results during Section view processing - - - Debug Section - - - debugSection - - - Mod/TechDraw/debug - - - - - - - - 0 - 0 - - - - - 0 - 20 - - - - - true - - - - Perform a fuse operation on input shape(s) before Section view processing - - - Fuse Before Section - - - SectionFuseFirst - - - Mod/TechDraw/General - - - - - - - - 0 - 0 - - - - - 0 - 20 - - - - Highlights border of section cut in section views - - - Show Section Edges - - - true - - - ShowSectionEdges - - - /Mod/TechDraw/General - - - - + @@ -296,15 +388,25 @@ when hatching a face with a PAT pattern - - - - - true - + + + + + 0 + 0 + + + + Dump intermediate results during Section view processing - Line End Cap Shape + Debug Section + + + debugSection + + + Mod/TechDraw/debug @@ -336,86 +438,98 @@ can be a performance penalty in complex models. - - - - Qt::Horizontal - - + + + - 40 - 20 + 0 + 0 - + + Mark Fuzz + + - - + + 0 0 - - Include edges with unexpected geometry (zero length etc.) in results - - - Allow Crazy Edges - - - allowCrazyEdge - - - Mod/TechDraw/debug - - - - - - - Max SVG Hatch Tiles - - - - - - - Max PAT Hatch Segments - - - - - - - - true - - - - Dimension Format - - - - - + + 174 + 0 + + + 0 - 20 + 0 - Override automatic dimension format + Size of selection area around edges +Each unit is approx. 0.1 mm wide + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + 10.000000000000000 + - formatSpec + EdgeFuzz - /Mod/TechDraw/Dimensions + Mod/TechDraw/General + + + + + + + + 0 + 0 + + + + + 174 + 0 + + + + + 0 + 0 + + + + Selection area around center marks +Each unit is approx. 0.1 mm wide + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 5.000000000000000 + + + MarkFuzz + + + Mod/TechDraw/General @@ -450,8 +564,8 @@ can be a performance penalty in complex models. - 20 - 20 + 17 + 1 @@ -479,6 +593,11 @@ can be a performance penalty in complex models. QLineEdit
Gui/PrefWidgets.h
+ + Gui::PrefDoubleSpinBox + QDoubleSpinBox +
Gui/PrefWidgets.h
+
diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvancedImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvancedImp.cpp index fffbf95c87..39b6aeb6f1 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvancedImp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvancedImp.cpp @@ -45,32 +45,36 @@ DlgPrefsTechDrawAdvancedImp::~DlgPrefsTechDrawAdvancedImp() void DlgPrefsTechDrawAdvancedImp::saveSettings() { - ui->cbEndCap->onSave(); - ui->cbCrazyEdges->onSave(); - ui->cbDebugSection->onSave(); - ui->cbDetectFaces->onSave(); - ui->cbDebugDetail->onSave(); + ui->cbDetectFaces->onSave(); ui->cbShowSectionEdges->onSave(); + ui->cbDebugSection->onSave(); + ui->cbDebugDetail->onSave(); + ui->cbCrazyEdges->onSave(); ui->cbFuseBeforeSection->onSave(); + ui->cbShowLoose->onSave(); + ui->pdsbEdgeFuzz->onSave(); + ui->pdsbMarkFuzz->onSave(); + ui->leFormatSpec->onSave(); + ui->cbEndCap->onSave(); ui->sbMaxTiles->onSave(); ui->sbMaxPat->onSave(); - ui->cbShowLoose->onSave(); - ui->leFormatSpec->onSave(); } void DlgPrefsTechDrawAdvancedImp::loadSettings() { - ui->cbEndCap->onRestore(); - ui->cbCrazyEdges->onRestore(); - ui->cbDebugSection->onRestore(); ui->cbDetectFaces->onRestore(); - ui->cbDebugDetail->onRestore(); ui->cbShowSectionEdges->onRestore(); + ui->cbDebugSection->onRestore(); + ui->cbDebugDetail->onRestore(); + ui->cbCrazyEdges->onRestore(); ui->cbFuseBeforeSection->onRestore(); + ui->cbShowLoose->onRestore(); + ui->pdsbEdgeFuzz->onRestore(); + ui->pdsbMarkFuzz->onRestore(); + ui->leFormatSpec->onRestore(); + ui->cbEndCap->onRestore(); ui->sbMaxTiles->onRestore(); ui->sbMaxPat->onRestore(); - ui->cbShowLoose->onRestore(); - ui->leFormatSpec->onRestore(); } /** diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui index 0e80c03b65..105a38b0a7 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAnnotation.ui @@ -6,7 +6,7 @@ 0 0 - 415 + 440 447 diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawColors.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawColors.ui index 7f277a0650..c7bacb5a0b 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawColors.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawColors.ui @@ -6,8 +6,8 @@ 0 0 - 460 - 343 + 440 + 342 diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensions.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensions.ui index e6ba0f06d2..f578208f0e 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensions.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensions.ui @@ -6,8 +6,8 @@ 0 0 - 460 - 403 + 440 + 336 @@ -46,19 +46,6 @@ - - - - - 0 - 0 - - - - Standard and Style - - - @@ -104,30 +91,101 @@ - - + + + + + true + + + + Arrow Style + + + + + + + + 0 + 0 + + + + Standard and Style + + + + + 0 0 + + + 0 + 22 + + + + Arrowhead style + + + -1 + + + ArrowStyle + + + Mod/TechDraw/Dimensions + + + + + true + + Arrow Size + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + + 12 + + - Use system setting for number of decimals + Character used to indicate diameter dimensions - Use Global Decimals + - - true + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - UseGlobalDecimals + DiameterSymbol /Mod/TechDraw/Dimensions @@ -162,10 +220,40 @@ - - + + - Alternate Decimals + Diameter Symbol + + + + + + + + 0 + 0 + + + + + true + + + + Use system setting for number of decimals + + + Use Global Decimals + + + true + + + UseGlobalDecimals + + + /Mod/TechDraw/Dimensions @@ -203,18 +291,6 @@ - - - - - true - - - - Font Size - - - @@ -259,102 +335,7 @@ - - - - Diameter Symbol - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - - 12 - - - - Character used to indicate diameter dimensions - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - DiameterSymbol - - - /Mod/TechDraw/Dimensions - - - - - - - - true - - - - Arrow Style - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - Arrowhead style - - - -1 - - - ArrowStyle - - - Mod/TechDraw/Dimensions - - - - - - - - true - - - - Arrow Size - - - - + @@ -385,151 +366,91 @@ - - - - - - - - - - 0 - 0 - - - - - 0 - 85 - - - - - 16777215 - 500 - - - - - 0 - 500 - - - - Conventions - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + - Projection Group Angle + Alternate Decimals - - - - - 0 - 0 - + + + + + true + - - - 184 - 0 - - - - Use first- or third-angle multiview projection convention - - - ProjectionAngle - - - Mod/TechDraw/General - - - - First - - - - - Third - - - - - Page - - - - - - - Hidden Line Style + Font Size - - - - - 0 - 0 - - + + 0 0 + + + 0 + 0 + + + + + false + + + + Tolerance Text Scale + + + + + + + + 0 + 0 + + + + + 174 + 0 + + + + + 0 + 0 + + - Style for hidden lines + Tolerance text scale +Multiplier of 'Font Size' + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0.100000000000000 + + + 0.800000000000000 - HiddenLine + TolSizeAdjust - Mod/TechDraw/General + Mod/TechDraw/Dimensions - - - Continuous - - - - :/icons/continuous-line.svg:/icons/continuous-line.svg - - - - - Dashed - - - - :/icons/dash-line.svg:/icons/dash-line.svg - - @@ -594,6 +515,11 @@ QLineEdit
Gui/PrefWidgets.h
+ + Gui::PrefDoubleSpinBox + QDoubleSpinBox +
Gui/PrefWidgets.h
+
Gui::PrefUnitSpinBox Gui::QuantitySpinBox diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp index cc017f5920..8cc4a5702d 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp @@ -58,16 +58,15 @@ DlgPrefsTechDrawDimensionsImp::~DlgPrefsTechDrawDimensionsImp() void DlgPrefsTechDrawDimensionsImp::saveSettings() { + ui->pcbStandardAndStyle->onSave(); ui->cbGlobalDecimals->onSave(); - ui->cbHiddenLineStyle->onSave(); - ui->cbProjAngle->onSave(); ui->cbShowUnits->onSave(); + ui->sbAltDecimals->onSave(); + ui->plsb_FontSize->onSave(); + ui->pdsbToleranceScale->onSave(); ui->leDiameter->onSave(); ui->pcbArrow->onSave(); - ui->pcbStandardAndStyle->onSave(); ui->plsb_ArrowSize->onSave(); - ui->plsb_FontSize->onSave(); - ui->sbAltDecimals->onSave(); } void DlgPrefsTechDrawDimensionsImp::loadSettings() @@ -81,16 +80,15 @@ void DlgPrefsTechDrawDimensionsImp::loadSettings() // plsb_ArrowSize->setValue(arrowDefault); ui->plsb_ArrowSize->setValue(fontDefault); + ui->pcbStandardAndStyle->onRestore(); ui->cbGlobalDecimals->onRestore(); - ui->cbHiddenLineStyle->onRestore(); - ui->cbProjAngle->onRestore(); ui->cbShowUnits->onRestore(); + ui->sbAltDecimals->onRestore(); + ui->plsb_FontSize->onRestore(); + ui->pdsbToleranceScale->onRestore(); ui->leDiameter->onRestore(); ui->pcbArrow->onRestore(); - ui->pcbStandardAndStyle->onRestore(); ui->plsb_ArrowSize->onRestore(); - ui->plsb_FontSize->onRestore(); - ui->sbAltDecimals->onRestore(); DrawGuiUtil::loadArrowBox(ui->pcbArrow); ui->pcbArrow->setCurrentIndex(prefArrowStyle()); diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawGeneral.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawGeneral.ui index a0d599e440..d28d7872bf 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawGeneral.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawGeneral.ui @@ -6,8 +6,8 @@ 0 0 - 496 - 495 + 440 + 581 @@ -229,8 +229,12 @@ for ProjectionGroups
0 + + * this font is also used for dimensions + Changes have no effect on existing dimensions. + - Label Font + Label Font* @@ -326,6 +330,153 @@ for ProjectionGroups
+ + + + + 0 + 0 + + + + + 0 + 85 + + + + + 16777215 + 500 + + + + + 0 + 500 + + + + Conventions + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Projection Group Angle + + + + + + + + 0 + 0 + + + + + 184 + 0 + + + + Use first- or third-angle multiview projection convention + + + ProjectionAngle + + + Mod/TechDraw/General + + + + First + + + + + Third + + + + + Page + + + + + + + + Hidden Line Style + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Style for hidden lines + + + HiddenLine + + + Mod/TechDraw/General + + + + Continuous + + + + :/icons/continuous-line.svg:/icons/continuous-line.svg + + + + + Dashed + + + + :/icons/dash-line.svg:/icons/dash-line.svg + + + + + + + + + @@ -689,6 +840,11 @@ for ProjectionGroups QCheckBox
Gui/PrefWidgets.h
+ + Gui::PrefComboBox + QComboBox +
Gui/PrefWidgets.h
+
Gui::PrefLineEdit QLineEdit @@ -705,6 +861,8 @@ for ProjectionGroups
Gui/PrefWidgets.h
- + + + diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawGeneralImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawGeneralImp.cpp index 534b9ec4cb..3eeb076a0c 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawGeneralImp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawGeneralImp.cpp @@ -53,54 +53,59 @@ DlgPrefsTechDrawGeneralImp::~DlgPrefsTechDrawGeneralImp() void DlgPrefsTechDrawGeneralImp::saveSettings() { - ui->pfc_DefTemp->onSave(); - ui->pfc_DefDir->onSave(); - ui->pfc_HatchFile->onSave(); - ui->pfc_FilePattern->onSave(); - ui->pfc_LineGroup->onSave(); - ui->pfc_Welding->onSave(); - ui->le_NamePattern->onSave(); - - ui->pfb_LabelFont->onSave(); - ui->plsb_LabelSize->onSave(); - ui->cb_Global->onSave(); ui->cb_Override->onSave(); ui->cb_PageUpdate->onSave(); ui->cb_AutoDist->onSave(); + + ui->pfb_LabelFont->onSave(); + ui->plsb_LabelSize->onSave(); + + ui->cbProjAngle->onSave(); + ui->cbHiddenLineStyle->onSave(); + + ui->pfc_DefTemp->onSave(); + ui->pfc_DefDir->onSave(); + ui->pfc_HatchFile->onSave(); + ui->pfc_LineGroup->onSave(); + ui->pfc_Welding->onSave(); + ui->pfc_FilePattern->onSave(); + ui->le_NamePattern->onSave(); } void DlgPrefsTechDrawGeneralImp::loadSettings() { -// double labelDefault = 8.0; - double labelDefault = Preferences::labelFontSizeMM(); - ui->plsb_LabelSize->setValue(labelDefault); - QFont prefFont(Preferences::labelFontQString()); - ui->pfb_LabelFont->setCurrentFont(prefFont); -// ui->pfb_LabelFont->setCurrentText(Preferences::labelFontQString()); //only works in Qt5 - - ui->pfc_DefTemp->setFileName(Preferences::defaultTemplate()); - ui->pfc_DefDir->setFileName(Preferences::defaultTemplateDir()); - ui->pfc_HatchFile->setFileName(QString::fromStdString(DrawHatch::prefSvgHatch())); - ui->pfc_FilePattern->setFileName(QString::fromStdString(DrawGeomHatch::prefGeomHatchFile())); - ui->pfc_Welding->setFileName(PreferencesGui::weldingDirectory()); - ui->pfc_LineGroup->setFileName(QString::fromUtf8(Preferences::lineGroupFile().c_str())); - - ui->pfc_DefTemp->onRestore(); - ui->pfc_DefDir->onRestore(); - ui->pfc_HatchFile->onRestore(); - ui->pfc_FilePattern->onRestore(); - ui->pfc_LineGroup->onRestore(); - ui->pfc_Welding->onRestore(); - ui->le_NamePattern->onRestore(); - - ui->pfb_LabelFont->onRestore(); - ui->plsb_LabelSize->onRestore(); - ui->cb_Global->onRestore(); ui->cb_Override->onRestore(); ui->cb_PageUpdate->onRestore(); ui->cb_AutoDist->onRestore(); + + double labelDefault = Preferences::labelFontSizeMM(); + ui->plsb_LabelSize->setValue(labelDefault); + QFont prefFont(Preferences::labelFontQString()); + ui->pfb_LabelFont->setCurrentFont(prefFont); + // ui->pfb_LabelFont->setCurrentText(Preferences::labelFontQString()); //only works in Qt5 + + ui->pfb_LabelFont->onRestore(); + ui->plsb_LabelSize->onRestore(); + + ui->cbProjAngle->onRestore(); + ui->cbHiddenLineStyle->onRestore(); + + ui->pfc_DefTemp->setFileName(Preferences::defaultTemplate()); + ui->pfc_DefDir->setFileName(Preferences::defaultTemplateDir()); + ui->pfc_HatchFile->setFileName(QString::fromStdString(DrawHatch::prefSvgHatch())); + ui->pfc_LineGroup->setFileName(QString::fromUtf8(Preferences::lineGroupFile().c_str())); + ui->pfc_Welding->setFileName(PreferencesGui::weldingDirectory()); + ui->pfc_FilePattern->setFileName(QString::fromStdString(DrawGeomHatch::prefGeomHatchFile())); + + ui->pfc_DefTemp->onRestore(); + ui->pfc_DefDir->onRestore(); + ui->pfc_HatchFile->onRestore(); + ui->pfc_LineGroup->onRestore(); + ui->pfc_Welding->onRestore(); + ui->pfc_FilePattern->onRestore(); + ui->le_NamePattern->onRestore(); } /** diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawHLR.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawHLR.ui index 18a86e5967..5d5a91f4cf 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawHLR.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawHLR.ui @@ -6,7 +6,7 @@ 0 0 - 441 + 440 307
@@ -49,6 +49,41 @@ + + + + Visible + + + + + + + + 0 + 0 + + + + + 140 + 16777215 + + + + Number of ISO lines per face edge + + + Qt::AlignRight + + + IsoCount + + + Mod/TechDraw/HLR + + + @@ -109,6 +144,88 @@ + + + + + 0 + 0 + + + + + true + + + + Use an approximation to find hidden lines. +Fast, but result is a collection of short straight lines. + + + Use Polygon Approximation + + + UsePolygon + + + Mod/TechDraw/HLR + + + + + + + + 0 + 0 + + + + + true + + + + Show hidden smooth edges + + + Show Smooth Lines + + + SmoothHid + + + Mod/TechDraw/HLR + + + + + + + + 0 + 0 + + + + + true + + + + Show hidden hard and outline edges + + + Show Hard Lines + + + HardHid + + + Mod/TechDraw/HLR + + + @@ -148,8 +265,8 @@ - - + + 0 @@ -162,20 +279,71 @@ - Use an approximation to find hidden lines. -Fast, but result is a collection of short straight lines. + Show hidden seam lines - Use Polygon Approximation + Show Seam Lines - UsePolygon + SeamHid Mod/TechDraw/HLR + + + + + 0 + 0 + + + + + true + + + + Show hidden equal parameterization lines + + + Show UV ISO Lines + + + IsoHid + + + Mod/TechDraw/HLR + + + + + + + Hidden + + + + + + + + 0 + 0 + + + + + true + + + + ISO Count + + + @@ -203,173 +371,31 @@ Fast, but result is a collection of short straight lines. - - - - - 0 - 0 - + + + + Qt::Horizontal - - - true - + + + 40 + 20 + - - Show hidden smooth edges - - - Show Smooth Lines - - - SmoothHid - - - Mod/TechDraw/HLR - - - - - - - - 0 - 0 - - - - - true - - - - Show hidden seam lines - - - Show Seam Lines - - - SeamHid - - - Mod/TechDraw/HLR - - - - - - - - 0 - 0 - - - - - true - - - - Show hidden equal parameterization lines - - - Show UV ISO Lines - - - IsoHid - - - Mod/TechDraw/HLR - - - - - - - Visible - - + - - - Hidden + + + Qt::Horizontal - - - - - - - 0 - 0 - - - - - true - - - - Show hidden hard and outline edges - - - Show Hard Lines - - - HardHid - - - Mod/TechDraw/HLR - - - - - - + - 0 - 0 + 40 + 20 - - - true - - - - ISO Count - - - - - - - - 0 - 0 - - - - - 140 - 16777215 - - - - Number of ISO lines per face edge - - - Qt::AlignRight - - - IsoCount - - - Mod/TechDraw/HLR - - + diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScale.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScale.ui index a0479c4f3d..b522f98a91 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScale.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScale.ui @@ -7,7 +7,7 @@ 0 0 440 - 447 + 342 @@ -220,164 +220,6 @@
- - - - - 0 - 0 - - - - - 0 - 0 - - - - - 0 - 200 - - - - Selection - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 174 - 0 - - - - - 0 - 0 - - - - Selection area around center marks -Each unit is approx. 0.1 mm wide - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 5.000000000000000 - - - MarkFuzz - - - Mod/TechDraw/General - - - - - - - - 0 - 0 - - - - - 174 - 0 - - - - - 0 - 0 - - - - Size of selection area around edges -Each unit is approx. 0.1 mm wide - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 10.000000000000000 - - - EdgeFuzz - - - Mod/TechDraw/General - - - - - - - - 0 - 0 - - - - Mark Fuzz - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Edge Fuzz - - - - - - - - @@ -398,47 +240,14 @@ Each unit is approx. 0.1 mm wide - - - - - 0 - 0 - - - - - 174 - 0 - - - - - 0 - 0 - - - - Tolerance font size adjustment. Multiplier of dimension font size. - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 0.500000000000000 - - - TolSizeAdjust - - - Mod/TechDraw/Dimensions + + + + Vertex Scale - + @@ -469,26 +278,18 @@ Each unit is approx. 0.1 mm wide - - + + + + + true + + - Vertex Scale + Center Mark Scale - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -512,6 +313,9 @@ Each unit is approx. 0.1 mm wide Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + 0.100000000000000 + 0.500000000000000 @@ -523,6 +327,42 @@ Each unit is approx. 0.1 mm wide + + + + Template Edit Mark + + + + + + + Multiplier for size of welding symbols + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 0.100000000000000 + + + 1.250000000000000 + + + SymbolFactor + + + Mod/TechDraw/Decorations + + + + + + + Welding Symbol Scale + + + @@ -557,74 +397,18 @@ Each unit is approx. 0.1 mm wide - - - - - true - + + + + Qt::Horizontal - - Center Mark Scale - - - - - - + - 0 - 0 + 40 + 20 - - - 0 - 0 - - - - - true - - - - Tolerance Text Scale - - - - - - - Template Edit Mark - - - - - - - Welding Symbol Scale - - - - - - - Multiplier for size of welding symbols - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 1.250000000000000 - - - SymbolFactor - - - Mod/TechDraw/Decorations - - + diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScaleImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScaleImp.cpp index 242e6f9eb2..f90cf1649f 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScaleImp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawScaleImp.cpp @@ -61,32 +61,24 @@ void DlgPrefsTechDrawScaleImp::onScaleTypeChanged(int index) void DlgPrefsTechDrawScaleImp::saveSettings() { - ui->pdsbToleranceScale->onSave(); - ui->pdsbTemplateMark->onSave(); - ui->pdsbVertexScale->onSave(); - ui->pdsbCenterScale->onSave(); ui->pdsbPageScale->onSave(); ui->cbViewScaleType->onSave(); ui->pdsbViewScale->onSave(); - ui->pdsbEdgeFuzz->onSave(); - ui->pdsbMarkFuzz->onSave(); + ui->pdsbVertexScale->onSave(); + ui->pdsbCenterScale->onSave(); ui->pdsbTemplateMark->onSave(); ui->pdsbSymbolScale->onSave(); } void DlgPrefsTechDrawScaleImp::loadSettings() { - double markDefault = 3.0; - ui->pdsbTemplateMark->setValue(markDefault); - ui->pdsbToleranceScale->onRestore(); - ui->pdsbTemplateMark->onRestore(); - ui->pdsbVertexScale->onRestore(); - ui->pdsbCenterScale->onRestore(); ui->pdsbPageScale->onRestore(); ui->cbViewScaleType->onRestore(); ui->pdsbViewScale->onRestore(); - ui->pdsbEdgeFuzz->onRestore(); - ui->pdsbMarkFuzz->onRestore(); + ui->pdsbVertexScale->onRestore(); + ui->pdsbCenterScale->onRestore(); + double markDefault = 3.0; + ui->pdsbTemplateMark->setValue(markDefault); ui->pdsbTemplateMark->onRestore(); ui->pdsbSymbolScale->onRestore(); } From 6e535d9ac372e94c05415c8bc7139aaa01c51ea0 Mon Sep 17 00:00:00 2001 From: bitacovir Date: Sun, 27 Dec 2020 08:52:08 -0300 Subject: [PATCH 11/11] Replace SVG icons of six Std View commands --- src/Gui/CommandView.cpp | 12 +- src/Gui/Icons/Std_SetAppearance.svg | 233 ++++++++++++++++ .../Std_ViewIvStereoInterleavedColumns.svg | 254 +++++++++++++++++ .../Icons/Std_ViewIvStereoInterleavedRows.svg | 254 +++++++++++++++++ src/Gui/Icons/Std_ViewIvStereoOff.svg | 218 +++++++++++++++ src/Gui/Icons/Std_ViewIvStereoQuadBuff.svg | 262 ++++++++++++++++++ src/Gui/Icons/Std_ViewIvStereoRedGreen.svg | 230 +++++++++++++++ src/Gui/Icons/resource.qrc | 8 +- 8 files changed, 1464 insertions(+), 7 deletions(-) create mode 100644 src/Gui/Icons/Std_SetAppearance.svg create mode 100644 src/Gui/Icons/Std_ViewIvStereoInterleavedColumns.svg create mode 100644 src/Gui/Icons/Std_ViewIvStereoInterleavedRows.svg create mode 100644 src/Gui/Icons/Std_ViewIvStereoOff.svg create mode 100644 src/Gui/Icons/Std_ViewIvStereoQuadBuff.svg create mode 100644 src/Gui/Icons/Std_ViewIvStereoRedGreen.svg diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 5ed54ca0e2..0a4383be5a 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -1145,7 +1145,7 @@ StdCmdSetAppearance::StdCmdSetAppearance() sToolTipText = QT_TR_NOOP("Sets the display properties of the selected object"); sWhatsThis = "Std_SetAppearance"; sStatusTip = QT_TR_NOOP("Sets the display properties of the selected object"); - sPixmap = "Std_Tool1"; + sPixmap = "Std_SetAppearance"; sAccel = "Ctrl+D"; eType = Alter3DView; } @@ -2289,7 +2289,7 @@ StdCmdViewIvStereoOff::StdCmdViewIvStereoOff() sToolTipText = QT_TR_NOOP("Switch stereo viewing off"); sWhatsThis = "Std_ViewIvStereoOff"; sStatusTip = QT_TR_NOOP("Switch stereo viewing off"); - sPixmap = "Std_Tool6"; + sPixmap = "Std_ViewIvStereoOff"; eType = Alter3DView; } @@ -2318,7 +2318,7 @@ StdCmdViewIvStereoRedGreen::StdCmdViewIvStereoRedGreen() sToolTipText = QT_TR_NOOP("Switch stereo viewing to red/cyan"); sWhatsThis = "Std_ViewIvStereoRedGreen"; sStatusTip = QT_TR_NOOP("Switch stereo viewing to red/cyan"); - sPixmap = "Std_Tool7"; + sPixmap = "Std_ViewIvStereoRedGreen"; eType = Alter3DView; } @@ -2346,7 +2346,7 @@ StdCmdViewIvStereoQuadBuff::StdCmdViewIvStereoQuadBuff() sToolTipText = QT_TR_NOOP("Switch stereo viewing to quad buffer"); sWhatsThis = "Std_ViewIvStereoQuadBuff"; sStatusTip = QT_TR_NOOP("Switch stereo viewing to quad buffer"); - sPixmap = "Std_Tool7"; + sPixmap = "Std_ViewIvStereoQuadBuff"; eType = Alter3DView; } @@ -2374,7 +2374,7 @@ StdCmdViewIvStereoInterleavedRows::StdCmdViewIvStereoInterleavedRows() sToolTipText = QT_TR_NOOP("Switch stereo viewing to Interleaved Rows"); sWhatsThis = "Std_ViewIvStereoInterleavedRows"; sStatusTip = QT_TR_NOOP("Switch stereo viewing to Interleaved Rows"); - sPixmap = "Std_Tool7"; + sPixmap = "Std_ViewIvStereoInterleavedRows"; eType = Alter3DView; } @@ -2402,7 +2402,7 @@ StdCmdViewIvStereoInterleavedColumns::StdCmdViewIvStereoInterleavedColumns() sToolTipText = QT_TR_NOOP("Switch stereo viewing to Interleaved Columns"); sWhatsThis = "Std_ViewIvStereoInterleavedColumns"; sStatusTip = QT_TR_NOOP("Switch stereo viewing to Interleaved Columns"); - sPixmap = "Std_Tool7"; + sPixmap = "Std_ViewIvStereoInterleavedColumns"; eType = Alter3DView; } diff --git a/src/Gui/Icons/Std_SetAppearance.svg b/src/Gui/Icons/Std_SetAppearance.svg new file mode 100644 index 0000000000..ba102d0569 --- /dev/null +++ b/src/Gui/Icons/Std_SetAppearance.svg @@ -0,0 +1,233 @@ + + + Std_SetAppearance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Std_SetAppearance + + 2020/12/20 + + + [bitacovir] + + + + + FreeCAD LGPL2+ + + + + + FreeCAD + + + + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ViewIvStereoInterleavedColumns.svg b/src/Gui/Icons/Std_ViewIvStereoInterleavedColumns.svg new file mode 100644 index 0000000000..0e56fb820b --- /dev/null +++ b/src/Gui/Icons/Std_ViewIvStereoInterleavedColumns.svg @@ -0,0 +1,254 @@ + + + Std_ViewIvStereoInterleavedColumns + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [bitacovir] + + + Std_ViewIvStereoInterleavedColumns + 2020/12/20 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ViewIvStereoInterleavedRows.svg b/src/Gui/Icons/Std_ViewIvStereoInterleavedRows.svg new file mode 100644 index 0000000000..47087d1993 --- /dev/null +++ b/src/Gui/Icons/Std_ViewIvStereoInterleavedRows.svg @@ -0,0 +1,254 @@ + + + Std_ViewIvStereoInterleavedRows + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [bitacovir] + + + Std_ViewIvStereoInterleavedRows + 2020/12/20 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ViewIvStereoOff.svg b/src/Gui/Icons/Std_ViewIvStereoOff.svg new file mode 100644 index 0000000000..0ea6a7abb2 --- /dev/null +++ b/src/Gui/Icons/Std_ViewIvStereoOff.svg @@ -0,0 +1,218 @@ + + + Std_ViewIvStereoOff + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [bitacovir] + + + Std_ViewIvStereoOff + 2020/12/20 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ViewIvStereoQuadBuff.svg b/src/Gui/Icons/Std_ViewIvStereoQuadBuff.svg new file mode 100644 index 0000000000..ae10328dbf --- /dev/null +++ b/src/Gui/Icons/Std_ViewIvStereoQuadBuff.svg @@ -0,0 +1,262 @@ + + + Std_ViewIvStereoQuadBuff + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [bitacovir] + + + Std_ViewIvStereoQuadBuff + 2020/12/20 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/Std_ViewIvStereoRedGreen.svg b/src/Gui/Icons/Std_ViewIvStereoRedGreen.svg new file mode 100644 index 0000000000..66301ad8c0 --- /dev/null +++ b/src/Gui/Icons/Std_ViewIvStereoRedGreen.svg @@ -0,0 +1,230 @@ + + + Std_ViewIvStereoRedGreen + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [bitacovir] + + + Std_ViewIvStereoRedGreen + 2020/12/20 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index ad7f6a1fe3..fc24826e9c 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -162,6 +162,7 @@ Std_Revert.svg Std_SaveAll.svg Std_SaveCopy.svg + Std_SetAppearance.svg Std_Tool1.svg Std_Tool2.svg Std_Tool3.svg @@ -174,7 +175,12 @@ Std_Tool10.svg Std_Tool11.svg Std_Tool12.svg - Std_WindowCascade.svg + Std_ViewIvStereoInterleavedColumns.svg + Std_ViewIvStereoInterleavedRows.svg + Std_ViewIvStereoInterleavedRows.svg + Std_ViewIvStereoOff.svg + Std_ViewIvStereoQuadBuff.svg + Std_ViewIvStereoRedGreen.svg Std_WindowNext.svg Std_WindowPrev.svg Std_WindowTileVer.svg