]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2362 Show dimensional and geometrical constraints is not activated
authornds <nds@opencascade.com>
Fri, 15 Dec 2017 11:47:20 +0000 (14:47 +0300)
committernds <nds@opencascade.com>
Fri, 15 Dec 2017 11:56:38 +0000 (14:56 +0300)
src/XGUI/XGUI_Displayer.cpp
src/XGUI/XGUI_Workshop.cpp

index 7028e4a352baa2f520b64c54c63a6547a8d3dd7c..cb1ea4bcd9196b4837a77ed52fc75bf7b22082ca 100644 (file)
@@ -99,6 +99,8 @@ const int MOUSE_SENSITIVITY_IN_PIXEL = 10;
 
 #define CLEAR_OUTDATED_SELECTION_BEFORE_REDISPLAY
 
+//#define DEBUG_VIEWER_BLOCKED_COUNT
+
 //**************************************************************
 void displayedObjects(const Handle(AIS_InteractiveContext)& theAIS, AIS_ListOfInteractive& theList)
 {
@@ -614,6 +616,10 @@ bool XGUI_Displayer::enableUpdateViewer(const bool isEnabled)
   else
     myViewerBlockedRecursiveCount++;
 
+#ifdef DEBUG_VIEWER_BLOCKED_COUNT
+  std::cout << "myViewerBlockedRecursiveCount = " << myViewerBlockedRecursiveCount << std::endl;
+#endif
+
   if (myNeedUpdate && isUpdateEnabled()) {
     updateViewer();
     myNeedUpdate = false;
@@ -631,6 +637,11 @@ bool XGUI_Displayer::isUpdateEnabled() const
 void XGUI_Displayer::updateViewer() const
 {
   Handle(AIS_InteractiveContext) aContext = AISContext();
+
+#ifdef DEBUG_VIEWER_BLOCKED_COUNT
+  std::cout << "updateViewer: " << (myViewerBlockedRecursiveCount == 0 ? " done" : " later") << std::endl;
+#endif
+
   if (!aContext.IsNull() && isUpdateEnabled()) {
     //myWorkshop->viewer()->Zfitall();
     aContext->UpdateCurrentViewer();
index 6cb816382fe023cad1b64bb5fe99b057df762cce..796c70af222c59365ec129cfc67873de12c815b2 100755 (executable)
@@ -1050,7 +1050,10 @@ void XGUI_Workshop::processUndoRedo(const ModuleBase_ActionType theActionType, i
     if (aOpMgr->canStopOperation(aOpMgr->currentOperation()))
       aOpMgr->abortOperation(aOpMgr->currentOperation());
     else
+    {
+      myDisplayer->enableUpdateViewer(isUpdateEnabled);
       return;
+    }
   }
   objectBrowser()->treeView()->setCurrentIndex(QModelIndex());
   std::list<std::string> anActionList = theActionType == ActionUndo ? aMgr->undoList()
@@ -1070,10 +1073,8 @@ void XGUI_Workshop::processUndoRedo(const ModuleBase_ActionType theActionType, i
   updateCommandStatus();
 
   // unblock the viewer update functionality and make update on purpose
-  if (theActionType == ActionRedo) {
-    myDisplayer->enableUpdateViewer(isUpdateEnabled);
-    myDisplayer->updateViewer();
-  }
+  myDisplayer->enableUpdateViewer(isUpdateEnabled);
+  myDisplayer->updateViewer();
 }
 
 //******************************************************