ResInsight/ApplicationLibCode/UserInterface/RiuPlotMainWindow.h

151 lines
4.6 KiB
C
Raw Normal View History

2016-06-24 08:10:18 -05:00
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 Statoil ASA
//
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.
//
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.
//
// 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
#include "RiuMainWindowBase.h"
#include "cafPdmPointer.h"
2016-10-04 04:44:31 -05:00
2022-10-31 07:26:26 -05:00
#include <QMdiArea>
#include <QPointer>
#include <QString>
#include <memory>
2020-04-01 05:48:02 -05:00
struct RimMdiWindowGeometry;
2020-04-01 05:48:02 -05:00
class QMdiSubWindow;
2016-06-24 08:10:18 -05:00
class RiuViewer;
class RimViewWindow;
class RicSummaryPlotEditorDialog;
class RicSummaryCurveCalculatorDialog;
2020-04-01 05:48:02 -05:00
class RiuMessagePanel;
2016-06-24 08:10:18 -05:00
namespace caf
{
class PdmUiTreeView;
class PdmObject;
class PdmUiPropertyView;
class PdmUiItem;
class PdmUiToolBarEditor;
} // namespace caf
2016-06-24 08:10:18 -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
static RiuPlotMainWindow* instance();
2022-08-16 05:43:15 -05:00
static void onWellSelected( QString wellName );
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;
void setActiveViewer( QWidget* subWindow ) override;
2016-06-24 08:10:18 -05:00
void setDefaultWindowSize();
void enable3DSelectionLink( bool enable );
bool selection3DLinkEnabled();
2016-06-24 08:10:18 -05:00
bool isAnyMdiSubWindowVisible();
QMdiSubWindow* findMdiSubWindow( QWidget* viewer ) override;
RimViewWindow* findViewWindowFromSubWindow( QMdiSubWindow* subWindow );
QList<QMdiSubWindow*> subWindowList( QMdiArea::WindowOrder order );
2016-06-24 08:10:18 -05:00
void setWidthOfMdiWindow( QWidget* mdiWindowWidget, int newWidth );
void addToTemporaryWidgets( QWidget* widget );
2017-03-15 14:15:04 -05:00
void updateWellLogPlotToolBar();
void updateMultiPlotToolBar();
RicSummaryPlotEditorDialog* summaryCurveCreatorDialog( bool createIfNotPresent );
RicSummaryCurveCalculatorDialog* summaryCurveCalculatorDialog( bool createIfNotPresent );
2020-04-01 05:48:02 -05:00
RiuMessagePanel* messagePanel();
void showAndSetKeyboardFocusToSummaryPlotManager();
2016-06-24 08:10:18 -05:00
protected:
void closeEvent( QCloseEvent* event ) override;
void keyPressEvent( QKeyEvent* ) override;
void dragEnterEvent( QDragEnterEvent* event ) override;
void dropEvent( QDropEvent* event ) override;
2016-06-24 08:10:18 -05:00
QStringList defaultDockStateNames() override;
2022-10-31 07:26:26 -05:00
QStringList windowsMenuFeatureNames() override;
2016-06-24 08:10:18 -05:00
private:
void setPdmRoot( caf::PdmObject* pdmRoot );
2016-06-24 08:10:18 -05:00
void createMenus();
void createToolBars();
void createDockPanels();
2016-06-24 08:10:18 -05:00
void restoreTreeViewState();
2016-06-24 08:10:18 -05:00
void refreshToolbars();
static QStringList toolbarCommandIds( const QString& toolbarName = "" );
2016-06-24 08:10:18 -05:00
private slots:
void slotToggleSelectionLink();
2016-06-24 08:10:18 -05:00
friend class RiuMdiSubWindow;
void slotBuildWindowActions();
2016-06-24 08:10:18 -05:00
void slotSubWindowActivated( QMdiSubWindow* subWindow );
2016-06-24 08:10:18 -05:00
void selectedObjectsChanged();
void customMenuRequested( const QPoint& pos );
2016-06-24 08:10:18 -05:00
private:
caf::PdmPointer<RimViewWindow> m_activePlotViewWindow;
2020-04-01 05:48:02 -05:00
QPointer<RiuMessagePanel> m_messagePanel;
std::unique_ptr<caf::PdmUiToolBarEditor> m_wellLogPlotToolBarEditor;
std::unique_ptr<caf::PdmUiToolBarEditor> m_multiPlotToolBarEditor;
std::unique_ptr<caf::PdmUiToolBarEditor> m_multiPlotLayoutToolBarEditor;
2016-06-24 08:10:18 -05:00
std::unique_ptr<caf::PdmUiPropertyView> m_pdmUiPropertyView;
std::unique_ptr<caf::PdmUiPropertyView> m_summaryPlotManagerView;
std::unique_ptr<RicSummaryPlotEditorDialog> m_summaryCurveCreatorDialog;
std::unique_ptr<RicSummaryCurveCalculatorDialog> m_summaryCurveCalculatorDialog;
std::unique_ptr<caf::PdmObject> m_summaryPlotManager;
std::vector<QWidget*> m_temporaryWidgets;
QAction* m_toggleSelectionLinkAction;
bool m_selection3DLinkEnabled;
2016-06-24 08:10:18 -05:00
};