Work in progress

This commit is contained in:
Jon Jenssen authored and JJ committed 2026-06-17 13:55:32 +02:00
1 parent cc9a075fc6
commit aa9edc43bb
13 files changed
+243 -104

No files matched your search

@@ -3,6 +3,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicStoreUserDefinedCameraFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicStoreUserDefinedCameraFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicPopOutTo3dViewFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicPopOutTo3dViewFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicPopOutToPlotViewFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicPopOutToPlotViewFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicConvert3dToMdiFeature.cpp
) )
list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES}) list(APPEND COMMAND_CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES})
@@ -0,0 +1,65 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026 Equinor 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 "RicConvert3dToMdiFeature.h"
#include "RiaGuiApplication.h"
#include "RimGridView.h"
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "cafSelectionManager.h"
#include <QAction>
#include <QSettings>
CAF_CMD_SOURCE_INIT( RicConvert3dToMdiFeature, "RicConvert3dToMdiFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicConvert3dToMdiFeature::isCommandEnabled() const
{
if ( auto view = dynamic_cast<Rim3dView*>( caf::SelectionManager::instance()->selectedItem() ) )
{
return view->isDockingViewer();
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicConvert3dToMdiFeature::onActionTriggered( bool isChecked )
{
if ( auto view = dynamic_cast<Rim3dView*>( caf::SelectionManager::instance()->selectedItem() ) )
{
view->convertToMdi( RiaGuiApplication::instance()->mainWindow() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicConvert3dToMdiFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Convert to MDI view" );
actionToSetup->setIcon( QIcon( ":/3DWindow.svg" ) );
}
@@ -0,0 +1,34 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026 Equinor 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
#include "cafCmdFeature.h"
//==================================================================================================
///
//==================================================================================================
class RicConvert3dToMdiFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
bool isCommandEnabled() const override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};
@@ -42,23 +42,24 @@ bool RicPopOutTo3dViewFeature::isCommandEnabled() const
return !view->isDockingViewer(); return !view->isDockingViewer();
} }
return false; return false;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicPopOutTo3dViewFeature::onActionTriggered( bool isChecked ) void RicPopOutTo3dViewFeature::onActionTriggered( bool isChecked )
{
if ( auto view = dynamic_cast<Rim3dView*>( caf::SelectionManager::instance()->selectedItem() ) )
{ {
if ( auto view = dynamic_cast<Rim3dView*>( caf::SelectionManager::instance()->selectedItem() ) ) view->convertToDocking( RiaGuiApplication::instance()->mainWindow() );
{
view->convertToDocking( RiaGuiApplication::instance()->mainWindow() );
}
} }
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RicPopOutTo3dViewFeature::setupActionLook( QAction * actionToSetup ) void RicPopOutTo3dViewFeature::setupActionLook( QAction* actionToSetup )
{ {
actionToSetup->setText( "Pop Out (in 3D View)" ); actionToSetup->setText( "Pop Out (in 3D View)" );
actionToSetup->setIcon( QIcon( ":/3DWindow.svg" ) ); actionToSetup->setIcon( QIcon( ":/3DWindow.svg" ) );
} }
@@ -35,6 +35,7 @@
#include "RimGridView.h" #include "RimGridView.h"
#include "RimLegendConfig.h" #include "RimLegendConfig.h"
#include "RimMainPlotCollection.h" #include "RimMainPlotCollection.h"
#include "RimMdiWindowController.h"
#include "RimMeasurement.h" #include "RimMeasurement.h"
#include "RimOilField.h" #include "RimOilField.h"
#include "RimProject.h" #include "RimProject.h"
@@ -53,6 +54,8 @@
#include "RiuTimeStepChangedHandler.h" #include "RiuTimeStepChangedHandler.h"
#include "RiuViewer.h" #include "RiuViewer.h"
#include "DockManager.h"
#include "cafCmdFeatureMenuBuilder.h" #include "cafCmdFeatureMenuBuilder.h"
#include "cafDisplayCoordTransform.h" #include "cafDisplayCoordTransform.h"
#include "cafFrameAnimationControl.h" #include "cafFrameAnimationControl.h"
@@ -1908,6 +1911,7 @@ void Rim3dView::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const
{ {
if ( isDockingViewer() ) if ( isDockingViewer() )
{ {
menuBuilder << "RicConvert3dToMdiFeature";
} }
else else
{ {
@@ -1927,7 +1931,27 @@ void Rim3dView::convertToDocking( RiuMainWindowBase* mainWindow )
QWidget* viewWidget = createViewWidget( nullptr ); QWidget* viewWidget = createViewWidget( nullptr );
mainWindow->initializeDockingViewer( viewWidget ); m_dockWidget = mainWindow->initializeDockingViewer( viewWidget );
updateViewWidgetAfterCreation();
scheduleCreateDisplayModelAndRedraw();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::convertToMdi( RiuMainWindowBase* mainWindow )
{
if ( !isDockingViewer() ) return;
mainWindow->dockManager()->removeDockWidget( m_dockWidget );
m_dockWidget->takeWidget();
m_dockWidget = nullptr;
m_windowController->updateViewerWidget();
updateMdiWindowVisibility();
updateViewWidgetAfterCreation(); updateViewWidgetAfterCreation();
scheduleCreateDisplayModelAndRedraw(); scheduleCreateDisplayModelAndRedraw();
} }
@@ -71,6 +71,11 @@ namespace caf
class DisplayCoordTransform; class DisplayCoordTransform;
} }
namespace ads
{
class CDockWidget;
}
enum PartRenderMaskEnum enum PartRenderMaskEnum
{ {
surfaceBit = 1, surfaceBit = 1,
@@ -96,7 +101,7 @@ public:
int id() const final; int id() const final;
bool isDockingViewer() const { return m_isDockingViewer; } bool isDockingViewer() const { return !m_dockWidget.isNull(); }
// Public fields: // Public fields:
@@ -207,6 +212,7 @@ public:
void synchronizeLocalAnnotationsFromGlobal(); void synchronizeLocalAnnotationsFromGlobal();
void convertToDocking( RiuMainWindowBase* mainWindow ); void convertToDocking( RiuMainWindowBase* mainWindow );
void convertToMdi( RiuMainWindowBase* mainWindow );
protected: protected:
static void removeModelByName( cvf::Scene* scene, const cvf::String& modelName ); static void removeModelByName( cvf::Scene* scene, const cvf::String& modelName );
@@ -367,5 +373,5 @@ private:
const int m_animationIntervalMillisec; const int m_animationIntervalMillisec;
int m_animationTimerUsers; int m_animationTimerUsers;
bool m_isDockingViewer; QPointer<ads::CDockWidget> m_dockWidget;
}; };
@@ -117,11 +117,10 @@ private:
virtual void assignIdIfNecessary() = 0; virtual void assignIdIfNecessary() = 0;
protected: protected:
caf::PdmField<bool> m_showWindow; caf::PdmField<bool> m_showWindow;
private:
caf::PdmChildField<RimMdiWindowController*> m_windowController; caf::PdmChildField<RimMdiWindowController*> m_windowController;
private:
// Obsoleted field // Obsoleted field
caf::PdmField<std::vector<int>> obsoleteField_windowGeometry; caf::PdmField<std::vector<int>> obsoleteField_windowGeometry;
}; };
@@ -141,12 +141,12 @@ RiuMainWindow::RiuMainWindow()
{ {
setAttribute( Qt::WA_DeleteOnClose ); setAttribute( Qt::WA_DeleteOnClose );
m_mdiArea = new RiuMdiArea( this ); // m_mdiArea = new RiuMdiArea( this );
connect( m_mdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), SLOT( slotSubWindowActivated( QMdiSubWindow* ) ) ); // connect( m_mdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), SLOT( slotSubWindowActivated( QMdiSubWindow* ) ) );
ads::CDockWidget* cWidget = RiuDockWidgetTools::createDockWidget( "3D Views", RiuDockWidgetTools::main3DWindowName(), this ); // ads::CDockWidget* cWidget = RiuDockWidgetTools::createDockWidget( "3D Views", RiuDockWidgetTools::main3DWindowName(), this );
cWidget->setWidget( m_mdiArea ); // cWidget->setWidget( m_mdiArea );
dockManager()->setCentralWidget( cWidget ); // dockManager()->setCentralWidget( cWidget );
createActions(); createActions();
createMenus(); createMenus();
@@ -241,7 +241,7 @@ void RiuMainWindow::initializeGuiNewProjectLoaded()
setPdmRoot( RimProject::current() ); setPdmRoot( RimProject::current() );
restoreTreeViewState(); restoreTreeViewState();
m_mdiArea->applyTiling(); // m_mdiArea->applyTiling();
slotRefreshFileActions(); slotRefreshFileActions();
slotRefreshUndoRedoActions(); slotRefreshUndoRedoActions();
@@ -261,15 +261,15 @@ void RiuMainWindow::initializeGuiNewProjectLoaded()
statusBar()->showMessage( "Ready ...", 5000 ); statusBar()->showMessage( "Ready ...", 5000 );
} }
QMdiSubWindow* activeSubWindow = m_mdiArea->activeSubWindow(); // QMdiSubWindow* activeSubWindow = m_mdiArea->activeSubWindow();
if ( activeSubWindow ) // if ( activeSubWindow )
{ //{
auto w = findViewWindowFromSubWindow( activeSubWindow ); // auto w = findViewWindowFromSubWindow( activeSubWindow );
if ( w && w->mdiWindowGeometry().isMaximized ) // if ( w && w->mdiWindowGeometry().isMaximized )
{ // {
activeSubWindow->showMaximized(); // activeSubWindow->showMaximized();
} // }
} // }
// Sync selections with property editor. // Sync selections with property editor.
// Go backwards as the most "important" tree view is first in the list // Go backwards as the most "important" tree view is first in the list
@@ -343,7 +343,7 @@ void RiuMainWindow::cleanupGuiCaseClose()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuMainWindow::cleanupGuiBeforeProjectClose() void RiuMainWindow::cleanupGuiBeforeProjectClose()
{ {
m_mdiArea->closeAllSubWindows(); // m_mdiArea->closeAllSubWindows();
setPdmRoot( nullptr ); setPdmRoot( nullptr );
@@ -1144,15 +1144,15 @@ void RiuMainWindow::slotInputMockModel()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QMdiSubWindow* RiuMainWindow::findMdiSubWindow( QWidget* viewer ) QMdiSubWindow* RiuMainWindow::findMdiSubWindow( QWidget* viewer )
{ {
QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList(); // QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList();
int i; // int i;
for ( i = 0; i < subws.size(); ++i ) // for ( i = 0; i < subws.size(); ++i )
{ //{
if ( subws[i]->widget() == viewer ) // if ( subws[i]->widget() == viewer )
{ // {
return subws[i]; // return subws[i];
} // }
} // }
return nullptr; return nullptr;
} }
@@ -1182,7 +1182,8 @@ RimViewWindow* RiuMainWindow::findViewWindowFromSubWindow( QMdiSubWindow* subWin
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QList<QMdiSubWindow*> RiuMainWindow::subWindowList( QMdiArea::WindowOrder order ) QList<QMdiSubWindow*> RiuMainWindow::subWindowList( QMdiArea::WindowOrder order )
{ {
return m_mdiArea->subWindowList( order ); // return m_mdiArea->subWindowList( order );
return {};
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -1246,7 +1247,7 @@ RiuMessagePanel* RiuMainWindow::messagePanel()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuMainWindow::removeViewer( QWidget* viewer ) void RiuMainWindow::removeViewer( QWidget* viewer )
{ {
removeViewerFromMdiArea( m_mdiArea, viewer ); // removeViewerFromMdiArea( m_mdiArea, viewer );
slotRefreshViewActions(); slotRefreshViewActions();
} }
@@ -1268,7 +1269,7 @@ void RiuMainWindow::initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer,
subWindowSize = QSize( 400, 400 ); subWindowSize = QSize( 400, 400 );
} }
initializeSubWindow( m_mdiArea, subWindow, subWindowPos, subWindowSize ); // initializeSubWindow( m_mdiArea, subWindow, subWindowPos, subWindowSize );
subWindow->setWidget( viewer ); subWindow->setWidget( viewer );
slotRefreshViewActions(); slotRefreshViewActions();
@@ -1277,13 +1278,15 @@ void RiuMainWindow::initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer,
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuMainWindow::initializeDockingViewer( QWidget* viewer ) ads::CDockWidget* RiuMainWindow::initializeDockingViewer( QWidget* viewer )
{ {
auto dockViewer = RiuDockWidgetTools::createDockWidget( "3D Viewer", "3D view", dockManager() ); auto dockWidget = RiuDockWidgetTools::createDockWidget( "3D Viewer", "3D view", dockManager() );
dockViewer->setWidget( viewer ); dockWidget->setWidget( viewer );
dockManager()->addDockWidgetFloating( dockViewer ); dockManager()->addDockWidgetFloating( dockWidget );
slotRefreshViewActions(); slotRefreshViewActions();
return dockWidget;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -1499,8 +1502,8 @@ void RiuMainWindow::selectViewInProjectTreePreservingSubItemSelection( const Rim
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuMainWindow::setActiveViewer( QWidget* viewer ) void RiuMainWindow::setActiveViewer( QWidget* viewer )
{ {
QMdiSubWindow* swin = findMdiSubWindow( viewer ); // QMdiSubWindow* swin = findMdiSubWindow( viewer );
if ( swin ) m_mdiArea->setActiveSubWindow( swin ); // if ( swin ) m_mdiArea->setActiveSubWindow( swin );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -2110,7 +2113,8 @@ void RiuMainWindow::customMenuRequested( const QPoint& pos )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiuMainWindow::isAnyMdiSubWindowVisible() bool RiuMainWindow::isAnyMdiSubWindowVisible()
{ {
return !m_mdiArea->subWindowList().empty(); // return !m_mdiArea->subWindowList().empty();
return false;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -101,7 +101,7 @@ public:
void initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry ) override; void initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry ) override;
void setActiveViewer( QWidget* subWindow ) override; void setActiveViewer( QWidget* subWindow ) override;
void initializeDockingViewer( QWidget* viewer ) override; ads::CDockWidget* initializeDockingViewer( QWidget* viewer ) override;
void setResultInfo( const QString& info ) const; void setResultInfo( const QString& info ) const;
@@ -66,7 +66,7 @@ RiuMainWindowBase::RiuMainWindowBase()
, m_blockSubWindowProjectTreeSelection( false ) , m_blockSubWindowProjectTreeSelection( false )
, m_hasBeenVisible( false ) , m_hasBeenVisible( false )
, m_windowMenu( nullptr ) , m_windowMenu( nullptr )
, m_mdiArea( nullptr ) // , m_mdiArea( nullptr )
{ {
ads::CDockManager::setAutoHideConfigFlags( ads::CDockManager::DefaultAutoHideConfig ); ads::CDockManager::setAutoHideConfigFlags( ads::CDockManager::DefaultAutoHideConfig );
m_dockManager = new ads::CDockManager( this ); m_dockManager = new ads::CDockManager( this );
@@ -123,7 +123,8 @@ ads::CDockManager* RiuMainWindowBase::dockManager() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiuMdiArea* RiuMainWindowBase::mdiArea() RiuMdiArea* RiuMainWindowBase::mdiArea()
{ {
return m_mdiArea; return nullptr;
// return m_mdiArea;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -774,12 +775,12 @@ void RiuMainWindowBase::addDefaultEntriesToWindowsMenu()
connect( exportLayoutAction, SIGNAL( triggered() ), this, SLOT( exportDockLayout() ) ); connect( exportLayoutAction, SIGNAL( triggered() ), this, SLOT( exportDockLayout() ) );
} }
m_windowMenu->addSeparator(); // m_windowMenu->addSeparator();
QAction* cascadeWindowsAction = new QAction( "Cascade Windows", this ); // QAction* cascadeWindowsAction = new QAction( "Cascade Windows", this );
connect( cascadeWindowsAction, SIGNAL( triggered() ), m_mdiArea, SLOT( cascadeSubWindows() ) ); // connect( cascadeWindowsAction, SIGNAL( triggered() ), m_mdiArea, SLOT( cascadeSubWindows() ) );
QAction* closeAllSubWindowsAction = new QAction( "Close All Windows", this ); // QAction* closeAllSubWindowsAction = new QAction( "Close All Windows", this );
connect( closeAllSubWindowsAction, SIGNAL( triggered() ), m_mdiArea, SLOT( closeAllSubWindows() ) ); // connect( closeAllSubWindowsAction, SIGNAL( triggered() ), m_mdiArea, SLOT( closeAllSubWindows() ) );
caf::CmdFeatureManager* cmdFeatureMgr = caf::CmdFeatureManager::instance(); caf::CmdFeatureManager* cmdFeatureMgr = caf::CmdFeatureManager::instance();
@@ -789,8 +790,8 @@ void RiuMainWindowBase::addDefaultEntriesToWindowsMenu()
m_windowMenu->addAction( cmdFeatureMgr->action( name ) ); m_windowMenu->addAction( cmdFeatureMgr->action( name ) );
} }
m_windowMenu->addAction( cascadeWindowsAction ); // m_windowMenu->addAction( cascadeWindowsAction );
m_windowMenu->addAction( closeAllSubWindowsAction ); // m_windowMenu->addAction( closeAllSubWindowsAction );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -72,7 +72,7 @@ public:
virtual void initializeViewer( QMdiSubWindow* viewWindow, QWidget* viewWidget, const RimMdiWindowGeometry& windowsGeometry ) = 0; virtual void initializeViewer( QMdiSubWindow* viewWindow, QWidget* viewWidget, const RimMdiWindowGeometry& windowsGeometry ) = 0;
virtual void setActiveViewer( QWidget* subWindow ) = 0; virtual void setActiveViewer( QWidget* subWindow ) = 0;
virtual void initializeDockingViewer( QWidget* viewer ) = 0; virtual ads::CDockWidget* initializeDockingViewer( QWidget* viewer ) = 0;
virtual QMdiSubWindow* findMdiSubWindow( QWidget* viewer ) = 0; virtual QMdiSubWindow* findMdiSubWindow( QWidget* viewer ) = 0;
@@ -143,8 +143,8 @@ protected:
QAction* m_redoAction; QAction* m_redoAction;
QUndoView* m_undoView; QUndoView* m_undoView;
RiuMdiArea* m_mdiArea; // RiuMdiArea* m_mdiArea;
QMenu* m_windowMenu; QMenu* m_windowMenu;
const int DOCKSTATE_VERSION = 3; const int DOCKSTATE_VERSION = 3;
@@ -98,19 +98,19 @@ RiuPlotMainWindow::RiuPlotMainWindow()
, m_autoUpdateEnabled( false ) , m_autoUpdateEnabled( false )
, m_autoUpdateTimerId( -1 ) , m_autoUpdateTimerId( -1 )
{ {
m_mdiArea = new RiuMdiArea( this ); // m_mdiArea = new RiuMdiArea( this );
connect( m_mdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), SLOT( slotSubWindowActivated( QMdiSubWindow* ) ) ); // connect( m_mdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), SLOT( slotSubWindowActivated( QMdiSubWindow* ) ) );
caf::CmdFeatureMenuBuilder menuForMdiArea; // caf::CmdFeatureMenuBuilder menuForMdiArea;
menuForMdiArea << "RicNewEmptySummaryMultiPlotFeature"; // menuForMdiArea << "RicNewEmptySummaryMultiPlotFeature";
menuForMdiArea << "RicOpenSummaryPlotEditorFromMdiAreaFeature"; // menuForMdiArea << "RicOpenSummaryPlotEditorFromMdiAreaFeature";
new RiuContextMenuLauncher( m_mdiArea, menuForMdiArea ); // new RiuContextMenuLauncher( m_mdiArea, menuForMdiArea );
ads::CDockWidget* cWidget = RiuDockWidgetTools::createDockWidget( "Plot Window", RiuDockWidgetTools::mainPlotWindowName(), this ); // ads::CDockWidget* cWidget = RiuDockWidgetTools::createDockWidget( "Plot Window", RiuDockWidgetTools::mainPlotWindowName(), this );
cWidget->setWidget( m_mdiArea ); // cWidget->setWidget( m_mdiArea );
auto dockArea = dockManager()->setCentralWidget( cWidget ); // auto dockArea = dockManager()->setCentralWidget( cWidget );
dockArea->setVisible( true ); // dockArea->setVisible( true );
m_toggleSelectionLinkAction = new QAction( QIcon( ":/Link3DandPlots.png" ), tr( "Link With Selection in 3D" ), this ); m_toggleSelectionLinkAction = new QAction( QIcon( ":/Link3DandPlots.png" ), tr( "Link With Selection in 3D" ), this );
m_toggleSelectionLinkAction->setToolTip( "Update wells used in plots from well selections in 3D view." ); m_toggleSelectionLinkAction->setToolTip( "Update wells used in plots from well selections in 3D view." );
@@ -223,7 +223,7 @@ void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
} }
} }
m_mdiArea->applyTiling(); // m_mdiArea->applyTiling();
if ( m_activePlotViewWindow && m_activePlotViewWindow->viewWidget() && !RiaRegressionTestRunner::instance()->isRunningRegressionTests() ) if ( m_activePlotViewWindow && m_activePlotViewWindow->viewWidget() && !RiaRegressionTestRunner::instance()->isRunningRegressionTests() )
{ {
@@ -262,7 +262,7 @@ void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::cleanupGuiBeforeProjectClose() void RiuPlotMainWindow::cleanupGuiBeforeProjectClose()
{ {
m_mdiArea->closeAllSubWindows(); // m_mdiArea->closeAllSubWindows();
setPdmRoot( nullptr ); setPdmRoot( nullptr );
@@ -640,15 +640,15 @@ void RiuPlotMainWindow::createDockPanels()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QMdiSubWindow* RiuPlotMainWindow::findMdiSubWindow( QWidget* viewer ) QMdiSubWindow* RiuPlotMainWindow::findMdiSubWindow( QWidget* viewer )
{ {
QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList(); // QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList();
int i; // int i;
for ( i = 0; i < subws.size(); ++i ) // for ( i = 0; i < subws.size(); ++i )
{ //{
if ( subws[i]->widget() == viewer ) // if ( subws[i]->widget() == viewer )
{ // {
return subws[i]; // return subws[i];
} // }
} // }
return nullptr; return nullptr;
} }
@@ -671,7 +671,8 @@ RimViewWindow* RiuPlotMainWindow::findViewWindowFromSubWindow( QMdiSubWindow* su
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
QList<QMdiSubWindow*> RiuPlotMainWindow::subWindowList( QMdiArea::WindowOrder order ) QList<QMdiSubWindow*> RiuPlotMainWindow::subWindowList( QMdiArea::WindowOrder order )
{ {
return m_mdiArea->subWindowList( order ); // return m_mdiArea->subWindowList( order );
return {};
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -837,7 +838,7 @@ void RiuPlotMainWindow::showAndSetKeyboardFocusToSummaryPlotManager()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::removeViewer( QWidget* viewer ) void RiuPlotMainWindow::removeViewer( QWidget* viewer )
{ {
removeViewerFromMdiArea( m_mdiArea, viewer ); // removeViewerFromMdiArea( m_mdiArea, viewer );
refreshToolbars(); refreshToolbars();
} }
@@ -859,7 +860,7 @@ void RiuPlotMainWindow::initializeViewer( QMdiSubWindow* subWindow, QWidget* vie
subWindowSize = QSize( 400, 400 ); subWindowSize = QSize( 400, 400 );
} }
initializeSubWindow( m_mdiArea, subWindow, subWindowPos, subWindowSize ); // initializeSubWindow( m_mdiArea, subWindow, subWindowPos, subWindowSize );
subWindow->setWidget( viewer ); subWindow->setWidget( viewer );
refreshToolbars(); refreshToolbars();
@@ -868,11 +869,13 @@ void RiuPlotMainWindow::initializeViewer( QMdiSubWindow* subWindow, QWidget* vie
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::initializeDockingViewer( QWidget* viewer ) ads::CDockWidget* RiuPlotMainWindow::initializeDockingViewer( QWidget* viewer )
{ {
auto dockViewer = RiuDockWidgetTools::createDockWidget( "3D Viewer", "3D view", dockManager() ); auto dockViewer = RiuDockWidgetTools::createDockWidget( "3D Viewer", "3D view", dockManager() );
dockViewer->setWidget( viewer ); dockViewer->setWidget( viewer );
dockManager()->addDockWidgetFloating( dockViewer ); dockManager()->addDockWidgetFloating( dockViewer );
return dockViewer;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -937,8 +940,8 @@ void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::setActiveViewer( QWidget* viewer ) void RiuPlotMainWindow::setActiveViewer( QWidget* viewer )
{ {
QMdiSubWindow* swin = findMdiSubWindow( viewer ); // QMdiSubWindow* swin = findMdiSubWindow( viewer );
if ( swin ) m_mdiArea->setActiveSubWindow( swin ); // if ( swin ) m_mdiArea->setActiveSubWindow( swin );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -1085,7 +1088,8 @@ void RiuPlotMainWindow::customMenuRequested( const QPoint& pos )
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RiuPlotMainWindow::isAnyMdiSubWindowVisible() bool RiuPlotMainWindow::isAnyMdiSubWindowVisible()
{ {
return !m_mdiArea->subWindowList().empty(); // return !m_mdiArea->subWindowList().empty();
return false;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -1093,9 +1097,9 @@ bool RiuPlotMainWindow::isAnyMdiSubWindowVisible()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::dragEnterEvent( QDragEnterEvent* event ) void RiuPlotMainWindow::dragEnterEvent( QDragEnterEvent* event )
{ {
QPoint curpos = m_mdiArea->mapFromGlobal( QCursor::pos() ); // QPoint curpos = m_mdiArea->mapFromGlobal( QCursor::pos() );
if ( m_mdiArea->rect().contains( curpos ) ) event->acceptProposedAction(); // if ( m_mdiArea->rect().contains( curpos ) ) event->acceptProposedAction();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -68,10 +68,10 @@ public:
void cleanupGuiBeforeProjectClose(); void cleanupGuiBeforeProjectClose();
void cleanUpTemporaryWidgets(); void cleanUpTemporaryWidgets();
void removeViewer( QWidget* viewer ) override; void removeViewer( QWidget* viewer ) override;
void initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry ) override; void initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry ) override;
void setActiveViewer( QWidget* subWindow ) override; void setActiveViewer( QWidget* subWindow ) override;
void initializeDockingViewer( QWidget* viewer ) override; ads::CDockWidget* initializeDockingViewer( QWidget* viewer ) override;
void setDefaultWindowSize(); void setDefaultWindowSize();
void enable3DSelectionLink( bool enable ); void enable3DSelectionLink( bool enable );