Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / XGUI / XGUI_SelectionActivate.cpp
index 82faaa9fd469f9f13a0ea082ac049dfa155b3330..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
 
 //**************************************************************
@@ -101,13 +105,15 @@ void XGUI_SelectionActivate::updateSelectionModes()
 void XGUI_SelectionActivate::updateSelectionFilters()
 {
   SelectMgr_ListOfFilter aSelectionFilters;
-  QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
   switch (activeSelectionPlace()) {
-    case Workshop:
+    case Workshop: {
+      QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
       myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
-
+    }
     break;
     case PropertyPanel: {
+      QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
+
       ModuleBase_ModelWidget* anActiveWidget = myWorkshop->module()->activeWidget();
       if (anActiveWidget)
         anActiveWidget->selectionFilters(aModuleSelectionFilters, aSelectionFilters);
@@ -116,7 +122,8 @@ void XGUI_SelectionActivate::updateSelectionFilters()
     break;
     case FacesPanel: {
       XGUI_Tools::workshop(myWorkshop)->facesPanel()->selectionFilters(aSelectionFilters);
-      myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
+      //QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
+      //myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
     }
     break;
     default: break;
@@ -330,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;