]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #396 Rigid constraint can not be deleted
authornds <natalia.donis@opencascade.com>
Mon, 16 Feb 2015 07:23:14 +0000 (10:23 +0300)
committernds <natalia.donis@opencascade.com>
Mon, 16 Feb 2015 07:23:14 +0000 (10:23 +0300)
A selected object should be find before aborting the current operation. It is caused by #391 issue

src/PartSet/PartSet_Module.cpp

index 169e9ba751298ef58ce2ad08c62f3e38ef67c61d..960c92ffc8438a90e9c6689c05b4d1b4802ce5d5 100644 (file)
@@ -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<XGUI_ModuleConnector*>(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<FeaturePtr> aRefFeatures;
   foreach (ObjectPtr aObj, aSelectedObj)
   {