-void PartSet_Module::onNoMoreWidgets()
-{
- ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
- if (anOperation) {
- if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
- if (myRestartingMode != RM_Forbided)
- myRestartingMode = RM_LastFeatureUsed;
- XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
- XGUI_Workshop* aWorkshop = aConnector->workshop();
- XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
- // do nothing if the feature can not be applyed
- if (anOpMgr->isApplyEnabled())
- anOperation->commit();
- }
- }
-}
-
-void PartSet_Module::onVertexSelected()
-{
- ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
- if (aOperation->id().toStdString() == SketchPlugin_Line::ID()) {
- /// If last line finished on vertex the lines creation sequence has to be break
- ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
- ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
- const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
- QList<ModuleBase_ModelWidget*>::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end();
- bool aFoundWidget = false;
- bool aFoundObligatory = false;
- for (; anIt != aLast && !aFoundObligatory; anIt++) {
- if (!aFoundWidget)
- aFoundWidget = *anIt == anActiveWidget;
- else
- aFoundObligatory = (*anIt)->isObligatory();
- }
- if (!aFoundObligatory)
- myRestartingMode = RM_Forbided;
- }
-}
-