[TD]fix showSectionEdge preference

This commit is contained in:
wandererfan
2020-08-09 11:55:48 -04:00
committed by WandererFan
parent 50aa73da9d
commit abd18ff88f
5 changed files with 16 additions and 17 deletions

View File

@@ -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<TechDraw::BaseGeom *> DrawViewPart::getVisibleFaceEdges() con
return geometryObject->getVisibleFaceEdges(SmoothVisible.getValue(),SeamVisible.getValue());
}
void DrawViewPart::getRunControl()
bool DrawViewPart::handleFaces(void)
{
Base::Reference<ParameterGrp> 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

View File

@@ -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??

View File

@@ -869,6 +869,14 @@ int DrawViewSection::prefCutSurface(void) const
return result;
}
bool DrawViewSection::showSectionEdges(void)
{
Base::Reference<ParameterGrp> 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");

View File

@@ -120,6 +120,8 @@ public:
std::pair<Base::Vector3d, Base::Vector3d> sectionLineEnds(void);
bool showSectionEdges(void);
protected:
TopoDS_Compound sectionFaces; //tSectionFaces
// std::vector<TopoDS_Wire> sectionFaceWires; //obs??? getSectionFaceWires

View File

@@ -250,6 +250,9 @@ Then you need to increase the tile limit.</string>
<property name="text">
<string>Show Section Edges</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ShowSectionEdges</cstring>
</property>