From abd18ff88f7682e9b1160c36bb785b14a33473ef Mon Sep 17 00:00:00 2001 From: wandererfan Date: Sun, 9 Aug 2020 11:55:48 -0400 Subject: [PATCH] [TD]fix showSectionEdge preference --- src/Mod/TechDraw/App/DrawViewPart.cpp | 16 ++-------------- src/Mod/TechDraw/App/DrawViewPart.h | 4 +--- src/Mod/TechDraw/App/DrawViewSection.cpp | 8 ++++++++ src/Mod/TechDraw/App/DrawViewSection.h | 2 ++ src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui | 3 +++ 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index 13972c9fcf..d757e0168b 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -169,7 +169,6 @@ DrawViewPart::DrawViewPart(void) : ADD_PROPERTY_TYPE(IsoCount ,(prefIsoCount()),sgroup,App::Prop_None,"Number of iso parameters lines"); geometryObject = nullptr; - getRunControl(); //initialize bbox to non-garbage bbox = Base::BoundBox3d(Base::Vector3d(0.0, 0.0, 0.0), 0.0); } @@ -951,22 +950,11 @@ const std::vector DrawViewPart::getVisibleFaceEdges() con return geometryObject->getVisibleFaceEdges(SmoothVisible.getValue(),SeamVisible.getValue()); } -void DrawViewPart::getRunControl() +bool DrawViewPart::handleFaces(void) { Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General"); - m_sectionEdges = hGrp->GetBool("ShowSectionEdges", 0l); - m_handleFaces = hGrp->GetBool("HandleFaces", 1l); -} - -bool DrawViewPart::handleFaces(void) -{ - return m_handleFaces; -} - -bool DrawViewPart::showSectionEdges(void) -{ - return m_sectionEdges; + return hGrp->GetBool("HandleFaces", 1l); } //! remove features that are useless without this DVP diff --git a/src/Mod/TechDraw/App/DrawViewPart.h b/src/Mod/TechDraw/App/DrawViewPart.h index 03a668d354..fffc70e652 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.h +++ b/src/Mod/TechDraw/App/DrawViewPart.h @@ -162,7 +162,6 @@ public: bool handleFaces(void); - bool showSectionEdges(void); bool isUnsetting(void) { return nowUnsetting; } @@ -225,8 +224,7 @@ protected: Base::Vector3d shapeCentroid; void getRunControl(void); - - bool m_sectionEdges; + bool m_handleFaces; TopoDS_Shape m_saveShape; //TODO: make this a Property. Part::TopoShapeProperty?? diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index 8e2cdd4473..6c77bfe760 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -869,6 +869,14 @@ int DrawViewSection::prefCutSurface(void) const return result; } +bool DrawViewSection::showSectionEdges(void) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General"); + return (hGrp->GetBool("ShowSectionEdges", true)); +} + + void DrawViewSection::onDocumentRestored() { // Base::Console().Message("DVS::onDocumentRestored()\n"); diff --git a/src/Mod/TechDraw/App/DrawViewSection.h b/src/Mod/TechDraw/App/DrawViewSection.h index b42fbf81fe..0bbd9acbeb 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.h +++ b/src/Mod/TechDraw/App/DrawViewSection.h @@ -120,6 +120,8 @@ public: std::pair sectionLineEnds(void); + bool showSectionEdges(void); + protected: TopoDS_Compound sectionFaces; //tSectionFaces // std::vector sectionFaceWires; //obs??? getSectionFaceWires diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui index 44095c9ff4..45859a070e 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawAdvanced.ui @@ -250,6 +250,9 @@ Then you need to increase the tile limit. Show Section Edges + + true + ShowSectionEdges