Salome HOME
Updated copyright comment
[modules/paravis.git] / src / PVGUI / PVGUI_Module_actions.cxx
index 91e840e049c19f8ee0fa2065c469110d5fc7c659..3776ac797528f6dab886d4d7894acbb3abf3a805 100644 (file)
@@ -1,6 +1,6 @@
 // PARAVIS : ParaView wrapper SALOME module
 //
-// Copyright (C) 2010-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2010-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -49,6 +49,7 @@
 #include <pqExportReaction.h>
 #include <pqSaveAnimationReaction.h>
 #include <pqSaveAnimationGeometryReaction.h>
+#include <pqLoadMaterialsReaction.h>
 #include <pqServerConnectReaction.h>
 #include <pqServerDisconnectReaction.h>
 #include <pqCameraUndoRedoReaction.h>
@@ -67,7 +68,7 @@
 #include <pqAboutDialogReaction.h>
 #include <pqHelpReaction.h>
 #include <pqDataQueryReaction.h>
-#include <pqPythonShellReaction.h>
+//#include <pqPythonShellReaction.h>
 
 #include <pqViewManager.h>
 #include <pqViewMenuManager.h>
@@ -88,7 +89,7 @@ void PVGUI_Module::pvCreateActions()
 
   QPixmap aPixmap;
   QAction* anAction;
-
+  
   // --- Menu "File"
 
   // Open File
@@ -98,14 +99,14 @@ void PVGUI_Module::pvCreateActions()
   anAction->setStatusTip(tr("STB_OPEN_FILE"));
   registerAction(OpenFileId, anAction);
   new pqLoadDataReaction(anAction);
-
+  
   // Load State
   anAction = new QAction(tr("MEN_LOAD_STATE"), this);
   anAction->setToolTip(tr("TOP_LOAD_STATE"));
   anAction->setStatusTip(tr("STB_LOAD_STATE"));
   registerAction(LoadStateId, anAction);
   new pqLoadStateReaction(anAction);
-
+  
   // Save State
   anAction = new QAction(tr("MEN_SAVE_STATE"), this);
   anAction->setToolTip(tr("TOP_SAVE_STATE"));
@@ -152,6 +153,14 @@ void PVGUI_Module::pvCreateActions()
   registerAction(SaveGeometryId, anAction);
   new pqSaveAnimationGeometryReaction(anAction);
 
+  // Load Path Tracer Materials
+  aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_LOAD_MATERIAL"), false );
+  anAction = new QAction(QIcon(aPixmap), tr("MEN_LOAD_MATERIAL"), this);
+  anAction->setToolTip(tr("TOP_LOAD_MATERIAL"));
+  anAction->setStatusTip(tr("STB_LOAD_MATERIAL"));
+  registerAction(LoadMaterialsId, anAction);
+  new pqLoadMaterialsReaction(anAction);
+
   // Connect
   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CONNECT"), false );
   anAction = new QAction(QIcon(aPixmap), tr("MEN_CONNECT"), this);
@@ -193,7 +202,7 @@ void PVGUI_Module::pvCreateActions()
   anAction->setStatusTip(tr("STB_CAMERA_UNDO"));
   registerAction(CameraUndoId, anAction);
   new pqCameraUndoRedoReaction(anAction, true);
-
+  
   // Camera Redo
   aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_CAMERA_REDO"), false );
   anAction = new QAction(QIcon(aPixmap), tr("MEN_CAMERA_REDO"), this);
@@ -208,7 +217,7 @@ void PVGUI_Module::pvCreateActions()
   anAction->setStatusTip("");
   registerAction(FindDataId, anAction);
   new pqDataQueryReaction(anAction);
-
+  
   // Change Input
   anAction = new QAction(tr("MEN_CHANGE_INPUT"), this);
   anAction->setToolTip(tr("TOP_CHANGE_INPUT"));
@@ -236,7 +245,7 @@ void PVGUI_Module::pvCreateActions()
   anAction->setToolTip(tr("TOP_DELETE_ALL"));
   anAction->setStatusTip(tr("STB_DELETE_ALL"));
   registerAction(DeleteAllId, anAction);
