2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 02:45:23 -05:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2016-06-24 08:53:04 -05:00
|
|
|
#include "RiuMainWindowBase.h"
|
|
|
|
|
2016-10-04 04:44:31 -05:00
|
|
|
#include "cafPdmUiDragDropInterface.h"
|
2018-02-13 06:29:44 -06:00
|
|
|
#include "cafPdmObjectHandle.h"
|
2016-10-04 04:44:31 -05:00
|
|
|
|
2013-05-06 03:55:00 -05:00
|
|
|
#include <QEvent>
|
2012-05-18 02:45:23 -05:00
|
|
|
#include <QPointer>
|
2016-01-06 16:01:27 -06:00
|
|
|
#include <QMdiArea>
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2016-10-04 02:29:45 -05:00
|
|
|
#include <memory>
|
2016-10-06 01:33:34 -05:00
|
|
|
#include <vector>
|
2016-10-04 02:29:45 -05:00
|
|
|
|
2015-08-06 13:37:40 -05:00
|
|
|
class QActionGroup;
|
|
|
|
class QMdiSubWindow;
|
2013-04-26 04:49:37 -05:00
|
|
|
class QSpinBox;
|
2015-08-06 13:37:40 -05:00
|
|
|
class QUndoView;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-08-06 13:37:40 -05:00
|
|
|
class RimCase;
|
2017-02-23 07:24:18 -06:00
|
|
|
|
|
|
|
class RiuMessagePanel;
|
2015-08-06 13:37:40 -05:00
|
|
|
class RiuProcessMonitor;
|
|
|
|
class RiuResultInfoPanel;
|
2015-11-11 07:07:21 -06:00
|
|
|
class RiuResultQwtPlot;
|
2017-02-23 07:24:18 -06:00
|
|
|
class RiuViewer;
|
2017-10-27 02:38:24 -05:00
|
|
|
class RiuRelativePermeabilityPlotPanel;
|
|
|
|
class RiuPvtPlotPanel;
|
2018-02-21 04:08:35 -06:00
|
|
|
class RiuMohrsCirclePlot;
|
2017-02-23 07:24:18 -06:00
|
|
|
|
2016-05-26 06:17:26 -05:00
|
|
|
struct RimMdiWindowGeometry;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
namespace caf
|
|
|
|
{
|
2015-10-23 08:46:25 -05:00
|
|
|
class PdmUiTreeView;
|
2012-05-18 02:45:23 -05:00
|
|
|
class AnimationToolBar;
|
2017-02-23 07:24:18 -06:00
|
|
|
class PdmObject;
|
2012-06-26 09:10:41 -05:00
|
|
|
class PdmUiPropertyView;
|
2015-08-14 11:06:22 -05:00
|
|
|
class PdmUiItem;
|
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
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
2016-06-24 08:53:04 -05:00
|
|
|
class RiuMainWindow : public RiuMainWindowBase
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-03-22 11:17:56 -05:00
|
|
|
RiuMainWindow();
|
2016-10-04 02:29:45 -05:00
|
|
|
|
2013-03-22 11:17:56 -05:00
|
|
|
static RiuMainWindow* instance();
|
2016-06-24 08:53:04 -05:00
|
|
|
|
2018-02-27 04:23:43 -06:00
|
|
|
QString mainWindowName() override;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2015-10-23 08:46:25 -05:00
|
|
|
void initializeGuiNewProjectLoaded();
|
2016-07-18 09:16:10 -05:00
|
|
|
void cleanupGuiCaseClose();
|
2015-10-23 08:46:25 -05:00
|
|
|
void cleanupGuiBeforeProjectClose();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2017-01-17 06:06:57 -06:00
|
|
|
void removeViewer( QWidget* viewer ) override;
|
|
|
|
void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry) override;
|
|
|
|
void setActiveViewer(QWidget* subWindow) override;
|
2015-08-27 09:13:49 -05:00
|
|
|
|
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
|
|
|
|
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-04-23 00:29:37 -05:00
|
|
|
|
2015-05-15 11:51:49 -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();
|
|
|
|
|
2013-12-18 16:37:30 -06:00
|
|
|
void refreshDrawStyleActions();
|
2014-07-31 07:04:37 -05:00
|
|
|
|
2017-10-19 00:30:28 -05:00
|
|
|
void setExpanded(const caf::PdmUiItem* uiItem, bool expanded = true);
|
2013-10-24 04:06:26 -05:00
|
|
|
|
2018-02-27 04:23:43 -06:00
|
|
|
RimMdiWindowGeometry windowGeometryForViewer(QWidget* viewer) override;
|
2015-09-01 15:11:39 -05:00
|
|
|
|
2015-09-16 08:46:01 -05:00
|
|
|
void tileWindows();
|
2015-09-17 01:25:10 -05:00
|
|
|
bool isAnyMdiSubWindowVisible();
|
2015-09-21 08:00:54 -05:00
|
|
|
QMdiSubWindow* findMdiSubWindow(QWidget* viewer);
|
2018-03-12 05:12:39 -05:00
|
|
|
QList<QMdiSubWindow*> subWindowList(QMdiArea::WindowOrder order);
|
2015-09-16 08:46:01 -05:00
|
|
|
|
2017-10-27 02:38:24 -05:00
|
|
|
RiuResultQwtPlot* resultPlot();
|
|
|
|
RiuRelativePermeabilityPlotPanel* relativePermeabilityPlotPanel();
|
|
|
|
RiuPvtPlotPanel* pvtPlotPanel();
|
2018-02-22 10:52:10 -06:00
|
|
|
RiuMohrsCirclePlot* mohrsCirclePlot();
|
2017-10-27 02:38:24 -05:00
|
|
|
RiuMessagePanel* messagePanel();
|
2015-11-04 07:18:52 -06:00
|
|
|
|
2017-04-07 02:21:26 -05:00
|
|
|
void showProcessMonitorDockPanel();
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
protected:
|
2015-10-23 08:46:25 -05:00
|
|
|
virtual void closeEvent(QCloseEvent* event);
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
void createActions();
|
|
|
|
void createMenus();
|
|
|
|
void createToolBars();
|
|
|
|
void createDockPanels();
|
|
|
|
|
2013-04-19 06:20:46 -05:00
|
|
|
void restoreTreeViewState();
|
|
|
|
|
2017-04-07 02:21:26 -05:00
|
|
|
void showDockPanel(const QString& dockPanelName);
|
|
|
|
|
2018-02-13 06:29:44 -06:00
|
|
|
void updateUiFieldsFromActiveResult(caf::PdmObjectHandle* objectToUpdate);
|
|
|
|
|
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
|
|
|
|
2015-10-23 08:46:25 -05:00
|
|
|
QByteArray m_initialDockAndToolbarLayout; // Initial dock window and toolbar layout, used to reset GUI
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Edit actions
|
2015-10-23 08:46:25 -05:00
|
|
|
QAction* m_newPropertyView;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// View actions
|
2015-10-23 08:46:25 -05:00
|
|
|
QAction* m_viewFromNorth;
|
|
|
|
QAction* m_viewFromSouth;
|
|
|
|
QAction* m_viewFromEast;
|
|
|
|
QAction* m_viewFromWest;
|
|
|
|
QAction* m_viewFromAbove;
|
|
|
|
QAction* m_viewFromBelow;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-02-06 04:43:26 -06:00
|
|
|
// Mock actions
|
2015-10-23 08:46:25 -05:00
|
|
|
QAction* m_mockModelAction;
|
|
|
|
QAction* m_mockResultsModelAction;
|
|
|
|
QAction* m_mockLargeResultsModelAction;
|
|
|
|
QAction* m_mockModelCustomizedAction;
|
|
|
|
QAction* m_mockInputModelAction;
|
2013-02-06 04:43:26 -06:00
|
|
|
|
2015-10-23 08:46:25 -05:00
|
|
|
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
|
|
|
caf::AnimationToolBar* m_animationToolBar;
|
|
|
|
|
|
|
|
QMdiArea* m_mdiArea;
|
2015-09-16 05:56:48 -05:00
|
|
|
RiuViewer* m_mainViewer;
|
|
|
|
RiuResultInfoPanel* m_resultInfoPanel;
|
|
|
|
RiuProcessMonitor* m_processMonitor;
|
2017-02-23 07:24:18 -06:00
|
|
|
QPointer<RiuMessagePanel> m_messagePanel;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2017-10-27 02:38:24 -05:00
|
|
|
RiuResultQwtPlot* m_resultQwtPlot;
|
2018-02-21 04:08:35 -06:00
|
|
|
RiuMohrsCirclePlot* m_mohrsCirclePlot;
|
2017-10-27 02:38:24 -05:00
|
|
|
RiuRelativePermeabilityPlotPanel* m_relPermPlotPanel;
|
|
|
|
RiuPvtPlotPanel* m_pvtPlotPanel;
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
QMenu* m_windowMenu;
|
|
|
|
|
|
|
|
|
|
|
|
// Menu and action slots
|
|
|
|
private slots:
|
|
|
|
|
2015-09-17 01:25:10 -05:00
|
|
|
friend class RiuMdiSubWindow;
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
// File slots
|
|
|
|
void slotRefreshFileActions();
|
|
|
|
|
|
|
|
// Edit slots
|
|
|
|
void slotRefreshEditActions();
|
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();
|
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);
|
2015-11-27 06:45:02 -06:00
|
|
|
void slotToggleHideGridCellsAction(bool);
|
2014-01-23 00:31:07 -06:00
|
|
|
void slotToggleFaultLabelsAction(bool);
|
2015-06-17 08:09:46 -05:00
|
|
|
void slotDisableLightingAction(bool);
|
2013-12-18 16:37:30 -06:00
|
|
|
|
2017-01-26 10:41:34 -06:00
|
|
|
void slotShowWellCellsAction(bool doAdd);
|
2013-04-18 08:10:57 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
// Debug slots
|
|
|
|
void slotUseShaders(bool enable);
|
|
|
|
void slotShowPerformanceInfo(bool enable);
|
2013-02-06 04:43:26 -06:00
|
|
|
|
|
|
|
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();
|
2013-10-28 04:32:24 -05:00
|
|
|
void slotMockModelCustomized();
|
2013-02-06 04:43:26 -06:00
|
|
|
void slotInputMockModel();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// Windows slots
|
|
|
|
void slotBuildWindowActions();
|
|
|
|
|
|
|
|
void slotSubWindowActivated(QMdiSubWindow* subWindow);
|
2015-08-04 08:57:58 -05:00
|
|
|
|
2015-10-23 08:46:25 -05:00
|
|
|
void selectedObjectsChanged();
|
2015-08-06 04:00:21 -05:00
|
|
|
void customMenuRequested(const QPoint& pos);
|
2015-08-04 08:57:58 -05:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
// Animation slots
|
|
|
|
void slotFramerateChanged(double frameRate);
|
|
|
|
|
|
|
|
// Pdm System :
|
|
|
|
public:
|
|
|
|
void setPdmRoot(caf::PdmObject* pdmRoot);
|
|
|
|
private:
|
2015-08-18 04:23:53 -05:00
|
|
|
|
2016-10-04 02:29:45 -05:00
|
|
|
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
2015-08-18 04:23:53 -05:00
|
|
|
|
2015-08-06 13:37:40 -05:00
|
|
|
QUndoView* m_undoView;
|
2015-08-04 08:57:58 -05:00
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
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;
|
2015-06-17 08:09:46 -05:00
|
|
|
QAction* m_disableLightingAction;
|
2015-12-03 01:39:08 -06:00
|
|
|
QAction* m_drawStyleHideGridCellsAction;
|
2014-01-23 00:31:07 -06:00
|
|
|
QAction* m_toggleFaultsLabelAction;
|
2013-04-18 08:10:57 -05:00
|
|
|
QAction* m_drawStyleLinesAction;
|
|
|
|
QAction* m_drawStyleLinesSolidAction;
|
2013-12-18 16:37:30 -06:00
|
|
|
QAction* m_drawStyleFaultLinesSolidAction;
|
2013-04-18 08:10:57 -05:00
|
|
|
QAction* m_drawStyleSurfOnlyAction;
|
2017-01-26 10:41:34 -06:00
|
|
|
QAction* m_showWellCellsAction;
|
2013-10-18 04:19:49 -05:00
|
|
|
|
2015-08-31 00:53:03 -05:00
|
|
|
std::vector<QPointer<QDockWidget> > additionalProjectViews;
|
2015-09-10 01:14:28 -05:00
|
|
|
|
|
|
|
bool m_blockSlotSubWindowActivated;
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|