From: vsv Date: Mon, 17 Jul 2017 15:02:11 +0000 (+0300) Subject: Issue #2218: Provide correct display of already shown object X-Git-Tag: V_2.7.2RC~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3dfd84103767b529d6b96935a6879432774cd082;p=modules%2Fshaper.git Issue #2218: Provide correct display of already shown object --- diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 653b8b2f4..93e82f071 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -2052,6 +2052,13 @@ void XGUI_Workshop::showOnlyObjects(const QObjectPtrList& theList) if (module()->canEraseObject(aObj)) aObj->setDisplayed(false); } + // Block fitAll command according to bug #2214 + myEventsListener->setFitAllBlocked(true); + + //Do not use eraseAll if you didn't send Redisplay event: + //all objects are erased from viewer, but considered as displayed in displayer + // Problem in bug 2218 + Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY)); #ifdef HAVE_SALOME //issue #2159 Hide all incomplete behavior viewer()->eraseAll(); @@ -2062,6 +2069,9 @@ void XGUI_Workshop::showOnlyObjects(const QObjectPtrList& theList) aObj->setDisplayed(true); } Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY)); + + // UnBlock fitAll command (bug #2214) + myEventsListener->setFitAllBlocked(false); } diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index f5f2626e2..81f88b857 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -86,7 +86,8 @@ const std::string DebugFeatureKind = "";//"Extrusion"; XGUI_WorkshopListener::XGUI_WorkshopListener(ModuleBase_IWorkshop* theWorkshop) : myWorkshop(theWorkshop), - myUpdatePrefs(false) + myUpdatePrefs(false), + myBlockFitAll(false) { XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr(); } @@ -352,7 +353,7 @@ void XGUI_WorkshopListener:: Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION)); //VSV FitAll updated viewer by itself - if (aDoFitAll) + if (aDoFitAll && (!myBlockFitAll)) myWorkshop->viewer()->fitAll(); else aDisplayer->updateViewer(); diff --git a/src/XGUI/XGUI_WorkshopListener.h b/src/XGUI/XGUI_WorkshopListener.h index 486d8f889..aad3aa07a 100755 --- a/src/XGUI/XGUI_WorkshopListener.h +++ b/src/XGUI/XGUI_WorkshopListener.h @@ -59,6 +59,13 @@ public: //! Redefinition of Events_Listener method virtual void processEvent(const std::shared_ptr& theMessage); + //! Returns state of blocking fitAll command + bool isFitAllBlocked() const { return myBlockFitAll; } + + //! Sets state of blocking fitAll command + //! \param toBlock a new blocking state + void setFitAllBlocked(bool toBlock) { myBlockFitAll = toBlock; } + signals: /// Emitted when error in applivation happens void errorOccurred(std::shared_ptr theMsg); @@ -114,6 +121,7 @@ private: ModuleBase_IWorkshop* myWorkshop; // the current workshop bool myUpdatePrefs; + bool myBlockFitAll; }; #endif