Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / ModelAPI / ModelAPI_Result.cpp
index e09d3e7116a00b8043e173b5b8370a28d335ea17..588d138bf17cb447927b3273fed0f6fdfbeb1988 100644 (file)
@@ -14,7 +14,8 @@
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 //
 
 #include "ModelAPI_Result.h"
@@ -36,13 +37,15 @@ void ModelAPI_Result::initAttributes()
   DataPtr aData = data();
   aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId());
   aData->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId());
+  aData->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeDouble::typeId());
 }
 
 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