diff --git a/ApplicationCode/Application/RiaApplication.cpp b/ApplicationCode/Application/RiaApplication.cpp index e81e9a3067..59e86b3012 100644 --- a/ApplicationCode/Application/RiaApplication.cpp +++ b/ApplicationCode/Application/RiaApplication.cpp @@ -1322,13 +1322,15 @@ void RiaApplication::deleteMainPlotWindow() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RiuMainPlotWindow* RiaApplication::getOrCreateMainPlotWindow() +RiuMainPlotWindow* RiaApplication::getOrCreateAndShowMainPlotWindow() { if (!m_mainPlotWindow) { createMainPlotWindow(); } + m_mainPlotWindow->showWindow(); + return m_mainPlotWindow; } diff --git a/ApplicationCode/Application/RiaApplication.h b/ApplicationCode/Application/RiaApplication.h index f1a3d7987b..2282d1cfa7 100644 --- a/ApplicationCode/Application/RiaApplication.h +++ b/ApplicationCode/Application/RiaApplication.h @@ -164,7 +164,7 @@ public: int launchUnitTests(); int launchUnitTestsWithConsole(); - RiuMainPlotWindow* getOrCreateMainPlotWindow(); + RiuMainPlotWindow* getOrCreateAndShowMainPlotWindow(); RiuMainPlotWindow* mainPlotWindow(); private: diff --git a/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp index c9be134f2a..9dca59bfb5 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicAddWellLogToPlotFeature.cpp @@ -110,7 +110,7 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked) plotTrack->viewer()->replot(); // Make sure the summary plot window is created and visible - RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateMainPlotWindow(); + RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); RiaApplication::instance()->project()->updateConnectedEditors(); diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp index 704d57612a..3f1e41b42c 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogCurveExtractionFeature.cpp @@ -138,7 +138,7 @@ RimWellLogExtractionCurve* RicNewWellLogCurveExtractionFeature::addCurve(RimWell plotTrack->updateConnectedEditors(); // Make sure the summary plot window is created and visible - RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateMainPlotWindow(); + RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); RiaApplication::instance()->project()->updateConnectedEditors(); diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogFileCurveFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogFileCurveFeature.cpp index be6492afb2..839eb1d0e9 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogFileCurveFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogFileCurveFeature.cpp @@ -152,7 +152,7 @@ RimWellLogFileCurve* RicNewWellLogFileCurveFeature::addCurve(RimWellLogTrack* pl plotTrack->updateConnectedEditors(); - RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateMainPlotWindow(); + RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); plotwindow->selectAsCurrentItem(curve); return curve; diff --git a/ApplicationCode/ProjectDataModel/RimSummaryPlot.cpp b/ApplicationCode/ProjectDataModel/RimSummaryPlot.cpp index 3e0773ca2a..a11e1c75ff 100644 --- a/ApplicationCode/ProjectDataModel/RimSummaryPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimSummaryPlot.cpp @@ -232,7 +232,7 @@ void RimSummaryPlot::setDescription(const QString& description) //-------------------------------------------------------------------------------------------------- void RimSummaryPlot::updateViewerWidget() { - RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateMainPlotWindow(); + RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); if (m_showWindow()) { diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index e9a713ed1b..f9e66cadc4 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -103,7 +103,7 @@ RimWellLogPlot::~RimWellLogPlot() //-------------------------------------------------------------------------------------------------- void RimWellLogPlot::updateViewerWidget() { - RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateMainPlotWindow(); + RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow(); if (m_showWindow()) { diff --git a/ApplicationCode/UserInterface/RiuMainPlotWindow.cpp b/ApplicationCode/UserInterface/RiuMainPlotWindow.cpp index 2c820a2cca..2582656ab7 100644 --- a/ApplicationCode/UserInterface/RiuMainPlotWindow.cpp +++ b/ApplicationCode/UserInterface/RiuMainPlotWindow.cpp @@ -21,86 +21,29 @@ #include "RiaApplication.h" #include "RiaBaseDefs.h" #include "RiaPreferences.h" -#include "RiaRegressionTest.h" -#include "RigCaseCellResultsData.h" -#include "RigFemPartResultsCollection.h" -#include "RigGeoMechCaseData.h" - -#include "RimCaseCollection.h" -#include "RimCommandObject.h" -#include "RimEclipseCase.h" -#include "RimEclipseCaseCollection.h" -#include "RimEclipseCellColors.h" -#include "RimEclipsePropertyFilterCollection.h" -#include "RimEclipseView.h" -#include "RimEclipseWellCollection.h" -#include "RimFaultCollection.h" -#include "RimGeoMechCase.h" -#include "RimGeoMechCellColors.h" -#include "RimGeoMechModels.h" -#include "RimGeoMechView.h" -#include "RimGeoMechView.h" -#include "RimMainPlotCollection.h" -#include "RimOilField.h" #include "RimProject.h" -#include "RimReservoirCellResultsStorage.h" -#include "RimTools.h" #include "RimTreeViewStateSerializer.h" #include "RimViewWindow.h" #include "RimWellLogPlot.h" -#include "RimWellLogPlotCollection.h" -#include "RimSummaryPlot.h" -#include "RimWellPathImport.h" #include "RiuDragDrop.h" #include "RiuMdiSubWindow.h" -#include "RiuMultiCaseImportDialog.h" -#include "RiuProcessMonitor.h" -#include "RiuProjectPropertyView.h" -#include "RiuResultInfoPanel.h" -#include "RiuResultQwtPlot.h" -#include "RiuSummaryQwtPlot.h" #include "RiuToolTipMenu.h" #include "RiuTreeViewEventFilter.h" -#include "RiuViewer.h" -#include "RiuWellImportWizard.h" #include "RiuWellLogPlot.h" -#include "cafAboutDialog.h" -#include "cafAnimationToolBar.h" -#include "cafCmdExecCommandManager.h" #include "cafCmdFeatureManager.h" -#include "cafPdmDefaultObjectFactory.h" -#include "cafPdmFieldCvfMat4d.h" -#include "cafPdmObjectGroup.h" -#include "cafPdmSettings.h" #include "cafPdmUiPropertyView.h" -#include "cafPdmUiPropertyViewDialog.h" #include "cafPdmUiTreeView.h" -#include "cafSelectionManager.h" -#include "cvfTimer.h" -#include #include -#include #include -#include -#include -#include -#include #include -#include #include -#include #include -#include -#include -#include +#include #include -#include - - //================================================================================================== /// @@ -160,13 +103,6 @@ void RiuMainPlotWindow::initializeGuiNewProjectLoaded() { setPdmRoot(RiaApplication::instance()->project()); restoreTreeViewState(); - slotRefreshFileActions(); - slotRefreshEditActions(); - slotRefreshViewActions(); - refreshAnimationActions(); - refreshDrawStyleActions(); - - m_processMonitor->slotClearTextEdit(); } //-------------------------------------------------------------------------------------------------- @@ -174,27 +110,12 @@ void RiuMainPlotWindow::initializeGuiNewProjectLoaded() //-------------------------------------------------------------------------------------------------- void RiuMainPlotWindow::cleanupGuiBeforeProjectClose() { - caf::CmdExecCommandManager::instance()->undoStack()->clear(); - setPdmRoot(NULL); - setResultInfo(""); - - m_resultQwtPlot->deleteAllCurves(); if (m_pdmUiPropertyView) { m_pdmUiPropertyView->showProperties(NULL); } - - for (size_t i = 0; i < additionalProjectViews.size(); i++) - { - RiuProjectAndPropertyView* projPropView = dynamic_cast(additionalProjectViews[i]->widget()); - if (projPropView) - { - projPropView->showProperties(NULL); - } - } - m_processMonitor->startMonitorWorkProcess(NULL); } //-------------------------------------------------------------------------------------------------- @@ -203,8 +124,6 @@ void RiuMainPlotWindow::cleanupGuiBeforeProjectClose() void RiuMainPlotWindow::closeEvent(QCloseEvent* event) { saveWinGeoAndDockToolBarLayout(); - - event->accept(); } //-------------------------------------------------------------------------------------------------- @@ -212,146 +131,13 @@ void RiuMainPlotWindow::closeEvent(QCloseEvent* event) //-------------------------------------------------------------------------------------------------- void RiuMainPlotWindow::createActions() { - // File actions - m_openProjectAction = new QAction(style()->standardIcon(QStyle::SP_DirOpenIcon), "&Open Project", this); - m_openLastUsedProjectAction = new QAction("Open &Last Used Project", this); - - m_importGeoMechCaseAction = new QAction(QIcon(":/GeoMechCase48x48.png"), "Import &Geo Mechanical Model", this); - - m_mockModelAction = new QAction("&Mock Model", this); - m_mockResultsModelAction = new QAction("Mock Model With &Results", this); - m_mockLargeResultsModelAction = new QAction("Large Mock Model", this); - m_mockModelCustomizedAction = new QAction("Customized Mock Model", this); - m_mockInputModelAction = new QAction("Input Mock Model", this); - - m_snapshotToFile = new QAction(QIcon(":/SnapShotSave.png"), "Snapshot To File", this); - m_snapshotToClipboard = new QAction(QIcon(":/SnapShot.png"), "Copy Snapshot To Clipboard", this); - m_snapshotAllViewsToFile = new QAction(QIcon(":/SnapShotSaveViews.png"), "Snapshot All Views To File", this); - - m_createCommandObject = new QAction("Create Command Object", this); - m_showRegressionTestDialog = new QAction("Regression Test Dialog", this); - m_executePaintEventPerformanceTest = new QAction("&Paint Event Performance Test", this); - - m_saveProjectAction = new QAction(QIcon(":/Save.png"), "&Save Project", this); - m_saveProjectAsAction = new QAction(QIcon(":/Save.png"), "Save Project &As", this); - - m_closeProjectAction = new QAction("&Close Project", this); - - for (int i = 0; i < MaxRecentFiles; ++i) - { - m_recentFileActions[i] = new QAction(this); - m_recentFileActions[i]->setVisible(false); - connect(m_recentFileActions[i], SIGNAL(triggered()), this, SLOT(slotOpenRecentFile())); - } - - m_exitAction = new QAction("E&xit", this); - - connect(m_openProjectAction, SIGNAL(triggered()), SLOT(slotOpenProject())); - connect(m_openLastUsedProjectAction, SIGNAL(triggered()), SLOT(slotOpenLastUsedProject())); - - connect(m_importGeoMechCaseAction, SIGNAL(triggered()), SLOT(slotImportGeoMechModel())); - - connect(m_mockModelAction, SIGNAL(triggered()), SLOT(slotMockModel())); - connect(m_mockResultsModelAction, SIGNAL(triggered()), SLOT(slotMockResultsModel())); - connect(m_mockLargeResultsModelAction, SIGNAL(triggered()), SLOT(slotMockLargeResultsModel())); - connect(m_mockModelCustomizedAction, SIGNAL(triggered()), SLOT(slotMockModelCustomized())); - connect(m_mockInputModelAction, SIGNAL(triggered()), SLOT(slotInputMockModel())); - - connect(m_snapshotToFile, SIGNAL(triggered()), SLOT(slotSnapshotToFile())); - connect(m_snapshotToClipboard, SIGNAL(triggered()), SLOT(slotSnapshotToClipboard())); - connect(m_snapshotAllViewsToFile, SIGNAL(triggered()), SLOT(slotSnapshotAllViewsToFile())); - - connect(m_createCommandObject, SIGNAL(triggered()), SLOT(slotCreateCommandObject())); - connect(m_showRegressionTestDialog, SIGNAL(triggered()), SLOT(slotShowRegressionTestDialog())); - connect(m_executePaintEventPerformanceTest, SIGNAL(triggered()), SLOT(slotExecutePaintEventPerformanceTest())); - - connect(m_saveProjectAction, SIGNAL(triggered()), SLOT(slotSaveProject())); - connect(m_saveProjectAsAction, SIGNAL(triggered()), SLOT(slotSaveProjectAs())); - - connect(m_closeProjectAction, SIGNAL(triggered()), SLOT(slotCloseProject())); - - connect(m_exitAction, SIGNAL(triggered()), QApplication::instance(), SLOT(closeAllWindows())); - - // Edit actions - m_editPreferences = new QAction("&Preferences...", this); - connect(m_editPreferences, SIGNAL(triggered()), SLOT(slotEditPreferences())); - - // View actions - m_viewFromNorth = new QAction(QIcon(":/SouthViewArrow.png"), "Look South", this); - m_viewFromNorth->setToolTip("Look South"); - m_viewFromSouth = new QAction(QIcon(":/NorthViewArrow.png"),"Look North", this); - m_viewFromSouth->setToolTip("Look North"); - m_viewFromEast = new QAction(QIcon(":/WestViewArrow.png"),"Look West", this); - m_viewFromEast->setToolTip("Look West"); - m_viewFromWest = new QAction(QIcon(":/EastViewArrow.png"),"Look East", this); - m_viewFromWest->setToolTip("Look East"); - m_viewFromAbove = new QAction(QIcon(":/DownViewArrow.png"),"Look Down", this); - m_viewFromAbove->setToolTip("Look Down"); - m_viewFromBelow = new QAction(QIcon(":/UpViewArrow.png"),"Look Up", this); - m_viewFromBelow->setToolTip("Look Up"); - - m_zoomAll = new QAction(QIcon(":/ZoomAll16x16.png"),"Zoom all", this); - m_zoomAll->setToolTip("Zoom to view all"); - - connect(m_viewFromNorth, SIGNAL(triggered()), SLOT(slotViewFromNorth())); - connect(m_viewFromSouth, SIGNAL(triggered()), SLOT(slotViewFromSouth())); - connect(m_viewFromEast, SIGNAL(triggered()), SLOT(slotViewFromEast())); - connect(m_viewFromWest, SIGNAL(triggered()), SLOT(slotViewFromWest())); - connect(m_viewFromAbove, SIGNAL(triggered()), SLOT(slotViewFromAbove())); - connect(m_viewFromBelow, SIGNAL(triggered()), SLOT(slotViewFromBelow())); - connect(m_zoomAll, SIGNAL(triggered()), SLOT(slotZoomAll())); - - // Debug actions - m_newPropertyView = new QAction("New Project and Property View", this); - connect(m_newPropertyView, SIGNAL(triggered()), SLOT(slotNewObjectPropertyView())); - - // Help actions - m_aboutAction = new QAction("&About", this); - connect(m_aboutAction, SIGNAL(triggered()), SLOT(slotAbout())); - m_commandLineHelpAction = new QAction("&Command Line Help", this); - connect(m_commandLineHelpAction, SIGNAL(triggered()), SLOT(slotShowCommandLineHelp())); - m_openUsersGuideInBrowserAction = new QAction("&Users Guide", this); - connect(m_openUsersGuideInBrowserAction, SIGNAL(triggered()), SLOT(slotOpenUsersGuideInBrowserAction())); - - // Draw style actions - m_dsActionGroup = new QActionGroup(this); - - m_drawStyleLinesAction = new QAction(QIcon(":/draw_style_lines_24x24.png"), "&Mesh Only", this); - //connect(m_drawStyleLinesAction, SIGNAL(triggered()), SLOT(slotDrawStyleLines())); - m_dsActionGroup->addAction(m_drawStyleLinesAction); - - m_drawStyleLinesSolidAction = new QAction(QIcon(":/draw_style_meshlines_24x24.png"), "Mesh And Surfaces", this); - //connect(m_drawStyleLinesSolidAction, SIGNAL(triggered()), SLOT(slotDrawStyleLinesSolid())); - m_dsActionGroup->addAction(m_drawStyleLinesSolidAction); - - m_drawStyleFaultLinesSolidAction = new QAction(QIcon(":/draw_style_surface_w_fault_mesh_24x24.png"), "Fault Mesh And Surfaces", this); - m_dsActionGroup->addAction(m_drawStyleFaultLinesSolidAction); - - m_drawStyleSurfOnlyAction = new QAction(QIcon(":/draw_style_surface_24x24.png"), "&Surface Only", this); - //connect(m_drawStyleSurfOnlyAction, SIGNAL(triggered()), SLOT(slotDrawStyleSurfOnly())); - m_dsActionGroup->addAction(m_drawStyleSurfOnlyAction); - - - connect(m_dsActionGroup, SIGNAL(triggered(QAction*)), SLOT(slotDrawStyleChanged(QAction*))); - - m_disableLightingAction = new QAction(QIcon(":/disable_lighting_24x24.png"), "&Disable Results Lighting", this); - m_disableLightingAction->setCheckable(true); - connect(m_disableLightingAction, SIGNAL(toggled(bool)), SLOT(slotDisableLightingAction(bool))); - - - m_drawStyleHideGridCellsAction = new QAction( QIcon(":/draw_style_faults_24x24.png"), "&Hide Grid Cells", this); - m_drawStyleHideGridCellsAction->setCheckable(true); - connect(m_drawStyleHideGridCellsAction, SIGNAL(toggled(bool)), SLOT(slotToggleHideGridCellsAction(bool))); - - m_toggleFaultsLabelAction = new QAction( QIcon(":/draw_style_faults_label_24x24.png"), "&Show Fault Labels", this); - m_toggleFaultsLabelAction->setCheckable(true); - connect(m_toggleFaultsLabelAction, SIGNAL(toggled(bool)), SLOT(slotToggleFaultLabelsAction(bool))); - - m_addWellCellsToRangeFilterAction = new QAction(QIcon(":/draw_style_WellCellsToRangeFilter_24x24.png"), "&Add Well Cells To Range Filter", this); - m_addWellCellsToRangeFilterAction->setCheckable(true); - m_addWellCellsToRangeFilterAction->setToolTip("Add Well Cells To Range Filter based on the individual settings"); - connect(m_addWellCellsToRangeFilterAction, SIGNAL(toggled(bool)), SLOT(slotAddWellCellsToRangeFilterAction(bool))); + m_snapshotToFile = new QAction(QIcon(":/SnapShotSave.png"), "Snapshot To File", this); + m_snapshotToClipboard = new QAction(QIcon(":/SnapShot.png"), "Copy Snapshot To Clipboard", this); + m_snapshotAllViewsToFile = new QAction(QIcon(":/SnapShotSaveViews.png"), "Snapshot All Views To File", this); + connect(m_snapshotToFile, SIGNAL(triggered()), SLOT(slotSnapshotToFile())); + connect(m_snapshotToClipboard, SIGNAL(triggered()), SLOT(slotSnapshotToClipboard())); + connect(m_snapshotAllViewsToFile, SIGNAL(triggered()), SLOT(slotSnapshotAllViewsToFile())); } //-------------------------------------------------------------------------------------------------- @@ -359,102 +145,13 @@ void RiuMainPlotWindow::createActions() //-------------------------------------------------------------------------------------------------- void RiuMainPlotWindow::createMenus() { - caf::CmdFeatureManager* cmdFeatureMgr = caf::CmdFeatureManager::instance(); - CVF_ASSERT(cmdFeatureMgr); - // File menu QMenu* fileMenu = new RiuToolTipMenu(menuBar()); fileMenu->setTitle("&File"); menuBar()->addMenu(fileMenu); - - fileMenu->addAction(m_openProjectAction); - fileMenu->addAction(m_openLastUsedProjectAction); - fileMenu->addSeparator(); - QMenu* importMenu = fileMenu->addMenu("&Import"); - importMenu->addAction(cmdFeatureMgr->action("RicImportEclipseCaseFeature")); - importMenu->addAction(cmdFeatureMgr->action("RicImportInputEclipseCaseFeature")); - importMenu->addAction(cmdFeatureMgr->action("RicImportInputEclipseCaseOpmFeature")); - importMenu->addAction(cmdFeatureMgr->action("RicCreateGridCaseGroupFeature")); - importMenu->addSeparator(); - #ifdef USE_ODB_API - importMenu->addAction(m_importGeoMechCaseAction); - importMenu->addSeparator(); - #endif - importMenu->addAction(cmdFeatureMgr->action("RicWellPathsImportFileFeature")); - importMenu->addAction(cmdFeatureMgr->action("RicWellPathsImportSsihubFeature")); - importMenu->addAction(cmdFeatureMgr->action("RicWellLogsImportFileFeature")); - - QMenu* exportMenu = fileMenu->addMenu("&Export"); - exportMenu->addAction(m_snapshotToFile); - exportMenu->addAction(m_snapshotAllViewsToFile); - - fileMenu->addSeparator(); - fileMenu->addAction(m_saveProjectAction); - fileMenu->addAction(m_saveProjectAsAction); - - m_recentFilesSeparatorAction = fileMenu->addSeparator(); - for (int i = 0; i < MaxRecentFiles; ++i) - fileMenu->addAction(m_recentFileActions[i]); - - updateRecentFileActions(); - - fileMenu->addSeparator(); - QMenu* testMenu = fileMenu->addMenu("&Testing"); - - fileMenu->addSeparator(); - fileMenu->addAction(m_closeProjectAction); - fileMenu->addSeparator(); - fileMenu->addAction(m_exitAction); - - connect(fileMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshFileActions())); - - // Edit menu - QMenu* editMenu = menuBar()->addMenu("&Edit"); - editMenu->addAction(m_snapshotToClipboard); - editMenu->addSeparator(); - editMenu->addAction(m_editPreferences); - - connect(editMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshEditActions())); - - - // View menu - QMenu* viewMenu = menuBar()->addMenu("&View"); - viewMenu->addAction(m_zoomAll); - viewMenu->addSeparator(); - viewMenu->addAction(m_viewFromSouth); - viewMenu->addAction(m_viewFromNorth); - viewMenu->addAction(m_viewFromWest); - viewMenu->addAction(m_viewFromEast); - viewMenu->addAction(m_viewFromBelow); - viewMenu->addAction(m_viewFromAbove); - - connect(viewMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshViewActions())); - - // Debug menu - testMenu->addAction(m_mockModelAction); - testMenu->addAction(m_mockResultsModelAction); - testMenu->addAction(m_mockLargeResultsModelAction); - testMenu->addAction(m_mockModelCustomizedAction); - testMenu->addAction(m_mockInputModelAction); - testMenu->addSeparator(); - testMenu->addAction(m_createCommandObject); - testMenu->addSeparator(); - testMenu->addAction(m_showRegressionTestDialog); - testMenu->addAction(m_executePaintEventPerformanceTest); - testMenu->addAction(cmdFeatureMgr->action("RicLaunchUnitTestsFeature")); - - // Windows menu - m_windowMenu = menuBar()->addMenu("&Windows"); - connect(m_windowMenu, SIGNAL(aboutToShow()), SLOT(slotBuildWindowActions())); - - // Help menu - QMenu* helpMenu = menuBar()->addMenu("&Help"); - helpMenu->addAction(m_openUsersGuideInBrowserAction); - helpMenu->addAction(m_commandLineHelpAction); - helpMenu->addSeparator(); - helpMenu->addAction(m_aboutAction); + fileMenu->addAction("Close", this, SLOT(close())); } @@ -463,64 +160,12 @@ void RiuMainPlotWindow::createMenus() //-------------------------------------------------------------------------------------------------- void RiuMainPlotWindow::createToolBars() { - caf::CmdFeatureManager* cmdFeatureMgr = caf::CmdFeatureManager::instance(); - CVF_ASSERT(cmdFeatureMgr); - - m_standardToolBar = addToolBar(tr("Standard")); - m_standardToolBar->setObjectName(m_standardToolBar->windowTitle()); - - m_standardToolBar->addAction(cmdFeatureMgr->action("RicImportEclipseCaseFeature")); - m_standardToolBar->addAction(cmdFeatureMgr->action("RicImportInputEclipseCaseFeature")); - m_standardToolBar->addAction(m_openProjectAction); - //m_standardToolBar->addAction(m_openLastUsedProjectAction); - m_standardToolBar->addAction(m_saveProjectAction); - // Snapshots - m_snapshotToolbar = addToolBar(tr("View Snapshots")); - m_snapshotToolbar->setObjectName(m_snapshotToolbar->windowTitle()); - m_snapshotToolbar->addAction(m_snapshotToClipboard); - m_snapshotToolbar->addAction(m_snapshotToFile); - m_snapshotToolbar->addAction(m_snapshotAllViewsToFile); - - // View toolbar - m_viewToolBar = addToolBar(tr("View")); - m_viewToolBar->setObjectName(m_viewToolBar->windowTitle()); - m_viewToolBar->addAction(m_zoomAll); - m_viewToolBar->addAction(m_viewFromNorth); - m_viewToolBar->addAction(m_viewFromSouth); - m_viewToolBar->addAction(m_viewFromEast); - m_viewToolBar->addAction(m_viewFromWest); - m_viewToolBar->addAction(m_viewFromAbove); - m_viewToolBar->addAction(m_viewFromBelow); - m_viewToolBar->addSeparator(); - m_viewToolBar->addAction(cmdFeatureMgr->action("RicLinkVisibleViewsFeature")); - m_viewToolBar->addAction(cmdFeatureMgr->action("RicTileWindowsFeature")); - m_viewToolBar->addSeparator(); - m_viewToolBar->addAction(m_drawStyleLinesAction); - m_viewToolBar->addAction(m_drawStyleLinesSolidAction); - m_viewToolBar->addAction(m_drawStyleSurfOnlyAction); - m_viewToolBar->addAction(m_drawStyleFaultLinesSolidAction); - m_viewToolBar->addAction(m_disableLightingAction); - m_viewToolBar->addAction(m_drawStyleHideGridCellsAction); - m_viewToolBar->addAction(m_toggleFaultsLabelAction); - m_viewToolBar->addAction(m_addWellCellsToRangeFilterAction); - - QLabel* scaleLabel = new QLabel(m_viewToolBar); - scaleLabel->setText("Scale"); - m_viewToolBar->addWidget(scaleLabel); - - m_scaleFactor = new QSpinBox(m_viewToolBar); - m_scaleFactor->setValue(0); - m_viewToolBar->addWidget(m_scaleFactor); - connect(m_scaleFactor, SIGNAL(valueChanged(int)), SLOT(slotScaleChanged(int))); - - // Create animation toolbar - m_animationToolBar = new caf::AnimationToolBar("Animation", this); - addToolBar(m_animationToolBar); - //connect(m_animationToolBar, SIGNAL(signalFrameRateChanged(double)), SLOT(slotFramerateChanged(double))); - - refreshAnimationActions(); - refreshDrawStyleActions(); + QToolBar* toolbar = addToolBar(tr("View Snapshots")); + toolbar->setObjectName(toolbar->windowTitle()); + toolbar->addAction(m_snapshotToClipboard); + toolbar->addAction(m_snapshotToFile); + toolbar->addAction(m_snapshotAllViewsToFile); } @@ -531,7 +176,7 @@ void RiuMainPlotWindow::createToolBars() void RiuMainPlotWindow::createDockPanels() { { - QDockWidget* dockWidget = new QDockWidget("Project Tree", this); + QDockWidget* dockWidget = new QDockWidget("Plot Object Project Tree", this); dockWidget->setObjectName("dockWidget"); dockWidget->setAllowedAreas(Qt::AllDockWidgetAreas); @@ -565,26 +210,6 @@ void RiuMainPlotWindow::createDockPanels() m_projectTreeView->setUiConfigurationName("PlotWindow"); } -/* - { - QDockWidget* dockWidget = new QDockWidget("Undo stack", this); - dockWidget->setObjectName("dockWidget"); - dockWidget->setAllowedAreas(Qt::AllDockWidgetAreas); - - m_undoView = new QUndoView(this); - m_undoView->setStack(caf::CmdExecCommandManager::instance()->undoStack()); - //connect(caf::CmdExecCommandManager::instance()->undoStack(), SIGNAL(indexChanged(int)), SLOT(slotIndexChanged())); - - dockWidget->setWidget(m_undoView); - - addDockWidget(Qt::RightDockWidgetArea, dockWidget); - - dockWidget->hide(); - - //m_windowsMenu->addAction(dockWidget->toggleViewAction()); - } -*/ - { QDockWidget* dockWidget = new QDockWidget("Property Editor", this); dockWidget->setObjectName("dockWidget"); @@ -598,452 +223,10 @@ void RiuMainPlotWindow::createDockPanels() addDockWidget(Qt::LeftDockWidgetArea, dockWidget); } - { - QDockWidget* dockPanel = new QDockWidget("Result Info", this); - dockPanel->setObjectName("dockResultInfoPanel"); - dockPanel->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); - m_resultInfoPanel = new RiuResultInfoPanel(dockPanel); - dockPanel->setWidget(m_resultInfoPanel); - - addDockWidget(Qt::BottomDockWidgetArea, dockPanel); - } - - { - QDockWidget* dockPanel = new QDockWidget("Process Monitor", this); - dockPanel->setObjectName("dockProcessMonitor"); - dockPanel->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); - m_processMonitor = new RiuProcessMonitor(dockPanel); - dockPanel->setWidget(m_processMonitor); - - addDockWidget(Qt::BottomDockWidgetArea, dockPanel); - } - - { - QDockWidget* dockPanel = new QDockWidget("Result Plot", this); - dockPanel->setObjectName("dockTimeHistoryPanel"); - dockPanel->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); - m_resultQwtPlot = new RiuResultQwtPlot(dockPanel); - dockPanel->setWidget(m_resultQwtPlot); - - addDockWidget(Qt::RightDockWidgetArea, dockPanel); - } - setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::setResultInfo(const QString& info) const -{ - m_resultInfoPanel->setInfo(info); -} - -//================================================================================================== -// -// Action slots -// -//================================================================================================== - - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotRefreshFileActions() -{ - RiaApplication* app = RiaApplication::instance(); - - bool projectExists = true; - m_saveProjectAction->setEnabled(projectExists); - m_saveProjectAsAction->setEnabled(projectExists); - m_closeProjectAction->setEnabled(projectExists); - - bool projectFileExists = QFile::exists(app->project()->fileName()); - - caf::CmdFeatureManager* cmdFeatureMgr = caf::CmdFeatureManager::instance(); - CVF_ASSERT(cmdFeatureMgr); - - cmdFeatureMgr->action("RicWellPathsImportSsihubFeature")->setEnabled(projectFileExists); -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotRefreshEditActions() -{ -// RiaApplication* app = RiaApplication::instance(); -// RISceneManager* proj = app->project(); -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotRefreshViewActions() -{ - bool enabled = true; - m_viewFromNorth->setEnabled(enabled); - m_viewFromSouth->setEnabled(enabled); - m_viewFromEast->setEnabled(enabled); - m_viewFromWest->setEnabled(enabled); - m_viewFromAbove->setEnabled(enabled); - m_viewFromBelow->setEnabled(enabled); - - updateScaleValue(); - - caf::CmdFeatureManager::instance()->refreshEnabledState(QStringList() << "RicLinkVisibleViewsFeature" << "RicTileWindowsFeature"); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::refreshAnimationActions() -{ - caf::FrameAnimationControl* animationControl = NULL; - if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer()) - { - animationControl = RiaApplication::instance()->activeReservoirView()->viewer()->animationControl(); - } - - m_animationToolBar->connectAnimationControl(animationControl); - - QStringList timeStepStrings; - - int currentTimeStepIndex = 0; - - bool enableAnimControls = false; - RimView * activeView = RiaApplication::instance()->activeReservoirView(); - if (activeView && - activeView->viewer() && - activeView->viewer()->frameCount()) - { - enableAnimControls = true; - RimEclipseView * activeRiv = dynamic_cast(activeView); - - if (activeRiv) - { - if (activeRiv->currentGridCellResults()) - { - if (activeRiv->isTimeStepDependentDataVisible()) - { - timeStepStrings = activeRiv->eclipseCase()->timeStepStrings(); - } - else - { - timeStepStrings.push_back(tr("Static Property")); - } - } - } - else - { - RimGeoMechView * activeGmv = dynamic_cast(activeView); - if (activeGmv) - { - if (activeGmv->isTimeStepDependentDataVisible()) - { - timeStepStrings = activeGmv->geoMechCase()->timeStepStrings(); - } - } - } - - currentTimeStepIndex = activeView->currentTimeStep(); - - // Animation control is only relevant for more than one time step - - if (timeStepStrings.size() < 2) - { - enableAnimControls = false; - } - - m_animationToolBar->setFrameRate(activeView->maximumFrameRate()); - } - - m_animationToolBar->setTimeStepStrings(timeStepStrings); - m_animationToolBar->setCurrentTimeStepIndex(currentTimeStepIndex); - - m_animationToolBar->setEnabled(enableAnimControls); -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotAbout() -{ - caf::AboutDialog dlg(this); - - dlg.setApplicationName(RI_APPLICATION_NAME); - dlg.setApplicationVersion(RiaApplication::getVersionStringApp(true)); - dlg.setCopyright("Copyright Statoil ASA, Ceetron Solutions AS, Ceetron AS"); - dlg.showQtVersion(false); -#ifdef _DEBUG - dlg.setIsDebugBuild(true); -#endif - - dlg.addVersionEntry(" ", "ResInsight is made available under the GNU General Public License v. 3"); - dlg.addVersionEntry(" ", "See http://www.gnu.org/licenses/gpl.html"); - dlg.addVersionEntry(" ", " "); - dlg.addVersionEntry(" ", " "); - dlg.addVersionEntry(" ", "Technical Information"); - dlg.addVersionEntry(" ", QString(" Qt ") + qVersion()); - dlg.addVersionEntry(" ", QString(" ") + caf::AboutDialog::versionStringForcurrentOpenGLContext()); - dlg.addVersionEntry(" ", caf::Viewer::isShadersSupported() ? " Hardware OpenGL" : " Software OpenGL"); - - dlg.create(); - dlg.resize(300, 200); - - dlg.exec(); -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotImportGeoMechModel() -{ - if (checkForDocumentModifications()) - { - RiaApplication* app = RiaApplication::instance(); - - QString defaultDir = app->defaultFileDialogDirectory("GEOMECH_MODEL"); - QStringList fileNames = QFileDialog::getOpenFileNames(this, "Import Geo-Mechanical Model", defaultDir, "Abaqus results (*.odb)"); - if (fileNames.size()) defaultDir = QFileInfo(fileNames.last()).absolutePath(); - app->setDefaultFileDialogDirectory("GEOMECH_MODEL", defaultDir); - - int i; - for (i = 0; i < fileNames.size(); i++) - { - QString fileName = fileNames[i]; - - if (!fileNames.isEmpty()) - { - if (app->openOdbCaseFromFile(fileName)) - { - addRecentFiles(fileName); - } - } - } - } -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotOpenProject() -{ - if (checkForDocumentModifications()) - { - RiaApplication* app = RiaApplication::instance(); - QString defaultDir = app->defaultFileDialogDirectory("BINARY_GRID"); - QString fileName = QFileDialog::getOpenFileName(this, "Open ResInsight Project", defaultDir, "ResInsight project (*.rsp *.rip);;All files(*.*)"); - - if (fileName.isEmpty()) return; - - // Remember the path to next time - app->setDefaultFileDialogDirectory("BINARY_GRID", QFileInfo(fileName).absolutePath()); - - if (app->loadProject(fileName)) - { - addRecentFiles(fileName); - } - } - -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotOpenLastUsedProject() -{ - RiaApplication* app = RiaApplication::instance(); - QString fileName = app->preferences()->lastUsedProjectFileName; - - if (app->loadProject(fileName)) - { - addRecentFiles(fileName); - } -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotMockModel() -{ - RiaApplication* app = RiaApplication::instance(); - app->createMockModel(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotMockResultsModel() -{ - RiaApplication* app = RiaApplication::instance(); - app->createResultsMockModel(); -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotMockLargeResultsModel() -{ - RiaApplication* app = RiaApplication::instance(); - app->createLargeResultsMockModel(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotMockModelCustomized() -{ - RiaApplication* app = RiaApplication::instance(); - app->createMockModelCustomized(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotInputMockModel() -{ - RiaApplication* app = RiaApplication::instance(); - app->createInputMockModel(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RiuMainPlotWindow::checkForDocumentModifications() -{ -// RiaApplication* app = RiaApplication::instance(); -// RISceneManager* project = app->sceneManager(); -// if (project && project->isModified()) -// { -// QMessageBox msgBox(this); -// msgBox.setIcon(QMessageBox::Warning); -// msgBox.setText("The project has been modified."); -// msgBox.setInformativeText("Do you want to save your changes?"); -// msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel); -// -// int ret = msgBox.exec(); -// if (ret == QMessageBox::Save) -// { -// project->saveAll(); -// } -// else if (ret == QMessageBox::Cancel) -// { -// return false; -// } -// } - - return true; -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotCloseProject() -{ - RiaApplication* app = RiaApplication::instance(); - app->closeProject(true); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotOpenRecentFile() -{ - QAction *action = qobject_cast(sender()); - if (action) - { - QString filename = action->data().toString(); - bool loadingSucceded = false; - - if (filename.contains(".rsp", Qt::CaseInsensitive) || filename.contains(".rip", Qt::CaseInsensitive) ) - { - loadingSucceded = RiaApplication::instance()->loadProject(action->data().toString()); - } - else if ( filename.contains(".egrid", Qt::CaseInsensitive) || filename.contains(".grid", Qt::CaseInsensitive) ) - { - loadingSucceded = RiaApplication::instance()->openEclipseCaseFromFile(filename); - } - else if (filename.contains(".odb", Qt::CaseInsensitive) ) - { - loadingSucceded = RiaApplication::instance()->openOdbCaseFromFile(filename); - } - - if (loadingSucceded) - { - addRecentFiles(filename); - } - else - { - removeRecentFiles(filename); - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::updateRecentFileActions() -{ - QSettings settings; - QStringList files = settings.value("recentFileList").toStringList(); - - int numRecentFiles = qMin(files.size(), (int)MaxRecentFiles); - - for (int i = 0; i < numRecentFiles; ++i) { - QString text = tr("&%1 %2").arg(i + 1).arg(QFileInfo(files[i]).fileName()); - m_recentFileActions[i]->setText(text); - m_recentFileActions[i]->setData(files[i]); - m_recentFileActions[i]->setToolTip(files[i]); - m_recentFileActions[i]->setVisible(true); - } - for (int j = numRecentFiles; j < MaxRecentFiles; ++j) - m_recentFileActions[j]->setVisible(false); - - m_recentFilesSeparatorAction->setVisible(numRecentFiles > 0); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::addRecentFiles(const QString& file) -{ - QSettings settings; - QStringList files = settings.value("recentFileList").toStringList(); - files.removeAll(file); - files.prepend(file); - while (files.size() > MaxRecentFiles) - files.removeLast(); - - settings.setValue("recentFileList", files); - - updateRecentFileActions(); -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::removeRecentFiles(const QString& file) -{ - QSettings settings; - QStringList files = settings.value("recentFileList").toStringList(); - files.removeAll(file); - - settings.setValue("recentFileList", files); - - updateRecentFileActions(); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1071,14 +254,6 @@ QList RiuMainPlotWindow::subWindowList(QMdiArea::WindowOrder ord return m_mdiArea->subWindowList(order); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiuResultQwtPlot* RiuMainPlotWindow::resultPlot() -{ - return m_resultQwtPlot; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1087,11 +262,8 @@ void RiuMainPlotWindow::removeViewer(QWidget* viewer) m_blockSlotSubWindowActivated = true; m_mdiArea->removeSubWindow(findMdiSubWindow(viewer)); m_blockSlotSubWindowActivated = false; - - slotRefreshViewActions(); } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1151,35 +323,8 @@ void RiuMainPlotWindow::addViewer(QWidget* viewer, const RimMdiWindowGeometry& w { subWin->showMaximized(); } - - slotRefreshViewActions(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotSaveProject() -{ - RiaApplication* app = RiaApplication::instance(); - - storeTreeViewState(); - - app->saveProject(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotSaveProjectAs() -{ - RiaApplication* app = RiaApplication::instance(); - - storeTreeViewState(); - - app->saveProjectPromptForFileName(); -} - - //-------------------------------------------------------------------------------------------------- /// This method needs to handle memory deallocation !!! //-------------------------------------------------------------------------------------------------- @@ -1190,96 +335,6 @@ void RiuMainPlotWindow::setPdmRoot(caf::PdmObject* pdmRoot) m_projectTreeView->setPdmItem(pdmRoot); // For debug only : m_projectTreeView->treeView()->expandAll(); m_projectTreeView->setDragDropInterface(m_dragDropInterface); - - for (size_t i = 0; i < additionalProjectViews.size(); i++) - { - if (!additionalProjectViews[i]) continue; - - RiuProjectAndPropertyView* projPropView = dynamic_cast(additionalProjectViews[i]->widget()); - if (projPropView) - { - projPropView->setPdmItem(pdmRoot); - } - } - - caf::SelectionManager::instance()->setPdmRootObject(pdmRoot); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotViewFromNorth() -{ - if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer()) - { - RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(0,-1,0), cvf::Vec3d(0,0,1)); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotViewFromSouth() -{ - if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer()) - { - RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(0,1,0), cvf::Vec3d(0,0,1)); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotViewFromEast() -{ - if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer()) - { - RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(-1,0,0), cvf::Vec3d(0,0,1)); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotViewFromWest() -{ - if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer()) - { - RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(1,0,0), cvf::Vec3d(0,0,1)); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotViewFromAbove() -{ - if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer()) - { - RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(0,0,-1), cvf::Vec3d(0,1,0)); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotViewFromBelow() -{ - if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer()) - { - RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(0,0,1), cvf::Vec3d(0,1,0)); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotZoomAll() -{ - if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer()) - { - RiaApplication::instance()->activeReservoirView()->viewer()->zoomAll(); - } } //-------------------------------------------------------------------------------------------------- @@ -1311,137 +366,6 @@ void RiuMainPlotWindow::slotSubWindowActivated(QMdiSubWindow* subWindow) } RiaApplication::instance()->setActiveWellLogPlot(NULL); - - // Find the activated 3D view - - RimView* activatedView = NULL; - - std::vector allCases; - proj->allCases(allCases); - - for (size_t caseIdx = 0; caseIdx < allCases.size(); ++caseIdx) - { - RimCase* reservoirCase = allCases[caseIdx]; - if (reservoirCase == NULL) continue; - - std::vector views = reservoirCase->views(); - - size_t viewIdx; - for (viewIdx = 0; viewIdx < views.size(); viewIdx++) - { - RimView* riv = views[viewIdx]; - - if (riv && - riv->viewer() && - riv->viewer()->layoutWidget() && - riv->viewer()->layoutWidget()->parent() == subWindow) - { - activatedView = riv; - break; - } - } - } - - { - RimView* previousActiveReservoirView = RiaApplication::instance()->activeReservoirView(); - RiaApplication::instance()->setActiveReservoirView(activatedView); - - if (previousActiveReservoirView != activatedView) - { - QModelIndex newViewModelIndex = m_projectTreeView->findModelIndex(activatedView); - QModelIndex newSelectionIndex = newViewModelIndex; - - if (previousActiveReservoirView) - { - // Try to select the same entry in the new View, as was selected in the previous - - QModelIndex previousViewModelIndex = m_projectTreeView->findModelIndex(previousActiveReservoirView); - QModelIndex currentSelectionIndex = m_projectTreeView->treeView()->selectionModel()->currentIndex(); - - if (currentSelectionIndex != newViewModelIndex && - currentSelectionIndex.isValid()) - { - QVector route; // Contains all model indices from current selection up to previous view - - QModelIndex tmpModelIndex = currentSelectionIndex; - - while (tmpModelIndex.isValid() && tmpModelIndex != previousViewModelIndex) - { - // NB! Add model index to front of vector to be able to do a for-loop with correct ordering - route.push_front(tmpModelIndex); - - tmpModelIndex = tmpModelIndex.parent(); - } - - // Traverse model indices from new view index to currently selected item - int i; - for (i = 0; i < route.size(); i++) - { - QModelIndex tmp = route[i]; - if (newSelectionIndex.isValid()) - { - newSelectionIndex = m_projectTreeView->treeView()->model()->index(tmp.row(), tmp.column(), newSelectionIndex); - } - } - - // Use view model index if anything goes wrong - if (!newSelectionIndex.isValid()) - { - newSelectionIndex = newViewModelIndex; - } - } - } - - m_projectTreeView->treeView()->setCurrentIndex(newSelectionIndex); - if (newSelectionIndex != newViewModelIndex) - { - m_projectTreeView->treeView()->setExpanded(newViewModelIndex, true); - } - - } - - slotRefreshViewActions(); - refreshAnimationActions(); - refreshDrawStyleActions(); - } -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotUseShaders(bool enable) -{ - RiaApplication::instance()->setUseShaders(enable); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotShowPerformanceInfo(bool enable) -{ - RiaApplication::instance()->setShowPerformanceInfo(enable); -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotEditPreferences() -{ - RiaApplication* app = RiaApplication::instance(); - caf::PdmUiPropertyViewDialog propertyDialog(this, app->preferences(), "Preferences", ""); - if (propertyDialog.exec() == QDialog::Accepted) - { - // Write preferences using QSettings and apply them to the application - caf::PdmSettings::writeFieldsToApplicationStore(app->preferences()); - app->applyPreferences(); - } - else - { - // Read back currently stored values using QSettings - caf::PdmSettings::readFieldsFromApplicationStore(app->preferences()); - } } //-------------------------------------------------------------------------------------------------- @@ -1457,34 +381,12 @@ void RiuMainPlotWindow::setActiveViewer(QWidget* viewer) m_blockSlotSubWindowActivated = false; } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotFramerateChanged(double frameRate) -{ - if (RiaApplication::instance()->activeReservoirView() != NULL) - { - caf::PdmUiFieldHandle* uiFieldHandle = RiaApplication::instance()->activeReservoirView()->maximumFrameRate.uiCapability(); - uiFieldHandle->setValueFromUi(QVariant(frameRate)); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RiuProcessMonitor* RiuMainPlotWindow::processMonitor() -{ - return m_processMonitor; -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RiuMainPlotWindow::slotBuildWindowActions() { m_windowMenu->clear(); - m_windowMenu->addAction(m_newPropertyView); - m_windowMenu->addSeparator(); QList dockWidgets = findChildren(); @@ -1539,54 +441,28 @@ void RiuMainPlotWindow::selectedObjectsChanged() if (!firstSelectedObject) return; - // First check if we are within a RimView - RimView* selectedReservoirView = dynamic_cast(firstSelectedObject); - if (!selectedReservoirView) - { - firstSelectedObject->firstAnchestorOrThisOfType(selectedReservoirView); - } - bool isActiveViewChanged = false; - RimWellLogPlot* selectedWellLogPlot = NULL; + RimWellLogPlot* selectedWellLogPlot = dynamic_cast(firstSelectedObject); - if (selectedReservoirView) + if (!selectedWellLogPlot) { - // Set focus in MDI area to this window if it exists - if (selectedReservoirView->viewer()) + firstSelectedObject->firstAnchestorOrThisOfType(selectedWellLogPlot); + } + + if (selectedWellLogPlot) + { + if (selectedWellLogPlot->viewer()) { - setActiveViewer(selectedReservoirView->viewer()->layoutWidget()); + setActiveViewer(selectedWellLogPlot->viewer()); + } isActiveViewChanged = true; } - else // Check if we are winthin a Well Log plot - { - selectedWellLogPlot = dynamic_cast(firstSelectedObject); - if (!selectedWellLogPlot) - { - firstSelectedObject->firstAnchestorOrThisOfType(selectedWellLogPlot); - } - - if (selectedWellLogPlot) - { - if (selectedWellLogPlot->viewer()) - { - setActiveViewer(selectedWellLogPlot->viewer()); - - } - isActiveViewChanged = true; - } - } if (isActiveViewChanged) { - RiaApplication::instance()->setActiveReservoirView(selectedReservoirView); RiaApplication::instance()->setActiveWellLogPlot(selectedWellLogPlot); - refreshDrawStyleActions(); - refreshAnimationActions(); - slotRefreshFileActions(); - slotRefreshEditActions(); - slotRefreshViewActions(); // The only way to get to this code is by selection change initiated from the project tree view // As we are activating an MDI-window, the focus is given to this MDI-window @@ -1596,25 +472,6 @@ void RiuMainPlotWindow::selectedObjectsChanged() } } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotNewObjectPropertyView() -{ - QDockWidget* dockWidget = new QDockWidget(QString("Additional Project Tree (%1)").arg(additionalProjectViews.size() + 1), this); - dockWidget->setObjectName("dockWidget"); - dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); - - RiuProjectAndPropertyView* projPropView = new RiuProjectAndPropertyView(dockWidget); - dockWidget->setWidget(projPropView); - projPropView->setPdmItem(m_pdmRoot); - - addDockWidget(Qt::RightDockWidgetArea, dockWidget); - - additionalProjectViews.push_back(dockWidget); -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1660,154 +517,6 @@ void RiuMainPlotWindow::hideAllDockWindows() } } - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -/*void RiuMainPlotWindow::slotOpenMultipleCases() -{ -#if 1 - QAction* action = caf::CmdFeatureManager::instance()->action("RicCreateGridCaseGroupFeature"); - CVF_ASSERT(action); - - action->trigger(); - -#else // Code to fast generate a test project - RiaApplication* app = RiaApplication::instance(); - - QStringList gridFileNames; - - if (1) - { - gridFileNames += RimDefines::mockModelBasicWithResults(); - gridFileNames += RimDefines::mockModelBasicWithResults(); - gridFileNames += RimDefines::mockModelBasicWithResults(); - } - else - { - gridFileNames += "d:/Models/Statoil/MultipleRealisations/Case_with_10_timesteps/Real0/BRUGGE_0000.EGRID"; - gridFileNames += "d:/Models/Statoil/MultipleRealisations/Case_with_10_timesteps/Real10/BRUGGE_0010.EGRID"; - gridFileNames += "d:/Models/Statoil/MultipleRealisations/Case_with_10_timesteps/Real30/BRUGGE_0030.EGRID"; - gridFileNames += "d:/Models/Statoil/MultipleRealisations/Case_with_10_timesteps/Real40/BRUGGE_0040.EGRID"; - } - - app->addEclipseCases(gridFileNames); -#endif - -} -*/ -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotDrawStyleChanged(QAction* activatedAction) -{ - if (!RiaApplication::instance()->activeReservoirView()) return; - - if (activatedAction == m_drawStyleLinesAction) - { - RiaApplication::instance()->activeReservoirView()->setMeshOnlyDrawstyle(); - } - else if (activatedAction == m_drawStyleLinesSolidAction) - { - RiaApplication::instance()->activeReservoirView()->setMeshSurfDrawstyle(); - } - else if (activatedAction == m_drawStyleSurfOnlyAction) - { - RiaApplication::instance()->activeReservoirView()->setSurfOnlyDrawstyle(); - } - else if (activatedAction == m_drawStyleFaultLinesSolidAction) - { - RiaApplication::instance()->activeReservoirView()->setFaultMeshSurfDrawstyle(); - } - -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotToggleHideGridCellsAction(bool hideGridCells) -{ - if (!RiaApplication::instance()->activeReservoirView()) return; - - RiaApplication::instance()->activeReservoirView()->showGridCells(!hideGridCells); -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotToggleFaultLabelsAction(bool showLabels) -{ - RimEclipseView* activeRiv = dynamic_cast(RiaApplication::instance()->activeReservoirView()); - if (!activeRiv) return; - - caf::PdmUiFieldHandle* uiFieldHandle = activeRiv->faultCollection->showFaultLabel.uiCapability(); - uiFieldHandle->setValueFromUi(showLabels); - - refreshDrawStyleActions(); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::refreshDrawStyleActions() -{ - RimView* view = RiaApplication::instance()->activeReservoirView(); - bool enable = view != NULL; - - m_drawStyleLinesAction->setEnabled(enable); - m_drawStyleLinesSolidAction->setEnabled(enable); - m_drawStyleSurfOnlyAction->setEnabled(enable); - m_drawStyleFaultLinesSolidAction->setEnabled(enable); - m_disableLightingAction->setEnabled(enable); - - bool lightingDisabledInView = view ? view->isLightingDisabled() : false; - - m_disableLightingAction->blockSignals(true); - m_disableLightingAction->setChecked(lightingDisabledInView); - m_disableLightingAction->blockSignals(false); - - if (enable) - { - m_drawStyleHideGridCellsAction->setEnabled(true); - } - - RimEclipseView* eclView = dynamic_cast(view); - enable = enable && eclView; - - m_toggleFaultsLabelAction->setEnabled(enable); - m_addWellCellsToRangeFilterAction->setEnabled(enable); - - if (enable) - { - m_drawStyleHideGridCellsAction->blockSignals(true); - m_drawStyleHideGridCellsAction->setChecked(!eclView->isGridVisualizationMode()); - m_drawStyleHideGridCellsAction->blockSignals(false); - - m_toggleFaultsLabelAction->blockSignals(true); - m_toggleFaultsLabelAction->setChecked(eclView->faultCollection()->showFaultLabel()); - m_toggleFaultsLabelAction->blockSignals(false); - - m_addWellCellsToRangeFilterAction->blockSignals(true); - m_addWellCellsToRangeFilterAction->setChecked(eclView->wellCollection()->wellCellsToRangeFilterMode() != RimEclipseWellCollection::RANGE_ADD_NONE); - m_addWellCellsToRangeFilterAction->blockSignals(false); - } -} - - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotDisableLightingAction(bool disable) -{ - RimView* view = RiaApplication::instance()->activeReservoirView(); - if (view) - { - view->disableLighting(disable); - } -} - - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -1859,143 +568,6 @@ void RiuMainPlotWindow::selectAsCurrentItem(caf::PdmObject* object) m_projectTreeView->selectAsCurrentItem(object); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotScaleChanged(int scaleValue) -{ - if (RiaApplication::instance()->activeReservoirView()) - { - caf::PdmUiFieldHandle* uiFieldHandle = RiaApplication::instance()->activeReservoirView()->scaleZ.uiCapability(); - uiFieldHandle->setValueFromUi(scaleValue); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::updateScaleValue() -{ - if (RiaApplication::instance()->activeReservoirView()) - { - m_scaleFactor->setEnabled(true); - - int scaleValue = static_cast(RiaApplication::instance()->activeReservoirView()->scaleZ()); // Round down is probably ok. - m_scaleFactor->blockSignals(true); - m_scaleFactor->setValue(scaleValue); - m_scaleFactor->blockSignals(false); - } - else - { - m_scaleFactor->setEnabled(false); - } -} - -//-------------------------------------------------------------------------------------------------- -/// TODO: This function will be moved to a class responsible for handling the application selection concept -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::selectedCases(std::vector& cases) -{ - caf::SelectionManager::instance()->objectsByType(&cases); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotShowCommandLineHelp() -{ - RiaApplication* app = RiaApplication::instance(); - QString text = app->commandLineParameterHelp(); - app->showFormattedTextInMessageBox(text); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotCreateCommandObject() -{ - RiaApplication* app = RiaApplication::instance(); - if (!app->project()) return; - - std::vector selectedUiItems; - m_projectTreeView->selectedUiItems(selectedUiItems); - - caf::PdmObjectGroup selectedObjects; - for (size_t i = 0; i < selectedUiItems.size(); ++i) - { - caf::PdmUiObjectHandle* uiObj = dynamic_cast(selectedUiItems[i]); - if (uiObj) - { - selectedObjects.addObject(uiObj->objectHandle()); - } - } - - if (selectedObjects.objects.size()) - { - std::vector commandObjects; - RimCommandFactory::createCommandObjects(selectedObjects, &commandObjects); - - for (size_t i = 0; i < commandObjects.size(); i++) - { - app->project()->commandObjects.push_back(commandObjects[i]); - } - - app->project()->updateConnectedEditors(); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotShowRegressionTestDialog() -{ - RiaRegressionTest regTestConfig; - - RiaApplication* app = RiaApplication::instance(); - caf::PdmSettings::readFieldsFromApplicationStore(®TestConfig); - - caf::PdmUiPropertyViewDialog regressionTestDialog(this, ®TestConfig, "Regression Test", ""); - if (regressionTestDialog.exec() == QDialog::Accepted) - { - // Write preferences using QSettings and apply them to the application - caf::PdmSettings::writeFieldsToApplicationStore(®TestConfig); - - QString currentApplicationPath = QDir::currentPath(); - - QDir::setCurrent(regTestConfig.applicationWorkingFolder); - app->executeRegressionTests(regTestConfig.regressionTestFolder); - - QDir::setCurrent(currentApplicationPath); - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotExecutePaintEventPerformanceTest() -{ - - if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer()) - { - size_t redrawCount = 50; - - caf::Viewer* viewer = RiaApplication::instance()->activeReservoirView()->viewer(); - - cvf::Timer timer; - for (size_t i = 0; i < redrawCount; i++) - { - viewer->repaint(); - } - - double totalTimeMS = timer.time() * 1000.0; - - double msPerFrame = totalTimeMS / redrawCount; - - QString resultInfo = QString("Total time '%1 ms' for %2 number of redraws, frame time '%3 ms'").arg(totalTimeMS).arg(redrawCount).arg(msPerFrame); - setResultInfo(resultInfo); - } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -2004,39 +576,6 @@ void RiuMainPlotWindow::setDefaultWindowSize() resize(1000, 810); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotAddWellCellsToRangeFilterAction(bool doAdd) -{ - RimEclipseView* riv = dynamic_cast(RiaApplication::instance()->activeReservoirView()); - if (riv) - { - caf::AppEnum rangeAddType; - rangeAddType = doAdd ? RimEclipseWellCollection::RANGE_ADD_INDIVIDUAL : RimEclipseWellCollection::RANGE_ADD_NONE; - - caf::PdmUiFieldHandle* pdmUiFieldHandle = riv->wellCollection()->wellCellsToRangeFilterMode.uiCapability(); - if (pdmUiFieldHandle) - { - pdmUiFieldHandle->setValueFromUi(static_cast(rangeAddType.index())); - } - } -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RiuMainPlotWindow::slotOpenUsersGuideInBrowserAction() -{ - QString usersGuideUrl = "http://resinsight.org/docs/home"; - - if (!QDesktopServices::openUrl(usersGuideUrl)) - { - QErrorMessage* errorHandler = QErrorMessage::qtHandler(); - errorHandler->showMessage("Failed open browser with the following url\n\n" + usersGuideUrl); - } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuMainPlotWindow.h b/ApplicationCode/UserInterface/RiuMainPlotWindow.h index d50ce37348..a40943a8ac 100644 --- a/ApplicationCode/UserInterface/RiuMainPlotWindow.h +++ b/ApplicationCode/UserInterface/RiuMainPlotWindow.h @@ -20,45 +20,21 @@ #include "RiuMainWindowBase.h" -#include -#include #include -class QActionGroup; -class QComboBox; -class QFrame; -class QItemSelection; -class QLabel; -class QLineEdit; class QMdiSubWindow; -class QSpinBox; -class QTreeView; -class QUndoView; -class RimCase; -class RimEclipseCase; -class RiuProcessMonitor; -class RiuResultInfoPanel; class RiuViewer; -class RiuWellLogPlot; -class RiuResultQwtPlot; + struct RimMdiWindowGeometry; namespace caf { - class PdmUiTreeView; - class AnimationToolBar; - class FrameAnimationControl; - class PdmObject; - class PdmUiPropertyView; - class UiPropertyCreatorPdm; - class PdmUiItem; - class PdmUiDragDropInterface; -} - -namespace ssihub -{ - class Interface; + class PdmUiTreeView; + class PdmObject; + class PdmUiPropertyView; + class PdmUiItem; + class PdmUiDragDropInterface; } //================================================================================================== @@ -83,29 +59,16 @@ public: void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry); void setActiveViewer(QWidget* subWindow); - void setResultInfo(const QString& info) const; - - void refreshAnimationActions(); - void updateScaleValue(); - caf::PdmUiTreeView* projectTreeView() { return m_projectTreeView;} - RiuProcessMonitor* processMonitor(); void hideAllDockWindows(); void selectAsCurrentItem(caf::PdmObject* object); - void selectedCases(std::vector& cases); - void setDefaultWindowSize(); - void refreshDrawStyleActions(); - void setExpanded(const caf::PdmUiItem* uiItem, bool expanded); - void addRecentFiles(const QString& file); - void removeRecentFiles(const QString& file); - RimMdiWindowGeometry windowGeometryForViewer(QWidget* viewer); RimMdiWindowGeometry windowGeometryForWidget(QWidget* widget); @@ -114,8 +77,6 @@ public: QMdiSubWindow* findMdiSubWindow(QWidget* viewer); QList subWindowList(QMdiArea::WindowOrder order); - RiuResultQwtPlot* resultPlot(); - protected: virtual void closeEvent(QCloseEvent* event); @@ -125,10 +86,6 @@ private: void createToolBars(); void createDockPanels(); - bool checkForDocumentModifications(); - - void updateRecentFileActions(); - void storeTreeViewState(); void restoreTreeViewState(); @@ -136,70 +93,12 @@ private: QByteArray m_initialDockAndToolbarLayout; // Initial dock window and toolbar layout, used to reset GUI private: - // File actions - QAction* m_importGeoMechCaseAction; - QAction* m_openProjectAction; - QAction* m_openLastUsedProjectAction; - QAction* m_saveProjectAction; - QAction* m_saveProjectAsAction; - QAction* m_closeProjectAction; - QAction* m_exitAction; - - // Recent files - enum { MaxRecentFiles = 5 }; - QAction* m_recentFilesSeparatorAction; - QMenu* m_recentFilesMenu; - QAction* m_recentFileActions[MaxRecentFiles]; - - - // Edit actions - QAction* m_editPreferences; - QAction* m_newPropertyView; - - // View actions - QAction* m_viewFromNorth; - QAction* m_viewFromSouth; - QAction* m_viewFromEast; - QAction* m_viewFromWest; - QAction* m_viewFromAbove; - QAction* m_viewFromBelow; - QAction* m_zoomAll; - - // Mock actions - QAction* m_mockModelAction; - QAction* m_mockResultsModelAction; - QAction* m_mockLargeResultsModelAction; - QAction* m_mockModelCustomizedAction; - QAction* m_mockInputModelAction; - QAction* m_snapshotToFile; QAction* m_snapshotToClipboard; QAction* m_snapshotAllViewsToFile; - QAction* m_createCommandObject; - QAction* m_showRegressionTestDialog; - QAction* m_executePaintEventPerformanceTest; - - // Help actions - QAction* m_aboutAction; - QAction* m_commandLineHelpAction; - QAction* m_openUsersGuideInBrowserAction; - - // Animation - caf::AnimationToolBar* m_animationToolBar; - - // Toolbars - QToolBar* m_viewToolBar; - QToolBar* m_standardToolBar; - QToolBar* m_snapshotToolbar; - - QMdiArea* m_mdiArea; RiuViewer* m_mainViewer; - RiuResultInfoPanel* m_resultInfoPanel; - RiuProcessMonitor* m_processMonitor; - - RiuResultQwtPlot* m_resultQwtPlot; QMenu* m_windowMenu; @@ -209,81 +108,20 @@ private slots: friend class RiuMdiSubWindow; - // File slots - void slotImportGeoMechModel(); - void slotOpenProject(); - void slotOpenLastUsedProject(); - void slotSaveProject(); - void slotSaveProjectAs(); - void slotCloseProject(); - - void slotOpenRecentFile(); - - void slotRefreshFileActions(); - - // Edit slots - void slotRefreshEditActions(); - void slotEditPreferences(); - void slotNewObjectPropertyView(); - - // View slots - void slotRefreshViewActions(); - void slotViewFromNorth(); - void slotViewFromSouth(); - void slotViewFromEast(); - void slotViewFromWest(); - void slotViewFromAbove(); - void slotViewFromBelow(); - void slotZoomAll(); - void slotScaleChanged(int scaleValue); - - void slotDrawStyleChanged(QAction* activatedAction); - void slotToggleHideGridCellsAction(bool); - void slotToggleFaultLabelsAction(bool); - void slotDisableLightingAction(bool); - - void slotAddWellCellsToRangeFilterAction(bool doAdd); - - // Debug slots - void slotUseShaders(bool enable); - void slotShowPerformanceInfo(bool enable); - void slotSnapshotToFile(); void slotSnapshotToClipboard(); void slotSnapshotAllViewsToFile(); - void slotCreateCommandObject(); - - void slotShowRegressionTestDialog(); - void slotExecutePaintEventPerformanceTest(); - - // Mock models - void slotMockModel(); - void slotMockResultsModel(); - void slotMockLargeResultsModel(); - void slotMockModelCustomized(); - void slotInputMockModel(); - - // Windows slots void slotBuildWindowActions(); - // Help slots - void slotAbout(); - void slotShowCommandLineHelp(); - void slotOpenUsersGuideInBrowserAction(); - void slotSubWindowActivated(QMdiSubWindow* subWindow); void selectedObjectsChanged(); void customMenuRequested(const QPoint& pos); - - // Animation slots - void slotFramerateChanged(double frameRate); - - // Pdm System : public: void setPdmRoot(caf::PdmObject* pdmRoot); + private: caf::PdmUiTreeView* m_projectTreeView; @@ -292,19 +130,5 @@ private: caf::PdmObject* m_pdmRoot; caf::PdmUiPropertyView* m_pdmUiPropertyView; - QSpinBox* m_scaleFactor; - - QActionGroup* m_dsActionGroup; - QAction* m_disableLightingAction; - QAction* m_drawStyleHideGridCellsAction; - QAction* m_toggleFaultsLabelAction; - QAction* m_drawStyleLinesAction; - QAction* m_drawStyleLinesSolidAction; - QAction* m_drawStyleFaultLinesSolidAction; - QAction* m_drawStyleSurfOnlyAction; - QAction* m_addWellCellsToRangeFilterAction; - - std::vector > additionalProjectViews; - bool m_blockSlotSubWindowActivated; }; diff --git a/ApplicationCode/UserInterface/RiuMdiSubWindow.cpp b/ApplicationCode/UserInterface/RiuMdiSubWindow.cpp index 07ee5e7cf3..8b7ce8911f 100644 --- a/ApplicationCode/UserInterface/RiuMdiSubWindow.cpp +++ b/ApplicationCode/UserInterface/RiuMdiSubWindow.cpp @@ -44,11 +44,6 @@ RiuMdiSubWindow::RiuMdiSubWindow(QWidget* parent /*= 0*/, Qt::WindowFlags flags RiuMdiSubWindow::~RiuMdiSubWindow() { RiuMainWindow::instance()->slotRefreshViewActions(); - - if (RiaApplication::instance()->mainPlotWindow()) - { - RiaApplication::instance()->mainPlotWindow()->slotRefreshViewActions(); - } } //--------------------------------------------------------------------------------------------------