From: nds Date: Mon, 16 Feb 2015 07:23:14 +0000 (+0300) Subject: Issue #396 Rigid constraint can not be deleted X-Git-Tag: V_1.1.0~185 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f0ea2cdc27b1e61b7a890f5af94949623412b1a8;p=modules%2Fshaper.git 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 --- 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) {