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 3e4986f163
commit ee47c53339
7 changed files with 79 additions and 13 deletions

View File

@@ -41,7 +41,8 @@
#include <Gui/Command.h>
#include <Mod/PartDesign/App/FeatureGroove.h>
#include <Mod/Sketcher/App/SketchObject.h>
#include <Mod/PartDesign/App/Body.h>
#include "Workbench.h"
using namespace PartDesignGui;
using namespace Gui;
@@ -336,6 +337,19 @@ bool TaskDlgGrooveParameters::reject()
pcSupport = pcSketch->Support.getValue();
}
// Body housekeeping
if (ActivePartObject != NULL) {
ActivePartObject->removeFeature(pcGroove);
// 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();
}
}
// role back the done things
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");