// PARAVIS : ParaView wrapper SALOME module
//
-// Copyright (C) 2010-2016 CEA/DEN, EDF R&D
+// Copyright (C) 2010-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <pqExportReaction.h>
#include <pqSaveAnimationReaction.h>
#include <pqSaveAnimationGeometryReaction.h>
+#include <pqLoadMaterialsReaction.h>
#include <pqServerConnectReaction.h>
#include <pqServerDisconnectReaction.h>
#include <pqCameraUndoRedoReaction.h>
#include <pqAboutDialogReaction.h>
#include <pqHelpReaction.h>
#include <pqDataQueryReaction.h>
-#include <pqPythonShellReaction.h>
+//#include <pqPythonShellReaction.h>
#include <pqViewManager.h>
#include <pqViewMenuManager.h>
QPixmap aPixmap;
QAction* anAction;
-
+
// --- Menu "File"
// Open File
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"));
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);
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);
anAction->setStatusTip("");
registerAction(FindDataId, anAction);
new pqDataQueryReaction(anAction);
-
+
// Change Input
anAction = new QAction(tr("MEN_CHANGE_INPUT"), this);
anAction->setToolTip(tr("TOP_CHANGE_INPUT"));
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
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"));
//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) {
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);
\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 );
// 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 );
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 );
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 );
createMenu( separator(), aToolsMnu );
createMenu( TimerLogId, aToolsMnu );
- createMenu( OutputWindowId, aToolsMnu );
createMenu( separator(), aToolsMnu );
createMenu( PythonShellId, aToolsMnu );
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 );
// -- Context menu in the pipeline browser
pqPipelineBrowserWidget * pq = guiElements->getPipelineBrowserWidget();
- pqParaViewMenuBuilders::buildPipelineBrowserContextMenu( *pq );
+ pqParaViewMenuBuilders::buildPipelineBrowserContextMenu( *(pq->contextMenu()) );
}
/*!