Bug fixes for Body feature insert/remove functionality

This commit is contained in:
jrheinlaender
2013-04-11 19:46:53 +04:30
committed by Stefan Tröger
parent 8002584a52
commit 0cd8fc816b
7 changed files with 79 additions and 13 deletions

View File

@@ -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()");