From 252293adafb08bdcf52093f790d38e001fc4e4c6 Mon Sep 17 00:00:00 2001 From: wandererfan Date: Tue, 17 Mar 2020 19:50:20 -0400 Subject: [PATCH] [TD]add separate property for geom hatch --- src/Mod/TechDraw/Gui/QGIViewSection.cpp | 2 +- src/Mod/TechDraw/Gui/ViewProviderViewSection.cpp | 16 +++++++++++++--- src/Mod/TechDraw/Gui/ViewProviderViewSection.h | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Mod/TechDraw/Gui/QGIViewSection.cpp b/src/Mod/TechDraw/Gui/QGIViewSection.cpp index 5eb1d58147..40df1aea90 100644 --- a/src/Mod/TechDraw/Gui/QGIViewSection.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewSection.cpp @@ -130,7 +130,7 @@ void QGIViewSection::drawSectionFace() } else if (section->CutSurfaceDisplay.isValue("PatHatch")) { newFace->isHatched(true); newFace->setFillMode(QGIFace::GeomHatchFill); - newFace->setHatchColor(sectionVp->HatchColor.getValue()); + newFace->setHatchColor(sectionVp->GeomHatchColor.getValue()); newFace->setHatchScale(section->HatchScale.getValue()); newFace->setLineWeight(sectionVp->WeightPattern.getValue()); std::vector lineSets = section->getDrawableLines(i); diff --git a/src/Mod/TechDraw/Gui/ViewProviderViewSection.cpp b/src/Mod/TechDraw/Gui/ViewProviderViewSection.cpp index aec32a64ea..52a5751ba0 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderViewSection.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderViewSection.cpp @@ -46,6 +46,9 @@ #include #include +#include +#include + #include "TaskSectionView.h" #include "ViewProviderViewSection.h" @@ -67,7 +70,12 @@ ViewProviderViewSection::ViewProviderViewSection() ADD_PROPERTY_TYPE(CutSurfaceColor,(0.0,0.0,0.0),sgroup,App::Prop_None,"The color to shade the cut surface"); //HatchCutSurface is obsolete - use CutSurfaceDisplay ADD_PROPERTY_TYPE(HatchCutSurface ,(false),hgroup,App::Prop_Hidden,"Hatch the cut surface"); - ADD_PROPERTY_TYPE(HatchColor,(0.0,0.0,0.0),hgroup,App::Prop_None,"The color of the hatch pattern"); + + ADD_PROPERTY_TYPE(HatchColor,(TechDraw::DrawHatch::prefSvgHatchColor()), + hgroup,App::Prop_None,"The color of the Svg hatch pattern"); + ADD_PROPERTY_TYPE(GeomHatchColor,(TechDraw::DrawGeomHatch::prefGeomHatchColor()), + hgroup,App::Prop_None,"The color of the Geometric hatch pattern"); + ADD_PROPERTY_TYPE(WeightPattern,(0.1),hgroup,App::Prop_None,"GeomHatch pattern line thickness"); getParameters(); @@ -103,6 +111,7 @@ void ViewProviderViewSection::onChanged(const App::Property* prop) if (prop == &WeightPattern || // prop == &HatchCutSurface || prop == &HatchColor || + prop == &GeomHatchColor || // prop == &ShowCutSurface || prop == &CutSurfaceColor ) { updateGraphic(); @@ -178,8 +187,9 @@ void ViewProviderViewSection::getParameters(void) .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors"); App::Color cutColor = App::Color((uint32_t) hGrp->GetUnsigned("CutSurfaceColor", 0xC8C8C800)); CutSurfaceColor.setValue(cutColor); - App::Color hatchColor = App::Color((uint32_t) hGrp->GetUnsigned("SectionHatchColor", 0x00000000)); - HatchColor.setValue(hatchColor); + +// App::Color hatchColor = App::Color((uint32_t) hGrp->GetUnsigned("SectionHatchColor", 0x00000000)); +// HatchColor.setValue(hatchColor); hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT"); diff --git a/src/Mod/TechDraw/Gui/ViewProviderViewSection.h b/src/Mod/TechDraw/Gui/ViewProviderViewSection.h index ebf034ac04..35a7dc45f5 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderViewSection.h +++ b/src/Mod/TechDraw/Gui/ViewProviderViewSection.h @@ -48,6 +48,7 @@ public: App::PropertyColor CutSurfaceColor; App::PropertyBool HatchCutSurface; //obsolete - use CutSurfaceDisplay App::PropertyColor HatchColor; + App::PropertyColor GeomHatchColor; App::PropertyFloat WeightPattern;