Salome HOME
Update management of fields steps shows/hide
[modules/shaper.git] / src / ModelAPI / ModelAPI_ResultField.cpp
index 15f8bba963bff391a695ee70a96309779458d1f2..0b44d8c95eb53a34d0078af47c55469de0f70973 100644 (file)
@@ -33,9 +33,13 @@ std::string ModelAPI_ResultField::groupName()
 
 void ModelAPI_ResultField::ModelAPI_FieldStep::setDisplayed(const bool theDisplay)
 {
-  myIsDisplayed = theDisplay;
-  //static Events_Loop* aLoop = Events_Loop::loop();
-  //static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
-  //static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
-  //aECreator->sendUpdated(FieldStepPtr(this), EVENT_DISP);
+  if (myIsDisplayed != theDisplay) {
+    myIsDisplayed = theDisplay;
+    static Events_Loop* aLoop = Events_Loop::loop();
+    static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+    static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get();
+    if (field()) {
+      aECreator->sendUpdated(field()->step(id()), EVENT_DISP); // updated pointer to this
+    }
+  }
 }