]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2218: Provide correct display of already shown object
authorvsv <vsv@opencascade.com>
Mon, 17 Jul 2017 15:02:11 +0000 (18:02 +0300)
committervsv <vsv@opencascade.com>
Mon, 17 Jul 2017 15:02:11 +0000 (18:02 +0300)
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_WorkshopListener.cpp
src/XGUI/XGUI_WorkshopListener.h

index 653b8b2f4f1d626193ceebc928565af4a74e4c29..93e82f0716bad2bcaf79b062926b5b105472d0e9 100755 (executable)
@@ -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);
 }
 
 
index f5f2626e2d837da64177eb509dd4d95dce32d923..81f88b857ef824b908b314f0ba739199e45a6aac 100755 (executable)
@@ -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();
index 486d8f88903f36a150cfd084ab09c4e6abb2e336..aad3aa07a0024488f06f9e461e7129227b74236e 100755 (executable)
@@ -59,6 +59,13 @@ public:
   //! Redefinition of Events_Listener method
   virtual void processEvent(const std::shared_ptr<Events_Message>& 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<Events_InfoMessage> theMsg);
@@ -114,6 +121,7 @@ private:
   ModuleBase_IWorkshop* myWorkshop; // the current workshop
 
   bool myUpdatePrefs;
+  bool myBlockFitAll;
 };
 
 #endif