[PD] fix dressup feature display when broken

As discussed in https://forum.freecadweb.org/viewtopic.php?p=479647#p479377
the user can end up without either seeing nothing or an inexisting dressup feature.

This PR fixes this.
This commit is contained in:
donovaly
2021-02-19 05:02:18 +01:00
committed by wmayer
parent 1b07835aa5
commit 3fdce54be7
7 changed files with 70 additions and 7 deletions

View File

@@ -61,6 +61,7 @@
#include <Mod/PartDesign/App/DatumPoint.h>
#include <Mod/PartDesign/App/DatumLine.h>
#include <Mod/PartDesign/App/DatumPlane.h>
#include <Mod/PartDesign/App/FeatureDressUp.h>
#include <Mod/PartDesign/App/ShapeBinder.h>
#include "TaskFeaturePick.h"
@@ -1889,6 +1890,15 @@ void finishDressupFeature(const Gui::Command* cmd, const std::string& which,
FCMD_OBJ_CMD(Feat,"Base = " << str.str());
cmd->doCommand(cmd->Gui,"Gui.Selection.clearSelection()");
finishFeature(cmd, Feat, base);
App::DocumentObject* baseFeature = static_cast<PartDesign::DressUp*>(Feat)->Base.getValue();
if (baseFeature) {
PartDesignGui::ViewProvider* view = dynamic_cast<PartDesignGui::ViewProvider*>(Gui::Application::Instance->getViewProvider(baseFeature));
// in case there is an error, for example when a fillet is larger than the available space
// display the base feature to avoid that the user sees nothing
if (view && Feat->isError())
view->Visibility.setValue(true);
}
}
void makeChamferOrFillet(Gui::Command* cmd, const std::string& which)