Made the rest of the PartDesign features aware of the Body

This commit is contained in:
jrheinlaender
2013-04-21 09:24:12 +04:30
committed by Stefan Tröger
parent 4bb14de504
commit 7330d4357e
19 changed files with 923 additions and 746 deletions

View File

@@ -28,6 +28,7 @@
#include "ui_TaskFilletParameters.h"
#include "TaskFilletParameters.h"
#include "Workbench.h"
#include <Base/UnitsApi.h>
#include <App/Application.h>
#include <App/Document.h>
@@ -40,6 +41,7 @@
#include <Gui/Selection.h>
#include <Gui/Command.h>
#include <Mod/PartDesign/App/FeatureFillet.h>
#include <Mod/PartDesign/App/Body.h>
#include <Mod/Sketcher/App/SketchObject.h>
@@ -154,19 +156,20 @@ bool TaskDlgFilletParameters::accept()
bool TaskDlgFilletParameters::reject()
{
// get the support and Sketch
PartDesign::Fillet* pcFillet = static_cast<PartDesign::Fillet*>(FilletView->getObject());
App::DocumentObject *pcSupport;
pcSupport = pcFillet->Base.getValue();
// role back the done things
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
// if abort command deleted the object the support is visible again
if (!Gui::Application::Instance->getViewProvider(pcFillet)) {
if (pcSupport && Gui::Application::Instance->getViewProvider(pcSupport))
Gui::Application::Instance->getViewProvider(pcSupport)->show();
// Body housekeeping
if (ActivePartObject != NULL) {
// 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();
}
}
return true;