From f0ea2cdc27b1e61b7a890f5af94949623412b1a8 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 16 Feb 2015 10:23:14 +0300 Subject: [PATCH] Issue #396 Rigid constraint can not be deleted A selected object should be find before aborting the current operation. It is caused by #391 issue --- src/PartSet/PartSet_Module.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 169e9ba75..960c92ffc 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -527,9 +527,17 @@ void PartSet_Module::deleteObjects() if (!isSketchOp && !isSketchFeatureOperationActive()) return; + // sketch feature should be skipped, only sub-features can be removed + // when sketch operation is active + CompositeFeaturePtr aSketch = mySketchMgr->activeSketch(); + + // selected objects should be collected before the current operation abort because + // the abort leads to selection lost on constraint objects. It can be corrected after #386 issue XGUI_ModuleConnector* aConnector = dynamic_cast(workshop()); - XGUI_Workshop* aWorkshop = aConnector->workshop(); + ModuleBase_ISelection* aSel = aConnector->selection(); + QObjectPtrList aSelectedObj = aSel->selectedPresentations(); + XGUI_Workshop* aWorkshop = aConnector->workshop(); XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr(); if (!isSketchOp && anOpMgr->canStopOperation()) { ModuleBase_Operation* aCurrentOp = anOpMgr->currentOperation(); @@ -537,13 +545,6 @@ void PartSet_Module::deleteObjects() aCurrentOp->abort(); } } - // sketch feature should be skipped, only sub-features can be removed - // when sketch operation is active - CompositeFeaturePtr aSketch = mySketchMgr->activeSketch(); - - ModuleBase_ISelection* aSel = aConnector->selection(); - QObjectPtrList aSelectedObj = aSel->selectedPresentations(); - std::set aRefFeatures; foreach (ObjectPtr aObj, aSelectedObj) { -- 2.39.2