From: nds Date: Mon, 16 Feb 2015 13:33:43 +0000 (+0300) Subject: Issue #394 Undo-ing a Sketch element X-Git-Tag: V_1.1.0~181 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2d5cbfca3d96c8251370fc563d2d675650aabd28;p=modules%2Fshaper.git Issue #394 Undo-ing a Sketch element Compute default value by moving the mouse of the viewer. Check that the default value for the creation a constraint by preselection is computed. --- diff --git a/src/ModelAPI/ModelAPI_Feature.h b/src/ModelAPI/ModelAPI_Feature.h index 183077f4f..c7a57a01b 100644 --- a/src/ModelAPI/ModelAPI_Feature.h +++ b/src/ModelAPI/ModelAPI_Feature.h @@ -55,6 +55,11 @@ class ModelAPI_Feature : public ModelAPI_Object /// Computes or recomputes the results virtual void execute() = 0; + /// Computes the attribute value on the base of other attributes if the value can be computed + /// \param theAttributeId an attribute index to be computed + /// \return a boolean value about it is computed + virtual bool compute(const std::string& theAttributeId) { return false; }; + /// Registers error during the execution, causes the ExecutionFailed state virtual void setError(const std::string& theError) { data()->setError(theError); diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index 4c672c5b6..d332eedc7 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -28,7 +28,7 @@ ModuleBase_ModelWidget::ModuleBase_ModelWidget(QWidget* theParent, const Config_ myParentId(theParentId) { myDefaultValue = theData->getProperty(ATTR_DEFAULT); - myIsComputedDefault = false; + myIsComputedDefault = theData->getProperty(ATTR_DEFAULT) == DOUBLE_WDG_DEFAULT_COMPUTED; myAttributeID = theData ? theData->widgetId() : ""; connect(this, SIGNAL(valuesChanged()), this, SLOT(onWidgetValuesChanged())); @@ -96,11 +96,18 @@ bool ModuleBase_ModelWidget::focusTo() void ModuleBase_ModelWidget::activate() { - if (!isEditingMode()) { - // the control value is stored to the mode by the focus in on the widget - // we need the value is initialized in order to enable the apply button in the property panel - // it should happens only in the creation mode because during edition all fields are filled - storeValue(); + // the control value is stored to the mode by the focus in on the widget + // we need the value is initialized in order to enable the apply button in the property panel. + // It should happens in the creation mode only because all fields are filled in the edition mode + if (!isEditingMode()/* && !myFeature->data()->attribute(myAttributeID)->isInitialized()*/) { + if (isComputedDefault()) { + if (myFeature->compute(myAttributeID)) { + restoreValue(); + } + } + else { + storeValue(); + } } activateCustom(); } diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index 706793035..a6830788e 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -53,12 +53,12 @@ Q_OBJECT /// Returns true, if default value of the widget should be computed /// on operation's execute, like radius for circle's constraint (can not be zero) - bool isComputedDefault() { return myIsComputedDefault; } + bool isComputedDefault() const { return myIsComputedDefault; } /// Returns true, if default value of the widget is defined in the XML and it is not the /// computed value /// \return the boolean result - bool isValueDefault() { return !myDefaultValue.empty(); } + std::string getDefaultValue() const { return myDefaultValue; } /// Defines if it is supposed that the widget should interact with the viewer. virtual bool isViewerSelector() { return false; } @@ -190,14 +190,15 @@ protected slots: /// A feature which is processing by active operation FeaturePtr myFeature; + /// Flag which shows that current operation is in editing mode + bool myIsEditing; + +private: /// Value should be computed on execute, like radius for circle's constraint (can not be zero) bool myIsComputedDefault; /// the default value, which is defined in the XML for this attribute std::string myDefaultValue; - - /// Flag which shows that current operation is in editing mode - bool myIsEditing; }; #endif diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 8e8843af9..2b5437e46 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -79,11 +79,9 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, mySpinBox->setSingleStep(aStepVal); } - double aDefVal = QString::fromStdString(myDefaultValue).toDouble(&isOk); + double aDefVal = QString::fromStdString(getDefaultValue()).toDouble(&isOk); if (isOk) { mySpinBox->setValue(aDefVal); - } else if (theData->getProperty(ATTR_DEFAULT) == DOUBLE_WDG_DEFAULT_COMPUTED){ - myIsComputedDefault = true; } QString aTTip = QString::fromStdString(theData->widgetTooltip()); @@ -101,12 +99,16 @@ ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue() void ModuleBase_WidgetDoubleValue::reset() { - if (myIsComputedDefault) + if (isComputedDefault()) { return; - - bool isOk; - double aDefValue = QString::fromStdString(myDefaultValue).toDouble(&isOk); - ModuleBase_Tools::setSpinValue(mySpinBox, isOk ? aDefValue : 0.0); + //if (myFeature->compute(myAttributeID)) + // restoreValue(); + } + else { + bool isOk; + double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk); + ModuleBase_Tools::setSpinValue(mySpinBox, isOk ? aDefValue : 0.0); + } } bool ModuleBase_WidgetDoubleValue::storeValue() const diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index 034d063da..60b644e08 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -94,12 +94,19 @@ PartSet_WidgetPoint2D::PartSet_WidgetPoint2D(QWidget* theParent, void PartSet_WidgetPoint2D::reset() { - bool isOk; - double aDefValue = QString::fromStdString(myDefaultValue).toDouble(&isOk); - // it is important to block the spin box control in order to do not through out the - // locking of the validating state. - ModuleBase_Tools::setSpinValue(myXSpin, isOk ? aDefValue : 0.0); - ModuleBase_Tools::setSpinValue(myYSpin, isOk ? aDefValue : 0.0); + if (isComputedDefault()) { + //return; + if (myFeature->compute(myAttributeID)) + restoreValue(); + } + else { + bool isOk; + double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk); + // it is important to block the spin box control in order to do not through out the + // locking of the validating state. + ModuleBase_Tools::setSpinValue(myXSpin, isOk ? aDefValue : 0.0); + ModuleBase_Tools::setSpinValue(myYSpin, isOk ? aDefValue : 0.0); + } } PartSet_WidgetPoint2D::~PartSet_WidgetPoint2D() diff --git a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp index 756e9a8a9..14ac45921 100644 --- a/src/PartSet/PartSet_WidgetPoint2dDistance.cpp +++ b/src/PartSet/PartSet_WidgetPoint2dDistance.cpp @@ -44,7 +44,7 @@ PartSet_WidgetPoint2dDistance::~PartSet_WidgetPoint2dDistance() void PartSet_WidgetPoint2dDistance::reset() { bool isOk; - double aDefValue = QString::fromStdString(myDefaultValue).toDouble(&isOk); + double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk); ModuleBase_Tools::setSpinValue(mySpinBox, isOk ? aDefValue : 0.0); } diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index bdd410ec0..b8ce8c182 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -47,6 +47,57 @@ void SketchPlugin_ConstraintDistance::execute() } } +bool SketchPlugin_ConstraintDistance::compute(const std::string& theAttributeId) +{ + if (theAttributeId != SketchPlugin_Constraint::FLYOUT_VALUE_PNT()) + return false; + + if (!sketch()) + return false; + + DataPtr aData = data(); + std::shared_ptr aPoint_A = getFeaturePoint( + aData, SketchPlugin_Constraint::ENTITY_A()); + std::shared_ptr aPoint_B = getFeaturePoint( + aData, SketchPlugin_Constraint::ENTITY_B()); + + std::shared_ptr aPnt_A; + std::shared_ptr aPnt_B; + + if (aPoint_A && aPoint_B) { + aPnt_A = aPoint_A->pnt(); + aPnt_B = aPoint_B->pnt(); + } else if (!aPoint_A && aPoint_B) { + std::shared_ptr aLine = getFeatureLine( + aData, SketchPlugin_Constraint::ENTITY_A()); + if (aLine) { + aPnt_B = aPoint_B->pnt(); + aPnt_A = getProjectionPoint(aLine, aPnt_B); + } + } else if (aPoint_A && !aPoint_B) { + std::shared_ptr aLine = getFeatureLine( + aData, SketchPlugin_Constraint::ENTITY_B()); + if (aLine) { + aPnt_A = aPoint_A->pnt(); + aPnt_B = getProjectionPoint(aLine, aPnt_A); + } + } + if (!aPnt_A || !aPnt_B) + return false; + + std::shared_ptr aFlyOutAttr = std::dynamic_pointer_cast< + GeomDataAPI_Point2D>(aData->attribute(theAttributeId)); + + std::shared_ptr aPoint1 = sketch()->to3D(aPnt_A->x(), aPnt_A->y()); + std::shared_ptr aPoint2 = sketch()->to3D(aPnt_B->x(), aPnt_B->y()); + std::shared_ptr aLine = std::shared_ptr(new GeomAPI_Lin2d(aPnt_A, aPnt_B)); + double aDist = aPoint1->distance(aPoint2)/5.; + std::shared_ptr aFPnt = aLine->shiftedLocation(aDist); + aFlyOutAttr->setValue(aFPnt); + + return true; +} + //************************************************************************************* AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevious) { @@ -90,16 +141,10 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi std::shared_ptr aPoint1 = sketch()->to3D(aPnt_A->x(), aPnt_A->y()); std::shared_ptr aPoint2 = sketch()->to3D(aPnt_B->x(), aPnt_B->y()); - std::shared_ptr aFlyoutPnt = std::shared_ptr(); - if(aFlyOutAttr->isInitialized()) { - aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()); - } else { - std::shared_ptr aLine = std::shared_ptr(new GeomAPI_Lin2d(aPnt_A, aPnt_B)); - double aDist = aPoint1->distance(aPoint2)/5.; - std::shared_ptr aFPnt = aLine->shiftedLocation(aDist); - aFlyOutAttr->setValue(aFPnt); - aFlyoutPnt = sketch()->to3D(aFPnt->x(), aFPnt->y()); - } + if(!aFlyOutAttr->isInitialized()) + compute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()); + std::shared_ptr aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()/*aFPnt->x(), aFPnt->y()*/); + // value calculation std::shared_ptr aValueAttr = std::dynamic_pointer_cast< ModelAPI_AttributeDouble>(aData->attribute(SketchPlugin_Constraint::VALUE())); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.h b/src/SketchPlugin/SketchPlugin_ConstraintDistance.h index 69f318798..99281efdb 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.h +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.h @@ -47,6 +47,11 @@ class SketchPlugin_ConstraintDistance : public SketchPlugin_ConstraintBase /// \brief Creates a new part document if needed SKETCHPLUGIN_EXPORT virtual void execute(); + /// Computes the attribute value on the base of other attributes if the value can be computed + /// \param theAttributeId an attribute index to be computed + /// \return a boolean value about it is computed + SKETCHPLUGIN_EXPORT virtual bool compute(const std::string& theAttributeId); + /// \brief Request for initialization of data model of the feature: adding all attributes SKETCHPLUGIN_EXPORT virtual void initAttributes(); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp index 224ea32b5..ea50c3850 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.cpp @@ -53,6 +53,28 @@ void SketchPlugin_ConstraintLength::execute() } } +bool SketchPlugin_ConstraintLength::compute(const std::string& theAttributeId) +{ + if (theAttributeId != SketchPlugin_Constraint::FLYOUT_VALUE_PNT()) + return false; + + std::shared_ptr aPoint1, aPoint2; + std::shared_ptr aStartPoint, anEndPoint; + if (!getPoints(aPoint1, aPoint2, aStartPoint, anEndPoint)) + return false; + + std::shared_ptr aFlyOutAttr = std::dynamic_pointer_cast< + GeomDataAPI_Point2D>(data()->attribute(theAttributeId)); + + std::shared_ptr aLine = + std::shared_ptr(new GeomAPI_Lin2d(aStartPoint->pnt(), anEndPoint->pnt())); + double aDist = aPoint1->distance(aPoint2)/5.; + std::shared_ptr aFPnt = aLine->shiftedLocation(aDist); + aFlyOutAttr->setValue(aFPnt); + + return true; +} + bool SketchPlugin_ConstraintLength::getPoints( std::shared_ptr& thePoint1, std::shared_ptr& thePoint2, std::shared_ptr& theStartPoint, @@ -85,20 +107,14 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou if (!getPoints(aPoint1, aPoint2, aStartPoint, anEndPoint)) return thePrevious; // not possible to show length because points are not defined - std::shared_ptr aPlane = sketch()->plane(); - std::shared_ptr aFlyOutAttr = std::dynamic_pointer_cast< - GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); - std::shared_ptr aFlyoutPnt = std::shared_ptr(); - if (aFlyOutAttr->isInitialized()) { - aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()); - } else { - std::shared_ptr aLine = - std::shared_ptr(new GeomAPI_Lin2d(aStartPoint->pnt(), anEndPoint->pnt())); - double aDist = aPoint1->distance(aPoint2)/5.; - std::shared_ptr aFPnt = aLine->shiftedLocation(aDist); - aFlyOutAttr->setValue(aFPnt); - aFlyoutPnt = sketch()->to3D(aFPnt->x(), aFPnt->y()); + AttributePtr aFlyOutAttribute = data()->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()); + if (!aFlyOutAttribute->isInitialized()) { + if (!compute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())) + return thePrevious; // not possible to show length because points are not defined } + std::shared_ptr aFlyOutAttr = std::dynamic_pointer_cast< + GeomDataAPI_Point2D>(aFlyOutAttribute); + std::shared_ptr aFlyoutPnt = sketch()->to3D(aFlyOutAttr->x(), aFlyOutAttr->y()); // value calculation // TODO: has to be calculated on definition of reference object double aDistance = aPoint1->distance(aPoint2); @@ -114,6 +130,7 @@ AISObjectPtr SketchPlugin_ConstraintLength::getAISObject(AISObjectPtr thePreviou AISObjectPtr anAIS = thePrevious; if (!anAIS) anAIS = AISObjectPtr(new GeomAPI_AISObject); + std::shared_ptr aPlane = sketch()->plane(); anAIS->createDistance(aPoint1, aPoint2, aFlyoutPnt, aPlane, aValue); // Set color from preferences diff --git a/src/SketchPlugin/SketchPlugin_ConstraintLength.h b/src/SketchPlugin/SketchPlugin_ConstraintLength.h index 98ef62511..5d36f051e 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintLength.h +++ b/src/SketchPlugin/SketchPlugin_ConstraintLength.h @@ -43,6 +43,11 @@ class SketchPlugin_ConstraintLength : public SketchPlugin_ConstraintBase /// \brief Creates a new part document if needed SKETCHPLUGIN_EXPORT virtual void execute(); + /// Computes the attribute value on the base of other attributes if the value can be computed + /// \param theAttributeId an attribute index to be computed + /// \return a boolean value about it is computed + SKETCHPLUGIN_EXPORT virtual bool compute(const std::string& theAttributeId); + /// \brief Request for initialization of data model of the feature: adding all attributes SKETCHPLUGIN_EXPORT virtual void initAttributes(); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp index 135b6bbdb..0a2115dbc 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintRadius.cpp @@ -63,6 +63,36 @@ void SketchPlugin_ConstraintRadius::execute() } } +bool SketchPlugin_ConstraintRadius::compute(const std::string& theAttributeId) +{ + if (theAttributeId != SketchPlugin_Constraint::FLYOUT_VALUE_PNT()) + return false; + + std::shared_ptr aCyrcFeature; + double aRadius = circleRadius(aCyrcFeature); + if (aRadius < 0) + return false; + + // Flyout point + std::shared_ptr aFlyoutAttr = std::dynamic_pointer_cast< + GeomDataAPI_Point2D>(data()->attribute(theAttributeId)); + // Prepare a circle + if (aCyrcFeature->getKind() == SketchPlugin_Circle::ID()) { // circle + std::shared_ptr aCenterAttr = std::dynamic_pointer_cast( + aCyrcFeature->data()->attribute(SketchPlugin_Circle::CENTER_ID())); + double aShift = aRadius * 1.1; + std::shared_ptr aPnt = aCenterAttr->pnt(); + std::shared_ptr aFPnt = + std::shared_ptr(new GeomAPI_Pnt2d(aPnt->x() + aShift, aPnt->y() + aShift)); + aFlyoutAttr->setValue(aFPnt); + } else { // arc + std::shared_ptr aStartAttr = std::dynamic_pointer_cast< + GeomDataAPI_Point2D>(aCyrcFeature->data()->attribute(SketchPlugin_Arc::START_ID())); + aFlyoutAttr->setValue(aStartAttr->pnt()); + } + return true; +} + double SketchPlugin_ConstraintRadius::circleRadius(std::shared_ptr& theCirc) { static const double kErrorResult = -1.; @@ -105,35 +135,19 @@ AISObjectPtr SketchPlugin_ConstraintRadius::getAISObject(AISObjectPtr thePreviou // Flyout point std::shared_ptr aFlyoutAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())); - std::shared_ptr aFlyoutPnt; - if (aFlyoutAttr->isInitialized()) { - aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y()); - } + if (!aFlyoutAttr->isInitialized() && !compute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT())) + return thePrevious; // can not create a good presentation + std::shared_ptr aFlyoutPnt = sketch()->to3D(aFlyoutAttr->x(), aFlyoutAttr->y()); // Prepare a circle std::shared_ptr aCenterAttr; if (aCyrcFeature->getKind() == SketchPlugin_Circle::ID()) { // circle aCenterAttr = std::dynamic_pointer_cast( aCyrcFeature->data()->attribute(SketchPlugin_Circle::CENTER_ID())); - if (!aFlyoutPnt) { - double aShift = aRadius * 1.1; - std::shared_ptr aPnt = aCenterAttr->pnt(); - std::shared_ptr aFPnt = - std::shared_ptr(new GeomAPI_Pnt2d(aPnt->x() + aShift, aPnt->y() + aShift)); - aFlyoutAttr->setValue(aFPnt); - aFlyoutPnt = sketch()->to3D(aFPnt->x(), aFPnt->y()); - } } else { // arc aCenterAttr = std::dynamic_pointer_cast( aCyrcFeature->data()->attribute(SketchPlugin_Arc::CENTER_ID())); - if (!aFlyoutPnt) { - std::shared_ptr aStartAttr = std::dynamic_pointer_cast< - GeomDataAPI_Point2D>(aCyrcFeature->data()->attribute(SketchPlugin_Arc::START_ID())); - aFlyoutAttr->setValue(aStartAttr->pnt()); - aFlyoutPnt = sketch()->to3D(aStartAttr->pnt()->x(), aStartAttr->pnt()->y()); - } } - std::shared_ptr aCenter = sketch()->to3D(aCenterAttr->x(), aCenterAttr->y()); std::shared_ptr aNDir = std::dynamic_pointer_cast( sketch()->data()->attribute(SketchPlugin_Sketch::NORM_ID())); diff --git a/src/SketchPlugin/SketchPlugin_ConstraintRadius.h b/src/SketchPlugin/SketchPlugin_ConstraintRadius.h index 84c2043c4..4d6b9a3be 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintRadius.h +++ b/src/SketchPlugin/SketchPlugin_ConstraintRadius.h @@ -40,6 +40,11 @@ class SketchPlugin_ConstraintRadius : public SketchPlugin_ConstraintBase /// \brief Creates a new part document if needed SKETCHPLUGIN_EXPORT virtual void execute(); + /// Computes the attribute value on the base of other attributes if the value can be computed + /// \param theAttributeId an attribute index to be computed + /// \return a boolean value about it is computed + SKETCHPLUGIN_EXPORT virtual bool compute(const std::string& theAttributeId); + /// \brief Request for initialization of data model of the feature: adding all attributes SKETCHPLUGIN_EXPORT virtual void initAttributes(); diff --git a/src/SketchPlugin/plugin-Sketch.xml b/src/SketchPlugin/plugin-Sketch.xml index 5018b9fd3..7447a8fa7 100644 --- a/src/SketchPlugin/plugin-Sketch.xml +++ b/src/SketchPlugin/plugin-Sketch.xml @@ -63,7 +63,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -93,7 +93,7 @@ - + diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index ded693fcf..9f5a0083d 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -653,7 +653,7 @@ void XGUI_Workshop::setPropertyPanel(ModuleBase_Operation* theOperation) QList aWidgets = aFactory.getModelWidgets(); foreach (ModuleBase_ModelWidget* aWidget, aWidgets) { bool isStoreValue = !theOperation->isEditOperation() && - aWidget->isValueDefault() && !aWidget->isComputedDefault(); + !aWidget->getDefaultValue().empty() && !aWidget->isComputedDefault(); aWidget->setFeature(theOperation->feature(), isStoreValue); aWidget->enableFocusProcessing(); }