PartDesign/Gui: more old workflow support
* remove an error message if adding a sketchbased feature without a body * add champfer or fillet old workflow support Also rework finishFeature() so at least champfer and fillet may be inserted into any place of any apropriate body(not only the active one) of the body.
This commit is contained in:
committed by
Stefan Tröger
parent
a6ebfa496f
commit
e586f55fb2
@@ -230,6 +230,10 @@ bool TaskDlgDressUpParameters::accept()
|
||||
|
||||
bool TaskDlgDressUpParameters::reject()
|
||||
{
|
||||
PartDesign::DressUp* pcDressUp = static_cast<PartDesign::DressUp*>(DressUpView->getObject());
|
||||
App::DocumentObject* pcSupport = pcDressUp->Base.getValue();
|
||||
PartDesign::Body* body = PartDesign::Body::findBodyOf (pcDressUp);
|
||||
|
||||
DressUpView->highlightReferences(false);
|
||||
|
||||
// roll back the done things
|
||||
@@ -237,16 +241,22 @@ bool TaskDlgDressUpParameters::reject()
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
|
||||
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()");
|
||||
|
||||
// Body housekeeping
|
||||
PartDesign::Body* activeBody = Gui::Application::Instance->activeView()->getActiveObject<PartDesign::Body*>(PDBODYKEY);
|
||||
if (activeBody != NULL) {
|
||||
// Make the new Tip and the previous solid feature visible again
|
||||
App::DocumentObject* tip = activeBody->Tip.getValue();
|
||||
App::DocumentObject* prev = activeBody->getPrevSolidFeature();
|
||||
if (tip != NULL) {
|
||||
Gui::Application::Instance->getViewProvider(tip)->show();
|
||||
if ((tip != prev) && (prev != NULL))
|
||||
Gui::Application::Instance->getViewProvider(prev)->show();
|
||||
// if abort command deleted the object the support is visible again
|
||||
if (!Gui::Application::Instance->getViewProvider(pcDressUp)) {
|
||||
// Body housekeeping
|
||||
if (body != NULL) {
|
||||
// Make the new Tip and the previous solid feature visible again
|
||||
// TODO: share the code with TaskDlgSketchBasedDlg::reject()
|
||||
App::DocumentObject* tip = body->Tip.getValue();
|
||||
App::DocumentObject* prev = body->getPrevSolidFeature();
|
||||
if (tip != NULL) {
|
||||
Gui::Application::Instance->getViewProvider(tip)->show();
|
||||
if ((tip != prev) && (prev != NULL))
|
||||
Gui::Application::Instance->getViewProvider(prev)->show();
|
||||
}
|
||||
} else {
|
||||
if (pcSupport && Gui::Application::Instance->getViewProvider(pcSupport))
|
||||
Gui::Application::Instance->getViewProvider(pcSupport)->show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user