From: nds Date: Thu, 5 Mar 2015 11:39:53 +0000 (+0300) Subject: Construction elements are auxiliary entities: X-Git-Tag: V_1.1.0~145^2~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=23f7d231d3d75b641a76554f166387b51b853bae;p=modules%2Fshaper.git Construction elements are auxiliary entities: The regression: contour is not closed. We need to check whether there is at least one obligatory left widgets. --- diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index 80b1773a3..87112716e 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -60,6 +60,10 @@ Q_OBJECT /// \return the boolean result std::string getDefaultValue() const { return myDefaultValue; } + /// Returns true, if the obligatory value of the widget is not defined in the XML or has true value + /// \return the boolean result + bool isObligatory() const { return myIsObligatory; } + /// Defines if it is supposed that the widget should interact with the viewer. virtual bool isViewerSelector() { return false; } diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 39520d8af..6758f5722 100644 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -431,10 +431,19 @@ void PartSet_Module::onVertexSelected() 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& aWidgets = aPanel->modelWidgets(); - if (aWidgets.last() == aPanel->activeWidget()) { - myRestartingMode = RM_Forbided; + QList::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end(); + bool aFoundWidget = false; + bool aFoundNonObligatory = false; + for (; anIt != aLast && !aFoundNonObligatory; anIt++) { + aFoundWidget = aFoundWidget || *anIt == anActiveWidget; + if (!aFoundWidget) + continue; + aFoundNonObligatory = !(*anIt)->isObligatory(); } + if (!aFoundNonObligatory) + myRestartingMode = RM_Forbided; } }