Wired up application logic related to new RiuMainPlotWindow

This commit is contained in:
Magne Sjaastad 2016-06-27 11:07:01 +02:00
parent e92624a862
commit bbf1574feb
12 changed files with 194 additions and 92 deletions

View File

@ -193,6 +193,8 @@ RiaApplication::RiaApplication(int& argc, char** argv)
m_resViewUpdateTimer = NULL; m_resViewUpdateTimer = NULL;
m_runningRegressionTests = false; m_runningRegressionTests = false;
m_mainPlotWindow = NULL;
} }
@ -687,8 +689,12 @@ bool RiaApplication::closeProject(bool askToSaveIfDirty)
mainWnd->cleanupGuiBeforeProjectClose(); mainWnd->cleanupGuiBeforeProjectClose();
RiuMainPlotWindow* mainPlotWnd = RiuMainPlotWindow::instance(); if (m_mainPlotWindow)
mainPlotWnd->cleanupGuiBeforeProjectClose(); {
m_mainPlotWindow->cleanupGuiBeforeProjectClose();
deleteMainPlotWindow();
}
caf::EffectGenerator::clearEffectCache(); caf::EffectGenerator::clearEffectCache();
@ -714,10 +720,9 @@ void RiaApplication::onProjectOpenedOrClosed()
{ {
mainWnd->initializeGuiNewProjectLoaded(); mainWnd->initializeGuiNewProjectLoaded();
} }
RiuMainPlotWindow* mainPlotWnd = RiuMainPlotWindow::instance(); if (m_mainPlotWindow)
if (mainPlotWnd)
{ {
mainPlotWnd->initializeGuiNewProjectLoaded(); m_mainPlotWindow->initializeGuiNewProjectLoaded();
} }
setWindowCaptionFromAppState(); setWindowCaptionFromAppState();
@ -1287,6 +1292,54 @@ int RiaApplication::launchUnitTestsWithConsole()
return launchUnitTests(); return launchUnitTests();
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaApplication::createMainPlotWindow()
{
CVF_ASSERT(m_mainPlotWindow == NULL);
m_mainPlotWindow = new RiuMainPlotWindow;
m_mainPlotWindow->setWindowTitle("Summary Plots for ResInsight");
m_mainPlotWindow->setDefaultWindowSize();
m_mainPlotWindow->loadWinGeoAndDockToolBarLayout();
m_mainPlotWindow->showWindow();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaApplication::deleteMainPlotWindow()
{
m_mainPlotWindow->deleteLater();
processEvents();
m_mainPlotWindow = NULL;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuMainPlotWindow* RiaApplication::getOrCreateMainPlotWindow()
{
if (!m_mainPlotWindow)
{
createMainPlotWindow();
}
return m_mainPlotWindow;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuMainPlotWindow* RiaApplication::mainPlotWindow()
{
return m_mainPlotWindow;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -43,6 +43,7 @@ class RimProject;
class RimCommandObject; class RimCommandObject;
class RiaProjectModifier; class RiaProjectModifier;
class RimWellLogPlot; class RimWellLogPlot;
class RiuMainPlotWindow;
namespace caf namespace caf
{ {
@ -163,6 +164,9 @@ public:
int launchUnitTests(); int launchUnitTests();
int launchUnitTestsWithConsole(); int launchUnitTestsWithConsole();
RiuMainPlotWindow* getOrCreateMainPlotWindow();
RiuMainPlotWindow* mainPlotWindow();
private: private:
enum ProjectLoadAction enum ProjectLoadAction
{ {
@ -178,6 +182,9 @@ private:
QImage grabFrameBufferImage(); QImage grabFrameBufferImage();
void clearViewsScheduledForUpdate(); void clearViewsScheduledForUpdate();
void createMainPlotWindow();
void deleteMainPlotWindow();
private slots: private slots:
void slotWorkerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus); void slotWorkerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
@ -215,4 +222,6 @@ private:
QString m_helpText; QString m_helpText;
bool m_runningRegressionTests; bool m_runningRegressionTests;
RiuMainPlotWindow* m_mainPlotWindow;
}; };

View File

@ -22,25 +22,24 @@
#include "RicWellLogPlotCurveFeatureImpl.h" #include "RicWellLogPlotCurveFeatureImpl.h"
#include "RicNewWellLogPlotFeatureImpl.h" #include "RicNewWellLogPlotFeatureImpl.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
#include "RimWellLogFile.h" #include "RimWellLogFile.h"
#include "RimWellLogFileChannel.h" #include "RimWellLogFileChannel.h"
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "RimWellLogFileCurve.h" #include "RimWellLogFileCurve.h"
#include "RimProject.h" #include "RimWellLogPlot.h"
#include "RimMainPlotCollection.h"
#include "RimWellLogPlotCollection.h" #include "RimWellLogPlotCollection.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RimWellPathCollection.h" #include "RimWellPathCollection.h"
#include "RiuMainPlotWindow.h"
#include "RigWellLogFile.h" #include "RigWellLogFile.h"
#include "RiaApplication.h" #include "RiaApplication.h"
#include "RiuMainWindow.h"
#include "RiuWellLogTrack.h" #include "RiuWellLogTrack.h"
#include "cafSelectionManager.h" #include "cafSelectionManager.h"
#include "cafPdmUiTreeView.h"
#include <QAction> #include <QAction>
@ -110,9 +109,12 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
plot->updateDepthZoom(); plot->updateDepthZoom();
plotTrack->viewer()->replot(); plotTrack->viewer()->replot();
// Make sure the summary plot window is created and visible
RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateMainPlotWindow();
RiaApplication::instance()->project()->updateConnectedEditors(); RiaApplication::instance()->project()->updateConnectedEditors();
RiuMainWindow::instance()->projectTreeView()->selectAsCurrentItem(selection.back()); plotwindow->selectAsCurrentItem(selection.back());
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -29,8 +29,8 @@
#include "RimWellLogTrack.h" #include "RimWellLogTrack.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RimWellPathCollection.h" #include "RimWellPathCollection.h"
#include "RiuMainPlotWindow.h"
#include "RiuMainWindow.h"
#include "RiaApplication.h" #include "RiaApplication.h"
#include "cafSelectionManager.h" #include "cafSelectionManager.h"
@ -136,7 +136,13 @@ RimWellLogExtractionCurve* RicNewWellLogCurveExtractionFeature::addCurve(RimWell
plotTrack->addCurve(curve); plotTrack->addCurve(curve);
plotTrack->updateConnectedEditors(); plotTrack->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(curve);
// Make sure the summary plot window is created and visible
RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateMainPlotWindow();
RiaApplication::instance()->project()->updateConnectedEditors();
plotwindow->selectAsCurrentItem(curve);
return curve; return curve;
} }

View File

@ -22,17 +22,17 @@
#include "RicWellLogPlotCurveFeatureImpl.h" #include "RicWellLogPlotCurveFeatureImpl.h"
#include "RicNewWellLogPlotFeatureImpl.h" #include "RicNewWellLogPlotFeatureImpl.h"
#include "RimWellLogFileCurve.h" #include "RiaApplication.h"
#include "RimWellLogTrack.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimWellLogFile.h" #include "RimWellLogFile.h"
#include "RimWellLogFileChannel.h" #include "RimWellLogFileChannel.h"
#include "RimWellLogFileCurve.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h" #include "RimWellPath.h"
#include "RimWellPathCollection.h" #include "RimWellPathCollection.h"
#include "RimProject.h" #include "RiuMainPlotWindow.h"
#include "RimOilField.h"
#include "RiuMainWindow.h"
#include "RiaApplication.h"
#include "cafSelectionManager.h" #include "cafSelectionManager.h"
@ -152,7 +152,8 @@ RimWellLogFileCurve* RicNewWellLogFileCurveFeature::addCurve(RimWellLogTrack* pl
plotTrack->updateConnectedEditors(); plotTrack->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(curve); RiuMainPlotWindow* plotwindow = RiaApplication::instance()->getOrCreateMainPlotWindow();
plotwindow->selectAsCurrentItem(curve);
return curve; return curve;
} }

View File

@ -19,13 +19,12 @@
#include "RicWellLogPlotTrackFeatureImpl.h" #include "RicWellLogPlotTrackFeatureImpl.h"
#include "RimWellLogCurve.h"
#include "RimWellLogPlot.h" #include "RimWellLogPlot.h"
#include "RimWellLogTrack.h" #include "RimWellLogTrack.h"
#include "RimWellLogCurve.h"
#include "RiuMainWindow.h" #include "cvfAssert.h"
#include "cafPdmUiTreeView.h"
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///

View File

@ -735,18 +735,12 @@ void RimProject::appendScriptItems(QMenu* menu, RimScriptCollection* scriptColle
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimProject::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/) void RimProject::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
{ {
if (viewLinkerCollection()->viewLinker()) if (uiConfigName == "PlotWindow")
{ {
// Use object instead of field to avoid duplicate entries in the tree view
uiTreeOrdering.add(viewLinkerCollection());
}
RimOilField* oilField = activeOilField(); RimOilField* oilField = activeOilField();
if (oilField) if (oilField)
{ {
if (oilField->analysisModels()) uiTreeOrdering.add(oilField->analysisModels()); if (oilField->summaryCaseCollection()) uiTreeOrdering.add(oilField->summaryCaseCollection());
if (oilField->geoMechModels()) uiTreeOrdering.add(oilField->geoMechModels());
if (oilField->wellPathCollection()) uiTreeOrdering.add(oilField->wellPathCollection());
} }
if (mainPlotCollection) if (mainPlotCollection)
@ -761,8 +755,29 @@ void RimProject::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QS
} }
} }
uiTreeOrdering.setForgetRemainingFields(true);
return;
}
else
{
if (viewLinkerCollection()->viewLinker())
{
// Use object instead of field to avoid duplicate entries in the tree view
uiTreeOrdering.add(viewLinkerCollection());
}
RimOilField* oilField = activeOilField();
if (oilField)
{
if (oilField->analysisModels()) uiTreeOrdering.add(oilField->analysisModels());
if (oilField->geoMechModels()) uiTreeOrdering.add(oilField->geoMechModels());
if (oilField->wellPathCollection()) uiTreeOrdering.add(oilField->wellPathCollection());
}
uiTreeOrdering.add(scriptCollection()); uiTreeOrdering.add(scriptCollection());
uiTreeOrdering.setForgetRemainingFields(true); uiTreeOrdering.setForgetRemainingFields(true);
}
} }

