]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Use an option from SHAPER's Preferences to specify what shapes should be displayed...
authorazv <azv@opencascade.com>
Tue, 30 Nov 2021 19:35:48 +0000 (22:35 +0300)
committerazv <azv@opencascade.com>
Tue, 30 Nov 2021 19:35:48 +0000 (22:35 +0300)
src/ModelHighAPI/ModelHighAPI_Interface.cpp
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_WorkshopListener.cpp

index 82423fb0b0a73b1a0015897120366c0c0de82c4d..bd87cd0e40ac30231357e3966ce5ba932d4b6f11 100644 (file)
@@ -82,7 +82,7 @@ void ModelHighAPI_Interface::execute(bool isForce)
   Events_Loop* aLoop = Events_Loop::loop();
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
   aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
-  //aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
+  aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
   //aLoop->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED));
 }
 
index a572b5294f97d48d0857db40ad37ec9f1e3cf445..0336029ba2f44329f417ae0bdb2c03ae3a88bc6b 100644 (file)
@@ -706,21 +706,6 @@ void XGUI_Workshop::deactivateActiveObject(const ObjectPtr& theObject, const boo
       myDisplayer->deactivateObjects(anObjects, theUpdateViewer);
     }
   }
-
-  SUIT_Application * app = SUIT_Session::session()->activeApplication();
-
-  QVariant aVar = app->property("IsLoadedScript");
-
-  if (!aVar.isNull() && aVar.toBool()) {
-    DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
-    int aSize = aRootDoc->size(ModelAPI_ResultPart::group());
-    if (aSize > 0) {
-      ObjectPtr anPartObject = aRootDoc->object(ModelAPI_ResultPart::group(), aSize - 1);
-      ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(anPartObject);
-      XGUI_Tools::setDisplaying(aPart, true);
-      Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
-    }
-  }
 }
 
 //******************************************************
index 8a3f3d1814e29b30b910571ac314e6e9a6860b46..7dc112a93c8b021f9207e3aa48cccfa13db60def 100644 (file)
 #include "XGUI_OperationMgr.h"
 #include "XGUI_ModuleConnector.h"
 #include "XGUI_PropertyPanel.h"
-
 #include "XGUI_QtEvents.h"
 #include "XGUI_SalomeConnector.h"
 #include "XGUI_SelectionMgr.h"
+#include "XGUI_Tools.h"
 #include "XGUI_Workshop.h"
 
 #include <QAction>
@@ -378,6 +378,21 @@ void XGUI_WorkshopListener::
       }
     }
   }
+
+  // If the python script is being loaded now, the preferences should be used
+  // to display the required object
+  SUIT_Application * app = SUIT_Session::session()->activeApplication();
+  QVariant aVar = app->property("IsLoadedScript");
+  if (!aVar.isNull() && aVar.toBool()) {
+    DocumentPtr aRootDoc = ModelAPI_Session::get()->moduleDocument();
+    int aSize = aRootDoc->size(ModelAPI_ResultPart::group());
+    if (aSize > 0) {
+      ObjectPtr anPartObject = aRootDoc->object(ModelAPI_ResultPart::group(), aSize - 1);
+      ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(anPartObject);
+      XGUI_Tools::setDisplaying(aPart, true);
+    }
+  }
+
   // this processing should be moved in another place in order to do not cause problems in
   // flush messages chain
   //if (aHiddenObjects.size() > 0)