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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "cafUiTreeModelPdm.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QEvent>
|
2012-05-18 02:45:23 -05:00
|
|
|
#include <QPointer>
|
|
|
|
|
|
|
|
class QTreeView;
|
|
|
|
class QMdiArea;
|
|
|
|
class QFrame;
|
|
|
|
class QMdiSubWindow;
|
|
|
|
class QComboBox;
|
|
|
|
class QLabel;
|
|
|
|
class QLineEdit;
|
2012-06-26 09:10:41 -05:00
|
|
|
class QItemSelection;
|
2013-04-18 08:10:57 -05:00
|
|
|
class QActionGroup;
|
2013-04-26 04:49:37 -05:00
|
|
|
class QSpinBox;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-03-22 11:17:56 -05:00
|
|
|
class RiuViewer;
|
|
|
|
class RiuResultInfoPanel;
|
|
|
|
class RiuProcessMonitor;
|
2012-05-18 02:45:23 -05:00
|
|
|
class RimUiTreeModelPdm;
|
2013-04-19 06:20:46 -05:00
|
|
|
class RimUiTreeView;
|
2013-05-15 05:03:36 -05:00
|
|
|
class RimCase;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
namespace caf
|
|
|
|
{
|
|
|
|
class UiPropertyCreatorPdm;
|
|
|
|
class UiTreeModelPdm;
|
|
|
|
class PdmObject;
|
|
|
|
class FrameAnimationControl;
|
|
|
|
class AnimationToolBar;
|
2012-06-26 09:10:41 -05:00
|
|
|
class PdmUiPropertyView;
|
2012-05-18 02:45:23 -05:00
|
|
|
}
|
|
|
|
|
2013-05-29 05:59:08 -05:00
|
|
|
namespace ssihub
|
|
|
|
{
|
|
|
|
class Interface;
|
|
|
|
}
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
2013-03-22 11:17:56 -05:00
|
|
|
class RiuMainWindow : public QMainWindow
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-03-22 11:17:56 -05:00
|
|
|
RiuMainWindow();
|
|
|
|
static RiuMainWindow* instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
void initializeGuiNewProjectLoaded();
|
|
|
|
void cleanupGuiBeforeProjectClose();
|
|
|
|
|
2013-03-22 11:17:56 -05:00
|
|
|
void removeViewer( RiuViewer* viewer );
|
|
|
|
void addViewer(RiuViewer* viewer);
|
|
|
|
void setActiveViewer(RiuViewer* subWindow);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
void setResultInfo(const QString& info) const;
|
|
|
|
|
|
|
|
void refreshAnimationActions();
|
2013-04-26 04:49:37 -05:00
|
|
|
void updateScaleValue();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
RimUiTreeModelPdm* uiPdmModel() { return m_treeModelPdm;}
|
|
|
|
|
2013-03-22 11:17:56 -05:00
|
|
|
RiuProcessMonitor* processMonitor();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-11 04:47:45 -06:00
|
|
|
void hideAllDockWindows();
|
2013-09-12 02:07:29 -05:00
|
|
|
void loadWinGeoAndDockToolBarLayout();
|
2013-02-11 04:47:45 -06:00
|
|
|
|
2013-04-23 00:29:37 -05:00
|
|
|
void setCurrentObjectInTreeView(caf::PdmObject* object);
|
|
|
|
|
2013-05-15 05:03:36 -05:00
|
|
|
void selectedCases(std::vector<RimCase*>& cases);
|
2013-05-13 15:32:01 -05:00
|
|
|
|
2013-10-04 03:22:17 -05:00
|
|
|
void setDefaultWindowSize();
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
protected:
|
|
|
|
virtual void closeEvent(QCloseEvent* event);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void createActions();
|
|
|
|
void createMenus();
|
|
|
|
void createToolBars();
|
|
|
|
void createDockPanels();
|
|
|
|
void saveWinGeoAndDockToolBarLayout();
|
|
|
|
|
|
|
|
bool checkForDocumentModifications();
|
|
|
|
|
|
|
|
void updateMRUList(const QString &fileName, bool remove = false);
|
|
|
|
|
2013-03-22 11:17:56 -05:00
|
|
|
QMdiSubWindow* findMdiSubWindow(RiuViewer* viewer);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-19 06:20:46 -05:00
|
|
|
void storeTreeViewState();
|
|
|
|
void restoreTreeViewState();
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private:
|
2013-03-22 11:17:56 -05:00
|
|
|
static RiuMainWindow* sm_mainWindowInstance;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
QByteArray m_initialDockAndToolbarLayout; // Initial dock window and toolbar layout, used to reset GUI
|
|
|
|
|
|
|
|
private:
|
|
|
|
// File actions
|
2013-10-18 09:23:31 -05:00
|
|
|
QAction* m_importEclipseCaseAction;
|
|
|
|
QAction* m_importInputEclipseFileAction;
|
2013-02-21 09:46:34 -06:00
|
|
|
QAction* m_openMultipleEclipseCasesAction;
|
2012-05-18 02:45:23 -05:00
|
|
|
QAction* m_openProjectAction;
|
|
|
|
QAction* m_openLastUsedProjectAction;
|
2013-06-18 04:56:51 -05:00
|
|
|
QAction* m_importWellPathsFromFileAction;
|
|
|
|
QAction* m_importWellPathsFromSSIHubAction;
|
2012-05-18 02:45:23 -05:00
|
|
|
QAction* m_saveProjectAction;
|
|
|
|
QAction* m_saveProjectAsAction;
|
2013-04-17 03:59:34 -05:00
|
|
|
QAction* m_closeProjectAction;
|
2012-05-18 02:45:23 -05:00
|
|
|
QAction* m_exitAction;
|
|
|
|
|
|
|
|
// Edit actions
|
|
|
|
QAction* m_editPreferences;
|
2013-02-06 04:43:26 -06:00
|
|
|
QAction* m_newPropertyView;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// View actions
|
|
|
|
QAction* m_viewFromNorth;
|
|
|
|
QAction* m_viewFromSouth;
|
|
|
|
QAction* m_viewFromEast;
|
|
|
|
QAction* m_viewFromWest;
|
|
|
|
QAction* m_viewFromAbove;
|
|
|
|
QAction* m_viewFromBelow;
|
|
|
|
QAction* m_zoomAll;
|
|
|
|
|
2013-02-06 04:43:26 -06:00
|
|
|
// Mock actions
|
|
|
|
QAction* m_mockModelAction;
|
|
|
|
QAction* m_mockResultsModelAction;
|
|
|
|
QAction* m_mockLargeResultsModelAction;
|
|
|
|
QAction* m_mockInputModelAction;
|
|
|
|
|
|
|
|
QAction* m_snapshotToFile;
|
|
|
|
QAction* m_snapshotToClipboard;
|
|
|
|
QAction* m_snapshotAllViewsToFile;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-09-12 01:11:56 -05:00
|
|
|
QAction* m_createCommandObject;
|
2013-09-27 03:04:10 -05:00
|
|
|
QAction* m_showRegressionTestDialog;
|
2013-09-30 00:56:47 -05:00
|
|
|
QAction* m_executePaintEventPerformanceTest;
|
2013-09-12 01:11:56 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
// Help actions
|
|
|
|
QAction* m_aboutAction;
|
2013-08-08 04:09:18 -05:00
|
|
|
QAction* m_commandLineHelpAction;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// Animation
|
|
|
|
caf::AnimationToolBar* m_animationToolBar;
|
|
|
|
|
|
|
|
// Toolbars
|
|
|
|
QToolBar* m_viewToolBar;
|
|
|
|
QToolBar* m_standardToolBar;
|
2013-04-17 03:59:34 -05:00
|
|
|
QToolBar* m_snapshotToolbar;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
QFrame* m_CentralFrame;
|
|
|
|
QMdiArea* m_mdiArea;
|
2013-03-22 11:17:56 -05:00
|
|
|
RiuViewer* m_mainViewer;
|
|
|
|
RiuResultInfoPanel* m_resultInfoPanel;
|
|
|
|
RiuProcessMonitor* m_processMonitor;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
QMenu* m_windowMenu;
|
|
|
|
|
|
|
|
|
|
|
|
// Menu and action slots
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
// File slots
|
2013-10-18 09:23:31 -05:00
|
|
|
void slotImportEclipseCase();
|
|
|
|
void slotImportInputEclipseFiles();
|
2013-02-21 09:46:34 -06:00
|
|
|
void slotOpenMultipleCases();
|
2012-05-18 02:45:23 -05:00
|
|
|
void slotOpenProject();
|
|
|
|
void slotOpenLastUsedProject();
|
2013-06-18 04:56:51 -05:00
|
|
|
void slotImportWellPathsFromFile();
|
|
|
|
void slotImportWellPathsFromSSIHub();
|
2012-05-18 02:45:23 -05:00
|
|
|
void slotSaveProject();
|
|
|
|
void slotSaveProjectAs();
|
|
|
|
void slotCloseProject();
|
|
|
|
|
|
|
|
void slotRefreshFileActions();
|
|
|
|
|
|
|
|
// Edit slots
|
|
|
|
void slotRefreshEditActions();
|
|
|
|
void slotEditPreferences();
|
2013-02-06 04:43:26 -06:00
|
|
|
void slotNewObjectPropertyView();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// View slots
|
|
|
|
void slotRefreshViewActions();
|
|
|
|
void slotViewFromNorth();
|
|
|
|
void slotViewFromSouth();
|
|
|
|
void slotViewFromEast();
|
|
|
|
void slotViewFromWest();
|
|
|
|
void slotViewFromAbove();
|
|
|
|
void slotViewFromBelow();
|
|
|
|
void slotZoomAll();
|
2013-04-26 04:49:37 -05:00
|
|
|
void slotScaleChanged(int scaleValue);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-18 08:10:57 -05:00
|
|
|
void slotDrawStyleChanged(QAction* activatedAction);
|
|
|
|
void slotToggleFaultsAction(bool);
|
2013-10-18 04:19:49 -05:00
|
|
|
void slotAddWellCellsToRangeFilterAction(bool doAdd);
|
2013-04-18 08:10:57 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
// Debug slots
|
|
|
|
void slotRefreshDebugActions();
|
|
|
|
void slotUseShaders(bool enable);
|
|
|
|
void slotShowPerformanceInfo(bool enable);
|
2013-02-06 04:43:26 -06:00
|
|
|
|
|
|
|
void slotSnapshotToFile();
|
|
|
|
void slotSnapshotToClipboard();
|
|
|
|
void slotSnapshotAllViewsToFile();
|
|
|
|
|
2013-09-12 01:11:56 -05:00
|
|
|
void slotCreateCommandObject();
|
|
|
|
|
2013-09-27 03:04:10 -05:00
|
|
|
void slotShowRegressionTestDialog();
|
2013-09-30 00:56:47 -05:00
|
|
|
void slotExecutePaintEventPerformanceTest();
|
2013-09-27 03:04:10 -05:00
|
|
|
|
2013-02-06 04:43:26 -06:00
|
|
|
// Mock models
|
|
|
|
void slotMockModel();
|
|
|
|
void slotMockResultsModel();
|
|
|
|
void slotMockLargeResultsModel();
|
|
|
|
void slotInputMockModel();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// Windows slots
|
|
|
|
void slotBuildWindowActions();
|
|
|
|
|
|
|
|
// Help slots
|
|
|
|
void slotAbout();
|
2013-08-08 04:09:18 -05:00
|
|
|
void slotShowCommandLineHelp();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
void slotSubWindowActivated(QMdiSubWindow* subWindow);
|
|
|
|
void slotCurrentChanged(const QModelIndex & current, const QModelIndex & previous);
|
|
|
|
|
|
|
|
// Animation slots
|
|
|
|
void slotSetCurrentFrame(int frameIndex);
|
|
|
|
void slotFramerateChanged(double frameRate);
|
|
|
|
|
|
|
|
// Pdm System :
|
|
|
|
public:
|
|
|
|
void setPdmRoot(caf::PdmObject* pdmRoot);
|
|
|
|
|
|
|
|
private:
|
2013-04-19 06:20:46 -05:00
|
|
|
RimUiTreeView* m_treeView;
|
2012-06-26 09:10:41 -05:00
|
|
|
RimUiTreeModelPdm* m_treeModelPdm;
|
|
|
|
caf::PdmObject* m_pdmRoot;
|
|
|
|
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
2013-04-17 03:59:34 -05:00
|
|
|
|
2013-04-26 04:49:37 -05:00
|
|
|
QSpinBox* m_scaleFactor;
|
|
|
|
|
2013-04-18 08:10:57 -05:00
|
|
|
QActionGroup* m_dsActionGroup;
|
|
|
|
QAction* m_drawStyleToggleFaultsAction;
|
|
|
|
QAction* m_drawStyleLinesAction;
|
|
|
|
QAction* m_drawStyleLinesSolidAction;
|
|
|
|
QAction* m_drawStyleSurfOnlyAction;
|
2013-10-18 04:19:49 -05:00
|
|
|
QAction* m_addWellCellsToRangeFilterAction;
|
|
|
|
|
2013-04-18 08:10:57 -05:00
|
|
|
void refreshDrawStyleActions();
|
|
|
|
|
2013-04-17 03:59:34 -05:00
|
|
|
std::vector<QPointer<QDockWidget> > additionalProjectTrees;
|
|
|
|
std::vector<QPointer<QDockWidget> > additionalPropertyEditors;
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|