2012-05-18 09:45:23 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2014-09-23 15:04:57 +02:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2012-05-18 09:45:23 +02: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 15:53:04 +02:00
|
|
|
#include "RiuMainWindowBase.h"
|
2019-04-02 19:18:00 +02:00
|
|
|
#include "RiuMdiArea.h"
|
2016-06-24 15:53:04 +02:00
|
|
|
|
2016-10-04 11:44:31 +02:00
|
|
|
#include "cafPdmUiDragDropInterface.h"
|
2018-02-13 13:29:44 +01:00
|
|
|
#include "cafPdmObjectHandle.h"
|
2016-10-04 11:44:31 +02:00
|
|
|
|
2013-05-06 10:55:00 +02:00
|
|
|
#include <QEvent>
|
2018-06-11 13:47:21 +02:00
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QPointer>
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2016-10-04 09:29:45 +02:00
|
|
|
#include <memory>
|
2016-10-06 08:33:34 +02:00
|
|
|
#include <vector>
|
2016-10-04 09:29:45 +02:00
|
|
|
|
2015-08-06 20:37:40 +02:00
|
|
|
class QActionGroup;
|
|
|
|
|
class QMdiSubWindow;
|
2018-06-18 14:17:13 +02:00
|
|
|
class QToolButton;
|
2013-04-26 11:49:37 +02:00
|
|
|
class QSpinBox;
|
2018-06-14 12:04:16 +02:00
|
|
|
class QTimer;
|
2015-08-06 20:37:40 +02:00
|
|
|
class QUndoView;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2015-08-06 20:37:40 +02:00
|
|
|
class RimCase;
|
2018-10-24 11:30:34 +02:00
|
|
|
class RimViewWindow;
|
2017-02-23 14:24:18 +01:00
|
|
|
|
|
|
|
|
class RiuMessagePanel;
|
2015-08-06 20:37:40 +02:00
|
|
|
class RiuProcessMonitor;
|
|
|
|
|
class RiuResultInfoPanel;
|
2015-11-11 14:07:21 +01:00
|
|
|
class RiuResultQwtPlot;
|
2017-10-27 09:38:24 +02:00
|
|
|
class RiuRelativePermeabilityPlotPanel;
|
|
|
|
|
class RiuPvtPlotPanel;
|
2018-02-21 11:08:35 +01:00
|
|
|
class RiuMohrsCirclePlot;
|
2017-02-23 14:24:18 +01:00
|
|
|
|
2016-05-26 13:17:26 +02:00
|
|
|
struct RimMdiWindowGeometry;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
namespace caf
|
|
|
|
|
{
|
2015-10-23 15:46:25 +02:00
|
|
|
class PdmUiTreeView;
|
2012-05-18 09:45:23 +02:00
|
|
|
class AnimationToolBar;
|
2017-02-23 14:24:18 +01:00
|
|
|
class PdmObject;
|
2012-06-26 16:10:41 +02:00
|
|
|
class PdmUiPropertyView;
|
2015-08-14 18:06:22 +02:00
|
|
|
class PdmUiItem;
|
2012-05-18 09:45:23 +02:00
|
|
|
}
|
|
|
|
|
|
2013-05-29 12:59:08 +02:00
|
|
|
namespace ssihub
|
|
|
|
|
{
|
|
|
|
|
class Interface;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
//==================================================================================================
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
//==================================================================================================
|
2016-06-24 15:53:04 +02:00
|
|
|
class RiuMainWindow : public RiuMainWindowBase
|
2012-05-18 09:45:23 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2013-03-22 17:17:56 +01:00
|
|
|
RiuMainWindow();
|
2016-10-04 09:29:45 +02:00
|
|
|
|
2013-03-22 17:17:56 +01:00
|
|
|
static RiuMainWindow* instance();
|
2016-06-24 15:53:04 +02:00
|
|
|
|
2018-02-27 11:23:43 +01:00
|
|
|
QString mainWindowName() override;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2015-10-23 15:46:25 +02:00
|
|
|
void initializeGuiNewProjectLoaded();
|
2016-07-18 16:16:10 +02:00
|
|
|
void cleanupGuiCaseClose();
|
2015-10-23 15:46:25 +02:00
|
|
|
void cleanupGuiBeforeProjectClose();
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2017-01-17 13:06:57 +01:00
|
|
|
void removeViewer( QWidget* viewer ) override;
|
|
|
|
|
void addViewer(QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry) override;
|
|
|
|
|
void setActiveViewer(QWidget* subWindow) override;
|
2015-08-27 16:13:49 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
void setResultInfo(const QString& info) const;
|
|
|
|
|
|
2018-10-23 16:32:40 +02:00
|
|
|
void refreshViewActions();
|
|
|
|
|
void refreshAnimationActions();
|
2013-04-26 11:49:37 +02:00
|
|
|
void updateScaleValue();
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2013-03-22 17:17:56 +01:00
|
|
|
RiuProcessMonitor* processMonitor();
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2015-05-15 18:51:49 +02:00
|
|
|
void selectedCases(std::vector<RimCase*>& cases);
|
2013-05-13 22:32:01 +02:00
|
|
|
|
2013-10-04 10:22:17 +02:00
|
|
|
void setDefaultWindowSize();
|
|
|
|
|
|
2013-12-18 23:37:30 +01:00
|
|
|
void refreshDrawStyleActions();
|
2014-07-31 14:04:37 +02:00
|
|
|
|
2019-04-02 19:18:00 +02:00
|
|
|
void tileSubWindows() override;
|
|
|
|
|
void storeSubWindowTiling(bool tiled) override;
|
|
|
|
|
void clearWindowTiling() override;
|
|
|
|
|
|
|
|
|
|
bool subWindowsAreTiled() const override;
|
2015-09-17 08:25:10 +02:00
|
|
|
bool isAnyMdiSubWindowVisible();
|
2019-03-29 12:00:29 +01:00
|
|
|
QMdiSubWindow* findMdiSubWindow(QWidget* viewer) override;
|
2018-10-24 11:30:34 +02:00
|
|
|
RimViewWindow* findViewWindowFromSubWindow(QMdiSubWindow* lhs);
|
2018-03-12 11:12:39 +01:00
|
|
|
QList<QMdiSubWindow*> subWindowList(QMdiArea::WindowOrder order);
|
2015-09-16 15:46:01 +02:00
|
|
|
|
2017-10-27 09:38:24 +02:00
|
|
|
RiuResultQwtPlot* resultPlot();
|
|
|
|
|
RiuRelativePermeabilityPlotPanel* relativePermeabilityPlotPanel();
|
|
|
|
|
RiuPvtPlotPanel* pvtPlotPanel();
|
2018-02-22 17:52:10 +01:00
|
|
|
RiuMohrsCirclePlot* mohrsCirclePlot();
|
2017-10-27 09:38:24 +02:00
|
|
|
RiuMessagePanel* messagePanel();
|
2015-11-04 14:18:52 +01:00
|
|
|
|
2017-04-07 09:21:26 +02:00
|
|
|
void showProcessMonitorDockPanel();
|
2018-10-19 10:08:33 +02:00
|
|
|
void setDefaultToolbarVisibility();
|
2019-04-15 15:01:58 +02:00
|
|
|
void applyFontSizesToDockedPlots();
|
2017-04-07 09:21:26 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
protected:
|
2018-10-18 19:45:57 +02:00
|
|
|
void closeEvent(QCloseEvent* event) override;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void createActions();
|
|
|
|
|
void createMenus();
|
|
|
|
|
void createToolBars();
|
|
|
|
|
void createDockPanels();
|
|
|
|
|
|
2013-04-19 13:20:46 +02:00
|
|
|
void restoreTreeViewState();
|
|
|
|
|
|
2018-02-13 13:29:44 +01:00
|
|
|
void updateUiFieldsFromActiveResult(caf::PdmObjectHandle* objectToUpdate);
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
private:
|
|
|
|
|
// Edit actions
|
2015-10-23 15:46:25 +02:00
|
|
|
QAction* m_newPropertyView;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
// View actions
|
2015-10-23 15:46:25 +02:00
|
|
|
QAction* m_viewFromNorth;
|
|
|
|
|
QAction* m_viewFromSouth;
|
|
|
|
|
QAction* m_viewFromEast;
|
|
|
|
|
QAction* m_viewFromWest;
|
|
|
|
|
QAction* m_viewFromAbove;
|
|
|
|
|
QAction* m_viewFromBelow;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2013-02-06 11:43:26 +01:00
|
|
|
// Mock actions
|
2015-10-23 15:46:25 +02:00
|
|
|
QAction* m_mockModelAction;
|
|
|
|
|
QAction* m_mockResultsModelAction;
|
|
|
|
|
QAction* m_mockLargeResultsModelAction;
|
|
|
|
|
QAction* m_mockModelCustomizedAction;
|
|
|
|
|
QAction* m_mockInputModelAction;
|
2013-02-06 11:43:26 +01:00
|
|
|
|
2015-10-23 15:46:25 +02:00
|
|
|
QAction* m_snapshotAllViewsToFile;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2013-09-12 08:11:56 +02:00
|
|
|
QAction* m_createCommandObject;
|
2013-09-27 10:04:10 +02:00
|
|
|
QAction* m_showRegressionTestDialog;
|
2013-09-30 07:56:47 +02:00
|
|
|
QAction* m_executePaintEventPerformanceTest;
|
2013-09-12 08:11:56 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
caf::AnimationToolBar* m_animationToolBar;
|
|
|
|
|
|
2019-04-02 19:18:00 +02:00
|
|
|
RiuMdiArea* m_mdiArea;
|
2015-09-16 12:56:48 +02:00
|
|
|
RiuResultInfoPanel* m_resultInfoPanel;
|
|
|
|
|
RiuProcessMonitor* m_processMonitor;
|
2017-02-23 14:24:18 +01:00
|
|
|
QPointer<RiuMessagePanel> m_messagePanel;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2017-10-27 09:38:24 +02:00
|
|
|
RiuResultQwtPlot* m_resultQwtPlot;
|
2018-02-21 11:08:35 +01:00
|
|
|
RiuMohrsCirclePlot* m_mohrsCirclePlot;
|
2017-10-27 09:38:24 +02:00
|
|
|
RiuRelativePermeabilityPlotPanel* m_relPermPlotPanel;
|
|
|
|
|
RiuPvtPlotPanel* m_pvtPlotPanel;
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
QMenu* m_windowMenu;
|
2018-06-14 12:04:16 +02:00
|
|
|
QLabel* m_memoryCriticalWarning;
|
2018-06-18 14:17:13 +02:00
|
|
|
QToolButton* m_memoryUsedButton;
|
2018-06-14 12:04:16 +02:00
|
|
|
QLabel* m_memoryTotalStatus;
|
|
|
|
|
QTimer* m_memoryRefreshTimer;
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
// Menu and action slots
|
|
|
|
|
private slots:
|
|
|
|
|
|
2015-09-17 08:25:10 +02:00
|
|
|
friend class RiuMdiSubWindow;
|
|
|
|
|
|
2018-06-14 12:04:16 +02:00
|
|
|
// Memory update slot
|
|
|
|
|
void updateMemoryUsage();
|
|
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
// File slots
|
|
|
|
|
void slotRefreshFileActions();
|
|
|
|
|
|
|
|
|
|
// Edit slots
|
|
|
|
|
void slotRefreshEditActions();
|
2013-02-06 11:43:26 +01:00
|
|
|
void slotNewObjectPropertyView();
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
// View slots
|
|
|
|
|
void slotRefreshViewActions();
|
|
|
|
|
void slotViewFromNorth();
|
|
|
|
|
void slotViewFromSouth();
|
|
|
|
|
void slotViewFromEast();
|
|
|
|
|
void slotViewFromWest();
|
|
|
|
|
void slotViewFromAbove();
|
|
|
|
|
void slotViewFromBelow();
|
2013-04-26 11:49:37 +02:00
|
|
|
void slotScaleChanged(int scaleValue);
|
2012-05-18 09:45:23 +02:00
|
|
|
|
2018-10-19 10:08:33 +02:00
|
|
|
void slotDrawStyleChanged(QAction* activatedAction);
|
|
|
|
|
void slotToggleHideGridCellsAction(bool);
|
|
|
|
|
void slotToggleFaultLabelsAction(bool);
|
|
|
|
|
void slotDisableLightingAction(bool);
|
2013-12-18 23:37:30 +01:00
|
|
|
|
2018-10-19 10:08:33 +02:00
|
|
|
void slotShowWellCellsAction(bool doAdd);
|
2013-04-18 15:10:57 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
// Debug slots
|
2013-02-06 11:43:26 +01:00
|
|
|
void slotSnapshotAllViewsToFile();
|
|
|
|
|
|
2013-09-12 08:11:56 +02:00
|
|
|
void slotCreateCommandObject();
|
|
|
|
|
|
2013-09-27 10:04:10 +02:00
|
|
|
void slotShowRegressionTestDialog();
|
2013-09-30 07:56:47 +02:00
|
|
|
void slotExecutePaintEventPerformanceTest();
|
2013-09-27 10:04:10 +02:00
|
|
|
|
2013-02-06 11:43:26 +01:00
|
|
|
// Mock models
|
|
|
|
|
void slotMockModel();
|
|
|
|
|
void slotMockResultsModel();
|
|
|
|
|
void slotMockLargeResultsModel();
|
2013-10-28 10:32:24 +01:00
|
|
|
void slotMockModelCustomized();
|
2013-02-06 11:43:26 +01:00
|
|
|
void slotInputMockModel();
|
2012-05-18 09:45:23 +02:00
|
|
|
|
|
|
|
|
// Windows slots
|
|
|
|
|
void slotBuildWindowActions();
|
|
|
|
|
|
|
|
|
|
void slotSubWindowActivated(QMdiSubWindow* subWindow);
|
2015-08-04 15:57:58 +02:00
|
|
|
|
2015-10-23 15:46:25 +02:00
|
|
|
void selectedObjectsChanged();
|
2015-08-06 11:00:21 +02:00
|
|
|
void customMenuRequested(const QPoint& pos);
|
2015-08-04 15:57:58 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
// Pdm System :
|
|
|
|
|
public:
|
|
|
|
|
void setPdmRoot(caf::PdmObject* pdmRoot);
|
|
|
|
|
private:
|
2015-08-18 11:23:53 +02:00
|
|
|
|
2016-10-04 09:29:45 +02:00
|
|
|
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
|
2015-08-18 11:23:53 +02:00
|
|
|
|
2015-08-06 20:37:40 +02:00
|
|
|
QUndoView* m_undoView;
|
2015-08-04 15:57:58 +02:00
|
|
|
|
2012-06-26 16:10:41 +02:00
|
|
|
caf::PdmObject* m_pdmRoot;
|
|
|
|
|
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
2013-04-17 10:59:34 +02:00
|
|
|
|
2013-04-26 11:49:37 +02:00
|
|
|
QSpinBox* m_scaleFactor;
|
|
|
|
|
|
2013-04-18 15:10:57 +02:00
|
|
|
QActionGroup* m_dsActionGroup;
|
2015-06-17 15:09:46 +02:00
|
|
|
QAction* m_disableLightingAction;
|
2015-12-03 08:39:08 +01:00
|
|
|
QAction* m_drawStyleHideGridCellsAction;
|
2014-01-23 07:31:07 +01:00
|
|
|
QAction* m_toggleFaultsLabelAction;
|
2013-04-18 15:10:57 +02:00
|
|
|
QAction* m_drawStyleLinesAction;
|
|
|
|
|
QAction* m_drawStyleLinesSolidAction;
|
2013-12-18 23:37:30 +01:00
|
|
|
QAction* m_drawStyleFaultLinesSolidAction;
|
2013-04-18 15:10:57 +02:00
|
|
|
QAction* m_drawStyleSurfOnlyAction;
|
2017-01-26 17:41:34 +01:00
|
|
|
QAction* m_showWellCellsAction;
|
2013-10-18 11:19:49 +02:00
|
|
|
|
2018-10-19 10:08:33 +02:00
|
|
|
QToolBar* m_holoLensToolBar;
|
|
|
|
|
|
2019-03-29 11:30:37 +01:00
|
|
|
std::vector<QPointer<QDockWidget> > m_additionalProjectViews;
|
2015-09-10 08:14:28 +02:00
|
|
|
|
2012-05-18 09:45:23 +02:00
|
|
|
};
|