View File

@ -18,6 +18,8 @@
#include "RimSummaryPlot.h" #include "RimSummaryPlot.h"
#include "RiaApplication.h"
#include "RimSummaryCurve.h" #include "RimSummaryCurve.h"
#include "RimSummaryCurveFilter.h" #include "RimSummaryCurveFilter.h"
#include "RimSummaryPlotCollection.h" #include "RimSummaryPlotCollection.h"
@ -58,7 +60,10 @@ RimSummaryPlot::RimSummaryPlot()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimSummaryPlot::~RimSummaryPlot() RimSummaryPlot::~RimSummaryPlot()
{ {
RiuMainPlotWindow::instance()->removeViewer(m_qwtPlot); if (RiaApplication::instance()->mainPlotWindow())
{
RiaApplication::instance()->mainPlotWindow()->removeViewer(m_qwtPlot);
}
deletePlotWidget(); deletePlotWidget();
@ -184,7 +189,11 @@ void RimSummaryPlot::setupBeforeSave()
{ {
if (m_qwtPlot) if (m_qwtPlot)
{ {
this->setMdiWindowGeometry(RiuMainPlotWindow::instance()->windowGeometryForViewer(m_qwtPlot)); if (RiaApplication::instance()->mainPlotWindow())
{
this->setMdiWindowGeometry(RiaApplication::instance()->mainPlotWindow()->windowGeometryForViewer(m_qwtPlot));
}
} }
} }
@ -223,11 +232,13 @@ void RimSummaryPlot::setDescription(const QString& description)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimSummaryPlot::updateViewerWidget() void RimSummaryPlot::updateViewerWidget()
{ {
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateMainPlotWindow();
if (m_showWindow()) if (m_showWindow())
{ {
if (!m_qwtPlot) if (!m_qwtPlot)
{ {
m_qwtPlot = new RiuSummaryQwtPlot(this, RiuMainPlotWindow::instance()); m_qwtPlot = new RiuSummaryQwtPlot(this, mainPlotWindow);
for(RimSummaryCurveFilter* curveFilter: m_curveFilters) for(RimSummaryCurveFilter* curveFilter: m_curveFilters)
{ {
@ -239,8 +250,8 @@ void RimSummaryPlot::updateViewerWidget()
curve->setParentQwtPlot(m_qwtPlot); curve->setParentQwtPlot(m_qwtPlot);
} }
RiuMainPlotWindow::instance()->addViewer(m_qwtPlot, this->mdiWindowGeometry()); mainPlotWindow->addViewer(m_qwtPlot, this->mdiWindowGeometry());
RiuMainPlotWindow::instance()->setActiveViewer(m_qwtPlot); mainPlotWindow->setActiveViewer(m_qwtPlot);
} }
//updateViewerWidgetWindowTitle(); //updateViewerWidgetWindowTitle();
@ -249,9 +260,9 @@ void RimSummaryPlot::updateViewerWidget()
{ {
if (m_qwtPlot) if (m_qwtPlot)
{ {
this->setMdiWindowGeometry(RiuMainPlotWindow::instance()->windowGeometryForViewer(m_qwtPlot)); this->setMdiWindowGeometry(mainPlotWindow->windowGeometryForViewer(m_qwtPlot));
RiuMainPlotWindow::instance()->removeViewer(m_qwtPlot); mainPlotWindow->removeViewer(m_qwtPlot);
detachAllCurves(); detachAllCurves();
deletePlotWidget(); deletePlotWidget();

View File

@ -19,11 +19,13 @@
#include "RimWellLogPlot.h" #include "RimWellLogPlot.h"
#include "RiaApplication.h"
#include "RimWellLogTrack.h" #include "RimWellLogTrack.h"
#include "RiuWellLogPlot.h" #include "RiuWellLogPlot.h"
#include "RiuWellLogTrack.h" #include "RiuWellLogTrack.h"
#include "RiuMainWindow.h" #include "RiuMainPlotWindow.h"
#include "cafPdmUiTreeView.h" #include "cafPdmUiTreeView.h"
@ -85,7 +87,10 @@ RimWellLogPlot::RimWellLogPlot()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimWellLogPlot::~RimWellLogPlot() RimWellLogPlot::~RimWellLogPlot()
{ {
RiuMainWindow::instance()->removeViewer(m_viewer); if (RiaApplication::instance()->mainPlotWindow())
{
RiaApplication::instance()->mainPlotWindow()->removeViewer(m_viewer);
}
detachAllCurves(); detachAllCurves();
m_tracks.deleteAllChildObjects(); m_tracks.deleteAllChildObjects();
@ -98,16 +103,18 @@ RimWellLogPlot::~RimWellLogPlot()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellLogPlot::updateViewerWidget() void RimWellLogPlot::updateViewerWidget()
{ {
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateMainPlotWindow();
if (m_showWindow()) if (m_showWindow())
{ {
if (!m_viewer) if (!m_viewer)
{ {
m_viewer = new RiuWellLogPlot(this, RiuMainWindow::instance()); m_viewer = new RiuWellLogPlot(this, mainPlotWindow);
recreateTrackPlots(); recreateTrackPlots();
RiuMainWindow::instance()->addViewer(m_viewer, this->mdiWindowGeometry()); mainPlotWindow->addViewer(m_viewer, this->mdiWindowGeometry());
RiuMainWindow::instance()->setActiveViewer(m_viewer); mainPlotWindow->setActiveViewer(m_viewer);
} }
updateViewerWidgetWindowTitle(); updateViewerWidgetWindowTitle();
@ -116,14 +123,13 @@ void RimWellLogPlot::updateViewerWidget()
{ {
if (m_viewer) if (m_viewer)
{ {
this->setMdiWindowGeometry( RiuMainWindow::instance()->windowGeometryForViewer(m_viewer)); this->setMdiWindowGeometry(mainPlotWindow->windowGeometryForViewer(m_viewer));
RiuMainWindow::instance()->removeViewer(m_viewer); mainPlotWindow->removeViewer(m_viewer);
detachAllCurves(); detachAllCurves();
delete m_viewer; delete m_viewer;
m_viewer = NULL; m_viewer = NULL;
} }
} }
} }
@ -365,7 +371,10 @@ void RimWellLogPlot::setupBeforeSave()
{ {
if (m_viewer) if (m_viewer)
{ {
this->setMdiWindowGeometry( RiuMainWindow::instance()->windowGeometryForViewer(m_viewer)); if (RiaApplication::instance()->mainPlotWindow())
{
this->setMdiWindowGeometry(RiaApplication::instance()->mainPlotWindow()->windowGeometryForViewer(m_viewer));
}
} }
} }

View File

@ -143,23 +143,14 @@ RiuMainPlotWindow::RiuMainPlotWindow()
// When enableUndoCommandSystem is set false, all commands are executed and deleted immediately // When enableUndoCommandSystem is set false, all commands are executed and deleted immediately
//caf::CmdExecCommandManager::instance()->enableUndoCommandSystem(true); //caf::CmdExecCommandManager::instance()->enableUndoCommandSystem(true);
{
setWindowTitle("Summary Plots for ResInsight");
setDefaultWindowSize();
loadWinGeoAndDockToolBarLayout();
showWindow();
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiuMainPlotWindow* RiuMainPlotWindow::instance() RiuMainPlotWindow::~RiuMainPlotWindow()
{ {
static RiuMainPlotWindow staticInstance; delete m_dragDropInterface;
return &staticInstance;
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -211,14 +202,6 @@ void RiuMainPlotWindow::cleanupGuiBeforeProjectClose()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RiuMainPlotWindow::closeEvent(QCloseEvent* event) void RiuMainPlotWindow::closeEvent(QCloseEvent* event)
{ {
if (!RiaApplication::instance()->closeProject(true))
{
event->ignore();
return;
}
delete m_dragDropInterface;
saveWinGeoAndDockToolBarLayout(); saveWinGeoAndDockToolBarLayout();
event->accept(); event->accept();
@ -578,6 +561,8 @@ void RiuMainPlotWindow::createDockPanels()
connect(m_projectTreeView, SIGNAL(selectionChanged()), this, SLOT(selectedObjectsChanged())); connect(m_projectTreeView, SIGNAL(selectionChanged()), this, SLOT(selectedObjectsChanged()));
m_projectTreeView->treeView()->setContextMenuPolicy(Qt::CustomContextMenu); m_projectTreeView->treeView()->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_projectTreeView->treeView(), SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(customMenuRequested(const QPoint&))); connect(m_projectTreeView->treeView(), SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(customMenuRequested(const QPoint&)));
m_projectTreeView->setUiConfigurationName("PlotWindow");
} }
/* /*

View File

@ -72,7 +72,7 @@ class RiuMainPlotWindow : public RiuMainWindowBase
public: public:
RiuMainPlotWindow(); RiuMainPlotWindow();
static RiuMainPlotWindow* instance(); ~RiuMainPlotWindow();
virtual QString mainWindowName() { return "RiuMainPlotWindow"; } virtual QString mainWindowName() { return "RiuMainPlotWindow"; }
@ -289,8 +289,6 @@ private:
caf::PdmUiDragDropInterface* m_dragDropInterface; caf::PdmUiDragDropInterface* m_dragDropInterface;
QUndoView* m_undoView;
caf::PdmObject* m_pdmRoot; caf::PdmObject* m_pdmRoot;
caf::PdmUiPropertyView* m_pdmUiPropertyView; caf::PdmUiPropertyView* m_pdmUiPropertyView;

View File

@ -18,11 +18,14 @@
#include "RiuMdiSubWindow.h" #include "RiuMdiSubWindow.h"
#include "RiaApplication.h"
#include "RimSummaryPlot.h" #include "RimSummaryPlot.h"
#include "RimView.h" #include "RimView.h"
#include "RimWellLogPlot.h" #include "RimWellLogPlot.h"
#include "RiuMainPlotWindow.h" #include "RiuMainPlotWindow.h"
#include "RiuMainWindow.h"
#include "RiuSummaryQwtPlot.h" #include "RiuSummaryQwtPlot.h"
#include "RiuViewer.h" #include "RiuViewer.h"
#include "RiuWellLogPlot.h" #include "RiuWellLogPlot.h"
@ -40,7 +43,12 @@ RiuMdiSubWindow::RiuMdiSubWindow(QWidget* parent /*= 0*/, Qt::WindowFlags flags
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RiuMdiSubWindow::~RiuMdiSubWindow() RiuMdiSubWindow::~RiuMdiSubWindow()
{ {
RiuMainPlotWindow::instance()->slotRefreshViewActions(); RiuMainWindow::instance()->slotRefreshViewActions();
if (RiaApplication::instance()->mainPlotWindow())
{
RiaApplication::instance()->mainPlotWindow()->slotRefreshViewActions();
}
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -54,18 +62,24 @@ void RiuMdiSubWindow::closeEvent(QCloseEvent* event)
RiuSummaryQwtPlot* summaryPlot = dynamic_cast<RiuSummaryQwtPlot*>(mainWidget); RiuSummaryQwtPlot* summaryPlot = dynamic_cast<RiuSummaryQwtPlot*>(mainWidget);
if (wellLogPlot) if (wellLogPlot)
{ {
wellLogPlot->ownerPlotDefinition()->setMdiWindowGeometry(RiuMainPlotWindow::instance()->windowGeometryForWidget(this)); RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
CVF_ASSERT(mainPlotWindow);
wellLogPlot->ownerPlotDefinition()->setMdiWindowGeometry(mainPlotWindow->windowGeometryForWidget(this));
} }
else if (summaryPlot) else if (summaryPlot)
{ {
summaryPlot->ownerPlotDefinition()->setMdiWindowGeometry(RiuMainPlotWindow::instance()->windowGeometryForWidget(this)); RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->mainPlotWindow();
CVF_ASSERT(mainPlotWindow);
summaryPlot->ownerPlotDefinition()->setMdiWindowGeometry(mainPlotWindow->windowGeometryForWidget(this));
} }
else else
{ {
RiuViewer* viewer = mainWidget->findChild<RiuViewer*>(); RiuViewer* viewer = mainWidget->findChild<RiuViewer*>();
if (viewer) if (viewer)
{ {
viewer->ownerReservoirView()->setMdiWindowGeometry(RiuMainPlotWindow::instance()->windowGeometryForWidget(this)); viewer->ownerReservoirView()->setMdiWindowGeometry(RiuMainWindow::instance()->windowGeometryForWidget(this));
} }
} }