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
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();
+ }
}