Files
ResInsight/ApplicationCode/UserInterface/RiuMainWindow.h
T

263 lines
7.4 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.
//
// 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
#include "RiuMainWindowBase.h"
2016-10-04 11:44:31 +02:00
#include "cafPdmUiDragDropInterface.h"
#include <QEvent>
2012-05-18 09:45:23 +02:00
#include <QPointer>
#include <QMdiArea>
2012-05-18 09:45:23 +02:00
#include <memory>
2016-10-06 08:33:34 +02:00
#include <vector>
class QActionGroup;
class QMdiSubWindow;
2013-04-26 11:49:37 +02:00
class QSpinBox;
class QUndoView;
2012-05-18 09:45:23 +02:00
class RimCase;
class RiuMessagePanel;
class RiuProcessMonitor;
class RiuResultInfoPanel;
class RiuResultQwtPlot;
class RiuViewer;
struct RimMdiWindowGeometry;
2012-05-18 09:45:23 +02:00
namespace caf
{
class PdmUiTreeView;
2012-05-18 09:45:23 +02:00
class AnimationToolBar;
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
}
namespace ssihub
{
class Interface;
}
2012-05-18 09:45:23 +02:00
//==================================================================================================
//
//
//
//==================================================================================================
class RiuMainWindow : public RiuMainWindowBase
2012-05-18 09:45:23 +02:00
{
Q_OBJECT
public:
RiuMainWindow();
static RiuMainWindow* instance();
virtual QString mainWindowName() { return "RiuMainWindow"; }
2012-05-18 09:45:23 +02:00
void initializeGuiNewProjectLoaded();
void cleanupGuiCaseClose();
void cleanupGuiBeforeProjectClose();
2012-05-18 09:45:23 +02:00
void removeViewer( QWidget* viewer ) override;
void addViewer(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 refreshAnimationActions();
2013-04-26 11:49:37 +02:00
void updateScaleValue();
2012-05-18 09:45:23 +02:00
caf::PdmUiTreeView* projectTreeView() { return m_projectTreeView;}
RiuProcessMonitor* processMonitor();
2012-05-18 09:45:23 +02:00
void hideAllDockWindows();
void selectAsCurrentItem(caf::PdmObject* object);
void selectedCases(std::vector<RimCase*>& cases);
void setDefaultWindowSize();
void refreshDrawStyleActions();
2015-08-14 18:06:22 +02:00
void setExpanded(const caf::PdmUiItem* uiItem, bool expanded);
RimMdiWindowGeometry windowGeometryForViewer(QWidget* viewer);
void tileWindows();
2015-09-17 08:25:10 +02:00
bool isAnyMdiSubWindowVisible();
2015-09-21 15:00:54 +02:00
QMdiSubWindow* findMdiSubWindow(QWidget* viewer);
QList<QMdiSubWindow*> subWindowList(QMdiArea::WindowOrder order);
RiuResultQwtPlot* resultPlot();
RiuMessagePanel* messagePanel();
void showProcessMonitorDockPanel();
2012-05-18 09:45:23 +02:00
protected:
virtual void closeEvent(QCloseEvent* event);
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();
void showDockPanel(const QString& dockPanelName);
2012-05-18 09:45:23 +02:00
private:
static RiuMainWindow* sm_mainWindowInstance;
2012-05-18 09:45:23 +02:00
QByteArray m_initialDockAndToolbarLayout; // Initial dock window and toolbar layout, used to reset GUI
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;
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_createCommandObject;
QAction* m_showRegressionTestDialog;
QAction* m_executePaintEventPerformanceTest;
2012-05-18 09:45:23 +02:00
caf::AnimationToolBar* m_animationToolBar;
QMdiArea* m_mdiArea;
RiuViewer* m_mainViewer;
RiuResultInfoPanel* m_resultInfoPanel;
RiuProcessMonitor* m_processMonitor;
QPointer<RiuMessagePanel> m_messagePanel;
2012-05-18 09:45:23 +02:00
RiuResultQwtPlot* m_resultQwtPlot;
2012-05-18 09:45:23 +02:00
QMenu* m_windowMenu;
// Menu and action slots
private slots:
2015-09-17 08:25:10 +02:00
friend class RiuMdiSubWindow;
2012-05-18 09:45:23 +02:00
// File slots
void slotRefreshFileActions();
// Edit slots
void slotRefreshEditActions();
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
2013-04-18 15:10:57 +02:00
void slotDrawStyleChanged(QAction* activatedAction);
void slotToggleHideGridCellsAction(bool);
void slotToggleFaultLabelsAction(bool);
void slotDisableLightingAction(bool);
void slotShowWellCellsAction(bool doAdd);
2013-04-18 15:10:57 +02:00
2012-05-18 09:45:23 +02:00
// Debug slots
void slotUseShaders(bool enable);
void slotShowPerformanceInfo(bool enable);
void slotSnapshotAllViewsToFile();
void slotCreateCommandObject();
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();
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
// Animation slots
void slotFramerateChanged(double frameRate);
// Pdm System :
public:
void setPdmRoot(caf::PdmObject* pdmRoot);
private:
caf::PdmUiTreeView* m_projectTreeView;
std::unique_ptr<caf::PdmUiDragDropInterface> m_dragDropInterface;
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;
QAction* m_disableLightingAction;
2015-12-03 08:39:08 +01:00
QAction* m_drawStyleHideGridCellsAction;
QAction* m_toggleFaultsLabelAction;
2013-04-18 15:10:57 +02:00
QAction* m_drawStyleLinesAction;
QAction* m_drawStyleLinesSolidAction;
QAction* m_drawStyleFaultLinesSolidAction;
2013-04-18 15:10:57 +02:00
QAction* m_drawStyleSurfOnlyAction;
QAction* m_showWellCellsAction;
std::vector<QPointer<QDockWidget> > additionalProjectViews;
bool m_blockSlotSubWindowActivated;
2012-05-18 09:45:23 +02:00
};