]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Provide shape selector with possibility to work with AttributeRefAttrPtr
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 28 Nov 2014 12:09:05 +0000 (15:09 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 28 Nov 2014 12:09:05 +0000 (15:09 +0300)
src/Model/Model_FeatureValidator.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp

index 9f3ab4a1305e9dd08e70a551a58eb4c160c10eb4..b34f03edd8f69c946d24c9e2c827f8e6db71309c 100644 (file)
@@ -26,10 +26,10 @@ bool Model_FeatureValidator::isValid(const std::shared_ptr<ModelAPI_Feature>& th
   std::list<std::string>::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<std::string, std::set<std::string> >::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;
       }
index 0f1f100642c2c51852f2c9da0ed3b7da283cdb6d..12cb9898040bc2dcb62d8399faca6c57c945a1fb 100644 (file)
@@ -139,6 +139,11 @@ bool ModuleBase_WidgetShapeSelector::storeValue() const
         std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(aAttr);
       if (aSelectAttr)
         aSelectAttr->setValue(aBody, myShape);
+      else {
+        AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
+        if (aRefAttr) 
+          aRefAttr->setObject(mySelectedObject);
+      }
       updateObject(myFeature);
       return true;
     }