Bug fixes for Body feature insert/remove functionality

This commit is contained in:
jrheinlaender
2016-04-12 18:11:48 +02:00
committed by Stefan Tröger
parent 3e4986f163
commit ee47c53339
7 changed files with 79 additions and 13 deletions
@@ -46,7 +46,9 @@
#include <Gui/Command.h>
#include <Mod/PartDesign/App/FeaturePocket.h>
#include <Mod/Sketcher/App/SketchObject.h>
#include <Mod/PartDesign/App/Body.h>
#include "ReferenceSelection.h"
#include "Workbench.h"
using namespace PartDesignGui;
using namespace Gui;
@@ -499,6 +501,19 @@ bool TaskDlgPocketParameters::reject()
pcSupport = pcSketch->Support.getValue();
}
// Body housekeeping
if (ActivePartObject != NULL) {
ActivePartObject->removeFeature(pcPocket);
// Make the new Tip and the previous solid feature visible again
App::DocumentObject* tip = ActivePartObject->Tip.getValue();
App::DocumentObject* prev = ActivePartObject->getPrevSolidFeature();
if (tip != NULL) {
Gui::Application::Instance->getViewProvider(tip)->show();
if ((tip != prev) && (prev != NULL))
Gui::Application::Instance->getViewProvider(prev)->show();
}
}
// roll back the done things
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");