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