]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update management of fields steps shows/hide
authormpv <mpv@opencascade.com>
Mon, 8 Jul 2019 13:12:07 +0000 (16:12 +0300)
committermpv <mpv@opencascade.com>
Mon, 8 Jul 2019 13:12:07 +0000 (16:12 +0300)
src/ModelAPI/ModelAPI_ResultField.cpp
src/XGUI/XGUI_ObjectsBrowser.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
+    }
+  }
 }
index 6730df06b979fd515d9ca1798b90a0bff1686f80..2781c51f67fd90b73146ddc1790dfa1bacbab7dd 100644 (file)
@@ -246,8 +246,6 @@ void XGUI_DataTree::processEyeClick(const QModelIndex& theIndex)
       if (toDisplay) {
         for (int i = 0; i < aField->stepsSize(); i++) {
           aField->step(i)->setDisplayed(false);
-          // TODO: Sending events has to be removed when step will be defined as Object
-          aECreator->sendUpdated(aField->step(i), EVENT_DISP);
         }
       }
       Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
@@ -264,8 +262,6 @@ void XGUI_DataTree::processEyeClick(const QModelIndex& theIndex)
           aField->setDisplayed(false);
           for (int i = 0; i < aField->stepsSize(); i++) {
             aField->step(i)->setDisplayed(i == aId);
-            // TODO: Sending events has to be removed when step will be defined as Object
-            aECreator->sendUpdated(aField->step(i), EVENT_DISP);
           }
         }
         else {