From 99fcba49926e6d10a748fdc972484ff05159a50a Mon Sep 17 00:00:00 2001 From: WandererFan Date: Wed, 14 Feb 2018 09:06:36 -0500 Subject: [PATCH] VPart/VSection Graphic Properties to Gui side --- src/Mod/TechDraw/App/AppTechDrawPy.cpp | 7 +- src/Mod/TechDraw/App/DrawUtil.cpp | 11 +++ src/Mod/TechDraw/App/DrawUtil.h | 3 + src/Mod/TechDraw/App/DrawView.cpp | 5 +- src/Mod/TechDraw/App/DrawViewPart.cpp | 46 +++++-------- src/Mod/TechDraw/App/DrawViewPart.h | 11 --- src/Mod/TechDraw/App/DrawViewSection.cpp | 11 +-- src/Mod/TechDraw/Gui/QGIViewPart.cpp | 68 ++++++++++++------- src/Mod/TechDraw/Gui/ViewProviderViewPart.cpp | 57 ++++++++++++---- src/Mod/TechDraw/Gui/ViewProviderViewPart.h | 14 ++++ .../TechDraw/Gui/ViewProviderViewSection.cpp | 4 +- 11 files changed, 141 insertions(+), 96 deletions(-) diff --git a/src/Mod/TechDraw/App/AppTechDrawPy.cpp b/src/Mod/TechDraw/App/AppTechDrawPy.cpp index bb26caf7b3..a793f38d43 100644 --- a/src/Mod/TechDraw/App/AppTechDrawPy.cpp +++ b/src/Mod/TechDraw/App/AppTechDrawPy.cpp @@ -57,6 +57,7 @@ #include "DrawViewPartPy.h" #include "GeometryObject.h" #include "EdgeWalker.h" +#include "DrawUtil.h" namespace TechDraw { @@ -380,7 +381,8 @@ private: TechDrawGeometry::GeometryObject* go = dvp->getGeometryObject(); //visible group begin "" ss << grpHead1; - double thick = dvp->LineWidth.getValue(); +// double thick = dvp->LineWidth.getValue(); + double thick = DrawUtil::getDefaultLineWeight("Thick"); ss << thick; ss << grpHead2; TopoDS_Shape s = go->getVisHard(); @@ -403,7 +405,8 @@ private: dvp->SeamHidden.getValue() ) { //hidden group begin ss << grpHead1; - thick = dvp->HiddenWidth.getValue(); +// thick = dvp->HiddenWidth.getValue(); + thick = DrawUtil::getDefaultLineWeight("Thin"); ss << thick; ss << grpHead2; if (dvp->HardHidden.getValue()) { diff --git a/src/Mod/TechDraw/App/DrawUtil.cpp b/src/Mod/TechDraw/App/DrawUtil.cpp index ab3c69e13b..d8b94dbf66 100644 --- a/src/Mod/TechDraw/App/DrawUtil.cpp +++ b/src/Mod/TechDraw/App/DrawUtil.cpp @@ -425,6 +425,17 @@ double DrawUtil::sensibleScale(double working_scale) return result; } +double DrawUtil::getDefaultLineWeight(std::string lineType) +{ + Base::Reference hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")-> + GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations"); + std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm"); + auto lg = LineGroup::lineGroupFactory(lgName); + + double weight = lg->getWeight(lineType); + return weight; +} + //============================ // various debugging routines. void DrawUtil::dumpVertexes(const char* text, const TopoDS_Shape& s) diff --git a/src/Mod/TechDraw/App/DrawUtil.h b/src/Mod/TechDraw/App/DrawUtil.h index 400380c127..7b477e4bf1 100644 --- a/src/Mod/TechDraw/App/DrawUtil.h +++ b/src/Mod/TechDraw/App/DrawUtil.h @@ -40,6 +40,8 @@ #include #include +#include "LineGroup.h" + #define VERTEXTOLERANCE (2.0 * Precision::Confusion()) namespace TechDraw @@ -72,6 +74,7 @@ class TechDrawExport DrawUtil { Base::Vector3d axis, Base::Vector3d org = Base::Vector3d(0.0,0.0,0.0)); static Base::Vector3d closestBasis(Base::Vector3d v); + static double getDefaultLineWeight(std::string s); diff --git a/src/Mod/TechDraw/App/DrawView.cpp b/src/Mod/TechDraw/App/DrawView.cpp index 4d89b98b77..958ddbe07d 100644 --- a/src/Mod/TechDraw/App/DrawView.cpp +++ b/src/Mod/TechDraw/App/DrawView.cpp @@ -71,8 +71,7 @@ DrawView::DrawView(void) : autoPos(true), mouseMove(false) { - static const char *group = "BaseView"; - static const char *fgroup = "Format"; + static const char *group = "Base"; ADD_PROPERTY_TYPE(X ,(0),group,App::Prop_None,"X position of the view on the page in modelling units (mm)"); ADD_PROPERTY_TYPE(Y ,(0),group,App::Prop_None,"Y position of the view on the page in modelling units (mm)"); @@ -84,7 +83,7 @@ DrawView::DrawView(void) ADD_PROPERTY_TYPE(Scale ,(1.0),group,App::Prop_None,"Scale factor of the view"); Scale.setConstraints(&scaleRange); - ADD_PROPERTY_TYPE(Caption ,(""),fgroup,App::Prop_None,"Short text about the view"); + ADD_PROPERTY_TYPE(Caption ,(""),group,App::Prop_None,"Short text about the view"); } DrawView::~DrawView() diff --git a/src/Mod/TechDraw/App/DrawViewPart.cpp b/src/Mod/TechDraw/App/DrawViewPart.cpp index 7c43e2c6cd..f51122788a 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.cpp +++ b/src/Mod/TechDraw/App/DrawViewPart.cpp @@ -118,14 +118,12 @@ PROPERTY_SOURCE(TechDraw::DrawViewPart, TechDraw::DrawView) DrawViewPart::DrawViewPart(void) : geometryObject(0) { static const char *group = "Projection"; - static const char *fgroup = "Format"; - static const char *lgroup = "Lines"; - static const char *sgroup = "Show"; + static const char *sgroup = "HLR Parameters"; nowUnsetting = false; + Base::Reference hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")-> GetGroup("Preferences")->GetGroup("Mod/TechDraw/General"); double defDist = hGrp->GetFloat("FocusDistance",100.0); - bool coarseView = hGrp->GetBool("CoarseView", false); //properties that affect Geometry ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"3D Shape to view"); @@ -134,7 +132,8 @@ DrawViewPart::DrawViewPart(void) : geometryObject(0) ADD_PROPERTY_TYPE(Perspective ,(false),group,App::Prop_None,"Perspective(true) or Orthographic(false) projection"); ADD_PROPERTY_TYPE(Focus,(defDist),group,App::Prop_None,"Perspective view focus distance"); - //properties that affect Appearance + //properties that control HLR algoaffect Appearance + bool coarseView = hGrp->GetBool("CoarseView", false); ADD_PROPERTY_TYPE(CoarseView, (coarseView), sgroup, App::Prop_None, "Coarse View on/off"); //visible outline ADD_PROPERTY_TYPE(SmoothVisible ,(false),sgroup,App::Prop_None,"Visible Smooth lines on/off"); @@ -145,33 +144,9 @@ DrawViewPart::DrawViewPart(void) : geometryObject(0) 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"); - - //default line weights - hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")-> - GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations"); - std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm"); - auto lg = LineGroup::lineGroupFactory(lgName); - double weight = lg->getWeight("Thick"); - ADD_PROPERTY_TYPE(LineWidth,(weight),lgroup,App::Prop_None,"The thickness of visible lines"); - weight = lg->getWeight("Thin"); - ADD_PROPERTY_TYPE(HiddenWidth,(weight),lgroup,App::Prop_None,"The thickness of hidden lines, if enabled"); - weight = lg->getWeight("Graphic"); - ADD_PROPERTY_TYPE(IsoWidth,(weight),lgroup,App::Prop_None,"The thickness of isoparameter/center/section lines, if enabled"); - weight = lg->getWeight("Extra"); - ADD_PROPERTY_TYPE(ExtraWidth,(weight),lgroup,App::Prop_None,"The thickness of LineGroup Extra lines, if enabled"); - - ADD_PROPERTY_TYPE(HorizCenterLine ,(false),lgroup,App::Prop_None,"Show a horizontal centerline through view"); - ADD_PROPERTY_TYPE(VertCenterLine ,(false),lgroup,App::Prop_None,"Show a vertical centerline through view"); - - ADD_PROPERTY_TYPE(ArcCenterMarks ,(true),sgroup,App::Prop_None,"Center marks on/off"); - ADD_PROPERTY_TYPE(CenterScale,(2.0),fgroup,App::Prop_None,"Center mark size adjustment, if enabled"); - - //properties that affect Section Line - ADD_PROPERTY_TYPE(ShowSectionLine ,(true) ,sgroup,App::Prop_None,"Show/hide section line if applicable"); geometryObject = nullptr; getRunControl(); - delete lg; } DrawViewPart::~DrawViewPart() @@ -306,7 +281,18 @@ short DrawViewPart::mustExecute() const result = (Direction.isTouched() || Source.isTouched() || Scale.isTouched() || - ScaleType.isTouched()); + ScaleType.isTouched() || + Perspective.isTouched() || + Focus.isTouched() || + SmoothVisible.isTouched() || + SeamVisible.isTouched() || + IsoVisible.isTouched() || + HardHidden.isTouched() || + SmoothHidden.isTouched() || + SeamHidden.isTouched() || + IsoHidden.isTouched() || + IsoCount.isTouched() || + CoarseView.isTouched()); } if (result) { diff --git a/src/Mod/TechDraw/App/DrawViewPart.h b/src/Mod/TechDraw/App/DrawViewPart.h index 3addf317ab..42c3e68bde 100644 --- a/src/Mod/TechDraw/App/DrawViewPart.h +++ b/src/Mod/TechDraw/App/DrawViewPart.h @@ -100,17 +100,6 @@ public: App::PropertyBool IsoHidden; App::PropertyInteger IsoCount; - App::PropertyFloat LineWidth; - App::PropertyFloat HiddenWidth; - App::PropertyFloat IsoWidth; - App::PropertyFloat ExtraWidth; - App::PropertyBool ArcCenterMarks; - App::PropertyFloat CenterScale; - App::PropertyBool HorizCenterLine; - App::PropertyBool VertCenterLine; - App::PropertyBool ShowSectionLine; - - std::vector getHatches(void) const; std::vector getGeomHatches(void) const; std::vector getDimensions() const; diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index 86d1a4ce17..f3a217c9c1 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -104,8 +104,7 @@ PROPERTY_SOURCE(TechDraw::DrawViewSection, TechDraw::DrawViewPart) DrawViewSection::DrawViewSection() { static const char *sgroup = "Section"; - static const char *fgroup = "Format"; - //static const char *lgroup = "Line"; + static const char *fgroup = "Cut Surface Format"; ADD_PROPERTY_TYPE(SectionSymbol ,("A"),sgroup,App::Prop_None,"The identifier for this section"); @@ -119,14 +118,6 @@ DrawViewSection::DrawViewSection() ADD_PROPERTY_TYPE(NameGeomPattern ,(""),fgroup,App::Prop_None,"The pattern name for geometric hatching"); ADD_PROPERTY_TYPE(HatchScale,(1.0),fgroup,App::Prop_None,"Hatch pattern size adjustment"); -// ADD_PROPERTY_TYPE(ShowCutSurface ,(true),fgroup,App::Prop_None,"Show/hide the cut surface"); -// ADD_PROPERTY_TYPE(CutSurfaceColor,(0.0,0.0,0.0),fgroup,App::Prop_None,"The color to shade the cut surface"); -// ADD_PROPERTY_TYPE(HatchCutSurface ,(false),fgroup,App::Prop_None,"Hatch the cut surface"); -// ADD_PROPERTY_TYPE(FileHatchPattern ,(""),fgroup,App::Prop_None,"The hatch pattern file for the cut surface"); -// ADD_PROPERTY_TYPE(NameGeomPattern ,(""),fgroup,App::Prop_None,"The pattern name for geometric hatching"); -// ADD_PROPERTY_TYPE(HatchColor,(0.0,0.0,0.0),fgroup,App::Prop_None,"The color of the hatch pattern"); - - getParameters(); } diff --git a/src/Mod/TechDraw/Gui/QGIViewPart.cpp b/src/Mod/TechDraw/Gui/QGIViewPart.cpp index 2ee2659bf8..68c0904bb7 100644 --- a/src/Mod/TechDraw/Gui/QGIViewPart.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewPart.cpp @@ -71,6 +71,7 @@ #include "QGIViewPart.h" #include "ViewProviderGeomHatch.h" #include "ViewProviderHatch.h" +#include "ViewProviderViewPart.h" using namespace TechDrawGui; using namespace TechDrawGeometry; @@ -308,10 +309,13 @@ void QGIViewPart::updateView(bool update) if( viewPart == nullptr ) { return; } + auto vp = static_cast(getViewProvider(getViewObject())); + if ( vp == nullptr ) { + return; + } QGIView::updateView(update); - if (update || viewPart->isTouched() || viewPart->Source.isTouched() || @@ -325,21 +329,18 @@ void QGIViewPart::updateView(bool update) viewPart->SmoothHidden.isTouched() || viewPart->SeamHidden.isTouched() || viewPart->IsoHidden.isTouched() || - viewPart->IsoCount.isTouched() || - viewPart->ShowSectionLine.isTouched() || - viewPart->HorizCenterLine.isTouched() || - viewPart->VertCenterLine.isTouched() ) { + viewPart->IsoCount.isTouched() ) { draw(); } else if (update || - viewPart->LineWidth.isTouched() || - viewPart->HiddenWidth.isTouched()) { + vp->LineWidth.isTouched() || + vp->HiddenWidth.isTouched()) { QList items = childItems(); for(QList::iterator it = items.begin(); it != items.end(); ++it) { QGIEdge *edge = dynamic_cast(*it); if(edge && edge->getHiddenEdge()) { - edge->setWidth(viewPart->HiddenWidth.getValue() * lineScaleFactor); + edge->setWidth(vp->HiddenWidth.getValue() * lineScaleFactor); } else if (edge){ - edge->setWidth(viewPart->LineWidth.getValue() * lineScaleFactor); + edge->setWidth(vp->LineWidth.getValue() * lineScaleFactor); } } draw(); @@ -363,10 +364,16 @@ void QGIViewPart::drawViewPart() if (!viewPart->hasGeometry()) { return; } + + auto vp = static_cast(getViewProvider(getViewObject())); + if ( vp == nullptr ) { + return; + } - float lineWidth = viewPart->LineWidth.getValue() * lineScaleFactor; - float lineWidthHid = viewPart->HiddenWidth.getValue() * lineScaleFactor; - float lineWidthIso = viewPart->IsoWidth.getValue() * lineScaleFactor; + + float lineWidth = vp->LineWidth.getValue() * lineScaleFactor; + float lineWidthHid = vp->HiddenWidth.getValue() * lineScaleFactor; + float lineWidthIso = vp->IsoWidth.getValue() * lineScaleFactor; // float lineWidthExtra = viewPart->ExtraWidth.getValue() * lineScaleFactor; prepareGeometryChange(); @@ -485,8 +492,8 @@ void QGIViewPart::drawViewPart() bool usePolygonHLR = viewPart->CoarseView.getValue(); const std::vector &verts = viewPart->getVertexGeometry(); std::vector::const_iterator vert = verts.begin(); - bool showCenters = viewPart->ArcCenterMarks.getValue(); - double cAdjust = viewPart->CenterScale.getValue(); + bool showCenters = vp->ArcCenterMarks.getValue(); + double cAdjust = vp->CenterScale.getValue(); for(int i = 0 ; vert != verts.end(); ++vert, i++) { if ((*vert)->isCenter) { if (showCenters) { @@ -506,7 +513,7 @@ void QGIViewPart::drawViewPart() } } //draw section line - if (viewPart->ShowSectionLine.getValue()) { + if (vp->ShowSectionLine.getValue()) { auto refs = viewPart->getSectionRefs(); for (auto& r:refs) { drawSectionLine(r, true); @@ -601,7 +608,12 @@ void QGIViewPart::drawSectionLine(TechDraw::DrawViewSection* viewSection, bool b if (!viewSection->hasGeometry()) { return; } - + + auto vp = static_cast(getViewProvider(getViewObject())); + if ( vp == nullptr ) { + return; + } + if (b) { QGISectionLine* sectionLine = new QGISectionLine(); addToGroup(sectionLine); @@ -652,7 +664,7 @@ void QGIViewPart::drawSectionLine(TechDraw::DrawViewSection* viewSection, bool b yVal = sectionSpan / 2.0; } sectionLine->setBounds(-xVal,-yVal,xVal,yVal); - sectionLine->setWidth(Rez::guiX(viewPart->IsoWidth.getValue())); + sectionLine->setWidth(Rez::guiX(vp->IsoWidth.getValue())); sectionLine->setFont(m_font,Rez::guiX(6.0)); sectionLine->setZValue(ZVALUE::SECTIONLINE); sectionLine->setRotation(viewPart->Rotation.getValue()); @@ -665,11 +677,16 @@ void QGIViewPart::drawCenterLines(bool b) TechDraw::DrawViewPart *viewPart = dynamic_cast(getViewObject()); if (!viewPart) { return; - } + + auto vp = static_cast(getViewProvider(getViewObject())); + if ( vp == nullptr ) { + return; + } + if (b) { - bool horiz = viewPart->HorizCenterLine.getValue(); - bool vert = viewPart->VertCenterLine.getValue(); + bool horiz = vp->HorizCenterLine.getValue(); + bool vert = vp->VertCenterLine.getValue(); QGICenterLine* centerLine; double sectionSpan; @@ -683,7 +700,7 @@ void QGIViewPart::drawCenterLines(bool b) xVal = sectionSpan / 2.0; yVal = 0.0; centerLine->setBounds(-xVal,-yVal,xVal,yVal); - centerLine->setWidth(Rez::guiX(viewPart->IsoWidth.getValue())); + centerLine->setWidth(Rez::guiX(vp->IsoWidth.getValue())); centerLine->setZValue(ZVALUE::SECTIONLINE); centerLine->setRotation(viewPart->Rotation.getValue()); centerLine->draw(); @@ -696,7 +713,7 @@ void QGIViewPart::drawCenterLines(bool b) xVal = 0.0; yVal = sectionSpan / 2.0; centerLine->setBounds(-xVal,-yVal,xVal,yVal); - centerLine->setWidth(Rez::guiX(viewPart->IsoWidth.getValue())); + centerLine->setWidth(Rez::guiX(vp->IsoWidth.getValue())); centerLine->setZValue(ZVALUE::SECTIONLINE); centerLine->setRotation(viewPart->Rotation.getValue()); centerLine->draw(); @@ -716,6 +733,11 @@ void QGIViewPart::drawHighlight(TechDraw::DrawViewDetail* viewDetail, bool b) return; } + auto vp = static_cast(getViewProvider(getViewObject())); + if ( vp == nullptr ) { + return; + } + if (b) { QGIHighlight* highlight = new QGIHighlight(); addToGroup(highlight); @@ -724,7 +746,7 @@ void QGIViewPart::drawHighlight(TechDraw::DrawViewDetail* viewDetail, bool b) Base::Vector3d center = viewDetail->AnchorPoint.getValue() * viewPart->getScale(); double radius = viewDetail->Radius.getValue() * viewPart->getScale(); highlight->setBounds(center.x - radius, center.y + radius,center.x + radius, center.y - radius); - highlight->setWidth(Rez::guiX(viewPart->IsoWidth.getValue())); + highlight->setWidth(Rez::guiX(vp->IsoWidth.getValue())); highlight->setFont(m_font,Rez::guiX(6.0)); highlight->setZValue(ZVALUE::HIGHLIGHT); highlight->draw(); diff --git a/src/Mod/TechDraw/Gui/ViewProviderViewPart.cpp b/src/Mod/TechDraw/Gui/ViewProviderViewPart.cpp index 048c77edc0..3b5898cc0d 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderViewPart.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderViewPart.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "ViewProviderViewPart.h" @@ -54,6 +55,32 @@ PROPERTY_SOURCE(TechDrawGui::ViewProviderViewPart, TechDrawGui::ViewProviderDraw ViewProviderViewPart::ViewProviderViewPart() { sPixmap = "TechDraw_Tree_View"; + + static const char *group = "Lines"; + static const char *dgroup = "Decoration"; + + //default line weights + Base::Reference hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")-> + GetGroup("Preferences")->GetGroup("Mod/TechDraw/Decorations"); + std::string lgName = hGrp->GetASCII("LineGroup","FC 0.70mm"); + auto lg = TechDraw::LineGroup::lineGroupFactory(lgName); + double weight = lg->getWeight("Thick"); + ADD_PROPERTY_TYPE(LineWidth,(weight),group,App::Prop_None,"The thickness of visible lines"); + weight = lg->getWeight("Thin"); + ADD_PROPERTY_TYPE(HiddenWidth,(weight),group,App::Prop_None,"The thickness of hidden lines, if enabled"); + weight = lg->getWeight("Graphic"); + ADD_PROPERTY_TYPE(IsoWidth,(weight),group,App::Prop_None,"The thickness of isoparameter/center/section lines, if enabled"); + weight = lg->getWeight("Extra"); + ADD_PROPERTY_TYPE(ExtraWidth,(weight),group,App::Prop_None,"The thickness of LineGroup Extra lines, if enabled"); + + //decorations + ADD_PROPERTY_TYPE(HorizCenterLine ,(false),dgroup,App::Prop_None,"Show a horizontal centerline through view"); + ADD_PROPERTY_TYPE(VertCenterLine ,(false),dgroup,App::Prop_None,"Show a vertical centerline through view"); + ADD_PROPERTY_TYPE(ArcCenterMarks ,(true),dgroup,App::Prop_None,"Center marks on/off"); + ADD_PROPERTY_TYPE(CenterScale,(2.0),dgroup,App::Prop_None,"Center mark size adjustment, if enabled"); + + //properties that affect Section Line + ADD_PROPERTY_TYPE(ShowSectionLine ,(true) ,dgroup,App::Prop_None,"Show/hide section line if applicable"); } ViewProviderViewPart::~ViewProviderViewPart() @@ -63,13 +90,21 @@ ViewProviderViewPart::~ViewProviderViewPart() void ViewProviderViewPart::updateData(const App::Property* prop) { - if (prop == &(getViewObject()->LineWidth) || - prop == &(getViewObject()->HiddenWidth) || - prop == &(getViewObject()->ArcCenterMarks) || - prop == &(getViewObject()->CenterScale) || - prop == &(getViewObject()->ShowSectionLine) || - prop == &(getViewObject()->HorizCenterLine) || - prop == &(getViewObject()->VertCenterLine) ) { + + ViewProviderDrawingView::updateData(prop); +} + +void ViewProviderViewPart::onChanged(const App::Property* prop) +{ + if (prop == &(LineWidth) || + prop == &(HiddenWidth) || + prop == &(IsoWidth) || + prop == &(ExtraWidth) || + prop == &(ArcCenterMarks) || + prop == &(CenterScale) || + prop == &(ShowSectionLine) || + prop == &(HorizCenterLine) || + prop == &(VertCenterLine) ) { // redraw QGIVP QGIView* qgiv = getQView(); if (qgiv) { @@ -77,12 +112,6 @@ void ViewProviderViewPart::updateData(const App::Property* prop) } } - - ViewProviderDrawingView::updateData(prop); -} - -void ViewProviderViewPart::onChanged(const App::Property* prop) -{ ViewProviderDrawingView::onChanged(prop); } @@ -94,8 +123,6 @@ void ViewProviderViewPart::attach(App::DocumentObject *pcFeat) sPixmap = "TechDraw_Tree_Multi"; } - // call parent attach method -// ViewProviderDocumentObject::attach(pcFeat); ViewProviderDrawingView::attach(pcFeat); } diff --git a/src/Mod/TechDraw/Gui/ViewProviderViewPart.h b/src/Mod/TechDraw/Gui/ViewProviderViewPart.h index cfbd5b7765..5f45df29e5 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderViewPart.h +++ b/src/Mod/TechDraw/Gui/ViewProviderViewPart.h @@ -24,6 +24,10 @@ #ifndef DRAWINGGUI_VIEWPROVIDERVIEWPART_H #define DRAWINGGUI_VIEWPROVIDERVIEWPART_H +#include +#include +#include + #include "ViewProviderDrawingView.h" #include #include @@ -40,6 +44,16 @@ public: /// destructor virtual ~ViewProviderViewPart(); + App::PropertyFloat LineWidth; + App::PropertyFloat HiddenWidth; + App::PropertyFloat IsoWidth; + App::PropertyFloat ExtraWidth; + App::PropertyBool ArcCenterMarks; + App::PropertyFloat CenterScale; + App::PropertyBool HorizCenterLine; + App::PropertyBool VertCenterLine; + App::PropertyBool ShowSectionLine; + virtual void attach(App::DocumentObject *); virtual void setDisplayMode(const char* ModeName); virtual bool useNewSelectionModel(void) const {return false;} diff --git a/src/Mod/TechDraw/Gui/ViewProviderViewSection.cpp b/src/Mod/TechDraw/Gui/ViewProviderViewSection.cpp index 28d88ce8ab..16ca2830c8 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderViewSection.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderViewSection.cpp @@ -48,8 +48,8 @@ PROPERTY_SOURCE(TechDrawGui::ViewProviderViewSection, TechDrawGui::ViewProviderV ViewProviderViewSection::ViewProviderViewSection() { - static const char *sgroup = "Surface"; - static const char *hgroup = "Hatch"; + static const char *sgroup = "Cut Surface"; + static const char *hgroup = "Surface Hatch"; sPixmap = "TechDraw_Tree_Section"; ADD_PROPERTY_TYPE(ShowCutSurface ,(true),sgroup,App::Prop_None,"Show/hide the cut surface"); ADD_PROPERTY_TYPE(CutSurfaceColor,(0.0,0.0,0.0),sgroup,App::Prop_None,"The color to shade the cut surface");