X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Displayer.cpp;h=978d6154936421e9f0332bbd4520b7a4e65fb3b4;hb=220bd2b37119be1c65abf88a88792445cb9d99f8;hp=768c0d419a87515950c933273d7c7d2f03cc5456;hpb=8abdbb054d2e130d01aaf11ee6d5b984ce1e0b71;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 768c0d419..978d61549 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -252,7 +252,7 @@ bool XGUI_Displayer::erase(ObjectPtr theObject, const bool theUpdateViewer) Handle(AIS_InteractiveObject) anAIS = anObject->impl(); if (!anAIS.IsNull()) { emit beforeObjectErase(theObject, anObject); - aContext->Remove(anAIS); + aContext->Remove(anAIS, false/*update viewer*/); aErased = true; } } @@ -322,7 +322,16 @@ bool XGUI_Displayer::redisplay(ObjectPtr theObject, bool theUpdateViewer) arg(!isEqualShapes || isCustomized).arg(isEqualShapes).arg(isCustomized).toStdString().c_str()); #endif if (!isEqualShapes || isCustomized) { + /// if shapes are equal and presentation are customized, selection should be restored + bool aNeedToRestoreSelection = isEqualShapes && isCustomized; + if (aNeedToRestoreSelection) + myWorkshop->module()->storeSelection(); + aContext->Redisplay(aAISIO, false); + + if (aNeedToRestoreSelection) + myWorkshop->module()->restoreSelection(); + aRedisplayed = true; #ifdef DEBUG_FEATURE_REDISPLAY qDebug(" Redisplay happens"); @@ -599,7 +608,7 @@ bool XGUI_Displayer::eraseAll(const bool theUpdateViewer) Handle(AIS_InteractiveObject) anIO = aAISObj->impl(); if (!anIO.IsNull()) { emit beforeObjectErase(aObj, aAISObj); - aContext->Remove(anIO, false); + aContext->Remove(anIO, false/*update viewer*/); aErased = true; } }