From d44d8df10835d69a2616b426a8529fcf5555c9cd Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 28 Nov 2014 15:09:05 +0300 Subject: [PATCH] Provide shape selector with possibility to work with AttributeRefAttrPtr --- src/Model/Model_FeatureValidator.cpp | 4 ++-- src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Model/Model_FeatureValidator.cpp b/src/Model/Model_FeatureValidator.cpp index 9f3ab4a13..b34f03edd 100644 --- a/src/Model/Model_FeatureValidator.cpp +++ b/src/Model/Model_FeatureValidator.cpp @@ -26,10 +26,10 @@ bool Model_FeatureValidator::isValid(const std::shared_ptr& th std::list::iterator it = aLtAttributes.begin(); for (; it != aLtAttributes.end(); it++) { AttributePtr anAttr = aData->attribute(*it); - if (!anAttr->isInitialized()) { + if (!anAttr->isInitialized()) { // attribute is not initialized std::map >::const_iterator aFeatureFind = myNotObligatory.find(theFeature->getKind()); - if (aFeatureFind == myNotObligatory.end() || + if (aFeatureFind == myNotObligatory.end() || // and it is obligatory for filling aFeatureFind->second.find(*it) == aFeatureFind->second.end()) { return false; } diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index 0f1f10064..12cb98980 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -139,6 +139,11 @@ bool ModuleBase_WidgetShapeSelector::storeValue() const std::dynamic_pointer_cast(aAttr); if (aSelectAttr) aSelectAttr->setValue(aBody, myShape); + else { + AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID()); + if (aRefAttr) + aRefAttr->setObject(mySelectedObject); + } updateObject(myFeature); return true; } -- 2.39.2