From e44cf263319d3014a4a9d759bb77e62b167b93da Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 15 Jun 2015 11:15:24 +0300 Subject: [PATCH] Abort operation ExtrusionCur if sketcher was aborted --- src/PartSet/PartSet_WidgetSketchCreator.cpp | 26 +++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/PartSet/PartSet_WidgetSketchCreator.cpp b/src/PartSet/PartSet_WidgetSketchCreator.cpp index c0a43dbfd..fb687a891 100644 --- a/src/PartSet/PartSet_WidgetSketchCreator.cpp +++ b/src/PartSet/PartSet_WidgetSketchCreator.cpp @@ -133,11 +133,7 @@ bool PartSet_WidgetSketchCreator::focusTo() if (aCompFeature->numberOfSubs() == 0) return ModuleBase_ModelWidget::focusTo(); - CompositeFeaturePtr aSketchFeature = - std::dynamic_pointer_cast(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(myFeature); + CompositeFeaturePtr aSketchFeature = + std::dynamic_pointer_cast(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(); + } } -- 2.39.2