Skip to content

Commit

Permalink
[TD]fix Section frame paint
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Oct 30, 2019
1 parent 5d6c531 commit 1b4d2d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions src/Mod/TechDraw/App/DrawViewSection.cpp
Expand Up @@ -204,14 +204,18 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
return new App::DocumentObjectExecReturn("BaseView object not found");
}

if (!base->getTypeId().isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId()))
TechDraw::DrawViewPart* dvp = nullptr;
if (!base->getTypeId().isDerivedFrom(TechDraw::DrawViewPart::getClassTypeId())) {
return new App::DocumentObjectExecReturn("BaseView object is not a DrawViewPart object");

} else {
dvp = static_cast<TechDraw::DrawViewPart*>(base);
}

TopoDS_Shape baseShape;
if (FuseBeforeCut.getValue()) {
baseShape = static_cast<TechDraw::DrawViewPart*>(base)->getSourceShapeFused();
baseShape = dvp->getSourceShapeFused();
} else {
baseShape = static_cast<TechDraw::DrawViewPart*>(base)->getSourceShape();
baseShape = dvp->getSourceShape();
}

if (baseShape.IsNull()) {
Expand Down Expand Up @@ -302,8 +306,9 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
#endif //#if MOD_TECHDRAW_HANDLE_FACES
}
catch (Standard_Failure& e1) {
Base::Console().Log("LOG - DVS::execute - base shape failed for %s - %s **\n",getNameInDocument(),e1.GetMessageString());
return new App::DocumentObjectExecReturn(e1.GetMessageString());
Base::Console().Warning("DVS::execute - failed to build base shape %s - %s **\n",
getNameInDocument(),e1.GetMessageString());
return DrawView::execute();
}

try {
Expand Down Expand Up @@ -337,14 +342,16 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void)
sectionFaces = newFaces;
}
catch (Standard_Failure& e2) {
Base::Console().Log("LOG - DVS::execute - failed building section faces for %s - %s **\n",getNameInDocument(),e2.GetMessageString());
return new App::DocumentObjectExecReturn(e2.GetMessageString());
Base::Console().Warning("DVS::execute - failed to build section faces for %s - %s **\n",
getNameInDocument(),e2.GetMessageString());
return DrawView::execute();
}

addCosmeticVertexesToGeom();
addCosmeticEdgesToGeom();
addCenterLinesToGeom();

dvp->requestPaint(); //to refresh section line
return DrawView::execute();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/Gui/TaskSectionView.cpp
Expand Up @@ -400,8 +400,8 @@ bool TaskSectionView::accept()
Gui::Command::commitCommand();
}
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
// m_section->recomputeFeature();
if (m_section != nullptr) {
// m_section->recomputeFeature();
m_section->requestPaint();
}
if (m_base != nullptr) {
Expand Down

0 comments on commit 1b4d2d4

Please sign in to comment.