2016-06-24 08:10:18 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2016 Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-06-24 08:10:18 -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
|
|
|
//
|
2016-06-24 08:10:18 -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>
|
2016-06-24 08:10:18 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-06-24 08:53:04 -05:00
|
|
|
#include "RiuMainWindowBase.h"
|
|
|
|
|
2018-01-25 07:53:51 -06:00
|
|
|
#include "cafPdmPointer.h"
|
2016-10-04 04:44:31 -05:00
|
|
|
|
2022-10-31 07:26:26 -05:00
|
|
|
#include <QMdiArea>
|
2019-12-05 06:32:48 -06:00
|
|
|
#include <QPointer>
|
2022-07-07 05:03:02 -05:00
|
|
|
#include <QString>
|
2019-12-05 06:32:48 -06:00
|
|
|
|
2016-10-04 02:29:45 -05:00
|
|
|
#include <memory>
|
|
|
|
|
2020-04-01 05:48:02 -05:00
|
|
|
struct RimMdiWindowGeometry;
|
2016-06-27 07:00:19 -05:00
|
|
|
|
2020-04-01 05:48:02 -05:00
|
|
|
class QMdiSubWindow;
|
2016-06-24 08:10:18 -05:00
|
|
|
class RiuViewer;
|
2017-04-07 11:00:14 -05:00
|
|
|
class RimViewWindow;
|
2020-02-18 05:29:13 -06:00
|
|
|
class RicSummaryPlotEditorDialog;
|
2019-12-10 08:35:00 -06:00
|
|
|
class RicSummaryCurveCalculatorDialog;
|
2020-04-01 05:48:02 -05:00
|
|
|
class RiuMessagePanel;
|
2016-06-24 08:10:18 -05:00
|
|
|
|
|
|
|
namespace caf
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
class PdmUiTreeView;
|
|
|
|
class PdmObject;
|
|
|
|
class PdmUiPropertyView;
|
|
|
|
class PdmUiItem;
|
|
|
|
class PdmUiToolBarEditor;
|
|
|
|
} // namespace caf
|
2016-06-24 08:10:18 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-06-24 08:10:18 -05:00
|
|
|
//
|
|
|
|
//==================================================================================================
|
2018-04-26 23:28:08 -05:00
|
|
|
class RiuPlotMainWindow : public RiuMainWindowBase
|
2016-06-24 08:10:18 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2018-04-26 23:28:08 -05:00
|
|
|
RiuPlotMainWindow();
|
2021-04-14 21:14:51 -05:00
|
|
|
~RiuPlotMainWindow() override;
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2022-05-11 12:46:17 -05:00
|
|
|
static RiuPlotMainWindow* instance();
|
2022-08-16 05:43:15 -05:00
|
|
|
static void onWellSelected( QString wellName );
|
2022-05-11 12:46:17 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QString mainWindowName() override;
|
|
|
|
|
|
|
|
void initializeGuiNewProjectLoaded();
|
|
|
|
void cleanupGuiBeforeProjectClose();
|
|
|
|
void cleanUpTemporaryWidgets();
|
|
|
|
|
|
|
|
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;
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void setDefaultWindowSize();
|
2022-08-15 13:27:49 -05:00
|
|
|
void enable3DSelectionLink( bool enable );
|
|
|
|
bool selection3DLinkEnabled();
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool isAnyMdiSubWindowVisible();
|
|
|
|
QMdiSubWindow* findMdiSubWindow( QWidget* viewer ) override;
|
2019-09-27 08:29:14 -05:00
|
|
|
RimViewWindow* findViewWindowFromSubWindow( QMdiSubWindow* subWindow );
|
2019-09-06 03:40:57 -05:00
|
|
|
QList<QMdiSubWindow*> subWindowList( QMdiArea::WindowOrder order );
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void setWidthOfMdiWindow( QWidget* mdiWindowWidget, int newWidth );
|
|
|
|
void addToTemporaryWidgets( QWidget* widget );
|
2017-03-15 14:15:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void updateWellLogPlotToolBar();
|
2019-11-13 05:22:50 -06:00
|
|
|
void updateMultiPlotToolBar();
|
2017-12-01 08:15:43 -06:00
|
|
|
|
2022-03-03 03:15:32 -06:00
|
|
|
RicSummaryPlotEditorDialog* summaryCurveCreatorDialog( bool createIfNotPresent );
|
|
|
|
RicSummaryCurveCalculatorDialog* summaryCurveCalculatorDialog( bool createIfNotPresent );
|
2019-12-05 06:32:48 -06:00
|
|
|
|
2020-04-01 05:48:02 -05:00
|
|
|
RiuMessagePanel* messagePanel();
|
|
|
|
|
2021-11-19 07:53:01 -06:00
|
|
|
void showAndSetKeyboardFocusToSummaryPlotManager();
|
|
|
|
|
2016-06-24 08:10:18 -05:00
|
|
|
protected:
|
2019-09-06 03:40:57 -05:00
|
|
|
void closeEvent( QCloseEvent* event ) override;
|
2019-10-22 03:39:18 -05:00
|
|
|
void keyPressEvent( QKeyEvent* ) override;
|
2022-03-21 05:31:25 -05:00
|
|
|
void dragEnterEvent( QDragEnterEvent* event ) override;
|
|
|
|
void dropEvent( QDropEvent* event ) override;
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2022-08-10 10:06:13 -05:00
|
|
|
QStringList defaultDockStateNames() override;
|
2022-10-31 07:26:26 -05:00
|
|
|
QStringList windowsMenuFeatureNames() override;
|
2022-08-10 10:06:13 -05:00
|
|
|
|
2016-06-24 08:10:18 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
void setPdmRoot( caf::PdmObject* pdmRoot );
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void createMenus();
|
|
|
|
void createToolBars();
|
|
|
|
void createDockPanels();
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void restoreTreeViewState();
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void refreshToolbars();
|
|
|
|
|
|
|
|
static QStringList toolbarCommandIds( const QString& toolbarName = "" );
|
2016-06-24 08:10:18 -05:00
|
|
|
|
|
|
|
private slots:
|
2022-08-15 13:27:49 -05:00
|
|
|
void slotToggleSelectionLink();
|
2016-06-24 08:10:18 -05:00
|
|
|
|
|
|
|
friend class RiuMdiSubWindow;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void slotBuildWindowActions();
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void slotSubWindowActivated( QMdiSubWindow* subWindow );
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void selectedObjectsChanged();
|
|
|
|
void customMenuRequested( const QPoint& pos );
|
2016-06-27 07:00:19 -05:00
|
|
|
|
2016-06-24 08:10:18 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmPointer<RimViewWindow> m_activePlotViewWindow;
|
2020-04-01 05:48:02 -05:00
|
|
|
QPointer<RiuMessagePanel> m_messagePanel;
|
2017-04-07 11:00:14 -05:00
|
|
|
|
2022-03-03 03:15:32 -06:00
|
|
|
std::unique_ptr<caf::PdmUiToolBarEditor> m_wellLogPlotToolBarEditor;
|
|
|
|
std::unique_ptr<caf::PdmUiToolBarEditor> m_multiPlotToolBarEditor;
|
2022-05-03 04:30:09 -05:00
|
|
|
std::unique_ptr<caf::PdmUiToolBarEditor> m_multiPlotLayoutToolBarEditor;
|
2016-06-24 08:10:18 -05:00
|
|
|
|
2022-03-03 03:15:32 -06:00
|
|
|
std::unique_ptr<caf::PdmUiPropertyView> m_pdmUiPropertyView;
|
|
|
|
std::unique_ptr<caf::PdmUiPropertyView> m_summaryPlotManagerView;
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2022-03-03 03:15:32 -06:00
|
|
|
std::unique_ptr<RicSummaryPlotEditorDialog> m_summaryCurveCreatorDialog;
|
|
|
|
std::unique_ptr<RicSummaryCurveCalculatorDialog> m_summaryCurveCalculatorDialog;
|
|
|
|
std::unique_ptr<caf::PdmObject> m_summaryPlotManager;
|
2019-12-05 06:32:48 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<QWidget*> m_temporaryWidgets;
|
2022-08-15 13:27:49 -05:00
|
|
|
|
|
|
|
QAction* m_toggleSelectionLinkAction;
|
|
|
|
bool m_selection3DLinkEnabled;
|
2016-06-24 08:10:18 -05:00
|
|
|
};
|