-  new pqDeleteReaction(anAction, true);
+  new pqDeleteReaction(anAction, pqDeleteReaction::DeleteModes::ALL);
 
 
   // Setting
@@ -245,7 +254,7 @@ void PVGUI_Module::pvCreateActions()
   anAction->setStatusTip(tr("STB_SETTINGS"));
   registerAction(SettingsId, anAction);
   new pqApplicationSettingsReaction(anAction);*/
-
+  
   // View Settings
 //  anAction = new QAction(tr("MEN_VIEW_SETTINGS"), this);
 //  anAction->setToolTip(tr("TOP_VIEW_SETTINGS"));
@@ -257,7 +266,7 @@ void PVGUI_Module::pvCreateActions()
   //pqViewManager* viewManager = qobject_cast<pqViewManager*>(
   //                             pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
 
-  //rnv: Commented to implement issue
+  //rnv: Commented to implement issue 
   //21318: EDF 1615 ALL: Display in full screen mode
   //Switching to the "Full screen" mode added in the SALOME GUI module.
   //if (viewManager) {
@@ -343,20 +352,17 @@ void PVGUI_Module::pvCreateActions()
   registerAction(TimerLogId, anAction);
   new pqTimerLogReaction(anAction << pqSetName("actionToolsTimerLog"));
 
-  // Output Window
-  anAction = new QAction(tr("MEN_OUTPUT_WINDOW"), this);
-  anAction->setToolTip(tr("TOP_OUTPUT_WINDOW"));
-  anAction->setStatusTip(tr("STB_OUTPUT_WINDOW"));
-  registerAction(OutputWindowId, anAction);
-  anAction << pqSetName("actionToolsOutputWindow");
-  connect(anAction, SIGNAL(triggered()), pqApplicationCore::instance(), SLOT(showOutputWindow()));
-
- // Python Shell
+  // Python Shell
+  // ???
+  // No more pqPythonShellReaction class, but there is a pqPythonShell class.
+  // Is that equivalent? I don't know what to do at this stage.
   anAction = new QAction(tr("MEN_PYTHON_SHELL"), this);
   anAction->setToolTip(tr("TOP_PYTHON_SHELL"));
   anAction->setStatusTip(tr("STB_PYTHON_SHELL"));
   registerAction(PythonShellId, anAction);
+  /*
   new pqPythonShellReaction(anAction << pqSetName("actionToolsPythonShell"));
+  */
 
   //Show Trace
   anAction = new QAction(tr("MEN_SHOW_TRACE"), this);
@@ -396,14 +402,14 @@ void PVGUI_Module::pvCreateActions()
   \brief Create menus for ParaView GUI operations
   duplicating menus in pqMainWindow ParaView class
 
