Salome HOME
Merge remote-tracking branch 'origin/EDF_IMPROVEMENTS_2020'
[modules/shaper.git] / src / ModelAPI / ModelAPI_Result.cpp
index 9e38ffb46a4894d5498fd17a3e17843bc0d27652..32d04da6bc450a44c15bf0ee0eec3319066aab62 100644 (file)
@@ -23,6 +23,7 @@
 #include <ModelAPI_Attribute.h>
 #include <ModelAPI_AttributeIntArray.h>
 #include <ModelAPI_AttributeDouble.h>
+#include <ModelAPI_AttributeBoolean.h>
 
 #include <Events_Loop.h>
 
@@ -37,6 +38,8 @@ void ModelAPI_Result::initAttributes()
   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);
+  aData->addAttribute(ISO_LINES_ID(), ModelAPI_AttributeIntArray::typeId())->setIsArgument(false);
+  aData->addAttribute(SHOW_ISO_LINES_ID(), ModelAPI_AttributeBoolean::typeId())->setIsArgument(false);
 }
 
 bool ModelAPI_Result::setDisabled(std::shared_ptr<ModelAPI_Result> theThis, const bool theFlag)
@@ -65,7 +68,7 @@ bool ModelAPI_Result::setDisabled(std::shared_ptr<ModelAPI_Result> theThis, cons
 
 bool ModelAPI_Result::isDisabled()
 {
-  if (myIsDisabled != data()->isDeleted())
+  if (data()->isValid() && myIsDisabled != data()->isDeleted())
     setDisabled(std::dynamic_pointer_cast<ModelAPI_Result>(
       data()->owner()), data()->isDeleted()); // restore from the data model the correct value
   return myIsDisabled;