]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Abort operation ExtrusionCur if sketcher was aborted
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 15 Jun 2015 08:15:24 +0000 (11:15 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 15 Jun 2015 08:15:36 +0000 (11:15 +0300)
src/PartSet/PartSet_WidgetSketchCreator.cpp

index c0a43dbfd229cad6e57ad6a93137e556227e891a..fb687a8918c7f35a0e9a65d9e6f23352260caca8 100644 (file)
@@ -133,11 +133,7 @@ bool PartSet_WidgetSketchCreator::focusTo()
   if (aCompFeature->numberOfSubs() == 0)
     return ModuleBase_ModelWidget::focusTo(); 
 
-  CompositeFeaturePtr aSketchFeature = 
-    std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aCompFeature->subFeature(0));
-  if (aSketchFeature->numberOfSubs() == 0) {
-    connect(myModule, SIGNAL(operationResumed(ModuleBase_Operation*)), SLOT(onResumed(ModuleBase_Operation*)));
-  }
+  connect(myModule, SIGNAL(operationResumed(ModuleBase_Operation*)), SLOT(onResumed(ModuleBase_Operation*)));
   SessionPtr aMgr = ModelAPI_Session::get();
   bool aIsOp = aMgr->isOperation();
   // Open transaction if it was closed before
@@ -150,11 +146,17 @@ bool PartSet_WidgetSketchCreator::focusTo()
 
 void PartSet_WidgetSketchCreator::onResumed(ModuleBase_Operation* theOp)
 {
-  // Abort operation
-  SessionPtr aMgr = ModelAPI_Session::get();
-  bool aIsOp = aMgr->isOperation();
-  // Close transaction
-  if (aIsOp)
-    aMgr->abortOperation();
-  theOp->abort();
+  CompositeFeaturePtr aCompFeature = 
+    std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
+  CompositeFeaturePtr aSketchFeature = 
+    std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aCompFeature->subFeature(0));
+  if (aSketchFeature->numberOfSubs() == 0) {
+    // Abort operation
+    SessionPtr aMgr = ModelAPI_Session::get();
+    bool aIsOp = aMgr->isOperation();
+    // Close transaction
+    if (aIsOp)
+      aMgr->abortOperation();
+    theOp->abort();
+  }
 }