mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2535 Add MainWindow tools class that can reduce number of mainWindow includes and hopefully reduce compile time
This commit is contained in:
parent
6a3b43ec7c
commit
43dc25eca0
@ -70,6 +70,8 @@ ${CEE_CURRENT_LIST_DIR}RiuCalculationsContextMenuManager.h
|
|||||||
${CEE_CURRENT_LIST_DIR}RiuGridStatisticsHistogramWidget.h
|
${CEE_CURRENT_LIST_DIR}RiuGridStatisticsHistogramWidget.h
|
||||||
${CEE_CURRENT_LIST_DIR}RiuTools.h
|
${CEE_CURRENT_LIST_DIR}RiuTools.h
|
||||||
${CEE_CURRENT_LIST_DIR}RiuMohrsCirclePlot.h
|
${CEE_CURRENT_LIST_DIR}RiuMohrsCirclePlot.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}RiuPlotMainWindowTools.h
|
||||||
|
${CEE_CURRENT_LIST_DIR}Riu3DMainWindowTools.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
@ -135,6 +137,8 @@ ${CEE_CURRENT_LIST_DIR}RiuCalculationsContextMenuManager.cpp
|
|||||||
${CEE_CURRENT_LIST_DIR}RiuGridStatisticsHistogramWidget.cpp
|
${CEE_CURRENT_LIST_DIR}RiuGridStatisticsHistogramWidget.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RiuTools.cpp
|
${CEE_CURRENT_LIST_DIR}RiuTools.cpp
|
||||||
${CEE_CURRENT_LIST_DIR}RiuMohrsCirclePlot.cpp
|
${CEE_CURRENT_LIST_DIR}RiuMohrsCirclePlot.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}RiuPlotMainWindowTools.cpp
|
||||||
|
${CEE_CURRENT_LIST_DIR}Riu3DMainWindowTools.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND CODE_HEADER_FILES
|
list(APPEND CODE_HEADER_FILES
|
||||||
|
48
ApplicationCode/UserInterface/Riu3DMainWindowTools.cpp
Normal file
48
ApplicationCode/UserInterface/Riu3DMainWindowTools.cpp
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Statoil ASA
|
||||||
|
//
|
||||||
|
// 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.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "Riu3DMainWindowTools.h"
|
||||||
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void Riu3DMainWindowTools::setActiveViewer(QWidget* subWindow)
|
||||||
|
{
|
||||||
|
RiuMainWindow::instance()->setActiveViewer(subWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void Riu3DMainWindowTools::setExpanded(const caf::PdmUiItem* uiItem, bool expanded /*= true*/)
|
||||||
|
{
|
||||||
|
RiuMainWindow::instance()->setExpanded(uiItem, expanded);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void Riu3DMainWindowTools::selectAsCurrentItem(const caf::PdmObject* object, bool allowActiveViewChange /*= true*/)
|
||||||
|
{
|
||||||
|
RiuMainWindow::instance()->selectAsCurrentItem(object, allowActiveViewChange);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
35
ApplicationCode/UserInterface/Riu3DMainWindowTools.h
Normal file
35
ApplicationCode/UserInterface/Riu3DMainWindowTools.h
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Statoil ASA
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
|
||||||
|
class QWidget;
|
||||||
|
|
||||||
|
namespace caf
|
||||||
|
{
|
||||||
|
class PdmUiItem;
|
||||||
|
class PdmObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
class Riu3DMainWindowTools
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static void setActiveViewer(QWidget* subWindow) ;
|
||||||
|
static void setExpanded(const caf::PdmUiItem* uiItem, bool expanded = true);
|
||||||
|
static void selectAsCurrentItem(const caf::PdmObject* object, bool allowActiveViewChange = true);
|
||||||
|
};
|
62
ApplicationCode/UserInterface/RiuPlotMainWindowTools.cpp
Normal file
62
ApplicationCode/UserInterface/RiuPlotMainWindowTools.cpp
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Statoil ASA
|
||||||
|
//
|
||||||
|
// 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.
|
||||||
|
//
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "RiuPlotMainWindowTools.h"
|
||||||
|
#include "RiaApplication.h"
|
||||||
|
#include "RiuMainPlotWindow.h"
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuPlotMainWindowTools::showPlotMainWindow()
|
||||||
|
{
|
||||||
|
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuPlotMainWindowTools::setActiveViewer(QWidget* subWindow)
|
||||||
|
{
|
||||||
|
RiuMainPlotWindow* mpw = RiaApplication::instance()->mainPlotWindow();
|
||||||
|
|
||||||
|
if (mpw) mpw->setActiveViewer(subWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuPlotMainWindowTools::setExpanded(const caf::PdmUiItem* uiItem, bool expanded /*= true*/)
|
||||||
|
{
|
||||||
|
RiuMainPlotWindow* mpw = RiaApplication::instance()->mainPlotWindow();
|
||||||
|
|
||||||
|
if (mpw) mpw->setExpanded(uiItem, expanded);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuPlotMainWindowTools::selectAsCurrentItem(const caf::PdmObject* object, bool allowActiveViewChange /*= true*/)
|
||||||
|
{
|
||||||
|
RiuMainPlotWindow* mpw = RiaApplication::instance()->mainPlotWindow();
|
||||||
|
|
||||||
|
if (mpw) mpw->selectAsCurrentItem(object, allowActiveViewChange);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
37
ApplicationCode/UserInterface/RiuPlotMainWindowTools.h
Normal file
37
ApplicationCode/UserInterface/RiuPlotMainWindowTools.h
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright (C) 2018- Statoil ASA
|
||||||
|
//
|
||||||
|
// 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
|
||||||
|
|
||||||
|
class QWidget;
|
||||||
|
|
||||||
|
namespace caf
|
||||||
|
{
|
||||||
|
class PdmUiItem;
|
||||||
|
class PdmObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
class RiuPlotMainWindowTools
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static void showPlotMainWindow();
|
||||||
|
static void setActiveViewer(QWidget* subWindow) ;
|
||||||
|
static void setExpanded(const caf::PdmUiItem* uiItem, bool expanded = true);
|
||||||
|
static void selectAsCurrentItem(const caf::PdmObject* object, bool allowActiveViewChange = true);
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user