-  In particular, ParaView is responsible for updating "Sources" and "Filters" menus.
+  In particular, ParaView is responsible for updating "Sources" and "Filters" menus. 
   For this, specific menu managers created by pqMainWindowCore class are used, and PVGUI_Module
   is responsible for creation of corresponding QMenu objects only.
 */
 void PVGUI_Module::pvCreateMenus()
 {
   SUIT_Desktop* desk = application()->desktop();
-
+  
   // --- Menu "File"
   int aPVMnu = createMenu( tr( "MEN_DESK_FILE" ), -1, -1 );
 
@@ -412,7 +418,7 @@ void PVGUI_Module::pvCreateMenus()
   // Recent Files
    myRecentMenuId = createMenu( tr( "MEN_RECENT_FILES" ), aPVMnu, -1, 5 );
    QMenu* aMenu = menuMgr()->findMenu( myRecentMenuId );
-   pqRecentFilesMenu* aRecentFilesMenu = new pqRecentFilesMenu( *aMenu, getApp()->desktop() );
+   /*pqRecentFilesMenu* aRecentFilesMenu = */new pqRecentFilesMenu( *aMenu, getApp()->desktop() );
    QList<QAction*> anActns = aMenu->actions();
    for (int i = 0; i < anActns.size(); ++i)
      createMenu( anActns.at(i), myRecentMenuId );
@@ -432,10 +438,13 @@ void PVGUI_Module::pvCreateMenus()
   createMenu( SaveGeometryId, aPVMnu, 35 );
   createMenu( separator(), aPVMnu, -1, 35 );
 
-  createMenu( ConnectId, aPVMnu, 45 );
-  createMenu( DisconnectId, aPVMnu, 45 );
+  createMenu( LoadMaterialsId, aPVMnu, 45);
   createMenu( separator(), aPVMnu, -1, 45 );
 
+  createMenu( ConnectId, aPVMnu, 55 );
+  createMenu( DisconnectId, aPVMnu, 55 );
+  createMenu( separator(), aPVMnu, -1, 55 );
+
   // --- Menu "Edit"
   aPVMnu = createMenu( tr( "MEN_DESK_EDIT" ), -1, -1 );
 
@@ -462,30 +471,23 @@ void PVGUI_Module::pvCreateMenus()
   aPVMnu = createMenu( tr( "MEN_DESK_VIEW" ), -1, -1 );
 
   createMenu( FullScreenId, aPVMnu );
-
+  
   // --- Menu "Sources"
   // Install ParaView managers for "Sources" menu
   QMenu* aRes = 0;
   PVViewer_GUIElements * guiElements = PVViewer_GUIElements::GetInstance(desk);
   aRes = guiElements->getSourcesMenu();
   mySourcesMenuId = createMenu( tr( "MEN_DESK_SOURCES" ), -1, -1, 60, -1, aRes);
-
+  
   // --- Menu "Filters"
   // Install ParaView managers for "Filters" menu
   aRes = guiElements->getFiltersMenu();
   myFiltersMenuId = createMenu( tr( "MEN_DESK_FILTERS" ), -1, -1, 70, -1, aRes);
 
-  // --- Menu "Catalyst"
-  // Install ParaView managers for "Catalyst" menu
-#ifdef PVCATALYST_ENABLED
-  aRes = guiElements->getCatalystMenu();
-  myCatalystMenuId = createMenu( tr( "MEN_DESK_CATALYST" ), -1, -1, 75, -1, aRes);
-#endif
-
    // --- Menu "Macros"
   aRes = guiElements->getMacrosMenu();
   myMacrosMenuId = createMenu( tr( "MEN_MACROS" ), -1, -1, 80, -1, aRes);
-
   // --- Menu "Tools"
   int aToolsMnu = createMenu( tr( "MEN_DESK_TOOLS" ), -1, -1, 90 );
 
@@ -504,7 +506,6 @@ void PVGUI_Module::pvCreateMenus()
   createMenu( separator(), aToolsMnu );
 
   createMenu( TimerLogId, aToolsMnu );
-  createMenu( OutputWindowId, aToolsMnu );
   createMenu( separator(), aToolsMnu );
 
   createMenu( PythonShellId, aToolsMnu );
@@ -512,10 +513,15 @@ void PVGUI_Module::pvCreateMenus()
   createMenu( ShowTraceId, aToolsMnu );
   createMenu( RestartTraceId, aToolsMnu );
 
+  // --- Menu "Catalyst"
+  aRes = guiElements->getCatalystMenu();
+  myCatalystMenuId = createMenu( tr( "MEN_DESK_CATALYST" ), -1, -1, 100, -1, aRes);
+
   // --- Menu "Help"
 
   int aHelpMnu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1 );
-  int aPVHelpMnu = createMenu( tr( "ParaViS module" ), aHelpMnu, -1, 0 );
+  int aUsersGuide = createMenu( tr( "User's Guide" ), aHelpMnu, -1 );
+  int aPVHelpMnu = createMenu( tr( "ParaViS module" ), aUsersGuide, -1, 5 );
 #ifdef HAS_PV_DOC
   createMenu( ParaViewHelpId,  aPVHelpMnu );
   createMenu( separator(),     aPVHelpMnu );
@@ -524,7 +530,7 @@ void PVGUI_Module::pvCreateMenus()
 
   // -- Context menu in the pipeline browser
   pqPipelineBrowserWidget * pq = guiElements->getPipelineBrowserWidget();
-  pqParaViewMenuBuilders::buildPipelineBrowserContextMenu( *pq );
+  pqParaViewMenuBuilders::buildPipelineBrowserContextMenu( *(pq->contextMenu()) );
 }
 
 /*!