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

@@ -32,6 +32,7 @@
#include "TaskTransformedParameters.h"
#include "TaskMultiTransformParameters.h"
#include "Workbench.h"
#include <App/Application.h>
#include <App/Document.h>
#include <Gui/Application.h>
@@ -45,6 +46,7 @@
#include <Mod/PartDesign/App/FeatureTransformed.h>
#include <Mod/PartDesign/App/FeatureAdditive.h>
#include <Mod/PartDesign/App/FeatureSubtractive.h>
#include <Mod/PartDesign/App/Body.h>
#include "ReferenceSelection.h"
using namespace PartDesignGui;
@@ -274,21 +276,19 @@ bool TaskDlgTransformedParameters::reject()
// ensure that we are not in selection mode
parameter->exitSelectionMode();
// get object and originals before view is invalidated (if it is invalidated)
PartDesign::Transformed* pcTransformed = static_cast<PartDesign::Transformed*>(TransformedView->getObject());
std::vector<App::DocumentObject*> pcOriginals = pcTransformed->Originals.getValues();
// roll back the done things
Gui::Command::abortCommand();
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
// if abort command deleted the object the originals are visible again
if (!Gui::Application::Instance->getViewProvider(pcTransformed)) {
for (std::vector<App::DocumentObject*>::const_iterator it = pcOriginals.begin(); it != pcOriginals.end(); ++it)
{
if (((*it) != NULL) && (Gui::Application::Instance->getViewProvider(*it) != NULL)) {
Gui::Application::Instance->getViewProvider(*it)->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();
}
}