Salome HOME
Merge branch 'csgroup_IS2'
[modules/shaper.git] / src / ModelAPI / ModelAPI_Result.cpp
index c92a8ea3ba59e72cb826373876de674093503b6d..ad8862e30eb2675d7d7d7141acf3a4bd88e64bad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2021  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -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,9 @@ 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 +69,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;
@@ -76,7 +80,7 @@ bool ModelAPI_Result::isConcealed()
   return myIsConcealed;
 }
 
-void ModelAPI_Result::setIsConcealed(const bool theValue)
+void ModelAPI_Result::setIsConcealed(const bool theValue, const bool /*theForced*/)
 {
   if (myIsConcealed != theValue) {
     myIsConcealed = theValue;