mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 13:47:12 -05:00
Work in progress
This commit is contained in:
@@ -3,6 +3,7 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicStoreUserDefinedCameraFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicPopOutTo3dViewFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicPopOutToPlotViewFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicConvert3dToMdiFeature.cpp
|
||||
)
|
||||
|
||||
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 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 )
|
||||
{
|
||||
actionToSetup->setText( "Pop Out (in 3D View)" );
|
||||
actionToSetup->setIcon( QIcon( ":/3DWindow.svg" ) );
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicPopOutTo3dViewFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText( "Pop Out (in 3D View)" );
|
||||
actionToSetup->setIcon( QIcon( ":/3DWindow.svg" ) );
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "RimGridView.h"
|
||||
#include "RimLegendConfig.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimMdiWindowController.h"
|
||||
#include "RimMeasurement.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
@@ -53,6 +54,8 @@
|
||||
#include "RiuTimeStepChangedHandler.h"
|
||||
#include "RiuViewer.h"
|
||||
|
||||
#include "DockManager.h"
|
||||
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
#include "cafFrameAnimationControl.h"
|
||||
@@ -1908,6 +1911,7 @@ void Rim3dView::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const
|
||||
{
|
||||
if ( isDockingViewer() )
|
||||
{
|
||||
menuBuilder << "RicConvert3dToMdiFeature";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1927,7 +1931,27 @@ void Rim3dView::convertToDocking( RiuMainWindowBase* mainWindow )
|
||||
|
||||
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();
|
||||
scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
@@ -71,6 +71,11 @@ namespace caf
|
||||
class DisplayCoordTransform;
|
||||
}
|
||||
|
||||
namespace ads
|
||||
{
|
||||
class CDockWidget;
|
||||
}
|
||||
|
||||
enum PartRenderMaskEnum
|
||||
{
|
||||
surfaceBit = 1,
|
||||
@@ -96,7 +101,7 @@ public:
|
||||
|
||||
int id() const final;
|
||||
|
||||
bool isDockingViewer() const { return m_isDockingViewer; }
|
||||
bool isDockingViewer() const { return !m_dockWidget.isNull(); }
|
||||
|
||||
// Public fields:
|
||||
|
||||
@@ -207,6 +212,7 @@ public:
|
||||
void synchronizeLocalAnnotationsFromGlobal();
|
||||
|
||||
void convertToDocking( RiuMainWindowBase* mainWindow );
|
||||
void convertToMdi( RiuMainWindowBase* mainWindow );
|
||||
|
||||
protected:
|
||||
static void removeModelByName( cvf::Scene* scene, const cvf::String& modelName );
|
||||
@@ -367,5 +373,5 @@ private:
|
||||
const int m_animationIntervalMillisec;
|
||||
int m_animationTimerUsers;
|
||||
|
||||
bool m_isDockingViewer;
|
||||
QPointer<ads::CDockWidget> m_dockWidget;
|
||||
};
|
||||
|
||||
@@ -117,11 +117,10 @@ private:
|
||||
virtual void assignIdIfNecessary() = 0;
|
||||
|
||||
protected:
|
||||
caf::PdmField<bool> m_showWindow;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_showWindow;
|
||||
caf::PdmChildField<RimMdiWindowController*> m_windowController;
|
||||
|
||||
private:
|
||||
// Obsoleted field
|
||||
caf::PdmField<std::vector<int>> obsoleteField_windowGeometry;
|
||||
};
|
||||
|
||||
@@ -141,12 +141,12 @@ RiuMainWindow::RiuMainWindow()
|
||||
{
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
|
||||
m_mdiArea = new RiuMdiArea( this );
|
||||
connect( m_mdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), SLOT( slotSubWindowActivated( QMdiSubWindow* ) ) );
|
||||
// m_mdiArea = new RiuMdiArea( this );
|
||||
// connect( m_mdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), SLOT( slotSubWindowActivated( QMdiSubWindow* ) ) );
|
||||
|
||||
ads::CDockWidget* cWidget = RiuDockWidgetTools::createDockWidget( "3D Views", RiuDockWidgetTools::main3DWindowName(), this );
|
||||
cWidget->setWidget( m_mdiArea );
|
||||
dockManager()->setCentralWidget( cWidget );
|
||||
// ads::CDockWidget* cWidget = RiuDockWidgetTools::createDockWidget( "3D Views", RiuDockWidgetTools::main3DWindowName(), this );
|
||||
// cWidget->setWidget( m_mdiArea );
|
||||
// dockManager()->setCentralWidget( cWidget );
|
||||
|
||||
createActions();
|
||||
createMenus();
|
||||
@@ -241,7 +241,7 @@ void RiuMainWindow::initializeGuiNewProjectLoaded()
|
||||
setPdmRoot( RimProject::current() );
|
||||
restoreTreeViewState();
|
||||
|
||||
m_mdiArea->applyTiling();
|
||||
// m_mdiArea->applyTiling();
|
||||
|
||||
slotRefreshFileActions();
|
||||
slotRefreshUndoRedoActions();
|
||||
@@ -261,15 +261,15 @@ void RiuMainWindow::initializeGuiNewProjectLoaded()
|
||||
statusBar()->showMessage( "Ready ...", 5000 );
|
||||
}
|
||||
|
||||
QMdiSubWindow* activeSubWindow = m_mdiArea->activeSubWindow();
|
||||
if ( activeSubWindow )
|
||||
{
|
||||
auto w = findViewWindowFromSubWindow( activeSubWindow );
|
||||
if ( w && w->mdiWindowGeometry().isMaximized )
|
||||
{
|
||||
activeSubWindow->showMaximized();
|
||||
}
|
||||
}
|
||||
// QMdiSubWindow* activeSubWindow = m_mdiArea->activeSubWindow();
|
||||
// if ( activeSubWindow )
|
||||
//{
|
||||
// auto w = findViewWindowFromSubWindow( activeSubWindow );
|
||||
// if ( w && w->mdiWindowGeometry().isMaximized )
|
||||
// {
|
||||
// activeSubWindow->showMaximized();
|
||||
// }
|
||||
// }
|
||||
|
||||
// Sync selections with property editor.
|
||||
// Go backwards as the most "important" tree view is first in the list
|
||||
@@ -343,7 +343,7 @@ void RiuMainWindow::cleanupGuiCaseClose()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::cleanupGuiBeforeProjectClose()
|
||||
{
|
||||
m_mdiArea->closeAllSubWindows();
|
||||
// m_mdiArea->closeAllSubWindows();
|
||||
|
||||
setPdmRoot( nullptr );
|
||||
|
||||
@@ -1144,15 +1144,15 @@ void RiuMainWindow::slotInputMockModel()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QMdiSubWindow* RiuMainWindow::findMdiSubWindow( QWidget* viewer )
|
||||
{
|
||||
QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList();
|
||||
int i;
|
||||
for ( i = 0; i < subws.size(); ++i )
|
||||
{
|
||||
if ( subws[i]->widget() == viewer )
|
||||
{
|
||||
return subws[i];
|
||||
}
|
||||
}
|
||||
// QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList();
|
||||
// int i;
|
||||
// for ( i = 0; i < subws.size(); ++i )
|
||||
//{
|
||||
// if ( subws[i]->widget() == viewer )
|
||||
// {
|
||||
// return subws[i];
|
||||
// }
|
||||
// }
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
@@ -1182,7 +1182,8 @@ RimViewWindow* RiuMainWindow::findViewWindowFromSubWindow( QMdiSubWindow* subWin
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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 )
|
||||
{
|
||||
removeViewerFromMdiArea( m_mdiArea, viewer );
|
||||
// removeViewerFromMdiArea( m_mdiArea, viewer );
|
||||
slotRefreshViewActions();
|
||||
}
|
||||
|
||||
@@ -1268,7 +1269,7 @@ void RiuMainWindow::initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer,
|
||||
subWindowSize = QSize( 400, 400 );
|
||||
}
|
||||
|
||||
initializeSubWindow( m_mdiArea, subWindow, subWindowPos, subWindowSize );
|
||||
// initializeSubWindow( m_mdiArea, subWindow, subWindowPos, subWindowSize );
|
||||
subWindow->setWidget( viewer );
|
||||
|
||||
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() );
|
||||
dockViewer->setWidget( viewer );
|
||||
dockManager()->addDockWidgetFloating( dockViewer );
|
||||
auto dockWidget = RiuDockWidgetTools::createDockWidget( "3D Viewer", "3D view", dockManager() );
|
||||
dockWidget->setWidget( viewer );
|
||||
dockManager()->addDockWidgetFloating( dockWidget );
|
||||
|
||||
slotRefreshViewActions();
|
||||
|
||||
return dockWidget;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1499,8 +1502,8 @@ void RiuMainWindow::selectViewInProjectTreePreservingSubItemSelection( const Rim
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::setActiveViewer( QWidget* viewer )
|
||||
{
|
||||
QMdiSubWindow* swin = findMdiSubWindow( viewer );
|
||||
if ( swin ) m_mdiArea->setActiveSubWindow( swin );
|
||||
// QMdiSubWindow* swin = findMdiSubWindow( viewer );
|
||||
// if ( swin ) m_mdiArea->setActiveSubWindow( swin );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -2110,7 +2113,8 @@ void RiuMainWindow::customMenuRequested( const QPoint& pos )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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 setActiveViewer( QWidget* subWindow ) override;
|
||||
|
||||
void initializeDockingViewer( QWidget* viewer ) override;
|
||||
ads::CDockWidget* initializeDockingViewer( QWidget* viewer ) override;
|
||||
|
||||
void setResultInfo( const QString& info ) const;
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ RiuMainWindowBase::RiuMainWindowBase()
|
||||
, m_blockSubWindowProjectTreeSelection( false )
|
||||
, m_hasBeenVisible( false )
|
||||
, m_windowMenu( nullptr )
|
||||
, m_mdiArea( nullptr )
|
||||
// , m_mdiArea( nullptr )
|
||||
{
|
||||
ads::CDockManager::setAutoHideConfigFlags( ads::CDockManager::DefaultAutoHideConfig );
|
||||
m_dockManager = new ads::CDockManager( this );
|
||||
@@ -123,7 +123,8 @@ ads::CDockManager* RiuMainWindowBase::dockManager() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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() ) );
|
||||
}
|
||||
|
||||
m_windowMenu->addSeparator();
|
||||
QAction* cascadeWindowsAction = new QAction( "Cascade Windows", this );
|
||||
connect( cascadeWindowsAction, SIGNAL( triggered() ), m_mdiArea, SLOT( cascadeSubWindows() ) );
|
||||
// m_windowMenu->addSeparator();
|
||||
// QAction* cascadeWindowsAction = new QAction( "Cascade Windows", this );
|
||||
// connect( cascadeWindowsAction, SIGNAL( triggered() ), m_mdiArea, SLOT( cascadeSubWindows() ) );
|
||||
|
||||
QAction* closeAllSubWindowsAction = new QAction( "Close All Windows", this );
|
||||
connect( closeAllSubWindowsAction, SIGNAL( triggered() ), m_mdiArea, SLOT( closeAllSubWindows() ) );
|
||||
// QAction* closeAllSubWindowsAction = new QAction( "Close All Windows", this );
|
||||
// connect( closeAllSubWindowsAction, SIGNAL( triggered() ), m_mdiArea, SLOT( closeAllSubWindows() ) );
|
||||
|
||||
caf::CmdFeatureManager* cmdFeatureMgr = caf::CmdFeatureManager::instance();
|
||||
|
||||
@@ -789,8 +790,8 @@ void RiuMainWindowBase::addDefaultEntriesToWindowsMenu()
|
||||
m_windowMenu->addAction( cmdFeatureMgr->action( name ) );
|
||||
}
|
||||
|
||||
m_windowMenu->addAction( cascadeWindowsAction );
|
||||
m_windowMenu->addAction( closeAllSubWindowsAction );
|
||||
// m_windowMenu->addAction( cascadeWindowsAction );
|
||||
// m_windowMenu->addAction( closeAllSubWindowsAction );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
virtual void initializeViewer( QMdiSubWindow* viewWindow, QWidget* viewWidget, const RimMdiWindowGeometry& windowsGeometry ) = 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;
|
||||
|
||||
@@ -143,8 +143,8 @@ protected:
|
||||
QAction* m_redoAction;
|
||||
QUndoView* m_undoView;
|
||||
|
||||
RiuMdiArea* m_mdiArea;
|
||||
QMenu* m_windowMenu;
|
||||
// RiuMdiArea* m_mdiArea;
|
||||
QMenu* m_windowMenu;
|
||||
|
||||
const int DOCKSTATE_VERSION = 3;
|
||||
|
||||
|
||||
@@ -98,19 +98,19 @@ RiuPlotMainWindow::RiuPlotMainWindow()
|
||||
, m_autoUpdateEnabled( false )
|
||||
, m_autoUpdateTimerId( -1 )
|
||||
{
|
||||
m_mdiArea = new RiuMdiArea( this );
|
||||
connect( m_mdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), SLOT( slotSubWindowActivated( QMdiSubWindow* ) ) );
|
||||
// m_mdiArea = new RiuMdiArea( this );
|
||||
// connect( m_mdiArea, SIGNAL( subWindowActivated( QMdiSubWindow* ) ), SLOT( slotSubWindowActivated( QMdiSubWindow* ) ) );
|
||||
|
||||
caf::CmdFeatureMenuBuilder menuForMdiArea;
|
||||
menuForMdiArea << "RicNewEmptySummaryMultiPlotFeature";
|
||||
menuForMdiArea << "RicOpenSummaryPlotEditorFromMdiAreaFeature";
|
||||
new RiuContextMenuLauncher( m_mdiArea, menuForMdiArea );
|
||||
// caf::CmdFeatureMenuBuilder menuForMdiArea;
|
||||
// menuForMdiArea << "RicNewEmptySummaryMultiPlotFeature";
|
||||
// menuForMdiArea << "RicOpenSummaryPlotEditorFromMdiAreaFeature";
|
||||
// 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 );
|
||||
auto dockArea = dockManager()->setCentralWidget( cWidget );
|
||||
dockArea->setVisible( true );
|
||||
// cWidget->setWidget( m_mdiArea );
|
||||
// auto dockArea = dockManager()->setCentralWidget( cWidget );
|
||||
// dockArea->setVisible( true );
|
||||
|
||||
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." );
|
||||
@@ -223,7 +223,7 @@ void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
|
||||
}
|
||||
}
|
||||
|
||||
m_mdiArea->applyTiling();
|
||||
// m_mdiArea->applyTiling();
|
||||
|
||||
if ( m_activePlotViewWindow && m_activePlotViewWindow->viewWidget() && !RiaRegressionTestRunner::instance()->isRunningRegressionTests() )
|
||||
{
|
||||
@@ -262,7 +262,7 @@ void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotMainWindow::cleanupGuiBeforeProjectClose()
|
||||
{
|
||||
m_mdiArea->closeAllSubWindows();
|
||||
// m_mdiArea->closeAllSubWindows();
|
||||
|
||||
setPdmRoot( nullptr );
|
||||
|
||||
@@ -640,15 +640,15 @@ void RiuPlotMainWindow::createDockPanels()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QMdiSubWindow* RiuPlotMainWindow::findMdiSubWindow( QWidget* viewer )
|
||||
{
|
||||
QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList();
|
||||
int i;
|
||||
for ( i = 0; i < subws.size(); ++i )
|
||||
{
|
||||
if ( subws[i]->widget() == viewer )
|
||||
{
|
||||
return subws[i];
|
||||
}
|
||||
}
|
||||
// QList<QMdiSubWindow*> subws = m_mdiArea->subWindowList();
|
||||
// int i;
|
||||
// for ( i = 0; i < subws.size(); ++i )
|
||||
//{
|
||||
// if ( subws[i]->widget() == viewer )
|
||||
// {
|
||||
// return subws[i];
|
||||
// }
|
||||
// }
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
@@ -671,7 +671,8 @@ RimViewWindow* RiuPlotMainWindow::findViewWindowFromSubWindow( QMdiSubWindow* su
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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 )
|
||||
{
|
||||
removeViewerFromMdiArea( m_mdiArea, viewer );
|
||||
// removeViewerFromMdiArea( m_mdiArea, viewer );
|
||||
refreshToolbars();
|
||||
}
|
||||
|
||||
@@ -859,7 +860,7 @@ void RiuPlotMainWindow::initializeViewer( QMdiSubWindow* subWindow, QWidget* vie
|
||||
subWindowSize = QSize( 400, 400 );
|
||||
}
|
||||
|
||||
initializeSubWindow( m_mdiArea, subWindow, subWindowPos, subWindowSize );
|
||||
// initializeSubWindow( m_mdiArea, subWindow, subWindowPos, subWindowSize );
|
||||
subWindow->setWidget( viewer );
|
||||
|
||||
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() );
|
||||
dockViewer->setWidget( viewer );
|
||||
dockManager()->addDockWidgetFloating( dockViewer );
|
||||
|
||||
return dockViewer;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -937,8 +940,8 @@ void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPlotMainWindow::setActiveViewer( QWidget* viewer )
|
||||
{
|
||||
QMdiSubWindow* swin = findMdiSubWindow( viewer );
|
||||
if ( swin ) m_mdiArea->setActiveSubWindow( swin );
|
||||
// QMdiSubWindow* swin = findMdiSubWindow( viewer );
|
||||
// if ( swin ) m_mdiArea->setActiveSubWindow( swin );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -1085,7 +1088,8 @@ void RiuPlotMainWindow::customMenuRequested( const QPoint& pos )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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 )
|
||||
{
|
||||
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 cleanUpTemporaryWidgets();
|
||||
|
||||
void removeViewer( QWidget* viewer ) override;
|
||||
void initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry ) override;
|
||||
void setActiveViewer( QWidget* subWindow ) override;
|
||||
void initializeDockingViewer( QWidget* viewer ) override;
|
||||
void removeViewer( QWidget* viewer ) override;
|
||||
void initializeViewer( QMdiSubWindow* subWindow, QWidget* viewer, const RimMdiWindowGeometry& windowsGeometry ) override;
|
||||
void setActiveViewer( QWidget* subWindow ) override;
|
||||
ads::CDockWidget* initializeDockingViewer( QWidget* viewer ) override;
|
||||
|
||||
void setDefaultWindowSize();
|
||||
void enable3DSelectionLink( bool enable );
|
||||
|
||||
Reference in New Issue
Block a user