Salome HOME
Issue #1897 Selection of edges in Group feature with SHIFT Key
[modules/shaper.git] / src / XGUI / XGUI_ContextMenuMgr.cpp
index b99cfdd6b3aae3a3fd58c1336b82a6dc3ee8ff82..72025823a4a3775c3900f16c43b90741f0c0fe64 100644 (file)
@@ -28,6 +28,7 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_Tools.h>
+#include <ModelAPI_ResultField.h>
 
 #include <Config_DataModelReader.h>
 
@@ -44,7 +45,6 @@
 #include <QMainWindow>
 #include <QModelIndex>
 
-
 XGUI_ContextMenuMgr::XGUI_ContextMenuMgr(XGUI_Workshop* theParent)
     : QObject(theParent),
       myWorkshop(theParent),
@@ -151,6 +151,15 @@ void XGUI_ContextMenuMgr::createActions()
                                            tr("Select parent feature"), aDesktop);
   addAction("SHOW_FEATURE_CMD", aAction);
 
+#ifdef VINSPECTOR
+  aAction = ModuleBase_Tools::createAction(QIcon(), tr("Debug Visualization"), aDesktop);
+  addAction("VINSPECTOR_VIEW", aAction);
+#endif
+#ifdef DFBROWSER
+  aAction = ModuleBase_Tools::createAction(QIcon(), tr("DFBrowser"), aDesktop);
+  addAction("DFBROWSER_VIEW", aAction);
+#endif
+
   buildObjBrowserMenu();
   buildViewerMenu();
 }
@@ -328,6 +337,16 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu()
   if (myWorkshop->canChangeDeflection())
     action("DEFLECTION_CMD")->setEnabled(true);
 
+  #ifdef _DEBUG
+    #ifdef VINSPECTOR
+      action("VINSPECTOR_VIEW")->setEnabled(true);
+    #endif
+    #ifdef DFBROWSER
+      action("DFBROWSER_VIEW")->setEnabled(true);
+    #endif
+  #endif
+
+
   ModuleBase_IModule* aModule = myWorkshop->module();
   if (aModule)
     aModule->updateObjectBrowserMenu(myActions);
@@ -471,6 +490,7 @@ void XGUI_ContextMenuMgr::buildObjBrowserMenu()
   myObjBrowserMenus[ModelAPI_ResultBody::group()] = aList;
   // Group menu
   myObjBrowserMenus[ModelAPI_ResultGroup::group()] = aList;
+  myObjBrowserMenus[ModelAPI_ResultField::group()] = aList;
   // Result part menu
   myObjBrowserMenus[ModelAPI_ResultPart::group()] = aList;
   //-------------------------------------
@@ -519,6 +539,7 @@ void XGUI_ContextMenuMgr::buildViewerMenu()
   myViewerMenu[ModelAPI_ResultBody::group()] = aList;
   // Group menu
   myViewerMenu[ModelAPI_ResultGroup::group()] = aList;
+  myViewerMenu[ModelAPI_ResultField::group()] = aList;
   //-------------------------------------
 }
 
@@ -555,6 +576,16 @@ void XGUI_ContextMenuMgr::addObjBrowserMenu(QMenu* theMenu) const
       aActions.append(action("CLEAN_HISTORY_CMD"));
       aActions.append(action("DELETE_CMD"));
   }
+#ifdef _DEBUG
+  if (aSelected == 0) {
+    #ifdef VINSPECTOR
+    aActions.append(action("VINSPECTOR_VIEW"));
+    #endif
+    #ifdef DFBROWSER
+    aActions.append(action("DFBROWSER_VIEW"));
+    #endif
+  }
+#endif
   theMenu->addActions(aActions);
   addFeatures(theMenu);