From: mpv Date: Mon, 8 Jul 2019 13:12:07 +0000 (+0300) Subject: Update management of fields steps shows/hide X-Git-Tag: VEDF2019Lot4~103^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c44378454f86b757b14fd7466daa4b0f030ed320;p=modules%2Fshaper.git Update management of fields steps shows/hide --- diff --git a/src/ModelAPI/ModelAPI_ResultField.cpp b/src/ModelAPI/ModelAPI_ResultField.cpp index 15f8bba96..0b44d8c95 100644 --- a/src/ModelAPI/ModelAPI_ResultField.cpp +++ b/src/ModelAPI/ModelAPI_ResultField.cpp @@ -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 + } + } } diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index 6730df06b..2781c51f6 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -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 {