From c2829240644708b3a3359bcc234eb3ab6c0b73f3 Mon Sep 17 00:00:00 2001 From: wandererfan Date: Fri, 24 Jan 2020 23:25:29 -0500 Subject: [PATCH] [TD]Preferences: reorganize and add missing --- src/Mod/TechDraw/App/DrawView.cpp | 21 +- src/Mod/TechDraw/App/DrawView.h | 5 + src/Mod/TechDraw/App/DrawViewBalloon.cpp | 21 +- src/Mod/TechDraw/App/DrawViewBalloon.h | 3 +- src/Mod/TechDraw/App/DrawViewPart.cpp | 86 +- src/Mod/TechDraw/App/DrawViewPart.h | 10 + src/Mod/TechDraw/Gui/AppTechDrawGui.cpp | 12 +- src/Mod/TechDraw/Gui/CMakeLists.txt | 25 +- ...gPrefsTechDraw.ui => DlgPrefsTechDraw1.ui} | 1250 ++++++++++------- ...chDrawImp.cpp => DlgPrefsTechDraw1Imp.cpp} | 113 +- src/Mod/TechDraw/Gui/DlgPrefsTechDraw1Imp.h | 50 + src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui | 1121 +++++++-------- src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp | 70 +- src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.h | 6 +- src/Mod/TechDraw/Gui/DlgPrefsTechDraw3.ui | 1161 +++++++++++++++ src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.cpp | 111 ++ ...fsTechDrawImp.h => DlgPrefsTechDraw3Imp.h} | 16 +- src/Mod/TechDraw/Gui/DlgPrefsTechDraw4.ui | 293 ++++ src/Mod/TechDraw/Gui/DlgPrefsTechDraw4Imp.cpp | 81 ++ src/Mod/TechDraw/Gui/DlgPrefsTechDraw4Imp.h | 50 + src/Mod/TechDraw/Gui/DlgPrefsTechDraw5.ui | 429 ++++++ src/Mod/TechDraw/Gui/DlgPrefsTechDraw5Imp.cpp | 87 ++ src/Mod/TechDraw/Gui/DlgPrefsTechDraw5Imp.h | 50 + src/Mod/TechDraw/Gui/QGIPrimPath.cpp | 23 +- src/Mod/TechDraw/Gui/QGIViewBalloon.cpp | 2 +- 25 files changed, 3839 insertions(+), 1257 deletions(-) rename src/Mod/TechDraw/Gui/{DlgPrefsTechDraw.ui => DlgPrefsTechDraw1.ui} (71%) rename src/Mod/TechDraw/Gui/{DlgPrefsTechDrawImp.cpp => DlgPrefsTechDraw1Imp.cpp} (82%) create mode 100644 src/Mod/TechDraw/Gui/DlgPrefsTechDraw1Imp.h create mode 100644 src/Mod/TechDraw/Gui/DlgPrefsTechDraw3.ui create mode 100644 src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.cpp rename src/Mod/TechDraw/Gui/{DlgPrefsTechDrawImp.h => DlgPrefsTechDraw3Imp.h} (82%) create mode 100644 src/Mod/TechDraw/Gui/DlgPrefsTechDraw4.ui create mode 100644 src/Mod/TechDraw/Gui/DlgPrefsTechDraw4Imp.cpp create mode 100644 src/Mod/TechDraw/Gui/DlgPrefsTechDraw4Imp.h create mode 100644 src/Mod/TechDraw/Gui/DlgPrefsTechDraw5.ui create mode 100644 src/Mod/TechDraw/Gui/DlgPrefsTechDraw5Imp.cpp create mode 100644 src/Mod/TechDraw/Gui/DlgPrefsTechDraw5Imp.h diff --git a/src/Mod/TechDraw/App/DrawView.cpp b/src/Mod/TechDraw/App/DrawView.cpp index 2cf72bb738..4920d6228d 100644 --- a/src/Mod/TechDraw/App/DrawView.cpp +++ b/src/Mod/TechDraw/App/DrawView.cpp @@ -81,8 +81,8 @@ DrawView::DrawView(void): ADD_PROPERTY_TYPE(Rotation, (0.0), group, App::Prop_None, "Rotation in degrees counterclockwise"); ScaleType.setEnums(ScaleTypeEnums); - ADD_PROPERTY_TYPE(ScaleType, ((long)0), group, App::Prop_None, "Scale Type"); - ADD_PROPERTY_TYPE(Scale, (1.0), group, App::Prop_None, "Scale factor of the view"); + ADD_PROPERTY_TYPE(ScaleType, (prefScaleType()), group, App::Prop_None, "Scale Type"); + ADD_PROPERTY_TYPE(Scale, (prefScale()), group, App::Prop_None, "Scale factor of the view"); Scale.setConstraints(&scaleRange); ADD_PROPERTY_TYPE(Caption, (""), group, App::Prop_None, "Short text about the view"); @@ -429,6 +429,23 @@ bool DrawView::keepUpdated(void) return result; } +int DrawView::prefScaleType(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General"); + int result = hGrp->GetInt("DefaultScaleType", 0); + return result; +} + +double DrawView::prefScale(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General"); + double result = hGrp->GetInt("DefaultViewScale", 1.0); + return result; +} + + void DrawView::requestPaint(void) { // Base::Console().Message("DV::requestPaint() - %s\n", getNameInDocument()); diff --git a/src/Mod/TechDraw/App/DrawView.h b/src/Mod/TechDraw/App/DrawView.h index b863623b1e..31d0cfd22b 100644 --- a/src/Mod/TechDraw/App/DrawView.h +++ b/src/Mod/TechDraw/App/DrawView.h @@ -103,6 +103,11 @@ protected: bool autoPos; bool mouseMove; + int prefScaleType(void); + double prefScale(void); + + + private: static const char* ScaleTypeEnums[]; static App::PropertyFloatConstraint::Constraints scaleRange; diff --git a/src/Mod/TechDraw/App/DrawViewBalloon.cpp b/src/Mod/TechDraw/App/DrawViewBalloon.cpp index 06df033232..be8768fcba 100644 --- a/src/Mod/TechDraw/App/DrawViewBalloon.cpp +++ b/src/Mod/TechDraw/App/DrawViewBalloon.cpp @@ -115,10 +115,10 @@ DrawViewBalloon::DrawViewBalloon(void) ADD_PROPERTY_TYPE(OriginIsSet, (false), "",(App::PropertyType)(App::Prop_None),"Balloon origin is set"); EndType.setEnums(endTypeEnums); - ADD_PROPERTY(EndType,((long)0)); + ADD_PROPERTY(EndType,(prefEnd())); Symbol.setEnums(balloonTypeEnums); - ADD_PROPERTY(Symbol,((long)0)); + ADD_PROPERTY(Symbol,(prefShape())); ADD_PROPERTY_TYPE(SymbolScale,(1),"",(App::PropertyType)(App::Prop_None),"Balloon symbol scale"); @@ -270,6 +270,23 @@ double DrawViewBalloon::prefKinkLength(void) const return length; } +int DrawViewBalloon::prefShape(void) const +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations"); + int result = hGrp->GetInt("BalloonShape", 0); + return result; +} + +int DrawViewBalloon::prefEnd(void) const +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter(). + GetGroup("BaseApp")->GetGroup("Preferences")-> + GetGroup("Mod/TechDraw/Decorations"); + int length = hGrp->GetFloat("BalloonArrow", 5.0); + return length; +} + /* PyObject *DrawViewBalloon::getPyObject(void) { diff --git a/src/Mod/TechDraw/App/DrawViewBalloon.h b/src/Mod/TechDraw/App/DrawViewBalloon.h index 82a1a8af74..55c8d16688 100644 --- a/src/Mod/TechDraw/App/DrawViewBalloon.h +++ b/src/Mod/TechDraw/App/DrawViewBalloon.h @@ -81,7 +81,8 @@ public: void handleXYLock(void) override; double prefKinkLength(void) const; - + int prefShape(void) const; + int prefEnd(void) const; protected: void onChanged(const App::Property* prop) override; diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index 4e16733989..55729b8e5a 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -151,14 +151,14 @@ DrawViewPart::DrawViewPart(void) : bool coarseView = hGrp->GetBool("CoarseView", false); ADD_PROPERTY_TYPE(CoarseView, (coarseView), sgroup, App::Prop_None, "Coarse View on/off"); //add property for visible outline? - ADD_PROPERTY_TYPE(SmoothVisible ,(false),sgroup,App::Prop_None,"Visible Smooth lines on/off"); - ADD_PROPERTY_TYPE(SeamVisible ,(false),sgroup,App::Prop_None,"Visible Seam lines on/off"); - ADD_PROPERTY_TYPE(IsoVisible ,(false),sgroup,App::Prop_None,"Visible Iso u,v lines on/off"); - ADD_PROPERTY_TYPE(HardHidden ,(false),sgroup,App::Prop_None,"Hidden Hard lines on/off"); - ADD_PROPERTY_TYPE(SmoothHidden ,(false),sgroup,App::Prop_None,"Hidden Smooth lines on/off"); - ADD_PROPERTY_TYPE(SeamHidden ,(false),sgroup,App::Prop_None,"Hidden Seam lines on/off"); - ADD_PROPERTY_TYPE(IsoHidden ,(false),sgroup,App::Prop_None,"Hidden Iso u,v lines on/off"); - ADD_PROPERTY_TYPE(IsoCount ,(0),sgroup,App::Prop_None,"Number of isoparameters"); + ADD_PROPERTY_TYPE(SmoothVisible ,(prefSmoothViz()),sgroup,App::Prop_None,"Show Visible Smooth lines"); + ADD_PROPERTY_TYPE(SeamVisible ,(prefSeamViz()),sgroup,App::Prop_None,"Show Visible Seam lines"); + ADD_PROPERTY_TYPE(IsoVisible ,(prefIsoViz()),sgroup,App::Prop_None,"Show Visible Iso u,v lines"); + ADD_PROPERTY_TYPE(HardHidden ,(prefHardHid()),sgroup,App::Prop_None,"Show Hidden Hard lines"); + ADD_PROPERTY_TYPE(SmoothHidden ,(prefSmoothHid()),sgroup,App::Prop_None,"Show Hidden Smooth lines"); + ADD_PROPERTY_TYPE(SeamHidden ,(prefSeamHid()),sgroup,App::Prop_None,"Show Hidden Seam lines"); + ADD_PROPERTY_TYPE(IsoHidden ,(prefIsoHid()),sgroup,App::Prop_None,"Show Hidden Iso u,v lines"); + ADD_PROPERTY_TYPE(IsoCount ,(prefIsoCount()),sgroup,App::Prop_None,"Number of iso parameters lines"); // ADD_PROPERTY_TYPE(CosmeticVertexes ,(0),sgroup,App::Prop_Output,"CosmeticVertex Save/Restore"); // ADD_PROPERTY_TYPE(CosmeticEdges ,(0),sgroup,App::Prop_Output,"CosmeticEdge Save/Restore"); @@ -1220,7 +1220,77 @@ void DrawViewPart::handleChangedPropertyName(Base::XMLReader &reader, const char DrawView::handleChangedPropertyName(reader, TypeName, PropName); } +bool DrawViewPart::prefHardViz(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR"); + bool result = hGrp->GetBool("HardViz", true); + return result; +} +bool DrawViewPart::prefSeamViz(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR"); + bool result = hGrp->GetBool("SeamViz", true); + return result; +} + +bool DrawViewPart::prefSmoothViz(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR"); + bool result = hGrp->GetBool("SmoothViz", true); + return result; +} + +bool DrawViewPart::prefIsoViz(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR"); + bool result = hGrp->GetBool("IsoViz", true); + return result; +} + +bool DrawViewPart::prefHardHid(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR"); + bool result = hGrp->GetBool("HardHid", true); + return result; +} + +bool DrawViewPart::prefSeamHid(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR"); + bool result = hGrp->GetBool("SeamHid", true); + return result; +} + +bool DrawViewPart::prefSmoothHid(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR"); + bool result = hGrp->GetBool("SmoothHid", true); + return result; +} + +bool DrawViewPart::prefIsoHid(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR"); + bool result = hGrp->GetBool("IsoHid", true); + return result; +} + +int DrawViewPart::prefIsoCount(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/HLR"); + int result = hGrp->GetBool("IsoCount", 0); + return result; +} // Python Drawing feature --------------------------------------------------------- diff --git a/src/Mod/TechDraw/App/DrawViewPart.h b/src/Mod/TechDraw/App/DrawViewPart.h index 444b9d09f1..995f49f904 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.h +++ b/src/Mod/TechDraw/App/DrawViewPart.h @@ -215,6 +215,16 @@ protected: void handleChangedPropertyName(Base::XMLReader &reader, const char* TypeName, const char* PropName) override; + bool prefHardViz(void); + bool prefSeamViz(void); + bool prefSmoothViz(void); + bool prefIsoViz(void); + bool prefHardHid(void); + bool prefSeamHid(void); + bool prefSmoothHid(void); + bool prefIsoHid(void); + int prefIsoCount(void); + private: bool nowUnsetting; diff --git a/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp b/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp index 15c99576dd..b8833756f9 100644 --- a/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp +++ b/src/Mod/TechDraw/Gui/AppTechDrawGui.cpp @@ -39,8 +39,11 @@ #include "Workbench.h" #include "MDIViewPage.h" -#include "DlgPrefsTechDrawImp.h" +#include "DlgPrefsTechDraw1Imp.h" #include "DlgPrefsTechDraw2Imp.h" +#include "DlgPrefsTechDraw3Imp.h" +#include "DlgPrefsTechDraw4Imp.h" +#include "DlgPrefsTechDraw5Imp.h" #include "ViewProviderPage.h" #include "ViewProviderDrawingView.h" #include "ViewProviderDimension.h" @@ -146,8 +149,11 @@ PyMOD_INIT_FUNC(TechDrawGui) TechDrawGui::ViewProviderCosmeticExtension::init(); // register preferences pages - new Gui::PrefPageProducer ("TechDraw"); - new Gui::PrefPageProducer ("TechDraw"); + new Gui::PrefPageProducer ("TechDraw"); //General + new Gui::PrefPageProducer ("TechDraw"); //Scale + new Gui::PrefPageProducer ("TechDraw"); //Dimensions + new Gui::PrefPageProducer ("TechDraw"); //HLR + new Gui::PrefPageProducer ("TechDraw"); //Advanced // add resources and reloads the translators loadTechDrawResource(); diff --git a/src/Mod/TechDraw/Gui/CMakeLists.txt b/src/Mod/TechDraw/Gui/CMakeLists.txt index 64e41cfb17..3e5d16f58d 100644 --- a/src/Mod/TechDraw/Gui/CMakeLists.txt +++ b/src/Mod/TechDraw/Gui/CMakeLists.txt @@ -44,8 +44,11 @@ set(TechDrawGui_MOC_HDRS QGIViewDimension.h QGIViewBalloon.h TaskProjGroup.h - DlgPrefsTechDrawImp.h + DlgPrefsTechDraw1Imp.h DlgPrefsTechDraw2Imp.h + DlgPrefsTechDraw3Imp.h + DlgPrefsTechDraw4Imp.h + DlgPrefsTechDraw5Imp.h TaskLinkDim.h DlgTemplateField.h TaskSectionView.h @@ -79,8 +82,11 @@ else() endif() set(TechDrawGui_UIC_SRCS - DlgPrefsTechDraw.ui + DlgPrefsTechDraw1.ui DlgPrefsTechDraw2.ui + DlgPrefsTechDraw3.ui + DlgPrefsTechDraw4.ui + DlgPrefsTechDraw5.ui TaskProjGroup.ui TaskLinkDim.ui DlgTemplateField.ui @@ -137,12 +143,21 @@ SET(TechDrawGui_SRCS TaskProjGroup.ui TaskProjGroup.cpp TaskProjGroup.h - DlgPrefsTechDraw.ui - DlgPrefsTechDrawImp.cpp - DlgPrefsTechDrawImp.h + DlgPrefsTechDraw1.ui + DlgPrefsTechDraw1Imp.cpp + DlgPrefsTechDraw1Imp.h DlgPrefsTechDraw2.ui DlgPrefsTechDraw2Imp.cpp DlgPrefsTechDraw2Imp.h + DlgPrefsTechDraw3.ui + DlgPrefsTechDraw3Imp.cpp + DlgPrefsTechDraw3Imp.h + DlgPrefsTechDraw4.ui + DlgPrefsTechDraw4Imp.cpp + DlgPrefsTechDraw4Imp.h + DlgPrefsTechDraw5.ui + DlgPrefsTechDraw5Imp.cpp + DlgPrefsTechDraw5Imp.h TaskLinkDim.ui TaskLinkDim.cpp TaskLinkDim.h diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw1.ui similarity index 71% rename from src/Mod/TechDraw/Gui/DlgPrefsTechDraw.ui rename to src/Mod/TechDraw/Gui/DlgPrefsTechDraw1.ui index 4996fcfff4..68ae0311eb 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw1.ui @@ -1,15 +1,27 @@ - TechDrawGui::DlgPrefsTechDrawImp - + TechDrawGui::DlgPrefsTechDraw1Imp + 0 0 558 - 1110 + 1000 + + + 0 + 0 + + + + + 0 + 1000 + + TechDraw General @@ -17,363 +29,98 @@ - - - - Files + + + + + 12 + true + + + + QFrame::Box + + + Items in italics are default values for new objects. They have no effect on existing objects. + + + true - - - - - - - Default template file for new pages - - - TemplateFile - - - /Mod/TechDraw/Files - - - - - - - Welding Directory - - - - - - - Template Directory - - - - - - - Default Template - - - - - - - Starting directory for menu 'Insert new page using Template' - - - Gui::FileChooser::Directory - - - TemplateDir - - - /Mod/TechDraw/Files - - - - - - - Hatch Image - - - - - - - Line Group File - - - - - - - Default SVG or bitmap file for hatching - - - FileHatch - - - /Mod/TechDraw/Files - - - - - - - PAT File - - - - - - - Default PAT pattern definition file for hatching - - - FilePattern - - - /Mod/TechDraw/PAT - - - - - - - Alternate file for personal LineGroup definition - - - LineGroupFile - - - /Mod/TechDraw/Files - - - - - - - Default directory for welding symbols - - - Gui::FileChooser::Directory - - - WeldingDir - - - /Mod/TechDraw/Files - - - - - - - - - - - Name of the default PAT pattern - - - NamePattern - - - /Mod/TechDraw/PAT - - - - - - - Pattern Name - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - + + - + 0 0 - - Labels - - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 40 - 20 - - - - - - - - Label Font - - - - - - - Label Size - - - - - - - Font for labels - - - - DejaVu Sans - - - - LabelFont - - - /Mod/TechDraw/Labels - - - - - - - Editable Text Marker Size - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Label size - - - 8.000000000000000 - - - LabelSize - - - /Mod/TechDraw/Labels - - - - - - - Size of editable text marker in templates (green dots) - - - 3.000000000000000 - - - TemplateDotSize - - - /Mod/TechDraw/General - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Qt::Vertical - - + - 20 - 40 + 0 + 220 + + + + + 0 + 200 - - - - Colors + + + + Color of Dimension lines and text. + + + + 0 + 0 + 0 + + + + Color + + + Mod/TechDraw/Dimension + + + + + + + Section face hatch color + + + + 0 + 0 + 0 + + + + Hatch + + + /Mod/TechDraw/Colors + + + + + + true + + Section Hatch @@ -381,6 +128,11 @@ + + + true + + Section Face @@ -428,6 +180,11 @@ + + + true + + Normal @@ -527,6 +284,11 @@ + + + true + + Preselected @@ -534,6 +296,11 @@ + + + true + + Hidden Line @@ -561,33 +328,23 @@ + + + true + + Selected - - - - Section face hatch color - - - - 0 - 0 - 0 - - - - Hatch - - - /Mod/TechDraw/Colors - - - + + + true + + Background @@ -595,6 +352,11 @@ + + + true + + Geometric Hatch @@ -620,7 +382,7 @@ - + Face color @@ -640,8 +402,13 @@ - + + + + true + + Transparent faces if checked @@ -656,6 +423,202 @@ + + + + Dimension + + + + + + + Section Line + + + + + + + SectionColor + + + /Mod/TechDraw/Decorations + + + + + + + Center Line + + + + + + + CenterColor + + + Mod/TechDraw/Decorations + + + + + + + Vertex + + + + + + + VertexColor + + + Mod/TechDraw/Decorations + + + + + + + + + + + + + 0 + 0 + + + + Labels + + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Label Font + + + + + + + Label Size + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + 0 + 0 + + + + Font for labels + + + + osifont + + + + LabelFont + + + /Mod/TechDraw/Labels + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Label size + + + 8.000000000000000 + + + LabelSize + + + /Mod/TechDraw/Labels + + + @@ -676,8 +639,26 @@ + + + 0 + 0 + + + + + 0 + 180 + + + + + 16777215 + 200 + + - General + Drawing Update @@ -685,161 +666,7 @@ QFormLayout::AllNonFixedFieldsGrow - - - - Projection Angle - - - - - - - First- or third-angle projection - - - ProjectionAngle - - - /Mod/TechDraw/General - - - - First - - - - - Third - - - - - - - Hidden Line - - - - - - - Style for hidden lines - - - 1 - - - HiddenLine - - - Mod/TechDraw/General - - - - NeverShow - - - - - Solid - - - - - Dash - - - - - Dot - - - - - DashDot - - - - - DashDotDot - - - - - - - - If checked, TechDraw will attempt to build faces using the -line segments returned by the hidden line removal algorithm. -Faces must be detected in order to use hatching, but there -can be a performance penalty in complex models. - - - Detect Faces - - - true - - - HandleFaces - - - /Mod/TechDraw/General - - - - - - - Highlights the border of the section cut in section views - - - Show Section Edges - - - ShowSectionEdges - - - /Mod/TechDraw/General - - - - - - - Automatically distribute secondary views -for ProjectionGroups - - - Auto-distribute Secondary Views - - - true - - - AutoDist - - - /Mod/TechDraw/General - - - - - - - - 75 - true - - - - Drawing Updates - - - - Whether or not pages are updated every time the 3D model is changed @@ -858,7 +685,7 @@ for ProjectionGroups - + Whether or not a page's 'Keep Update' property @@ -878,14 +705,19 @@ can override the global 'Update With 3D' parameter - + + + + true + + Update pages as scheduled or skip updates. Checked is the default for new pages. - Keep Page Up To Date (default) + Keep Page Up To Date true @@ -898,10 +730,366 @@ Checked is the default for new pages. + + + + + true + + + + Automatically distribute secondary views +for ProjectionGroups + + + Auto-distribute Secondary Views + + + true + + + AutoDist + + + /Mod/TechDraw/General + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 350 + + + + Files + + + + + + QLayout::SetMinimumSize + + + 6 + + + + + + 0 + 0 + + + + Default SVG or bitmap file for hatching + + + FileHatch + + + /Mod/TechDraw/Files + + + + + + + + 0 + 0 + + + + Default directory for welding symbols + + + Gui::FileChooser::Directory + + + WeldingDir + + + /Mod/TechDraw/Files + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Default template file for new pages + + + TemplateFile + + + /Mod/TechDraw/Files + + + + + + + + 0 + 33 + + + + + true + + + + Line Group File + + + + + + + + 0 + 33 + + + + + true + + + + PAT File + + + + + + + + 0 + 33 + + + + + true + + + + Svg Hatch Pattern + + + + + + + + 0 + 0 + + + + Default PAT pattern definition file for hatching + + + FilePattern + + + /Mod/TechDraw/PAT + + + + + + + + 0 + 33 + + + + Default Template + + + + + + + + 0 + 0 + + + + Starting directory for menu 'Insert new page using Template' + + + Gui::FileChooser::Directory + + + TemplateDir + + + /Mod/TechDraw/Files + + + + + + + + 0 + 0 + + + + Alternate file for personal LineGroup definition + + + LineGroupFile + + + /Mod/TechDraw/Files + + + + + + + + 0 + 33 + + + + + true + + + + Welding Directory + + + + + + + + 0 + 33 + + + + Template Directory + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + - + + + 12 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Name of the default PAT pattern + + + NamePattern + + + /Mod/TechDraw/PAT + + + + + + + + 0 + 0 + + + + + true + + + + Pattern Name + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical @@ -916,6 +1104,19 @@ Checked is the default for new pages. + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -949,11 +1150,6 @@ Checked is the default for new pages. QCheckBox
Gui/PrefWidgets.h
- - Gui::PrefComboBox - QComboBox -
Gui/PrefWidgets.h
-
Gui::PrefLineEdit QLineEdit diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw1Imp.cpp similarity index 82% rename from src/Mod/TechDraw/Gui/DlgPrefsTechDrawImp.cpp rename to src/Mod/TechDraw/Gui/DlgPrefsTechDraw1Imp.cpp index c614e1024c..9994b72040 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawImp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw1Imp.cpp @@ -25,98 +25,95 @@ #include "PreCompiled.h" -#include "DlgPrefsTechDrawImp.h" +#include "DlgPrefsTechDraw1Imp.h" #include using namespace TechDrawGui; -DlgPrefsTechDrawImp::DlgPrefsTechDrawImp( QWidget* parent ) +DlgPrefsTechDraw1Imp::DlgPrefsTechDraw1Imp( QWidget* parent ) : PreferencePage( parent ) { this->setupUi(this); plsb_LabelSize->setUnit(Base::Unit::Length); - plsb_TemplateDot->setUnit(Base::Unit::Length); } -DlgPrefsTechDrawImp::~DlgPrefsTechDrawImp() +DlgPrefsTechDraw1Imp::~DlgPrefsTechDraw1Imp() { // no need to delete child widgets, Qt does it all for us } -void DlgPrefsTechDrawImp::saveSettings() +void DlgPrefsTechDraw1Imp::saveSettings() { - cb_HidLine->onSave(); - cb_Angle->onSave(); - cb_Faces->onSave(); - cb_SectionEdges->onSave(); - cb_PageUpdate->onSave(); - cb_Global->onSave(); - cb_Override->onSave(); - cb_AutoDist->onSave(); - - pcb_Normal->onSave(); - pcb_Select->onSave(); - pcb_PreSelect->onSave(); - pcb_Hidden->onSave(); - pcb_Surface->onSave(); - pcb_Background->onSave(); - pcb_Hatch->onSave(); - pcb_Face->onSave(); - pcb_PaintFaces->onSave(); //check box! - - pfb_LabelFont->onSave(); - plsb_LabelSize->onSave(); - plsb_TemplateDot->onSave(); - pfc_DefTemp->onSave(); pfc_DefDir->onSave(); pfc_HatchFile->onSave(); + pfc_FilePattern->onSave(); pfc_LineGroup->onSave(); pfc_Welding->onSave(); - - pfc_FilePattern->onSave(); le_NamePattern->onSave(); + + pfb_LabelFont->onSave(); + plsb_LabelSize->onSave(); + + cb_Global->onSave(); + cb_Override->onSave(); + cb_PageUpdate->onSave(); + cb_AutoDist->onSave(); + + pcbDimColor->onSave(); + pcb_Hatch->onSave(); + pcb_Background->onSave(); + pcb_PreSelect->onSave(); + pcb_Hidden->onSave(); + pcb_Select->onSave(); + pcb_Normal->onSave(); + pcb_Surface->onSave(); + pcb_GeomHatch->onSave(); + pcb_Face->onSave(); + pcb_PaintFaces->onSave(); + pcbSectionLine->onSave(); + pcbCenterColor->onSave(); + pcbVertexColor->onSave(); } -void DlgPrefsTechDrawImp::loadSettings() +void DlgPrefsTechDraw1Imp::loadSettings() { - cb_HidLine->onRestore(); - cb_Angle->onRestore(); - cb_Faces->onRestore(); - cb_SectionEdges->onRestore(); - cb_PageUpdate->onRestore(); - cb_Global->onRestore(); - cb_Override->onRestore(); - cb_AutoDist->onRestore(); - - pcb_Normal->onRestore(); - pcb_Select->onRestore(); - pcb_PreSelect->onRestore(); - pcb_Hidden->onRestore(); - pcb_Surface->onRestore(); - pcb_Background->onRestore(); - pcb_Hatch->onRestore(); - pcb_Face->onRestore(); - pcb_PaintFaces->onRestore(); //check box! - - pfb_LabelFont->onRestore(); - plsb_LabelSize->onRestore(); - plsb_TemplateDot->onRestore(); - pfc_DefTemp->onRestore(); pfc_DefDir->onRestore(); pfc_HatchFile->onRestore(); + pfc_FilePattern->onRestore(); pfc_LineGroup->onRestore(); pfc_Welding->onRestore(); - - pfc_FilePattern->onRestore(); le_NamePattern->onRestore(); + + pfb_LabelFont->onRestore(); + plsb_LabelSize->onRestore(); + + cb_Global->onRestore(); + cb_Override->onRestore(); + cb_PageUpdate->onRestore(); + cb_AutoDist->onRestore(); + + pcbDimColor->onRestore(); + pcb_Hatch->onRestore(); + pcb_Background->onRestore(); + pcb_PreSelect->onRestore(); + pcb_Hidden->onRestore(); + pcb_Select->onRestore(); + pcb_Normal->onRestore(); + pcb_Surface->onRestore(); + pcb_GeomHatch->onRestore(); + pcb_Face->onRestore(); + pcb_PaintFaces->onRestore(); + pcbSectionLine->onRestore(); + pcbCenterColor->onRestore(); + pcbVertexColor->onRestore(); } /** * Sets the strings of the subwidgets using the current language. */ -void DlgPrefsTechDrawImp::changeEvent(QEvent *e) +void DlgPrefsTechDraw1Imp::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { saveSettings(); @@ -128,4 +125,4 @@ void DlgPrefsTechDrawImp::changeEvent(QEvent *e) } } -#include +#include diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw1Imp.h b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw1Imp.h new file mode 100644 index 0000000000..e97fa37b3d --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw1Imp.h @@ -0,0 +1,50 @@ + /************************************************************************** + * Copyright (c) 2015 FreeCAD Developers * + * Author: WandererFan * + * Based on src/Mod/FEM/Gui/DlgPrefsTechDraw1Imp.cpp * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP1_H +#define DRAWINGGUI_DLGPREFSTECHDRAWIMP1_H + +#include +#include + +namespace TechDrawGui { + +class DlgPrefsTechDraw1Imp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDraw1Imp +{ + Q_OBJECT + +public: + DlgPrefsTechDraw1Imp( QWidget* parent = 0 ); + ~DlgPrefsTechDraw1Imp(); + +protected: + void saveSettings(); + void loadSettings(); + void changeEvent(QEvent *e); +}; + +} // namespace TechDrawGui + +#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP1_H diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui index 34cc979a24..14b22fef77 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2.ui @@ -6,30 +6,191 @@ 0 0 - 521 - 855 + 558 + 609 + + + 0 + 0 + + + + + 0 + 500 + + - TechDraw Dimensions + TechDraw Scale + + + - - - Dimensions + + + + 0 + 0 + - - - - - - - Font Size + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Scale + + + + + + QLayout::SetDefaultConstraint + + + 24 + + + + + + 0 + 0 + + + + Default scale type for new Views + + + DefaultScaleType + + + Mod/TechDraw/General + + + + Page + + + + + Custom + + + + + Auto + + + + + + + + + 0 + 0 + + + + Default scale for new Views if Scale Type is Custom + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 4 + + + 1.000000000000000 + + + DefaultViewScale + + + Mod/TechDraw/General - + + + + + true + + + + Page Scale + + + + + + + + 0 + 0 + + + + Default scale for new pages + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 4 + + + 1.000000000000000 + + + DefaultScale + + + Mod/TechDraw/General + + + + + + + + true + + + + View Scale Type + + + + + + + + true + + + + View Custom Scale + + + + Qt::Horizontal @@ -42,339 +203,81 @@ - - - - Alternate Decimals - - - - - - - Arrow Size - - - - - - - Diameter Symbol - - - - - - - Append unit to Dimension text - - - Show Units - - - ShowUnits - - - /Mod/TechDraw/Dimensions - - - - - - - Dimension text color - - - - 0 - 0 - 0 - - - - Color - - - /Mod/TechDraw/Dimensions - - - - - - - Color - - - - - - - - 12 - + + + + + + + + + + 0 + 0 + + + + Size Adjustments + + + + + + + + + 0 + 0 + - Character to use to indicate Diameter dimension + Size of CenterMarks. Multiplier of Vertex size. - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - DiameterSymbol - - - /Mod/TechDraw/Dimensions - - - - - - - Use system setting for decimal places. - - - Use Global Decimals - - - true - - - UseGlobalDecimals - - - /Mod/TechDraw/Dimensions - - - - - - - Preferred arrowhead style - - - 0 - - - 5 - - - ArrowStyle - - - Mod/TechDraw/Dimensions - - - - 0 - Filled Triangle - - - - :/icons/arrowfilled.svg - - - - - - 1 - Open Arrowhead - - - - :/icons/arrowopen.svg - - - - - - 2 - Tick - - - - :/icons/arrowtick.svg - - - - - - 3 - Dot - - - - :/icons/arrowdot.svg - - - - - - 4 - Open Circle - - - - :/icons/arrowopendot.svg - - - - - - 5 - Fork - - - - :/icons/arrowfork.svg:/icons/arrowfork.svg - - - - - 6 - Pyramid - - - - :/icons/arrowpyramid.svg - - - - - - - - - Arrow Style - - - - - - - Number of decimal places if not using Global Decimals + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - 2 + 0.500000000000000 - AltDecimals + CenterMarkScale - /Mod/TechDraw/Dimensions + Mod/TechDraw/Decorations - - + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + 0 + + - Dimension font size in units + Tolerance font size adjustment. Multiplier of Dimension text size. - - 5.000000000000000 + + - - FontSize - - - /Mod/TechDraw/Dimensions - - - - - - - Dimension arrowhead size in units - - - 3.500000000000000 - - - ArrowSize - - - Mod/TechDraw/Dimensions - - - - - - - Default Format - - - - - - - Custom format for Dimension text - - - formatSpec - - - /Mod/TechDraw/Dimensions - - - - - - - Dimensioning Standard and Style - - - - - - - Preferred standard and style of drawing dimensional values - - - StandardAndStyle - - - /Mod/TechDraw/Dimensions - - - - ISO Oriented - - - - - ISO Referencing - - - - - ASME Inlined - - - - - ASME Referencing - - - - - - - - Tolerance Font Size Factor - - - - - - - Size of tolerance text relative to main dimension text. - - - 2 - - - 99.000000000000000 - - - 0.100000000000000 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0.500000000000000 @@ -383,50 +286,79 @@ TolSizeAdjust - /Mod/TechDraw/Dimensions + Mod/TechDraw/Dimensions - - - - - - - - - Decorations - - - - - - - - Color for centerlines - - - - 175 - 175 - 175 - - - - CenterColor - - - /Mod/TechDraw/Decorations + + + + Vertex Scale - - + + + + + true + + + + Center Mark Scale + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + true + + + + Tolerance Text Scale + + + + + + + Template Edit Mark + + + + + + + + 0 + 0 + + - Adjusts size of vertices in drawing + Scale of Vertex dots. Multiplies line weight. + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - 3.000000000000000 + 5.000000000000000 VertexScale @@ -436,181 +368,244 @@ - - - - Vertex Scale + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + 0 + - - - - - Round or Square outline in Detail view + <html><head/><body><p>Size of Template Field Edit click handles in mm</p></body></html> + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 3.000000000000000 - MattingStyle + TemplateDotSize - /Mod/TechDraw/Decorations - - - - Round - - - - - Square - - - - - - - - Section Line Style + Mod/TechDraw/General + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 150 + + + + + 0 + 200 + + + + Selection + + + + + + 24 + - + - Center Line Style - - - - - - - Matting Style + OverLap Radius (TBI) - + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + 33 + + - Line type for centerlines + Area to be inspected for overlap object selection. (not implemented yet) - - 2 + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 20.000000000000000 - CenterLine + OverlapRadius - /Mod/TechDraw/Decorations + Mod/TechDraw/General - - - NeverShow - - - - - Solid - - - - - Dash - - - - - Dot - - - - - DashDot - - - - - DashDotDot - - - - - - 2 + + + + + 0 + 0 + - - SectionLine + + + 0 + 0 + - - /Mod/TechDraw/Decorations - - - - NeverShow - - - - - Solid - - - - - Dash - - - - - Dot - - - - - DashDot - - - - - DashDotDot - - - - - - - Center Line Color + Edge Fuzz - - + + - Section Line Color + Mark Fuzz - - + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + 0 + + - Line color for sectionlines + Size of selection area around edges. - - - 175 - 175 - 175 - + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 10.000000000000000 - SectionColor + EdgeFuzz - /Mod/TechDraw/Decorations + Mod/TechDraw/General - + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + 0 + + + + Selection area around Center Marks + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 5.000000000000000 + + + MarkFuzz + + + Mod/TechDraw/General + + + + Qt::Horizontal @@ -623,125 +618,57 @@ - - - - Line Group Name - - - - - - - Name of entry in LineGroup CSV file - - - FC 0.70mm - - - LineGroup - - - /Mod/TechDraw/Decorations - - - - - - - Vertex Color - - - - - - - Vertex display color - - - - 150 - 147 - 145 - - - - VertexColor - - - /Mod/TechDraw/Decorations - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - + + + + + 12 + true + + + + QFrame::Box + + + Items in italics are default values for new objects. They have no effect on existing objects. + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + - - Gui::QuantitySpinBox - QWidget -
Gui/QuantitySpinBox.h
-
- - Gui::ColorButton - QPushButton -
Gui/Widgets.h
-
- - Gui::PrefSpinBox - QSpinBox -
Gui/PrefWidgets.h
-
- - Gui::PrefColorButton - Gui::ColorButton -
Gui/PrefWidgets.h
-
- - Gui::PrefCheckBox - QCheckBox -
Gui/PrefWidgets.h
-
Gui::PrefComboBox QComboBox
Gui/PrefWidgets.h
- - Gui::PrefLineEdit - QLineEdit -
Gui/PrefWidgets.h
-
Gui::PrefDoubleSpinBox QDoubleSpinBox
Gui/PrefWidgets.h
- - Gui::PrefUnitSpinBox - Gui::QuantitySpinBox -
Gui/PrefWidgets.h
-
- - - +
diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp index 4adf898fb6..06634cc7cd 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.cpp @@ -34,8 +34,8 @@ DlgPrefsTechDraw2Imp::DlgPrefsTechDraw2Imp( QWidget* parent ) : PreferencePage( parent ) { this->setupUi(this); - plsb_FontSize->setUnit(Base::Unit::Length); - plsb_ArrowSize->setUnit(Base::Unit::Length); +// pdsbTemplateMark->setUnit(Base::Unit::Length); + } DlgPrefsTechDraw2Imp::~DlgPrefsTechDraw2Imp() @@ -45,48 +45,38 @@ DlgPrefsTechDraw2Imp::~DlgPrefsTechDraw2Imp() void DlgPrefsTechDraw2Imp::saveSettings() { - cbShowUnits->onSave(); - plsb_FontSize->onSave(); - pdsb_TolFactor->onSave(); - colDimColor->onSave(); - leDiameter->onSave(); - pcbMatting->onSave(); - pcbCenterStyle->onSave(); - colCenterLine->onSave(); - pcbSectionStyle->onSave(); - colSectionLine->onSave(); - pcbArrow->onSave(); - cbGlobalDecimals->onSave(); - sbAltDecimals->onSave(); - leformatSpec->onSave(); - plsb_ArrowSize->onSave(); - leLineGroup->onSave(); - pdsb_VertexScale->onSave(); - pcb_VertexColor->onSave(); - pcbStandardAndStyle->onSave(); + pdsbToleranceScale->onSave(); + pdsbTemplateMark->onSave(); + + pdsbVertexScale->onSave(); + pdsbCenterScale->onSave(); + + pdsbPageScale->onSave(); + cbViewScaleType->onSave(); + pdsbViewScale->onSave(); + pdsbEdgeFuzz->onSave(); + pdsbMarkFuzz->onSave(); + pdsbOverlapRadius->onSave(); + pdsbTemplateMark->onSave(); } void DlgPrefsTechDraw2Imp::loadSettings() { - cbShowUnits->onRestore(); - plsb_FontSize->onRestore(); - pdsb_TolFactor->onRestore(); - colDimColor->onRestore(); - leDiameter->onRestore(); - pcbMatting->onRestore(); - pcbCenterStyle->onRestore(); - colCenterLine->onRestore(); - pcbSectionStyle->onRestore(); - colSectionLine->onRestore(); - pcbArrow->onRestore(); - cbGlobalDecimals->onRestore(); - sbAltDecimals->onRestore(); - leformatSpec->onRestore(); - plsb_ArrowSize->onRestore(); - leLineGroup->onRestore(); - pdsb_VertexScale->onRestore(); - pcb_VertexColor->onRestore(); - pcbStandardAndStyle->onRestore(); + + pdsbToleranceScale->onRestore(); + + pdsbTemplateMark->onRestore(); + + pdsbVertexScale->onRestore(); + pdsbCenterScale->onRestore(); + + pdsbPageScale->onRestore(); + cbViewScaleType->onRestore(); + pdsbViewScale->onRestore(); + pdsbEdgeFuzz->onRestore(); + pdsbMarkFuzz->onRestore(); + pdsbOverlapRadius->onRestore(); + pdsbTemplateMark->onRestore(); } /** diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.h b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.h index 430e1aa202..9d7a42e5ee 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.h +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw2Imp.h @@ -23,8 +23,8 @@ ***************************************************************************/ -#ifndef DRAWINGGUI_DLGPREFSTECHDRAW2IMP_H -#define DRAWINGGUI_DLGPREFSTECHDRAW2IMP_H +#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP2_H +#define DRAWINGGUI_DLGPREFSTECHDRAWIMP2_H #include #include @@ -47,4 +47,4 @@ protected: } // namespace TechDrawGui -#endif // DRAWINGGUI_DLGPREFSTECHDRAW2IMP_H +#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP2_H diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3.ui new file mode 100644 index 0000000000..83ebc2ebce --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3.ui @@ -0,0 +1,1161 @@ + + + TechDrawGui::DlgPrefsTechDraw3Imp + + + + 0 + 0 + 521 + 1055 + + + + TechDraw Dimensions + + + + + + + 0 + 0 + + + + + true + + + + QFrame::Box + + + Items in italics are default values for new objects. They have no effect on existing objects + + + true + + + + + + + + 0 + 0 + + + + + 0 + 120 + + + + + 16777215 + 500 + + + + + 0 + 500 + + + + Conventions + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Projection Group "Angle" + + + + + + + + 0 + 0 + + + + Use First or Third Angle mutli-view convention. + + + ProjectionAngle + + + Mod/TechDraw/General + + + + First + + + + + Third + + + + + + + + Hidden Line Style + + + + + + + + 0 + 0 + + + + Style for hidden lines. + + + SectionLineStyle + + + Mod/TechDraw/Standards + + + + Solid + + + + + Dashed + + + + + + + + + + + + + Annotation + + + + + + + + + true + + + + Line Group Name + + + + + + + + true + + + + Matting Style + + + + + + + + 0 + 0 + + + + Shape of balloon "bubble". + + + BalloonShape + + + Mod/TechDraw/Decorations + + + + Circular + + + + + None + + + + + Triangle + + + + + Inspection + + + + + Hexagon + + + + + Square + + + + + Rectangle + + + + + + + + + true + + + + Length of horizontal portion of Balloon leader + + + Ballon Leader Kink Length + + + + + + + + 0 + 0 + + + + Leader Auto Horizontal + + + true + + + AutoHorizontal + + + Mod/TechDraw/LeaderLines + + + + + + + + 0 + 0 + + + + Line type for centerlines + + + 2 + + + CenterLine + + + /Mod/TechDraw/Decorations + + + + NeverShow + + + + + Solid + + + + + Dash + + + + + Dot + + + + + DashDot + + + + + DashDotDot + + + + + + + + + true + + + + Balloon Leader Arrow + + + + + + + + 0 + 0 + + + + Shape of balloon "bubble". + + + BalloonArrow + + + Mod/TechDraw/Decorations + + + + Filled Triangle + + + + + Open Arrow + + + + + Hash Mark + + + + + Dot + + + + + Open Circle + + + + + Fork + + + + + Pyramid + + + + + None + + + + + + + + + 0 + 0 + + + + Name of entry in LineGroup CSV file + + + FC 0.70mm + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + LineGroup + + + /Mod/TechDraw/Decorations + + + + + + + + 0 + 0 + + + + 2 + + + SectionLine + + + /Mod/TechDraw/Decorations + + + + NeverShow + + + + + Solid + + + + + Dash + + + + + Dot + + + + + DashDot + + + + + DashDotDot + + + + + + + + + true + + + + Section Line Standard + + + + + + + + 0 + 0 + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 5.000000000000000 + + + BalloonKink + + + Mod/TechDraw/Dimensions + + + + + + + + 0 + 0 + + + + Keep pyramid leader line end in vertical or horizontal position. + + + Balloon Pyramid Ortho + + + true + + + PyramidOrtho + + + Mod/TechDraw/Decorations + + + + + + + + 0 + 0 + + + + SectionLineStyle + + + Mod/TechDraw/General + + + + ISO + + + + + ANSI + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Round or Square outline in Detail view + + + MattingStyle + + + /Mod/TechDraw/Decorations + + + + Round + + + + + Square + + + + + + + + + true + + + + Balloon Shape + + + + + + + + true + + + + Center Line Style + + + + + + + + true + + + + Section Line Style + + + + + + + + 0 + 0 + + + + + true + + + + Show arc center marks in Views. + + + Show Center Marks + + + ShowCenterMarks + + + Mod/TechDraw/Decorations + + + + + + + + 0 + 0 + + + + Show arc centers on printed output + + + Print Center Marks + + + PrintCenterMarks + + + Mod/TechDraw/Decorations + + + + + + + + + + + + Dimensions + + + + + + + + + 0 + 0 + + + + + 12 + + + + Character to use to indicate Diameter dimension + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + DiameterSymbol + + + /Mod/TechDraw/Dimensions + + + + + + + + 0 + 0 + + + + Number of decimal places if not using Global Decimals + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 2 + + + AltDecimals + + + /Mod/TechDraw/Dimensions + + + + + + + + 0 + 0 + + + + Use system setting for decimal places. + + + Use Global Decimals + + + true + + + UseGlobalDecimals + + + /Mod/TechDraw/Dimensions + + + + + + + + true + + + + Font Size + + + + + + + + 0 + 0 + + + + Preferred arrowhead style + + + 0 + + + 5 + + + ArrowStyle + + + Mod/TechDraw/Dimensions + + + + 0 - Filled Triangle + + + + :/icons/arrowfilled.svg + + + + + + 1 - Open Arrowhead + + + + :/icons/arrowopen.svg + + + + + + 2 - Tick + + + + :/icons/arrowtick.svg + + + + + + 3 - Dot + + + + :/icons/arrowdot.svg + + + + + + 4 - Open Circle + + + + :/icons/arrowopendot.svg + + + + + + 5 - Fork + + + + :/icons/arrowfork.svg:/icons/arrowfork.svg + + + + + 6 - Pyramid + + + + :/icons/arrowpyramid.svg + + + + + + + + + Alternate Decimals + + + + + + + + 0 + 0 + + + + Custom format for Dimension text + + + %.2f + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + formatSpec + + + /Mod/TechDraw/Dimensions + + + + + + + Standard and Style + + + + + + + + true + + + + Arrow Size + + + + + + + + true + + + + Arrow Style + + + + + + + + 0 + 0 + + + + Dimension font size in units + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 5.000000000000000 + + + FontSize + + + /Mod/TechDraw/Dimensions + + + + + + + + 0 + 0 + + + + Dimension arrowhead size in units + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 5.000000000000000 + + + ArrowSize + + + Mod/TechDraw/Dimensions + + + + + + + + true + + + + Default Format + + + + + + + + 0 + 0 + + + + Preferred standard and style of drawing dimensional values + + + StandardAndStyle + + + /Mod/TechDraw/Dimensions + + + + ISO Oriented + + + + + ISO Referencing + + + + + ASME Inlined + + + + + ASME Referencing + + + + + + + + Diameter Symbol + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Append unit to Dimension text + + + Show Units + + + ShowUnits + + + /Mod/TechDraw/Dimensions + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Gui::QuantitySpinBox + QWidget +
Gui/QuantitySpinBox.h
+
+ + Gui::PrefSpinBox + QSpinBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefCheckBox + QCheckBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefComboBox + QComboBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefLineEdit + QLineEdit +
Gui/PrefWidgets.h
+
+ + Gui::PrefDoubleSpinBox + QDoubleSpinBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefUnitSpinBox + Gui::QuantitySpinBox +
Gui/PrefWidgets.h
+
+
+ + + + +
diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.cpp new file mode 100644 index 0000000000..d701804386 --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.cpp @@ -0,0 +1,111 @@ +/*************************************************************************** + * Copyright (c) 2015 FreeCAD Developers * + * Author: WandererFan * + * Based on src/Mod/FEM/Gui/DlgSettingsFEMImp.cpp * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" + +#include "DlgPrefsTechDraw3Imp.h" +#include + +using namespace TechDrawGui; + +DlgPrefsTechDraw3Imp::DlgPrefsTechDraw3Imp( QWidget* parent ) + : PreferencePage( parent ) +{ + this->setupUi(this); + plsb_FontSize->setUnit(Base::Unit::Length); + plsb_ArrowSize->setUnit(Base::Unit::Length); +} + +DlgPrefsTechDraw3Imp::~DlgPrefsTechDraw3Imp() +{ + // no need to delete child widgets, Qt does it all for us +} + +void DlgPrefsTechDraw3Imp::saveSettings() +{ + pcbMatting->onSave(); + pcbBalloonShape->onSave(); + cbSectionLineStd->onSave(); + cbPyramidOrtho->onSave(); + pcbCenterStyle->onSave(); + pcbSectionStyle->onSave(); + leLineGroup->onSave(); + pcbBalloonArrow->onSave(); + cbAutoHoriz->onSave(); + leDiameter->onSave(); + pcbArrow->onSave(); + sbAltDecimals->onSave(); + plsb_FontSize->onSave(); + plsb_ArrowSize->onSave(); + leformatSpec->onSave(); + cbGlobalDecimals->onSave(); + cbShowUnits->onSave(); + pcbStandardAndStyle->onSave(); + cbProjAngle->onSave(); + cbHiddenLineStyle->onSave(); + pdsbBalloonKink->onSave(); +} + +void DlgPrefsTechDraw3Imp::loadSettings() +{ + pcbMatting->onRestore(); + pcbBalloonShape->onRestore(); + cbSectionLineStd->onRestore(); + cbPyramidOrtho->onRestore(); + pcbCenterStyle->onRestore(); + pcbSectionStyle->onRestore(); + leLineGroup->onRestore(); + pcbBalloonArrow->onRestore(); + cbAutoHoriz->onRestore(); + leDiameter->onRestore(); + pcbArrow->onRestore(); + sbAltDecimals->onRestore(); + plsb_FontSize->onRestore(); + plsb_ArrowSize->onRestore(); + leformatSpec->onRestore(); + cbGlobalDecimals->onRestore(); + cbShowUnits->onRestore(); + pcbStandardAndStyle->onRestore(); + cbProjAngle->onRestore(); + cbHiddenLineStyle->onRestore(); + pdsbBalloonKink->onRestore(); +} + +/** + * Sets the strings of the subwidgets using the current language. + */ +void DlgPrefsTechDraw3Imp::changeEvent(QEvent *e) +{ + if (e->type() == QEvent::LanguageChange) { + saveSettings(); + retranslateUi(this); + loadSettings(); + } + else { + QWidget::changeEvent(e); + } +} + +#include diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawImp.h b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.h similarity index 82% rename from src/Mod/TechDraw/Gui/DlgPrefsTechDrawImp.h rename to src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.h index d5f297c3a5..7b30ae3e8c 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawImp.h +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw3Imp.h @@ -1,7 +1,7 @@ /************************************************************************** * Copyright (c) 2015 FreeCAD Developers * * Author: WandererFan * - * Based on src/Mod/FEM/Gui/DlgPrefsTechDrawImp.cpp * + * Based on src/Mod/FEM/Gui/DlgPrefsTechDraw3Imp.cpp * * * * This file is part of the FreeCAD CAx development system. * * * @@ -23,21 +23,21 @@ ***************************************************************************/ -#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP_H -#define DRAWINGGUI_DLGPREFSTECHDRAWIMP_H +#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP3_H +#define DRAWINGGUI_DLGPREFSTECHDRAWIMP3_H -#include +#include #include namespace TechDrawGui { -class DlgPrefsTechDrawImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawImp +class DlgPrefsTechDraw3Imp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDraw3Imp { Q_OBJECT public: - DlgPrefsTechDrawImp( QWidget* parent = 0 ); - ~DlgPrefsTechDrawImp(); + DlgPrefsTechDraw3Imp( QWidget* parent = 0 ); + ~DlgPrefsTechDraw3Imp(); protected: void saveSettings(); @@ -47,4 +47,4 @@ protected: } // namespace TechDrawGui -#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP_H +#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP3_H diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw4.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw4.ui new file mode 100644 index 0000000000..96ddc53574 --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw4.ui @@ -0,0 +1,293 @@ + + + TechDrawGui::DlgPrefsTechDraw4Imp + + + + 0 + 0 + 521 + 500 + + + + TechDraw Advanced + + + + + + + 0 + 150 + + + + Advanced + + + + + + + + + 0 + 0 + + + + Dump intermediate results during Detail processing + + + Debug Detail + + + debugDetail + + + Mod/TechDraw/debugDetail + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + true + + + + Perform a fuse operation on the input shape(s) before Section processing + + + Fuse Before Section + + + SectionFuseFirst + + + Mod/TechDraw/General + + + + + + + + 0 + 0 + + + + + false + + + + Change the shape of ends of edges. Used for 1:1 scale stencil making. + + + EdgeCapStyle + + + Mod/TechDraw/General + + + + Round + + + + + Square + + + + + Flat + + + + + + + + + 0 + 0 + + + + Include edges with unexpected geometry (zero length etc) to be included in results. + + + Allow Crazy Edges + + + allowCrazyEdge + + + Mod/TechDraw/debug + + + + + + + + 0 + 0 + + + + If checked, TechDraw will attempt to build faces using the +line segments returned by the hidden line removal algorithm. +Faces must be detected in order to use hatching, but there +can be a performance penalty in complex models. + + + Detect Faces + + + true + + + UseGlobalDecimals + + + /Mod/TechDraw/Dimensions + + + + + + + + true + + + + Edge End Cap + + + + + + + + 0 + 0 + + + + Highlights the border of the section cut in section views + + + Show Section Edges + + + ShowUnits + + + /Mod/TechDraw/Dimensions + + + + + + + + 0 + 0 + + + + Dump intermediate results during Section processing + + + Debug Section + + + debugSection + + + Mod/TechDraw/debug + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 12 + true + + + + QFrame::Box + + + Items in italics are default values for new objects. They have no effect on existing objects. + + + true + + + + + + + + Gui::PrefCheckBox + QCheckBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefComboBox + QComboBox +
Gui/PrefWidgets.h
+
+
+ + + + +
diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw4Imp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw4Imp.cpp new file mode 100644 index 0000000000..9a61cee942 --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw4Imp.cpp @@ -0,0 +1,81 @@ +/*************************************************************************** + * Copyright (c) 2015 FreeCAD Developers * + * Author: WandererFan * + * Based on src/Mod/FEM/Gui/DlgSettingsFEMImp.cpp * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" + +#include "DlgPrefsTechDraw4Imp.h" +#include + +using namespace TechDrawGui; + +DlgPrefsTechDraw4Imp::DlgPrefsTechDraw4Imp( QWidget* parent ) + : PreferencePage( parent ) +{ + this->setupUi(this); +} + +DlgPrefsTechDraw4Imp::~DlgPrefsTechDraw4Imp() +{ + // no need to delete child widgets, Qt does it all for us +} + +void DlgPrefsTechDraw4Imp::saveSettings() +{ + cbEndCap->onSave(); + cbCrazyEdges->onSave(); + cbDebugSection->onSave(); + cbDetectFaces->onSave(); + cbDebugDetail->onSave(); + cbShowSectionEdges->onSave(); + cbFuseBeforeSection->onSave(); +} + +void DlgPrefsTechDraw4Imp::loadSettings() +{ + cbEndCap->onRestore(); + cbCrazyEdges->onRestore(); + cbDebugSection->onRestore(); + cbDetectFaces->onRestore(); + cbDebugDetail->onRestore(); + cbShowSectionEdges->onRestore(); + cbFuseBeforeSection->onRestore(); +} + +/** + * Sets the strings of the subwidgets using the current language. + */ +void DlgPrefsTechDraw4Imp::changeEvent(QEvent *e) +{ + if (e->type() == QEvent::LanguageChange) { + saveSettings(); + retranslateUi(this); + loadSettings(); + } + else { + QWidget::changeEvent(e); + } +} + +#include diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw4Imp.h b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw4Imp.h new file mode 100644 index 0000000000..860652fdc9 --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw4Imp.h @@ -0,0 +1,50 @@ + /************************************************************************** + * Copyright (c) 2015 FreeCAD Developers * + * Author: WandererFan * + * Based on src/Mod/FEM/Gui/DlgPrefsTechDraw4Imp.cpp * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP4_H +#define DRAWINGGUI_DLGPREFSTECHDRAWIMP4_H + +#include +#include + +namespace TechDrawGui { + +class DlgPrefsTechDraw4Imp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDraw4Imp +{ + Q_OBJECT + +public: + DlgPrefsTechDraw4Imp( QWidget* parent = 0 ); + ~DlgPrefsTechDraw4Imp(); + +protected: + void saveSettings(); + void loadSettings(); + void changeEvent(QEvent *e); +}; + +} // namespace TechDrawGui + +#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP4_H diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw5.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw5.ui new file mode 100644 index 0000000000..795b84f146 --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw5.ui @@ -0,0 +1,429 @@ + + + TechDrawGui::DlgPrefsTechDraw5Imp + + + + 0 + 0 + 558 + 500 + + + + + 0 + 0 + + + + + 0 + 400 + + + + TechDraw HLR Parameters + + + + + + + + + + 0 + 0 + + + + + 12 + true + + + + QFrame::Box + + + Items in italics are default values for new objects. They have no effect on existing objects. + + + true + + + + + + + + 0 + 0 + + + + + 0 + 150 + + + + + 16777215 + 16777215 + + + + Hidden Line Removal + + + + + + + + + 0 + 0 + + + + + true + + + + Show Seam Lines + + + Show Seam Lines + + + true + + + SeamViz + + + Mod/TechDraw/HLR + + + + + + + + 0 + 0 + + + + + true + + + + Show Smooth Lines + + + Show Smooth Lines + + + true + + + SmoothViz + + + Mod/TechDraw/HLR + + + + + + + false + + + + 0 + 0 + + + + + true + + + + Qt::NoFocus + + + Show Hard and Outline Edges (alway shown) + + + Show Hard Lines + + + true + + + false + + + HardViz + + + Mod/TechDraw/HLR + + + + + + + + 0 + 0 + + + + + true + + + + Use an approximation to find hidden lines. Fast, but results is a collection of short straight lines. + + + Use Polygon Approximation + + + UsePolygon + + + Mod/TechDraw/HLR + + + + + + + + 0 + 0 + + + + + true + + + + Make lines of equal parameterization + + + Show UV Iso Lines + + + IsoViz + + + Mod/TechDraw/HLR + + + + + + + + 0 + 0 + + + + + true + + + + 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 + + + + + + + + 0 + 0 + + + + + true + + + + Show hidden Hard and Outline edges + + + Show Hard Lines + + + HardHid + + + Mod/TechDraw/HLR + + + + + + + + 0 + 0 + + + + + true + + + + Iso Count + + + + + + + + 0 + 0 + + + + Number of Iso lines per Face edge + + + IsoCount + + + Mod/TechDraw/HLR + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Gui::PrefSpinBox + QSpinBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefCheckBox + QCheckBox +
Gui/PrefWidgets.h
+
+
+ + +
diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw5Imp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw5Imp.cpp new file mode 100644 index 0000000000..1a78fc83a1 --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw5Imp.cpp @@ -0,0 +1,87 @@ +/*************************************************************************** + * Copyright (c) 2015 FreeCAD Developers * + * Author: WandererFan * + * Based on src/Mod/FEM/Gui/DlgSettingsFEMImp.cpp * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#include "PreCompiled.h" + +#include "DlgPrefsTechDraw5Imp.h" +#include + +using namespace TechDrawGui; + +DlgPrefsTechDraw5Imp::DlgPrefsTechDraw5Imp( QWidget* parent ) + : PreferencePage( parent ) +{ + this->setupUi(this); +} + +DlgPrefsTechDraw5Imp::~DlgPrefsTechDraw5Imp() +{ + // no need to delete child widgets, Qt does it all for us +} + +void DlgPrefsTechDraw5Imp::saveSettings() +{ + pcbSeamViz->onSave(); + pcbSmoothViz->onSave(); + pcbHardViz->onSave(); + pcbPolygon->onSave(); + pcbIsoViz->onSave(); + pcbSmoothHid->onSave(); + pcbSeamHid->onSave(); + pcbIsoHid->onSave(); + psbIsoCount->onSave(); + pcbHardHid->onSave(); +} + +void DlgPrefsTechDraw5Imp::loadSettings() +{ + pcbSeamViz->onRestore(); + pcbSmoothViz->onRestore(); + pcbHardViz->onRestore(); + pcbPolygon->onRestore(); + pcbIsoViz->onRestore(); + pcbSmoothHid->onRestore(); + pcbSeamHid->onRestore(); + pcbIsoHid->onRestore(); + psbIsoCount->onRestore(); + pcbHardHid->onRestore(); +} + +/** + * Sets the strings of the subwidgets using the current language. + */ +void DlgPrefsTechDraw5Imp::changeEvent(QEvent *e) +{ + if (e->type() == QEvent::LanguageChange) { + saveSettings(); + retranslateUi(this); + loadSettings(); + } + else { + QWidget::changeEvent(e); + } +} + +#include diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDraw5Imp.h b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw5Imp.h new file mode 100644 index 0000000000..4bc1b28bbc --- /dev/null +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDraw5Imp.h @@ -0,0 +1,50 @@ + /************************************************************************** + * Copyright (c) 2015 FreeCAD Developers * + * Author: WandererFan * + * Based on src/Mod/FEM/Gui/DlgPrefsTechDraw5Imp.cpp * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Library General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + + +#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP5_H +#define DRAWINGGUI_DLGPREFSTECHDRAWIMP5_H + +#include +#include + +namespace TechDrawGui { + +class DlgPrefsTechDraw5Imp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDraw5Imp +{ + Q_OBJECT + +public: + DlgPrefsTechDraw5Imp( QWidget* parent = 0 ); + ~DlgPrefsTechDraw5Imp(); + +protected: + void saveSettings(); + void loadSettings(); + void changeEvent(QEvent *e); +}; + +} // namespace TechDrawGui + +#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP5_H diff --git a/src/Mod/TechDraw/Gui/QGIPrimPath.cpp b/src/Mod/TechDraw/Gui/QGIPrimPath.cpp index 4af6fbfe2b..48b8d69ad3 100644 --- a/src/Mod/TechDraw/Gui/QGIPrimPath.cpp +++ b/src/Mod/TechDraw/Gui/QGIPrimPath.cpp @@ -256,13 +256,32 @@ Base::Reference QGIPrimPath::getParmGroup() return hGrp; } +//EdgeCapStyle param changed from UInt (Qt::PenCapStyle) to Int (QComboBox index) Qt::PenCapStyle QGIPrimPath::prefCapStyle() { Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General"); Qt::PenCapStyle result; - unsigned int cap = hGrp->GetUnsigned("EdgeCapStyle", 0x20); //0x00 FlatCap, 0x10 SquareCap, 0x20 RoundCap - result = (Qt::PenCapStyle) cap; + //old parameter format UINT + unsigned int oldStyle = hGrp->GetUnsigned("EdgeCapStyle", 0xFF); //0x00 FlatCap, 0x10 SquareCap, 0x20 RoundCap + result = (Qt::PenCapStyle) oldStyle; + int newStyle; + if (oldStyle == 0xFF) { //no old style parm found + newStyle = hGrp->GetUnsigned("EdgeCapStyle", 2); //0x00 FlatCap, 0x10 SquareCap, 0x20 RoundCap + switch (newStyle) { + case 0: + result = (Qt::PenCapStyle) 0x20; //round; + break; + case 1: + result = (Qt::PenCapStyle) 0x10; //square; + break; + case 2: + result = (Qt::PenCapStyle) 0x00; //flat + break; + default: + result = (Qt::PenCapStyle) 0x20; + } + } return result; } diff --git a/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp b/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp index c0587194f3..41d0353e18 100644 --- a/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewBalloon.cpp @@ -837,7 +837,7 @@ bool QGIViewBalloon::prefOrthoPyramid() const { Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions"); - bool ortho = hGrp->GetBool("OrthoPyramid", true); + bool ortho = hGrp->GetBool("PyramidOrtho", true); return ortho; }