Salome HOME
Improve Model package coverage: remove unused methods, open/save tests improvements
[modules/shaper.git] / src / ModelAPI / ModelAPI_Result.cpp
index 6569136a672e789abffecc1f4441154fcd0ccae6..e0f0f8c87af3842860ef28e52175cf52fa594e80 100644 (file)
@@ -35,15 +35,17 @@ void ModelAPI_Result::initAttributes()
 {
   // append the color attribute. It is empty, the attribute will be filled by a request
   DataPtr aData = data();
-  aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId());
-  aData->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId());
+  aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId())->setIsArgument(false);
+  aData->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId())->setIsArgument(false);
+  aData->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeDouble::typeId())->setIsArgument(false);
 }
 
 bool ModelAPI_Result::setDisabled(std::shared_ptr<ModelAPI_Result> theThis, const bool theFlag)
 {
   if (myIsDisabled != theFlag) {
     myIsDisabled = theFlag;
-    data()->setIsDeleted(theFlag); // store it in data model (to get back on undo/redo, etc)
+    if (data()->isValid())
+      data()->setIsDeleted(theFlag); // store it in data model (to get back on undo/redo, etc)
     // this must be before "updated" message send to have history updated for OB update
     document()->updateHistory(groupName()); // to update the history cash data in the document
     // generate related events