Salome HOME
Issue #2052 : really remove results if during the feature execution number of results...
[modules/shaper.git] / src / Model / Model_ResultCompSolid.cpp
index 687b0ea087c94c4c73b15f4ccab4067a6210a473..c613cd29f3d88b13eb75a473781ff7e8dda03cd7 100755 (executable)
@@ -79,13 +79,13 @@ void Model_ResultCompSolid::colorConfigInfo(std::string& theSection, std::string
   theDefault = DEFAULT_COLOR();
 }
 
-bool Model_ResultCompSolid::setDisabled(std::shared_ptr<ModelAPI_Result> theThis, 
+bool Model_ResultCompSolid::setDisabled(std::shared_ptr<ModelAPI_Result> theThis,
                                         const bool theFlag)
 {
   bool aChanged = ModelAPI_ResultBody::setDisabled(theThis, theFlag);
   if (aChanged) { // state is changed, so modifications are needed
     myBuilder->evolutionToSelection(theFlag);
-    updateSubs(shape()); // to set disabled/enabled 
+    updateSubs(shape()); // to set disabled/enabled
   }
   return aChanged;
 }
@@ -113,7 +113,7 @@ bool Model_ResultCompSolid::isConcealed()
         if (aResult) { // hidden unit must be redisplayed (hidden)
           ModelAPI_EventCreator::get()->sendDeleted(document(), (*aSubIter)->groupName());
           // redisplay for the viewer (it must be disappeared also)
-          static Events_ID EVENT_DISP = 
+          static Events_ID EVENT_DISP =
             Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
           ModelAPI_EventCreator::get()->sendUpdated(*aSubIter, EVENT_DISP);
         } else { // was not concealed become concealed => delete event
@@ -122,6 +122,10 @@ bool Model_ResultCompSolid::isConcealed()
         }
       }
     }
+    // update the display state of the subs: explicitly call Model_ResultBody::isConcealed
+    for(aSubIter = mySubs.cbegin(); aSubIter != mySubs.cend(); aSubIter++) {
+      (*aSubIter)->isConcealed();
+    }
   }
   return aResult;
 }
@@ -135,7 +139,7 @@ void Model_ResultCompSolid::setIsConcealed(const bool theValue)
         if (theValue) { // hidden unit must be redisplayed (hidden)
           ModelAPI_EventCreator::get()->sendDeleted(document(), (*aSubIter)->groupName());
           // redisplay for the viewer (it must be disappeared also)
-          static Events_ID EVENT_DISP = 
+          static Events_ID EVENT_DISP =
             Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
           ModelAPI_EventCreator::get()->sendUpdated(*aSubIter, EVENT_DISP);
         } else { // was not concealed become concealed => delete event