Files
ResInsight/ApplicationLibCode/UserInterface/RiuMainWindow.h
T

286 lines
8.0 KiB
C++
Raw Normal View History

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.
//
2012-05-18 09:45:23 +02: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.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
2012-05-18 09:45:23 +02:00
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiuMainWindowBase.h"
#include "cafPdmObjectHandle.h"
2016-10-04 11:44:31 +02:00
#include <QEvent>
#include <QLabel>
2022-10-31 13:26:26 +01:00
#include <QMdiArea>
#include <QPointer>
2022-07-07 12:03:02 +02:00
#include <QString>
2012-05-18 09:45:23 +02:00
#include <memory>
2016-10-06 08:33:34 +02:00
#include <vector>
class QActionGroup;
class QMdiSubWindow;
class QToolButton;
class QComboBox;
class QTimer;
class QUndoView;
2023-01-18 22:59:06 +01:00
class QSlider;
2012-05-18 09:45:23 +02:00
class Rim3dView;
class RimCase;
class RimViewWindow;
class RiuMessagePanel;
class RiuProcessMonitor;
class RiuResultInfoPanel;
class RiuResultQwtPlot;
2023-03-03 15:21:01 +01:00
class RiuDepthQwtPlot;
class RiuRelativePermeabilityPlotPanel;
class RiuPvtPlotPanel;
2018-02-21 11:08:35 +01:00
class RiuMohrsCirclePlot;
2022-10-31 13:26:26 +01:00
class RiuMdiArea;
2023-03-24 15:36:10 +01:00
class RiuSeismicHistogramPanel;
class RicGridCalculatorDialog;
struct RimMdiWindowGeometry;
2012-05-18 09:45:23 +02:00
namespace caf
{
class PdmUiTreeView;
class AnimationToolBar;
class PdmObject;
class PdmUiPropertyView;
class PdmUiItem;
} // namespace caf
2012-05-18 09:45:23 +02:00
2022-07-07 12:03:02 +02:00
namespace ads
{
class CDockWidget;
};
2012-05-18 09:45:23 +02:00
//==================================================================================================
//
//
2012-05-18 09:45:23 +02:00
//
//==================================================================================================
class RiuMainWindow : public RiuMainWindowBase
2012-05-18 09:45:23 +02:00
{
Q_OBJECT
public:
RiuMainWindow();
2021-04-15 02:14:51 +00:00
~RiuMainWindow() override;
static RiuMainWindow* instance();
static void closeIfOpen();
QString mainWindowName() override;
2012-05-18 09:45:23 +02:00
void initializeGuiNewProjectLoaded();
void cleanupGuiCaseClose();
void cleanupGuiBeforeProjectClose();
void removeViewer( QWidget* viewer ) override;
2020-10-07 15:00:26 +02:00
void initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry ) override;
void setActiveViewer( QWidget* subWindow ) override;
2012-05-18 09:45:23 +02:00
void setResultInfo( const QString& info ) const;
void refreshViewActions();
void refreshAnimationActions();
void updateScaleValue();
2012-05-18 09:45:23 +02:00
RiuProcessMonitor* processMonitor();
2012-05-18 09:45:23 +02:00
void selectedCases( std::vector<RimCase*>& cases );
void setDefaultWindowSize();
void refreshDrawStyleActions();
bool isAnyMdiSubWindowVisible();
QMdiSubWindow* findMdiSubWindow( QWidget* viewer ) override;
RimViewWindow* findViewWindowFromSubWindow( QMdiSubWindow* lhs );
QList<QMdiSubWindow*> subWindowList( QMdiArea::WindowOrder order );
RiuResultQwtPlot* resultPlot();
2023-03-03 15:21:01 +01:00
RiuDepthQwtPlot* depthPlot();
RiuRelativePermeabilityPlotPanel* relativePermeabilityPlotPanel();
RiuPvtPlotPanel* pvtPlotPanel();
RiuMohrsCirclePlot* mohrsCirclePlot();
2023-03-24 15:36:10 +01:00
RiuSeismicHistogramPanel* seismicHistogramPanel();
RiuMessagePanel* messagePanel();
void showProcessMonitorDockPanel();
void setDefaultToolbarVisibility();
void applyFontSizesToDockedPlots();
RicGridCalculatorDialog* gridCalculatorDialog( bool createIfNotPresent );
2012-05-18 09:45:23 +02:00
protected:
void closeEvent( QCloseEvent* event ) override;
QStringList defaultDockStateNames() override;
2022-10-31 13:26:26 +01:00
QStringList windowsMenuFeatureNames() override;
2012-05-18 09:45:23 +02:00
2022-11-17 15:51:01 +01:00
void dragEnterEvent( QDragEnterEvent* event ) override;
void dropEvent( QDropEvent* event ) override;
2012-05-18 09:45:23 +02:00
private:
void createActions();
void createMenus();
void createToolBars();
void createDockPanels();
2012-05-18 09:45:23 +02:00
void restoreTreeViewState();
2013-04-19 13:20:46 +02:00
void updateUiFieldsFromActiveResult( caf::PdmObjectHandle* objectToUpdate );
2012-05-18 09:45:23 +02:00
private:
// Edit actions
QAction* m_newPropertyView;
2012-05-18 09:45:23 +02:00
// View actions
QAction* m_viewFromNorth;
QAction* m_viewFromSouth;
QAction* m_viewFromEast;
QAction* m_viewFromWest;
QAction* m_viewFromAbove;
QAction* m_viewFromBelow;
2023-04-26 16:30:15 +02:00
QAction* m_viewFullScreen;
2012-05-18 09:45:23 +02:00
// Mock actions
QAction* m_mockModelAction;
QAction* m_mockResultsModelAction;
QAction* m_mockLargeResultsModelAction;
QAction* m_mockModelCustomizedAction;
QAction* m_mockInputModelAction;
QAction* m_snapshotAllViewsToFile;
2012-05-18 09:45:23 +02:00
QAction* m_showRegressionTestDialog;
QAction* m_executePaintEventPerformanceTest;
2012-05-18 09:45:23 +02:00
caf::AnimationToolBar* m_animationToolBar;
RiuResultInfoPanel* m_resultInfoPanel;
RiuProcessMonitor* m_processMonitor;
QPointer<RiuMessagePanel> m_messagePanel;
RiuResultQwtPlot* m_resultQwtPlot;
2023-03-03 15:21:01 +01:00
RiuDepthQwtPlot* m_depthQwtPlot;
RiuMohrsCirclePlot* m_mohrsCirclePlot;
RiuRelativePermeabilityPlotPanel* m_relPermPlotPanel;
2023-03-24 15:36:10 +01:00
RiuSeismicHistogramPanel* m_seismicHistogramPanel;
RiuPvtPlotPanel* m_pvtPlotPanel;
std::unique_ptr<RicGridCalculatorDialog> m_gridCalculatorDialog;
QLabel* m_memoryCriticalWarning;
QToolButton* m_memoryUsedButton;
QLabel* m_memoryTotalStatus;
QTimer* m_memoryRefreshTimer;
2023-09-01 10:57:40 +02:00
QLabel* m_versionInfo;
// Menu and action slots
2012-05-18 09:45:23 +02:00
private slots:
2015-09-17 08:25:10 +02:00
friend class RiuMdiSubWindow;
// Memory update slot
void updateMemoryUsage();
2012-05-18 09:45:23 +02:00
// File slots
void slotRefreshFileActions();
2012-05-18 09:45:23 +02:00
// Edit slots
void slotNewObjectPropertyView();
2012-05-18 09:45:23 +02:00
// View slots
void slotRefreshViewActions();
2023-04-26 16:30:15 +02:00
void slotViewFullScreen( bool );
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 17:25:19 +02:00
void slotToggleLightingAction( bool );
void slotShowWellCellsAction( bool doAdd );
2013-04-18 15:10:57 +02:00
2023-01-18 22:59:06 +01:00
void slotAnimationSliderMoved( int newValue );
void slotAnimationControlFrameChanged( int newValue );
2012-05-18 09:45:23 +02:00
// Debug slots
void slotSnapshotAllViewsToFile();
void slotShowRegressionTestDialog();
void slotExecutePaintEventPerformanceTest();
// Mock models
void slotMockModel();
void slotMockResultsModel();
void slotMockLargeResultsModel();
void slotMockModelCustomized();
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
void selectedObjectsChanged();
void customMenuRequested( const QPoint& pos );
2015-08-04 15:57:58 +02:00
2019-10-30 10:34:39 +01:00
private:
2023-02-26 10:48:40 +01:00
void selectViewInProjectTreePreservingSubItemSelection( const Rim3dView* previousActiveReservoirView, Rim3dView* activatedView );
2019-10-30 10:34:39 +01:00
2012-05-18 09:45:23 +02:00
// Pdm System :
public:
void setPdmRoot( caf::PdmObject* pdmRoot );
2012-05-18 09:45:23 +02:00
private:
caf::PdmObject* m_pdmRoot;
caf::PdmUiPropertyView* m_pdmUiPropertyView;
2024-10-18 14:41:19 +02:00
caf::PdmUiPropertyView* m_quickAccessView;
2013-04-26 11:49:37 +02:00
QComboBox* m_scaleFactor;
QActionGroup* m_dsActionGroup;
2020-10-01 17:25:19 +02:00
QAction* m_enableLightingAction;
QAction* m_drawStyleHideGridCellsAction;
QAction* m_toggleFaultsLabelAction;
QAction* m_drawStyleLinesAction;
QAction* m_drawStyleLinesSolidAction;
QAction* m_drawStyleFaultLinesSolidAction;
QAction* m_drawStyleSurfOnlyAction;
QAction* m_showWellCellsAction;
QAction* m_drawStyleDeformationsAction;
2023-01-18 22:59:06 +01:00
QAction* m_animationSliderAction;
QSlider* m_animationSlider;
QToolBar* m_holoLensToolBar;
2022-07-07 12:03:02 +02:00
std::vector<QPointer<ads::CDockWidget>> m_additionalProjectViews;
2012-05-18 09:45:23 +02:00
};