if (!myWorkshop->module()->getFeatureError(aFOperation->feature(), false).isEmpty())
return;
- if (aFOperation) {
- if (PartSet_SketcherMgr::isNestedSketchOperation(aFOperation)) {
- if (myRestartingMode != RM_Forbided) {
- myRestartingMode = RM_LastFeatureUsed;
- startInternalEdit(thePreviousAttributeID);
- }
- else {
- aFOperation->commit();
- }
+ if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation)) {
+ bool isStarted = false;
+ if (myRestartingMode != RM_Forbided) {
+ myRestartingMode = RM_LastFeatureUsed;
+ isStarted = startInternalEdit(thePreviousAttributeID);
}
+ if (!isStarted)
+ aFOperation->commit();
}
}
return isDone;
myRestartingMode = RM_EmptyFeatureUsed;
- startInternalEdit(thePreviousAttributeID);
- isDone = true;
+ isDone = startInternalEdit(thePreviousAttributeID);
return isDone;
}
return anActive;
}
-void PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePreviousAttributeID)
+bool PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePreviousAttributeID)
{
+ bool isDone = false;
ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
(myWorkshop->currentOperation());
- aFOperation->setEditOperation(true);
- FeaturePtr anOperationFeature = aFOperation->feature();
- if (anOperationFeature.get() != NULL) {
+ if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation)) {
+ aFOperation->setEditOperation(true);
+ FeaturePtr anOperationFeature = aFOperation->feature();
+
+ CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch();
+ myInternalFeature = aSketch->addFeature(anOperationFeature->getKind());
myIsInternalEditOperation = true;
+ isDone = true;
connect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped()));
connect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
}
}
}
+ return isDone;
}
void PartSet_SketcherReetntrantMgr::beforeStopInternalEdit()
disconnect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
}
+ QObjectPtrList anObjects;
+ anObjects.append(myInternalFeature);
+ workshop()->deleteFeatures(anObjects);
+
PartSet_Module* aModule = module();
ModuleBase_ModelWidget* aFirstWidget = aModule->activeWidget();
ModuleBase_IPropertyPanel* aPanel = aModule->currentOperation()->propertyPanel();
/// Sets the focus to the last control of the property panel and activates selection
/// of the first widget to can select first value of the next create operation
/// \param thePreviousAttributeID an index of the previous attribute to set focus to this widget
- void startInternalEdit(const std::string& thePreviousAttributeID);
+ /// \return true if it is started
+ bool startInternalEdit(const std::string& thePreviousAttributeID);
/// Disconnects this manager from operation signals, deactivate selection of the first control
/// in the viewer.
RestartingMode myRestartingMode; /// automatical restarting mode flag
bool myIsFlagsBlocked; /// true when reset of flags should not be perfromed
bool myIsInternalEditOperation; /// true when the 'internal' edit is started
+
+ FeaturePtr myInternalFeature;
};
#endif