From: nds Date: Mon, 8 Dec 2014 07:08:16 +0000 (+0300) Subject: A modification to commit the Lenght and the Radius constraints by the preselection. X-Git-Tag: V_0.6.0^2~12^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9239815477ef436c7c321bbf59fa6fa1a4ff6b0f;p=modules%2Fshaper.git A modification to commit the Lenght and the Radius constraints by the preselection. The distance still does not work because it uses the local points selection. --- diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index 9f55dab1e..c8a91fb93 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -51,6 +51,10 @@ Q_OBJECT /// Defines if it is supposed that the widget should interact with the viewer. virtual bool isViewerSelector() { return false; } + /// Defines if it is supported to set the value in this widget + /// By default it returns true + virtual bool canSetValue() const { return true; }; + /// Set the given wrapped value to the current widget /// This value should be processed in the widget according to the needs /// \param theValue the wrapped widget value diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index 5ee3daa6e..eca9c1c2a 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -247,9 +247,13 @@ bool ModuleBase_Operation::activateByPreselection() bool isSet = false; for (aWIt = aWidgets.constBegin(), aPIt = myPreSelection.constBegin(); (aWIt != aWidgets.constEnd()) && (aPIt != myPreSelection.constEnd()); - ++aWIt, ++aPIt) { + ++aWIt) { aWgt = (*aWIt); ModuleBase_WidgetValueFeature* aValue = (*aPIt); + if (!aWgt->canSetValue()) + continue; + + ++aPIt; if (!aWgt->setValue(aValue)) { isSet = false; break; diff --git a/src/ModuleBase/ModuleBase_WidgetLabel.h b/src/ModuleBase/ModuleBase_WidgetLabel.h index 81c7be592..7935316da 100644 --- a/src/ModuleBase/ModuleBase_WidgetLabel.h +++ b/src/ModuleBase/ModuleBase_WidgetLabel.h @@ -19,6 +19,10 @@ Q_OBJECT virtual ~ModuleBase_WidgetLabel(); + /// Defines if it is supported to set the value in this widget + /// It returns false because this is an info widget + virtual bool canSetValue() const { return false; }; + virtual bool storeValue() const { return true;