2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2013-03-22 10:12:00 -05:00
|
|
|
#include "RiaStdInclude.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-03-22 11:30:50 -05:00
|
|
|
#include "RiuMainWindow.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "RiaApplication.h"
|
|
|
|
|
|
|
|
#include "RimProject.h"
|
2013-06-06 08:07:31 -05:00
|
|
|
#include "RimAnalysisModels.h"
|
|
|
|
#include "RimOilField.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "RimReservoirView.h"
|
|
|
|
#include "RimUiTreeView.h"
|
|
|
|
#include "RimCase.h"
|
|
|
|
#include "RimResultSlot.h"
|
|
|
|
#include "RimCellPropertyFilterCollection.h"
|
|
|
|
#include "RimWellCollection.h"
|
|
|
|
#include "RimReservoirCellResultsCacher.h"
|
|
|
|
#include "RimCaseCollection.h"
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
Known problems:
- Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later.
p4#: 21658
2013-05-16 07:10:22 -05:00
|
|
|
#include "RimWellPathCollection.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
|
|
|
|
#include "RimUiTreeModelPdm.h"
|
|
|
|
|
|
|
|
#include "RiaBaseDefs.h"
|
2013-03-22 11:30:50 -05:00
|
|
|
#include "RiuViewer.h"
|
|
|
|
#include "RiuResultInfoPanel.h"
|
|
|
|
#include "RiuProcessMonitor.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "RiuMultiCaseImportDialog.h"
|
|
|
|
|
2013-03-22 10:24:42 -05:00
|
|
|
#include "RiaPreferences.h"
|
2013-03-22 11:30:50 -05:00
|
|
|
#include "RiuPreferencesDialog.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-03-22 10:58:44 -05:00
|
|
|
#include "RigCaseCellResultsData.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "cafAnimationToolBar.h"
|
|
|
|
#include "cafPdmUiPropertyView.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cvfqtBasicAboutDialog.h"
|
2013-09-30 00:56:47 -05:00
|
|
|
#include "cvfTimer.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "cafPdmFieldCvfMat4d.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "RimIdenticalGridCaseGroup.h"
|
|
|
|
#include "RimScriptCollection.h"
|
|
|
|
#include "RimCellEdgeResultSlot.h"
|
|
|
|
#include "RimCellRangeFilterCollection.h"
|
|
|
|
#include "Rim3dOverlayInfoConfig.h"
|
2013-09-06 06:06:39 -05:00
|
|
|
#include "RiuWellImportWizard.h"
|
2013-09-12 01:11:56 -05:00
|
|
|
#include "RimCalcScript.h"
|
2013-10-24 02:50:16 -05:00
|
|
|
#include "RimTools.h"
|
2013-09-27 03:04:10 -05:00
|
|
|
#include "RiaRegressionTest.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
///
|
2013-03-22 11:30:50 -05:00
|
|
|
/// \class RiuMainWindow
|
2012-05-18 02:45:23 -05:00
|
|
|
///
|
|
|
|
/// Contains our main window
|
|
|
|
///
|
|
|
|
//==================================================================================================
|
|
|
|
|
|
|
|
|
2013-03-22 11:17:56 -05:00
|
|
|
RiuMainWindow* RiuMainWindow::sm_mainWindowInstance = NULL;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
RiuMainWindow::RiuMainWindow()
|
2012-05-18 02:45:23 -05:00
|
|
|
: m_treeView(NULL),
|
|
|
|
m_pdmRoot(NULL),
|
|
|
|
m_mainViewer(NULL),
|
|
|
|
m_windowMenu(NULL)
|
|
|
|
{
|
|
|
|
CVF_ASSERT(sm_mainWindowInstance == NULL);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
m_CentralFrame = new QFrame;
|
|
|
|
QHBoxLayout* frameLayout = new QHBoxLayout(m_CentralFrame);
|
|
|
|
setCentralWidget(m_CentralFrame);
|
|
|
|
#else
|
|
|
|
m_mdiArea = new QMdiArea;
|
|
|
|
connect(m_mdiArea, SIGNAL(subWindowActivated ( QMdiSubWindow *)), SLOT(slotSubWindowActivated(QMdiSubWindow*)));
|
|
|
|
setCentralWidget(m_mdiArea);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//m_mainViewer = createViewer();
|
|
|
|
|
|
|
|
|
|
|
|
m_treeModelPdm = new RimUiTreeModelPdm(this);
|
|
|
|
|
|
|
|
createActions();
|
|
|
|
createMenus();
|
|
|
|
createToolBars();
|
|
|
|
createDockPanels();
|
|
|
|
|
|
|
|
// Store the layout so we can offer reset option
|
|
|
|
m_initialDockAndToolbarLayout = saveState(0);
|
|
|
|
loadWinGeoAndDockToolBarLayout();
|
|
|
|
|
|
|
|
sm_mainWindowInstance = this;
|
|
|
|
|
|
|
|
slotRefreshFileActions();
|
|
|
|
slotRefreshEditActions();
|
|
|
|
|
|
|
|
// Set pdm root so scripts are displayed
|
2013-03-22 09:50:44 -05:00
|
|
|
setPdmRoot(RiaApplication::instance()->project());
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
RiuMainWindow* RiuMainWindow::instance()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
return sm_mainWindowInstance;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::initializeGuiNewProjectLoaded()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-06-14 04:59:56 -05:00
|
|
|
setPdmRoot(RiaApplication::instance()->project());
|
|
|
|
restoreTreeViewState();
|
2012-05-18 02:45:23 -05:00
|
|
|
slotRefreshFileActions();
|
|
|
|
slotRefreshEditActions();
|
2013-04-26 04:49:37 -05:00
|
|
|
slotRefreshViewActions();
|
2012-05-18 02:45:23 -05:00
|
|
|
refreshAnimationActions();
|
2013-04-18 08:10:57 -05:00
|
|
|
refreshDrawStyleActions();
|
2013-09-13 02:17:57 -05:00
|
|
|
|
|
|
|
m_processMonitor->slotClearTextEdit();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::cleanupGuiBeforeProjectClose()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
setPdmRoot(NULL);
|
|
|
|
setResultInfo("");
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
if (m_pdmUiPropertyView)
|
|
|
|
{
|
|
|
|
m_pdmUiPropertyView->showProperties(NULL);
|
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
m_processMonitor->startMonitorWorkProcess(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::closeEvent(QCloseEvent* event)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
if (!RiaApplication::instance()->closeProject(true))
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
event->ignore();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
saveWinGeoAndDockToolBarLayout();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
event->accept();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::createActions()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
// File actions
|
|
|
|
m_openProjectAction = new QAction(style()->standardIcon(QStyle::SP_DirOpenIcon), "&Open Project", this);
|
|
|
|
m_openLastUsedProjectAction = new QAction("Open &Last Used Project", this);
|
2013-10-18 09:23:31 -05:00
|
|
|
|
|
|
|
m_importEclipseCaseAction = new QAction(QIcon(":/Case48x48.png"), "Import &Eclipse Case", this);
|
|
|
|
m_importInputEclipseFileAction= new QAction(QIcon(":/EclipseInput48x48.png"), "Import &Input Eclipse Case", this);
|
|
|
|
m_openMultipleEclipseCasesAction = new QAction(QIcon(":/CreateGridCaseGroup16x16.png"), "&Create Grid Case Group from Files", this);
|
|
|
|
|
|
|
|
m_importWellPathsFromFileAction = new QAction(QIcon(":/Well.png"), "Import &Well Paths from File", this);
|
2013-06-18 04:56:51 -05:00
|
|
|
m_importWellPathsFromSSIHubAction = new QAction(QIcon(":/WellCollection.png"),"Import Well Paths from &SSI-hub", this);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
m_mockModelAction = new QAction("&Mock Model", this);
|
|
|
|
m_mockResultsModelAction = new QAction("Mock Model With &Results", this);
|
|
|
|
m_mockLargeResultsModelAction = new QAction("Large Mock Model", this);
|
2012-06-26 09:10:41 -05:00
|
|
|
m_mockInputModelAction = new QAction("Input Mock Model", this);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-17 03:59:34 -05:00
|
|
|
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);
|
2013-02-06 04:43:26 -06:00
|
|
|
|
2013-09-12 01:11:56 -05:00
|
|
|
m_createCommandObject = new QAction("Create Command Object", this);
|
2013-09-27 03:04:10 -05:00
|
|
|
m_showRegressionTestDialog = new QAction("Regression Test Dialog", this);
|
2013-09-30 00:56:47 -05:00
|
|
|
m_executePaintEventPerformanceTest = new QAction("&Paint Event Performance Test", this);
|
2013-09-12 01:11:56 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
m_saveProjectAction = new QAction(QIcon(":/Save.png"), "&Save Project", this);
|
|
|
|
m_saveProjectAsAction = new QAction(QIcon(":/Save.png"), "Save Project &As", this);
|
|
|
|
|
2013-04-17 03:59:34 -05:00
|
|
|
m_closeProjectAction = new QAction("&Close Project", this);
|
2012-05-18 02:45:23 -05:00
|
|
|
m_exitAction = new QAction("E&xit", this);
|
|
|
|
|
2013-10-18 09:23:31 -05:00
|
|
|
connect(m_openProjectAction, SIGNAL(triggered()), SLOT(slotOpenProject()));
|
|
|
|
connect(m_openLastUsedProjectAction, SIGNAL(triggered()), SLOT(slotOpenLastUsedProject()));
|
|
|
|
connect(m_importEclipseCaseAction, SIGNAL(triggered()), SLOT(slotImportEclipseCase()));
|
|
|
|
connect(m_importInputEclipseFileAction, SIGNAL(triggered()), SLOT(slotImportInputEclipseFiles()));
|
|
|
|
connect(m_openMultipleEclipseCasesAction, SIGNAL(triggered()), SLOT(slotOpenMultipleCases()));
|
|
|
|
connect(m_importWellPathsFromFileAction, SIGNAL(triggered()), SLOT(slotImportWellPathsFromFile()));
|
|
|
|
connect(m_importWellPathsFromSSIHubAction, SIGNAL(triggered()), SLOT(slotImportWellPathsFromSSIHub()));
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
connect(m_mockModelAction, SIGNAL(triggered()), SLOT(slotMockModel()));
|
|
|
|
connect(m_mockResultsModelAction, SIGNAL(triggered()), SLOT(slotMockResultsModel()));
|
|
|
|
connect(m_mockLargeResultsModelAction, SIGNAL(triggered()), SLOT(slotMockLargeResultsModel()));
|
2012-06-26 09:10:41 -05:00
|
|
|
connect(m_mockInputModelAction, SIGNAL(triggered()), SLOT(slotInputMockModel()));
|
2013-02-06 04:43:26 -06:00
|
|
|
|
|
|
|
connect(m_snapshotToFile, SIGNAL(triggered()), SLOT(slotSnapshotToFile()));
|
|
|
|
connect(m_snapshotToClipboard, SIGNAL(triggered()), SLOT(slotSnapshotToClipboard()));
|
|
|
|
connect(m_snapshotAllViewsToFile, SIGNAL(triggered()), SLOT(slotSnapshotAllViewsToFile()));
|
2013-09-12 01:11:56 -05:00
|
|
|
|
|
|
|
connect(m_createCommandObject, SIGNAL(triggered()), SLOT(slotCreateCommandObject()));
|
2013-09-27 03:04:10 -05:00
|
|
|
connect(m_showRegressionTestDialog, SIGNAL(triggered()), SLOT(slotShowRegressionTestDialog()));
|
2013-09-30 00:56:47 -05:00
|
|
|
connect(m_executePaintEventPerformanceTest, SIGNAL(triggered()), SLOT(slotExecutePaintEventPerformanceTest()));
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
connect(m_saveProjectAction, SIGNAL(triggered()), SLOT(slotSaveProject()));
|
|
|
|
connect(m_saveProjectAsAction, SIGNAL(triggered()), SLOT(slotSaveProjectAs()));
|
|
|
|
|
2013-04-17 03:59:34 -05:00
|
|
|
connect(m_closeProjectAction, SIGNAL(triggered()), SLOT(slotCloseProject()));
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
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");
|
|
|
|
|
2013-03-07 09:47:42 -06:00
|
|
|
m_zoomAll = new QAction(QIcon(":/ZoomAll16x16.png"),"Zoom all", this);
|
2012-05-18 02:45:23 -05:00
|
|
|
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
|
2013-04-17 03:59:34 -05:00
|
|
|
m_newPropertyView = new QAction("New Project and Property View", this);
|
2012-06-26 09:10:41 -05:00
|
|
|
connect(m_newPropertyView, SIGNAL(triggered()), SLOT(slotNewObjectPropertyView()));
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// Help actions
|
|
|
|
m_aboutAction = new QAction("&About", this);
|
|
|
|
connect(m_aboutAction, SIGNAL(triggered()), SLOT(slotAbout()));
|
2013-08-08 04:09:18 -05:00
|
|
|
m_commandLineHelpAction = new QAction("&Command Line Help", this);
|
|
|
|
connect(m_commandLineHelpAction, SIGNAL(triggered()), SLOT(slotShowCommandLineHelp()));
|
2013-10-24 03:46:57 -05:00
|
|
|
m_openUsersGuideInBrowserAction = new QAction("&Users Guide", this);
|
|
|
|
connect(m_openUsersGuideInBrowserAction, SIGNAL(triggered()), SLOT(slotOpenUsersGuideInBrowserAction()));
|
2013-04-18 08:10:57 -05:00
|
|
|
|
|
|
|
// 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_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*)));
|
2013-10-18 04:19:49 -05:00
|
|
|
|
2013-04-18 08:10:57 -05:00
|
|
|
|
|
|
|
m_drawStyleToggleFaultsAction = new QAction( QIcon(":/draw_style_faults_24x24.png"), "&Show Faults Only", this);
|
|
|
|
m_drawStyleToggleFaultsAction->setCheckable(true);
|
|
|
|
connect(m_drawStyleToggleFaultsAction, SIGNAL(toggled(bool)), SLOT(slotToggleFaultsAction(bool)));
|
|
|
|
|
2013-10-18 04:19:49 -05:00
|
|
|
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)));
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::createMenus()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
// File menu
|
|
|
|
QMenu* fileMenu = menuBar()->addMenu("&File");
|
2013-04-17 03:59:34 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
fileMenu->addAction(m_openProjectAction);
|
|
|
|
fileMenu->addAction(m_openLastUsedProjectAction);
|
2013-04-17 03:59:34 -05:00
|
|
|
fileMenu->addSeparator();
|
|
|
|
|
|
|
|
QMenu* importMenu = fileMenu->addMenu("&Import");
|
2013-10-18 09:23:31 -05:00
|
|
|
importMenu->addAction(m_importEclipseCaseAction);
|
|
|
|
importMenu->addAction(m_importInputEclipseFileAction);
|
2013-04-17 03:59:34 -05:00
|
|
|
importMenu->addAction(m_openMultipleEclipseCasesAction);
|
2013-06-18 04:56:51 -05:00
|
|
|
importMenu->addSeparator();
|
|
|
|
importMenu->addAction(m_importWellPathsFromFileAction);
|
|
|
|
importMenu->addAction(m_importWellPathsFromSSIHubAction);
|
2013-04-17 03:59:34 -05:00
|
|
|
|
|
|
|
QMenu* exportMenu = fileMenu->addMenu("&Export");
|
|
|
|
exportMenu->addAction(m_snapshotToFile);
|
|
|
|
exportMenu->addAction(m_snapshotAllViewsToFile);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
fileMenu->addSeparator();
|
|
|
|
fileMenu->addAction(m_saveProjectAction);
|
|
|
|
fileMenu->addAction(m_saveProjectAsAction);
|
|
|
|
|
2013-10-24 06:08:12 -05:00
|
|
|
fileMenu->addSeparator();
|
|
|
|
QMenu* testMenu = fileMenu->addMenu("&Testing");
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
fileMenu->addSeparator();
|
2013-04-17 03:59:34 -05:00
|
|
|
fileMenu->addAction(m_closeProjectAction);
|
2012-05-18 02:45:23 -05:00
|
|
|
fileMenu->addSeparator();
|
|
|
|
fileMenu->addAction(m_exitAction);
|
|
|
|
|
|
|
|
connect(fileMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshFileActions()));
|
|
|
|
|
|
|
|
// Edit menu
|
|
|
|
QMenu* editMenu = menuBar()->addMenu("&Edit");
|
2013-04-17 03:59:34 -05:00
|
|
|
editMenu->addAction(m_snapshotToClipboard);
|
|
|
|
editMenu->addSeparator();
|
2012-05-18 02:45:23 -05:00
|
|
|
editMenu->addAction(m_editPreferences);
|
2013-04-17 03:59:34 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
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
|
2013-10-24 06:08:12 -05:00
|
|
|
testMenu->addAction(m_mockModelAction);
|
|
|
|
testMenu->addAction(m_mockResultsModelAction);
|
|
|
|
testMenu->addAction(m_mockLargeResultsModelAction);
|
|
|
|
testMenu->addAction(m_mockInputModelAction);
|
|
|
|
testMenu->addSeparator();
|
|
|
|
testMenu->addAction(m_createCommandObject);
|
|
|
|
testMenu->addSeparator();
|
|
|
|
testMenu->addAction(m_showRegressionTestDialog);
|
|
|
|
testMenu->addAction(m_executePaintEventPerformanceTest);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-09-12 01:11:56 -05:00
|
|
|
// Windows menu
|
2012-05-18 02:45:23 -05:00
|
|
|
m_windowMenu = menuBar()->addMenu("&Windows");
|
|
|
|
connect(m_windowMenu, SIGNAL(aboutToShow()), SLOT(slotBuildWindowActions()));
|
|
|
|
|
|
|
|
// Help menu
|
|
|
|
QMenu* helpMenu = menuBar()->addMenu("&Help");
|
2013-10-24 03:46:57 -05:00
|
|
|
helpMenu->addAction(m_openUsersGuideInBrowserAction);
|
2013-08-08 04:09:18 -05:00
|
|
|
helpMenu->addAction(m_commandLineHelpAction);
|
2013-10-24 06:08:12 -05:00
|
|
|
helpMenu->addSeparator();
|
|
|
|
helpMenu->addAction(m_aboutAction);
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::createToolBars()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
|
|
|
|
m_standardToolBar = addToolBar(tr("Standard"));
|
|
|
|
m_standardToolBar->setObjectName(m_standardToolBar->windowTitle());
|
|
|
|
|
2013-10-18 09:23:31 -05:00
|
|
|
m_standardToolBar->addAction(m_importEclipseCaseAction);
|
|
|
|
m_standardToolBar->addAction(m_importInputEclipseFileAction);
|
2012-05-18 02:45:23 -05:00
|
|
|
m_standardToolBar->addAction(m_openProjectAction);
|
|
|
|
//m_standardToolBar->addAction(m_openLastUsedProjectAction);
|
|
|
|
m_standardToolBar->addAction(m_saveProjectAction);
|
|
|
|
|
2013-04-17 03:59:34 -05:00
|
|
|
// 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);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-17 03:59:34 -05:00
|
|
|
// View toolbar
|
2012-05-18 02:45:23 -05:00
|
|
|
m_viewToolBar = addToolBar(tr("View"));
|
|
|
|
m_viewToolBar->setObjectName(m_viewToolBar->windowTitle());
|
2013-03-07 05:32:19 -06:00
|
|
|
m_viewToolBar->addAction(m_zoomAll);
|
2012-05-18 02:45:23 -05:00
|
|
|
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);
|
2013-04-18 08:10:57 -05:00
|
|
|
m_viewToolBar->addSeparator();
|
|
|
|
m_viewToolBar->addAction(m_drawStyleLinesAction);
|
|
|
|
m_viewToolBar->addAction(m_drawStyleLinesSolidAction);
|
|
|
|
m_viewToolBar->addAction(m_drawStyleSurfOnlyAction);
|
|
|
|
m_viewToolBar->addAction(m_drawStyleToggleFaultsAction);
|
2013-10-18 04:19:49 -05:00
|
|
|
m_viewToolBar->addAction(m_addWellCellsToRangeFilterAction);
|
2013-04-18 08:10:57 -05:00
|
|
|
|
2013-04-26 04:49:37 -05:00
|
|
|
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)));
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-17 03:59:34 -05:00
|
|
|
// Create animation toolbar
|
|
|
|
m_animationToolBar = new caf::AnimationToolBar("Animation", this);
|
|
|
|
addToolBar(m_animationToolBar);
|
|
|
|
//connect(m_animationToolBar, SIGNAL(signalFrameRateChanged(double)), SLOT(slotFramerateChanged(double)));
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
refreshAnimationActions();
|
2013-04-18 08:10:57 -05:00
|
|
|
refreshDrawStyleActions();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::createDockPanels()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
{
|
2013-04-17 03:59:34 -05:00
|
|
|
QDockWidget* dockWidget = new QDockWidget("Project Tree", this);
|
2012-05-18 02:45:23 -05:00
|
|
|
dockWidget->setObjectName("dockWidget");
|
|
|
|
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
m_treeView = new RimUiTreeView(dockWidget);
|
|
|
|
m_treeView->setModel(m_treeModelPdm);
|
2013-03-20 09:11:27 -05:00
|
|
|
m_treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
|
|
|
|
2013-03-21 07:41:44 -05:00
|
|
|
// Drag and drop configuration
|
2013-03-20 09:11:27 -05:00
|
|
|
m_treeView->setDragEnabled(true);
|
|
|
|
m_treeView->viewport()->setAcceptDrops(true);
|
|
|
|
m_treeView->setDropIndicatorShown(true);
|
2013-03-21 07:41:44 -05:00
|
|
|
m_treeView->setDragDropMode(QAbstractItemView::DragDrop);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
dockWidget->setWidget(m_treeView);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
|
|
|
|
}
|
|
|
|
|
2013-04-17 03:59:34 -05:00
|
|
|
{
|
|
|
|
QDockWidget* dockWidget = new QDockWidget("Property Editor", this);
|
|
|
|
dockWidget->setObjectName("dockWidget");
|
|
|
|
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
|
|
|
|
|
|
|
m_pdmUiPropertyView = new caf::PdmUiPropertyView(dockWidget);
|
|
|
|
dockWidget->setWidget(m_pdmUiPropertyView);
|
|
|
|
|
2013-06-26 02:02:37 -05:00
|
|
|
m_pdmUiPropertyView->layout()->setContentsMargins(5,0,0,0);
|
2013-04-17 03:59:34 -05:00
|
|
|
connect(m_treeView, SIGNAL(selectedObjectChanged( caf::PdmObject* )), m_pdmUiPropertyView, SLOT(showProperties( caf::PdmObject* )));
|
|
|
|
|
|
|
|
addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
|
|
|
|
}
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
QDockWidget* dockPanel = new QDockWidget("Result Info", this);
|
|
|
|
dockPanel->setObjectName("dockResultInfoPanel");
|
|
|
|
dockPanel->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea);
|
2013-03-22 11:17:56 -05:00
|
|
|
m_resultInfoPanel = new RiuResultInfoPanel(dockPanel);
|
2012-05-18 02:45:23 -05:00
|
|
|
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);
|
2013-03-22 11:17:56 -05:00
|
|
|
m_processMonitor = new RiuProcessMonitor(dockPanel);
|
2012-05-18 02:45:23 -05:00
|
|
|
dockPanel->setWidget(m_processMonitor);
|
|
|
|
|
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockPanel);
|
|
|
|
}
|
|
|
|
|
2013-04-17 03:59:34 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
|
|
|
|
setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::saveWinGeoAndDockToolBarLayout()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
// Company and appname set through QCoreApplication
|
|
|
|
QSettings settings;
|
|
|
|
|
|
|
|
QByteArray winGeo = saveGeometry();
|
|
|
|
settings.setValue("winGeometry", winGeo);
|
|
|
|
|
|
|
|
QByteArray layout = saveState(0);
|
|
|
|
settings.setValue("dockAndToolBarLayout", layout);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::loadWinGeoAndDockToolBarLayout()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
// Company and appname set through QCoreApplication
|
|
|
|
QSettings settings;
|
|
|
|
|
|
|
|
QVariant winGeo = settings.value("winGeometry");
|
|
|
|
QVariant layout = settings.value("dockAndToolBarLayout");
|
|
|
|
|
|
|
|
if (winGeo.isValid())
|
|
|
|
{
|
|
|
|
if (restoreGeometry(winGeo.toByteArray()))
|
|
|
|
{
|
|
|
|
if (layout.isValid())
|
|
|
|
{
|
|
|
|
restoreState(layout.toByteArray(), 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::setResultInfo(const QString& info) const
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
m_resultInfoPanel->setInfo(info);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
// Action slots
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotRefreshFileActions()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
bool projectExists = true;
|
|
|
|
m_saveProjectAction->setEnabled(projectExists);
|
|
|
|
m_saveProjectAsAction->setEnabled(projectExists);
|
2013-04-17 03:59:34 -05:00
|
|
|
m_closeProjectAction->setEnabled(projectExists);
|
2013-05-30 08:33:12 -05:00
|
|
|
|
|
|
|
bool projectFileExists = QFile::exists(app->project()->fileName());
|
|
|
|
|
2013-06-18 04:56:51 -05:00
|
|
|
m_importWellPathsFromSSIHubAction->setEnabled(projectFileExists);
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotRefreshEditActions()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 10:24:42 -05:00
|
|
|
// RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
// RISceneManager* proj = app->project();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotRefreshViewActions()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
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);
|
2013-04-26 04:49:37 -05:00
|
|
|
|
|
|
|
updateScaleValue();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::refreshAnimationActions()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
caf::FrameAnimationControl* ac = NULL;
|
2013-03-22 09:50:44 -05:00
|
|
|
if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
ac = RiaApplication::instance()->activeReservoirView()->viewer()->animationControl();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
m_animationToolBar->connectAnimationControl(ac);
|
|
|
|
|
|
|
|
QStringList timeStepStrings;
|
|
|
|
int currentTimeStepIndex = 0;
|
|
|
|
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
bool enableAnimControls = false;
|
|
|
|
if (app->activeReservoirView() &&
|
|
|
|
app->activeReservoirView()->viewer() &&
|
|
|
|
app->activeReservoirView()->viewer()->frameCount())
|
|
|
|
{
|
|
|
|
enableAnimControls = true;
|
|
|
|
|
2013-03-13 05:50:31 -05:00
|
|
|
if (app->activeReservoirView()->currentGridCellResults())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
if (app->activeReservoirView()->cellResult()->hasDynamicResult()
|
|
|
|
|| app->activeReservoirView()->propertyFilterCollection()->hasActiveDynamicFilters()
|
|
|
|
|| app->activeReservoirView()->wellCollection()->hasVisibleWellPipes())
|
|
|
|
{
|
2013-03-18 08:34:29 -05:00
|
|
|
std::vector<QDateTime> timeStepDates = app->activeReservoirView()->currentGridCellResults()->cellResults()->timeStepDates(0);
|
2013-02-07 01:35:04 -06:00
|
|
|
bool showHoursAndMinutes = false;
|
2013-03-20 00:11:45 -05:00
|
|
|
for (size_t i = 0; i < timeStepDates.size(); i++)
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
2013-02-07 01:35:04 -06:00
|
|
|
if (timeStepDates[i].time().hour() != 0.0 || timeStepDates[i].time().minute() != 0.0)
|
|
|
|
{
|
|
|
|
showHoursAndMinutes = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString formatString = "dd.MMM yyyy";
|
|
|
|
if (showHoursAndMinutes)
|
|
|
|
{
|
|
|
|
formatString += " - hh:mm";
|
|
|
|
}
|
|
|
|
|
2013-03-20 00:11:45 -05:00
|
|
|
for (size_t i = 0; i < timeStepDates.size(); i++)
|
2013-02-07 01:35:04 -06:00
|
|
|
{
|
|
|
|
timeStepStrings += timeStepDates[i].toString(formatString);
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
2013-03-22 09:50:44 -05:00
|
|
|
currentTimeStepIndex = RiaApplication::instance()->activeReservoirView()->currentTimeStep();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
timeStepStrings.push_back(tr("Static Property"));
|
|
|
|
}
|
|
|
|
}
|
2013-04-10 08:09:41 -05:00
|
|
|
|
|
|
|
// Animation control is only relevant for more than one time step
|
|
|
|
if (timeStepStrings.size() < 2)
|
|
|
|
{
|
|
|
|
enableAnimControls = false;
|
|
|
|
}
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
m_animationToolBar->setFrameRate(app->activeReservoirView()->maximumFrameRate());
|
|
|
|
}
|
|
|
|
|
|
|
|
m_animationToolBar->setTimeStepStrings(timeStepStrings);
|
|
|
|
m_animationToolBar->setCurrentTimeStepIndex(currentTimeStepIndex);
|
|
|
|
|
|
|
|
m_animationToolBar->setEnabled(enableAnimControls);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotAbout()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
cvfqt::BasicAboutDialog dlg(this);
|
|
|
|
|
|
|
|
dlg.setApplicationName(RI_APPLICATION_NAME);
|
2013-03-22 09:50:44 -05:00
|
|
|
dlg.setApplicationVersion(RiaApplication::getVersionStringApp(true));
|
2012-05-18 02:45:23 -05:00
|
|
|
dlg.setCopyright("Copyright 2012 Statoil ASA, Ceetron AS");
|
|
|
|
dlg.showCeeVizVersion(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(" ") + dlg.openGLVersionString());
|
|
|
|
dlg.addVersionEntry(" ", caf::Viewer::isShadersSupported() ? " Hardware OpenGL" : " Software OpenGL");
|
|
|
|
|
|
|
|
dlg.create();
|
|
|
|
dlg.resize(300, 200);
|
|
|
|
|
|
|
|
dlg.exec();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-10-18 09:23:31 -05:00
|
|
|
void RiuMainWindow::slotImportEclipseCase()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
if (checkForDocumentModifications())
|
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-10-23 02:59:57 -05:00
|
|
|
|
|
|
|
QString defaultDir = app->defaultFileDialogDirectory("BINARY_GRID");
|
2013-10-18 09:23:31 -05:00
|
|
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Import Eclipse File", defaultDir, "Eclipse Grid Files (*.GRID *.EGRID)");
|
2012-10-23 02:59:57 -05:00
|
|
|
if (fileNames.size()) defaultDir = QFileInfo(fileNames.last()).absolutePath();
|
|
|
|
app->setDefaultFileDialogDirectory("BINARY_GRID", defaultDir);
|
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
int i;
|
|
|
|
for (i = 0; i < fileNames.size(); i++)
|
|
|
|
{
|
|
|
|
QString fileName = fileNames[i];
|
|
|
|
|
|
|
|
if (!fileNames.isEmpty())
|
|
|
|
{
|
|
|
|
app->openEclipseCaseFromFile(fileName);
|
|
|
|
}
|
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-10-18 09:23:31 -05:00
|
|
|
void RiuMainWindow::slotImportInputEclipseFiles()
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
|
|
|
if (checkForDocumentModifications())
|
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-10-23 02:59:57 -05:00
|
|
|
QString defaultDir = app->defaultFileDialogDirectory("INPUT_FILES");
|
2013-10-18 09:23:31 -05:00
|
|
|
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Import Eclipse Input Files", defaultDir, "Eclipse Input Files and Input Properties (*.GRDECL *)");
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
if (fileNames.isEmpty()) return;
|
|
|
|
|
2012-10-23 02:59:57 -05:00
|
|
|
// Remember the path to next time
|
|
|
|
app->setDefaultFileDialogDirectory("INPUT_FILES", QFileInfo(fileNames.last()).absolutePath());
|
|
|
|
|
2013-10-08 07:28:01 -05:00
|
|
|
app->openInputEclipseCaseFromFileNames(fileNames);
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotOpenProject()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
if (checkForDocumentModifications())
|
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-10-23 02:59:57 -05:00
|
|
|
QString defaultDir = app->defaultFileDialogDirectory("BINARY_GRID");
|
2013-09-25 02:36:01 -05:00
|
|
|
QString fileName = QFileDialog::getOpenFileName(this, "Open ResInsight Project", defaultDir, "ResInsight project (*.rsp *.rip);;All files(*.*)");
|
2012-10-23 02:59:57 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
if (fileName.isEmpty()) return;
|
|
|
|
|
2012-10-23 02:59:57 -05:00
|
|
|
// Remember the path to next time
|
|
|
|
app->setDefaultFileDialogDirectory("BINARY_GRID", QFileInfo(fileName).absolutePath());
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
app->loadProject(fileName);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotOpenLastUsedProject()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
app->loadLastUsedProject();
|
2013-04-19 06:20:46 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
Known problems:
- Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later.
p4#: 21658
2013-05-16 07:10:22 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-06-18 04:56:51 -05:00
|
|
|
void RiuMainWindow::slotImportWellPathsFromFile()
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
Known problems:
- Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later.
p4#: 21658
2013-05-16 07:10:22 -05:00
|
|
|
{
|
|
|
|
// Open dialog box to select well path files
|
|
|
|
RiaApplication* app = RiaApplication::instance();
|
|
|
|
QString defaultDir = app->defaultFileDialogDirectory("WELLPATH_DIR");
|
2013-08-08 10:23:31 -05:00
|
|
|
QStringList wellPathFilePaths = QFileDialog::getOpenFileNames(this, "Import Well Paths", defaultDir, "Well Paths (*.json *.asc *.asci *.ascii *.dev);;All Files (*.*)");
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
Known problems:
- Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later.
p4#: 21658
2013-05-16 07:10:22 -05:00
|
|
|
|
|
|
|
if (wellPathFilePaths.size() < 1) return;
|
|
|
|
|
|
|
|
// Remember the path to next time
|
|
|
|
app->setDefaultFileDialogDirectory("WELLPATH_DIR", QFileInfo(wellPathFilePaths.last()).absolutePath());
|
|
|
|
|
|
|
|
app->addWellPathsToModel(wellPathFilePaths);
|
|
|
|
if (app->project()) app->project()->createDisplayModelAndRedrawAllViews();
|
|
|
|
}
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotMockModel()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
app->createMockModel();
|
|
|
|
|
|
|
|
//m_mainViewer->setDefaultView();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotMockResultsModel()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
app->createResultsMockModel();
|
|
|
|
|
|
|
|
//m_mainViewer->setDefaultView();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotMockLargeResultsModel()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
app->createLargeResultsMockModel();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotInputMockModel()
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-06-26 09:10:41 -05:00
|
|
|
app->createInputMockModel();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotSetCurrentFrame(int frameIndex)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
// app->setTimeStep(frameIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
bool RiuMainWindow::checkForDocumentModifications()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotCloseProject()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
bool ret = app->closeProject(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
2013-03-22 11:17:56 -05:00
|
|
|
QMdiSubWindow* RiuMainWindow::findMdiSubWindow(RiuViewer* viewer)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList();
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < subws.size(); ++i)
|
|
|
|
{
|
|
|
|
if (subws[i]->widget() == viewer->layoutWidget())
|
|
|
|
{
|
|
|
|
return subws[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::removeViewer(RiuViewer* viewer)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
#if 0
|
|
|
|
m_CentralFrame->layout()->removeWidget(viewer->layoutWidget());
|
|
|
|
#else
|
|
|
|
m_mdiArea->removeSubWindow( findMdiSubWindow(viewer));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::addViewer(RiuViewer* viewer)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
#if 0
|
|
|
|
m_CentralFrame->layout()->addWidget(viewer->layoutWidget());
|
|
|
|
#else
|
|
|
|
QMdiSubWindow * subWin = m_mdiArea->addSubWindow(viewer->layoutWidget());
|
|
|
|
subWin->resize(400, 400);
|
|
|
|
|
|
|
|
if (m_mdiArea->subWindowList().size() == 1)
|
|
|
|
{
|
|
|
|
// Show first view maximized
|
|
|
|
subWin->showMaximized();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
subWin->show();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotSaveProject()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-19 06:20:46 -05:00
|
|
|
storeTreeViewState();
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
app->saveProject();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotSaveProjectAs()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-19 06:20:46 -05:00
|
|
|
storeTreeViewState();
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
app->saveProjectPromptForFileName();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
/// This method needs to handle memory deallocation !!!
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::setPdmRoot(caf::PdmObject* pdmRoot)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
m_pdmRoot = pdmRoot;
|
|
|
|
|
|
|
|
caf::PdmUiTreeItem* treeItemRoot = caf::UiTreeItemBuilderPdm::buildViewItems(NULL, -1, m_pdmRoot);
|
2013-04-22 03:49:31 -05:00
|
|
|
m_treeModelPdm->setTreeItemRoot(treeItemRoot);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
if (treeItemRoot && m_treeView->selectionModel())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2012-06-26 09:10:41 -05:00
|
|
|
connect(m_treeView->selectionModel(), SIGNAL(currentChanged ( const QModelIndex & , const QModelIndex & )), SLOT(slotCurrentChanged( const QModelIndex & , const QModelIndex & )));
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotViewFromNorth()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(0,-1,0), cvf::Vec3d(0,0,1));
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotViewFromSouth()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(0,1,0), cvf::Vec3d(0,0,1));
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotViewFromEast()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(-1,0,0), cvf::Vec3d(0,0,1));
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotViewFromWest()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(1,0,0), cvf::Vec3d(0,0,1));
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotViewFromAbove()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(0,0,-1), cvf::Vec3d(0,1,0));
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotViewFromBelow()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->activeReservoirView()->viewer()->setView(cvf::Vec3d(0,0,1), cvf::Vec3d(0,1,0));
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotZoomAll()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
if (RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->activeReservoirView()->viewer()->zoomAll();
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotSubWindowActivated(QMdiSubWindow* subWindow)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RimProject * proj = RiaApplication::instance()->project();
|
2012-05-18 02:45:23 -05:00
|
|
|
if (!proj) return;
|
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
// Iterate all cases in each oil field
|
|
|
|
for (size_t oilFieldIdx = 0; oilFieldIdx < proj->oilFields().size(); oilFieldIdx++)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
RimOilField* oilField = proj->oilFields[oilFieldIdx];
|
|
|
|
RimAnalysisModels* analysisModels = oilField ? oilField->analysisModels() : NULL;
|
|
|
|
if (analysisModels == NULL) continue;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
for (size_t caseIdx = 0; caseIdx < analysisModels->cases().size(); caseIdx++)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
RimCase* reservoirCase = analysisModels->cases[caseIdx];
|
|
|
|
if (reservoirCase == NULL) continue;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
size_t viewIdx;
|
|
|
|
for (viewIdx = 0; viewIdx < reservoirCase->reservoirViews().size(); viewIdx++)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
RimReservoirView* riv = reservoirCase->reservoirViews()[viewIdx];
|
|
|
|
|
|
|
|
if (riv &&
|
|
|
|
riv->viewer() &&
|
|
|
|
riv->viewer()->layoutWidget() &&
|
|
|
|
riv->viewer()->layoutWidget()->parent() == subWindow)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
RimReservoirView* previousActiveReservoirView = RiaApplication::instance()->activeReservoirView();
|
|
|
|
RiaApplication::instance()->setActiveReservoirView(riv);
|
|
|
|
if (previousActiveReservoirView && previousActiveReservoirView != riv)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
QModelIndex previousViewModelIndex = m_treeModelPdm->getModelIndexFromPdmObject(previousActiveReservoirView);
|
|
|
|
QModelIndex newViewModelIndex = m_treeModelPdm->getModelIndexFromPdmObject(riv);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
QModelIndex newSelectionIndex = newViewModelIndex;
|
|
|
|
QModelIndex currentSelectionIndex = m_treeView->selectionModel()->currentIndex();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
if (currentSelectionIndex != newViewModelIndex &&
|
|
|
|
currentSelectionIndex.isValid())
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
QVector<QModelIndex> route; // Contains all model indices from current selection up to previous view
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
QModelIndex tmpModelIndex = currentSelectionIndex;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
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++)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
QModelIndex tmp = route[i];
|
|
|
|
if (newSelectionIndex.isValid())
|
|
|
|
{
|
|
|
|
newSelectionIndex = m_treeModelPdm->index(tmp.row(), tmp.column(), newSelectionIndex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Use view model index if anything goes wrong
|
|
|
|
if (!newSelectionIndex.isValid())
|
|
|
|
{
|
|
|
|
newSelectionIndex = newViewModelIndex;
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
m_treeView->setCurrentIndex(newSelectionIndex);
|
|
|
|
if (newSelectionIndex != newViewModelIndex)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-06-06 08:07:31 -05:00
|
|
|
m_treeView->setExpanded(newViewModelIndex, true);
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-06 08:07:31 -05:00
|
|
|
slotRefreshViewActions();
|
|
|
|
refreshAnimationActions();
|
|
|
|
refreshDrawStyleActions();
|
|
|
|
break;
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-06-06 08:07:31 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotUseShaders(bool enable)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->setUseShaders(enable);
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotShowPerformanceInfo(bool enable)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->setShowPerformanceInfo(enable);
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotEditPreferences()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2013-03-22 11:17:56 -05:00
|
|
|
RiuPreferencesDialog preferencesDialog(this, app->preferences(), "Preferences");
|
2012-05-18 02:45:23 -05:00
|
|
|
if (preferencesDialog.exec() == QDialog::Accepted)
|
|
|
|
{
|
|
|
|
// Write preferences using QSettings and apply them to the application
|
2013-09-27 03:04:10 -05:00
|
|
|
app->writeFieldsToApplicationStore(app->preferences());
|
2012-05-18 02:45:23 -05:00
|
|
|
app->applyPreferences();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Read back currently stored values using QSettings
|
2013-09-27 03:04:10 -05:00
|
|
|
app->readFieldsFromApplicationStore(app->preferences());
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::setActiveViewer(RiuViewer* viewer)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
QMdiSubWindow * swin = findMdiSubWindow(viewer);
|
|
|
|
if (swin) m_mdiArea->setActiveSubWindow(swin);
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotFramerateChanged(double frameRate)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
if (RiaApplication::instance()->activeReservoirView() != NULL)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->activeReservoirView()->maximumFrameRate.setValueFromUi(QVariant(frameRate));
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
RiuProcessMonitor* RiuMainWindow::processMonitor()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
return m_processMonitor;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotBuildWindowActions()
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
m_windowMenu->clear();
|
2013-04-17 03:59:34 -05:00
|
|
|
m_windowMenu->addAction(m_newPropertyView);
|
|
|
|
m_windowMenu->addSeparator();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
QList<QDockWidget*> dockWidgets = findChildren<QDockWidget*>();
|
2013-04-17 03:59:34 -05:00
|
|
|
|
|
|
|
int i = 0;
|
2012-05-18 02:45:23 -05:00
|
|
|
foreach (QDockWidget* dock, dockWidgets)
|
|
|
|
{
|
|
|
|
if (dock)
|
|
|
|
{
|
2013-04-17 03:59:34 -05:00
|
|
|
if (i == 4) m_windowMenu->addSeparator();
|
2012-05-18 02:45:23 -05:00
|
|
|
m_windowMenu->addAction(dock->toggleViewAction());
|
2013-04-17 03:59:34 -05:00
|
|
|
++i;
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotCurrentChanged(const QModelIndex & current, const QModelIndex & previous)
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RimReservoirView* activeReservoirView = RiaApplication::instance()->activeReservoirView();
|
2012-05-18 02:45:23 -05:00
|
|
|
QModelIndex activeViewModelIndex = m_treeModelPdm->getModelIndexFromPdmObject(activeReservoirView);
|
|
|
|
|
|
|
|
QModelIndex tmp = current;
|
|
|
|
|
|
|
|
// Traverse parents until a reservoir view is found
|
|
|
|
while (tmp.isValid())
|
|
|
|
{
|
|
|
|
caf::PdmUiTreeItem* treeItem = m_treeModelPdm->getTreeItemFromIndex(tmp);
|
|
|
|
caf::PdmObject* pdmObject = treeItem->dataObject();
|
|
|
|
|
|
|
|
RimReservoirView* rimReservoirView = dynamic_cast<RimReservoirView*>(pdmObject);
|
|
|
|
if (rimReservoirView)
|
|
|
|
{
|
|
|
|
// If current selection is an item within a different reservoir view than active,
|
|
|
|
// show new reservoir view and set this as activate view
|
|
|
|
if (rimReservoirView != activeReservoirView)
|
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication::instance()->setActiveReservoirView(rimReservoirView);
|
2012-05-18 02:45:23 -05:00
|
|
|
// Set focus in MDI area to this window if it exists
|
|
|
|
if (rimReservoirView->viewer())
|
|
|
|
{
|
|
|
|
setActiveViewer(rimReservoirView->viewer());
|
|
|
|
}
|
|
|
|
m_treeView->setCurrentIndex(current);
|
2013-06-14 04:59:56 -05:00
|
|
|
refreshDrawStyleActions();
|
|
|
|
refreshAnimationActions();
|
|
|
|
slotRefreshFileActions();
|
|
|
|
slotRefreshEditActions();
|
|
|
|
slotRefreshViewActions();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// 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
|
|
|
|
// Set focus back to the tree view to be able to continue keyboard tree view navigation
|
|
|
|
m_treeView->setFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Traverse parents until a reservoir view is found
|
|
|
|
tmp = tmp.parent();
|
|
|
|
}
|
|
|
|
}
|
2012-06-26 09:10:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotNewObjectPropertyView()
|
2012-06-26 09:10:41 -05:00
|
|
|
{
|
|
|
|
if (!m_treeModelPdm) return;
|
|
|
|
|
|
|
|
RimUiTreeView* treeView = NULL;
|
|
|
|
|
|
|
|
{
|
2013-04-17 03:59:34 -05:00
|
|
|
QDockWidget* dockWidget = new QDockWidget("Additional Project Tree " + QString::number(additionalProjectTrees.size() + 1), this);
|
2012-06-26 09:10:41 -05:00
|
|
|
dockWidget->setObjectName("dockWidget");
|
|
|
|
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
|
|
|
|
|
|
|
treeView = new RimUiTreeView(dockWidget);
|
2013-04-17 03:59:34 -05:00
|
|
|
treeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
|
|
|
|
|
|
|
// Drag and drop configuration
|
|
|
|
m_treeView->setDragEnabled(true);
|
|
|
|
m_treeView->viewport()->setAcceptDrops(true);
|
|
|
|
m_treeView->setDropIndicatorShown(true);
|
|
|
|
m_treeView->setDragDropMode(QAbstractItemView::DragDrop);
|
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
dockWidget->setWidget(treeView);
|
|
|
|
|
|
|
|
addDockWidget(Qt::RightDockWidgetArea, dockWidget);
|
2013-04-17 03:59:34 -05:00
|
|
|
additionalProjectTrees.push_back(dockWidget);
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
treeView->setModel(m_treeModelPdm);
|
|
|
|
|
|
|
|
|
|
|
|
{
|
2013-04-17 03:59:34 -05:00
|
|
|
QDockWidget* dockWidget = new QDockWidget("Additional Property Editor " + QString::number(additionalPropertyEditors.size() + 1), this);
|
2012-06-26 09:10:41 -05:00
|
|
|
dockWidget->setObjectName("dockWidget");
|
|
|
|
dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
|
|
|
|
|
|
|
caf::PdmUiPropertyView* propView = new caf::PdmUiPropertyView(dockWidget);
|
|
|
|
dockWidget->setWidget(propView);
|
|
|
|
|
|
|
|
addDockWidget(Qt::RightDockWidgetArea, dockWidget);
|
|
|
|
|
|
|
|
connect(treeView, SIGNAL(selectedObjectChanged( caf::PdmObject* )), propView, SLOT(showProperties( caf::PdmObject* )));
|
2013-04-17 03:59:34 -05:00
|
|
|
additionalPropertyEditors.push_back(dockWidget);
|
2012-06-26 09:10:41 -05:00
|
|
|
}
|
|
|
|
}
|
2013-02-06 04:43:26 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotSnapshotToFile()
|
2013-02-06 04:43:26 -06:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2013-02-06 04:43:26 -06:00
|
|
|
|
|
|
|
app->saveSnapshotPromtpForFilename();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotSnapshotToClipboard()
|
2013-02-06 04:43:26 -06:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2013-02-06 04:43:26 -06:00
|
|
|
|
|
|
|
app->copySnapshotToClipboard();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotSnapshotAllViewsToFile()
|
2013-02-06 04:43:26 -06:00
|
|
|
{
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2013-02-06 04:43:26 -06:00
|
|
|
|
2013-02-08 10:04:35 -06:00
|
|
|
app->saveSnapshotForAllViews("snapshots");
|
2013-02-06 04:43:26 -06:00
|
|
|
}
|
2013-02-11 04:47:45 -06:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::hideAllDockWindows()
|
2013-02-11 04:47:45 -06:00
|
|
|
{
|
|
|
|
QList<QDockWidget*> dockWidgets = findChildren<QDockWidget*>();
|
|
|
|
|
|
|
|
for (int i = 0; i < dockWidgets.size(); i++)
|
|
|
|
{
|
|
|
|
dockWidgets[i]->close();
|
|
|
|
}
|
|
|
|
}
|
2013-02-21 09:46:34 -06:00
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-03-22 11:17:56 -05:00
|
|
|
void RiuMainWindow::slotOpenMultipleCases()
|
2013-02-21 09:46:34 -06:00
|
|
|
{
|
2013-04-02 09:34:13 -05:00
|
|
|
#if 1
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2013-03-05 06:26:28 -06:00
|
|
|
RiuMultiCaseImportDialog dialog;
|
|
|
|
int action = dialog.exec();
|
|
|
|
if (action == QDialog::Accepted)
|
2013-02-21 09:46:34 -06:00
|
|
|
{
|
2013-03-05 06:26:28 -06:00
|
|
|
QStringList gridFileNames = dialog.eclipseCaseFileNames();
|
|
|
|
app->addEclipseCases(gridFileNames);
|
2013-02-21 09:46:34 -06:00
|
|
|
}
|
2013-03-22 03:32:42 -05:00
|
|
|
|
2013-04-02 09:34:13 -05:00
|
|
|
#else // Code to fast generate a test project
|
|
|
|
RiaApplication* app = RiaApplication::instance();
|
2013-03-22 03:32:42 -05:00
|
|
|
|
|
|
|
QStringList gridFileNames;
|
|
|
|
|
|
|
|
if (1)
|
|
|
|
{
|
|
|
|
gridFileNames += "Result Mock Debug Model With Results";
|
|
|
|
gridFileNames += "Result Mock Debug Model With Results";
|
|
|
|
gridFileNames += "Result Mock Debug Model With Results";
|
|
|
|
}
|
|
|
|
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);
|
2013-04-02 09:34:13 -05:00
|
|
|
#endif
|
2013-03-22 03:32:42 -05:00
|
|
|
|
2013-02-21 09:46:34 -06:00
|
|
|
}
|
2013-04-18 08:10:57 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::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();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::slotToggleFaultsAction(bool showFaults)
|
|
|
|
{
|
|
|
|
if (!RiaApplication::instance()->activeReservoirView()) return;
|
|
|
|
|
|
|
|
RiaApplication::instance()->activeReservoirView()->setShowFaultsOnly(showFaults);
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::refreshDrawStyleActions()
|
|
|
|
{
|
|
|
|
bool enable = RiaApplication::instance()->activeReservoirView() != NULL;
|
|
|
|
|
|
|
|
m_drawStyleLinesAction->setEnabled(enable);
|
|
|
|
m_drawStyleLinesSolidAction->setEnabled(enable);
|
|
|
|
m_drawStyleSurfOnlyAction->setEnabled(enable);
|
|
|
|
|
|
|
|
m_drawStyleToggleFaultsAction->setEnabled(enable);
|
|
|
|
|
2013-10-18 04:19:49 -05:00
|
|
|
m_addWellCellsToRangeFilterAction->setEnabled(enable);
|
|
|
|
|
2013-04-18 08:10:57 -05:00
|
|
|
if (enable)
|
|
|
|
{
|
2013-10-18 04:19:49 -05:00
|
|
|
RimReservoirView* riv = RiaApplication::instance()->activeReservoirView();
|
2013-04-18 08:10:57 -05:00
|
|
|
m_drawStyleToggleFaultsAction->blockSignals(true);
|
2013-10-18 04:19:49 -05:00
|
|
|
m_drawStyleToggleFaultsAction->setChecked( riv->meshMode == RimReservoirView::FAULTS_MESH
|
|
|
|
|| riv->surfaceMode == RimReservoirView::FAULTS);
|
2013-04-18 08:10:57 -05:00
|
|
|
m_drawStyleToggleFaultsAction->blockSignals(false);
|
2013-10-18 04:19:49 -05:00
|
|
|
|
|
|
|
m_addWellCellsToRangeFilterAction->blockSignals(true);
|
|
|
|
m_addWellCellsToRangeFilterAction->setChecked( riv->wellCollection()->wellCellsToRangeFilterMode() != RimWellCollection::RANGE_ADD_NONE);
|
|
|
|
m_addWellCellsToRangeFilterAction->blockSignals(false);
|
2013-04-18 08:10:57 -05:00
|
|
|
}
|
|
|
|
}
|
2013-04-19 06:20:46 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::storeTreeViewState()
|
|
|
|
{
|
|
|
|
if (m_treeView)
|
|
|
|
{
|
|
|
|
QString treeViewState;
|
2013-04-22 02:20:57 -05:00
|
|
|
m_treeView->storeTreeViewStateToString(treeViewState);
|
2013-04-26 12:05:35 -05:00
|
|
|
|
2013-05-27 08:38:03 -05:00
|
|
|
QModelIndex mi = m_treeView->currentIndex();
|
|
|
|
|
|
|
|
QString encodedModelIndexString;
|
|
|
|
RimUiTreeView::encodeStringFromModelIndex(mi, encodedModelIndexString);
|
2013-04-19 06:20:46 -05:00
|
|
|
|
|
|
|
RiaApplication::instance()->project()->treeViewState = treeViewState;
|
2013-05-27 08:38:03 -05:00
|
|
|
RiaApplication::instance()->project()->currentModelIndexPath = encodedModelIndexString;
|
2013-04-19 06:20:46 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::restoreTreeViewState()
|
|
|
|
{
|
|
|
|
if (m_treeView)
|
|
|
|
{
|
|
|
|
QString stateString = RiaApplication::instance()->project()->treeViewState;
|
|
|
|
if (!stateString.isEmpty())
|
|
|
|
{
|
|
|
|
m_treeView->collapseAll();
|
2013-04-22 02:20:57 -05:00
|
|
|
m_treeView->applyTreeViewStateFromString(stateString);
|
2013-04-19 06:20:46 -05:00
|
|
|
}
|
2013-04-26 12:05:35 -05:00
|
|
|
|
|
|
|
QString currentIndexString = RiaApplication::instance()->project()->currentModelIndexPath;
|
|
|
|
if (!currentIndexString.isEmpty())
|
|
|
|
{
|
2013-05-27 08:38:03 -05:00
|
|
|
QModelIndex mi = RimUiTreeView::getModelIndexFromString(m_treeView->model(), currentIndexString);
|
|
|
|
m_treeView->setCurrentIndex(mi);
|
2013-04-26 12:05:35 -05:00
|
|
|
}
|
2013-04-19 06:20:46 -05:00
|
|
|
}
|
|
|
|
}
|
2013-04-23 00:29:37 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::setCurrentObjectInTreeView(caf::PdmObject* object)
|
|
|
|
{
|
|
|
|
if (m_treeView && m_treeModelPdm)
|
|
|
|
{
|
|
|
|
QModelIndex mi = m_treeModelPdm->getModelIndexFromPdmObject(object);
|
|
|
|
|
|
|
|
if (mi.isValid())
|
|
|
|
{
|
|
|
|
m_treeView->setCurrentIndex(mi);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-04-26 04:49:37 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::slotScaleChanged(int scaleValue)
|
|
|
|
{
|
|
|
|
if (RiaApplication::instance()->activeReservoirView())
|
|
|
|
{
|
|
|
|
RiaApplication::instance()->activeReservoirView()->scaleZ.setValueFromUi(scaleValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::updateScaleValue()
|
|
|
|
{
|
|
|
|
if (RiaApplication::instance()->activeReservoirView())
|
|
|
|
{
|
|
|
|
m_scaleFactor->setEnabled(true);
|
|
|
|
|
2013-05-06 05:02:32 -05:00
|
|
|
int scaleValue = static_cast<int>(RiaApplication::instance()->activeReservoirView()->scaleZ()); // Round down is probably ok.
|
2013-04-26 04:49:37 -05:00
|
|
|
m_scaleFactor->blockSignals(true);
|
|
|
|
m_scaleFactor->setValue(scaleValue);
|
|
|
|
m_scaleFactor->blockSignals(false);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_scaleFactor->setEnabled(false);
|
|
|
|
}
|
|
|
|
}
|
2013-05-13 15:32:01 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-05-27 08:38:03 -05:00
|
|
|
/// TODO: This function will be moved to a class responsible for handling the application selection concept
|
2013-05-13 15:32:01 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-05-15 05:03:36 -05:00
|
|
|
void RiuMainWindow::selectedCases(std::vector<RimCase*>& cases)
|
2013-05-13 15:32:01 -05:00
|
|
|
{
|
|
|
|
if (m_treeView && m_treeView->selectionModel())
|
|
|
|
{
|
|
|
|
QModelIndexList selectedModelIndexes = m_treeView->selectionModel()->selectedIndexes();
|
2013-05-15 05:03:36 -05:00
|
|
|
|
|
|
|
caf::PdmObjectGroup group;
|
2013-09-12 01:11:56 -05:00
|
|
|
m_treeModelPdm->populateObjectGroupFromModelIndexList(selectedModelIndexes, &group);
|
2013-05-13 15:32:01 -05:00
|
|
|
|
2013-05-15 05:03:36 -05:00
|
|
|
std::vector<caf::PdmPointer<RimCase> > typedObjects;
|
|
|
|
group.objectsByType(&typedObjects);
|
2013-05-13 15:32:01 -05:00
|
|
|
|
2013-05-15 05:03:36 -05:00
|
|
|
for (size_t i = 0; i < typedObjects.size(); i++)
|
|
|
|
{
|
|
|
|
cases.push_back(typedObjects[i]);
|
2013-05-13 15:32:01 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-05-29 05:59:08 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-06-18 04:56:51 -05:00
|
|
|
void RiuMainWindow::slotImportWellPathsFromSSIHub()
|
2013-05-29 05:59:08 -05:00
|
|
|
{
|
2013-09-06 06:06:39 -05:00
|
|
|
RiaApplication* app = RiaApplication::instance();
|
|
|
|
if (!app->project())
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!QFile::exists(app->project()->fileName()))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-09-08 03:53:25 -05:00
|
|
|
// Update the UTM bounding box from the reservoir
|
|
|
|
app->project()->computeUtmAreaOfInterest();
|
|
|
|
|
2013-10-24 02:50:16 -05:00
|
|
|
QString wellPathsFolderPath = RimTools::getCacheRootDirectoryPathFromProject();
|
|
|
|
wellPathsFolderPath += "_wellpaths";
|
|
|
|
QDir::root().mkpath(wellPathsFolderPath);
|
2013-09-06 06:06:39 -05:00
|
|
|
|
2013-09-06 08:59:25 -05:00
|
|
|
RimWellPathImport* copyOfWellPathImport = dynamic_cast<RimWellPathImport*>(app->project()->wellPathImport->deepCopy());
|
|
|
|
RiuWellImportWizard wellImportwizard(app->preferences()->ssihubAddress, wellPathsFolderPath, copyOfWellPathImport, this);
|
2013-10-23 03:42:34 -05:00
|
|
|
|
|
|
|
RimWellPathImport* wellPathObjectToBeDeleted = NULL;
|
|
|
|
|
2013-09-08 03:53:25 -05:00
|
|
|
// Get password/username from application cache
|
|
|
|
{
|
|
|
|
QString ssihubUsername = app->cacheDataObject("ssihub_username").toString();
|
|
|
|
QString ssihubPassword = app->cacheDataObject("ssihub_password").toString();
|
|
|
|
|
|
|
|
wellImportwizard.setCredentials(ssihubUsername, ssihubPassword);
|
|
|
|
}
|
|
|
|
|
2013-09-06 06:06:39 -05:00
|
|
|
if (QDialog::Accepted == wellImportwizard.exec())
|
|
|
|
{
|
|
|
|
QStringList wellPaths = wellImportwizard.absoluteFilePathsToWellPaths();
|
|
|
|
if (wellPaths.size() > 0)
|
|
|
|
{
|
|
|
|
app->addWellPathsToModel(wellPaths);
|
|
|
|
app->project()->createDisplayModelAndRedrawAllViews();
|
|
|
|
}
|
2013-05-29 05:59:08 -05:00
|
|
|
|
2013-10-23 03:42:34 -05:00
|
|
|
wellPathObjectToBeDeleted = app->project()->wellPathImport;
|
2013-09-06 08:59:25 -05:00
|
|
|
app->project()->wellPathImport = copyOfWellPathImport;
|
2013-09-08 03:53:25 -05:00
|
|
|
|
|
|
|
app->setCacheDataObject("ssihub_username", wellImportwizard.field("username"));
|
|
|
|
app->setCacheDataObject("ssihub_password", wellImportwizard.field("password"));
|
2013-05-31 06:57:16 -05:00
|
|
|
}
|
2013-10-23 03:42:34 -05:00
|
|
|
else
|
|
|
|
{
|
|
|
|
wellPathObjectToBeDeleted = copyOfWellPathImport;
|
|
|
|
}
|
|
|
|
|
|
|
|
delete wellPathObjectToBeDeleted;
|
2013-05-29 05:59:08 -05:00
|
|
|
}
|
2013-08-08 04:09:18 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::slotShowCommandLineHelp()
|
|
|
|
{
|
|
|
|
RiaApplication* app = RiaApplication::instance();
|
|
|
|
QString text = app->commandLineParameterHelp();
|
|
|
|
app->showFormattedTextInMessageBox(text);
|
|
|
|
}
|
2013-09-12 01:11:56 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::slotCreateCommandObject()
|
|
|
|
{
|
|
|
|
RiaApplication* app = RiaApplication::instance();
|
|
|
|
if (!app->project()) return;
|
|
|
|
|
|
|
|
QItemSelectionModel* selectionModel = m_treeView->selectionModel();
|
|
|
|
if (selectionModel)
|
|
|
|
{
|
|
|
|
QModelIndexList selectedModelIndices = selectionModel->selectedIndexes();
|
|
|
|
|
|
|
|
caf::PdmObjectGroup selectedObjects;
|
|
|
|
m_treeModelPdm->populateObjectGroupFromModelIndexList(selectedModelIndices, &selectedObjects);
|
|
|
|
|
|
|
|
std::vector<RimCommandObject*> commandObjects;
|
2013-09-12 01:29:37 -05:00
|
|
|
RimCommandFactory::createCommandObjects(selectedObjects, &commandObjects);
|
2013-09-12 01:11:56 -05:00
|
|
|
|
|
|
|
for (size_t i = 0; i < commandObjects.size(); i++)
|
|
|
|
{
|
|
|
|
app->project()->commandObjects.push_back(commandObjects[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
app->project()->updateConnectedEditors();
|
|
|
|
}
|
|
|
|
}
|
2013-09-27 03:04:10 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::slotShowRegressionTestDialog()
|
|
|
|
{
|
|
|
|
RiaRegressionTest regTestConfig;
|
|
|
|
|
|
|
|
RiaApplication* app = RiaApplication::instance();
|
|
|
|
app->readFieldsFromApplicationStore(®TestConfig);
|
|
|
|
|
|
|
|
RiuPreferencesDialog regressionTestDialog(this, ®TestConfig, "Regression Test");
|
|
|
|
if (regressionTestDialog.exec() == QDialog::Accepted)
|
|
|
|
{
|
|
|
|
// Write preferences using QSettings and apply them to the application
|
|
|
|
app->writeFieldsToApplicationStore(®TestConfig);
|
|
|
|
|
|
|
|
QString currentApplicationPath = QDir::currentPath();
|
|
|
|
|
|
|
|
QDir::setCurrent(regTestConfig.applicationWorkingFolder);
|
|
|
|
app->executeRegressionTests(regTestConfig.regressionTestFolder);
|
|
|
|
|
|
|
|
QDir::setCurrent(currentApplicationPath);
|
|
|
|
}
|
|
|
|
}
|
2013-09-30 00:56:47 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::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);
|
|
|
|
}
|
|
|
|
}
|
2013-10-04 03:22:17 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::setDefaultWindowSize()
|
|
|
|
{
|
|
|
|
resize(1000, 810);
|
|
|
|
}
|
2013-10-18 04:19:49 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::slotAddWellCellsToRangeFilterAction(bool doAdd)
|
|
|
|
{
|
|
|
|
RimReservoirView* riv = RiaApplication::instance()->activeReservoirView();
|
|
|
|
if (riv)
|
|
|
|
{
|
|
|
|
caf::AppEnum<RimWellCollection::WellCellsRangeFilterType> rangeAddType;
|
|
|
|
rangeAddType = doAdd ? RimWellCollection::RANGE_ADD_INDIVIDUAL : RimWellCollection::RANGE_ADD_NONE;
|
2013-10-22 04:28:14 -05:00
|
|
|
riv->wellCollection()->wellCellsToRangeFilterMode.setValueFromUi(static_cast<unsigned int>(rangeAddType.index()));
|
2013-10-18 04:19:49 -05:00
|
|
|
}
|
|
|
|
}
|
2013-10-24 03:46:57 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::slotOpenUsersGuideInBrowserAction()
|
|
|
|
{
|
|
|
|
QString usersGuideUrl = "https://github.com/OPM/ResInsight/blob/internal/Documentation/UsersGuide/UsersGuide.md";
|
|
|
|
|
|
|
|
if (!QDesktopServices::openUrl(usersGuideUrl))
|
|
|
|
{
|
|
|
|
QErrorMessage* errorHandler = QErrorMessage::qtHandler();
|
|
|
|
errorHandler->showMessage("Failed open browser with the following url\n\n" + usersGuideUrl);
|
|
|
|
}
|
|
|
|
}
|
2013-10-24 04:06:26 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RiuMainWindow::appendActionsContextMenuForPdmObject(caf::PdmObject* pdmObject, QMenu* menu)
|
|
|
|
{
|
|
|
|
if (!menu)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dynamic_cast<RimWellPathCollection*>(pdmObject))
|
|
|
|
{
|
|
|
|
menu->addAction(m_importWellPathsFromFileAction);
|
|
|
|
menu->addAction(m_importWellPathsFromSSIHubAction);
|
|
|
|
}
|
|
|
|
else if (dynamic_cast<RimAnalysisModels*>(pdmObject))
|
|
|
|
{
|
|
|
|
menu->addAction(m_importEclipseCaseAction);
|
|
|
|
menu->addAction(m_importInputEclipseFileAction);
|
|
|
|
menu->addAction(m_openMultipleEclipseCasesAction);
|
|
|
|
}
|
|
|
|
}
|