Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / XGUI / XGUI_SelectionActivate.cpp
index 09d1cef22c812f08f0bf5330594b9a0ee2481501..3c6fc2f7191ea1a578c8113b588cb4374cbb7ec1 100644 (file)
 //#define DEBUG_ACTIVATE_AIS
 //#define DEBUG_DEACTIVATE_AIS
 
+#ifdef TINSPECTOR
+#include <inspector/VInspectorAPI_CallBack.hxx>
+#endif
+
 #define CLEAR_OUTDATED_SELECTION_BEFORE_REDISPLAY
 
 //**************************************************************
@@ -102,13 +106,15 @@ void XGUI_SelectionActivate::updateSelectionFilters()
 {
   SelectMgr_ListOfFilter aSelectionFilters;
   switch (activeSelectionPlace()) {
-    case Workshop:
-      myWorkshop->module()->moduleSelectionFilters(myWorkshop->module()->selectionFilters(),
-        aSelectionFilters);
+    case Workshop: {
+      QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
+      myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
+    }
     break;
     case PropertyPanel: {
-      ModuleBase_ModelWidget* anActiveWidget = myWorkshop->module()->activeWidget();
       QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
+
+      ModuleBase_ModelWidget* anActiveWidget = myWorkshop->module()->activeWidget();
       if (anActiveWidget)
         anActiveWidget->selectionFilters(aModuleSelectionFilters, aSelectionFilters);
       myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
@@ -116,6 +122,8 @@ void XGUI_SelectionActivate::updateSelectionFilters()
     break;
     case FacesPanel: {
       XGUI_Tools::workshop(myWorkshop)->facesPanel()->selectionFilters(aSelectionFilters);
+      //QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
+      //myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
     }
     break;
     default: break;
@@ -329,11 +337,19 @@ void XGUI_SelectionActivate::activateAIS(const Handle(AIS_InteractiveObject)& th
   }
   if (!aContext.IsNull()) {
     if (myWorkshop->module()) {
-      int aMode = (theMode > 8)? theMode : AIS_Shape::SelectionType(theMode);
+      // the code is obsolete, used in additional check before activate, it was removed
+      //int aMode = (theMode > 8)? theMode : AIS_Shape::SelectionType(theMode);
       aContext->Activate(theIO, theMode, false);
-    } else
+#ifdef TINSPECTOR
+      if (getDisplayer()->getCallBack()) getDisplayer()->getCallBack()->Activate(theIO, theMode);
+#endif
+    }
+    else {
       aContext->Activate(theIO, theMode, false);
-
+#ifdef TINSPECTOR
+      if (getDisplayer()->getCallBack()) getDisplayer()->getCallBack()->Activate(theIO, theMode);
+#endif
+    }
     // the fix from VPA for more suitable selection of sketcher lines
     if (theIO->Width() > 1) {
       double aPrecision = theIO->Width() + 2;