#1358 Added support for "Zoom All" of well alloc plots

This commit is contained in:
Magne Sjaastad
2017-03-24 12:10:05 +01:00
parent 03741fd7da
commit 40d5150b37
2 changed files with 33 additions and 10 deletions

View File

@@ -23,11 +23,13 @@
#include "RimSummaryPlot.h" #include "RimSummaryPlot.h"
#include "RimView.h" #include "RimView.h"
#include "RimViewWindow.h" #include "RimViewWindow.h"
#include "RimWellAllocationPlot.h"
#include "RimWellLogPlot.h" #include "RimWellLogPlot.h"
#include "RiuMainPlotWindow.h" #include "RiuMainPlotWindow.h"
#include "RiuMainWindow.h" #include "RiuMainWindow.h"
#include "RiuSummaryQwtPlot.h" #include "RiuSummaryQwtPlot.h"
#include "RiuWellAllocationPlot.h"
#include "RiuWellLogPlot.h" #include "RiuWellLogPlot.h"
#include <QAction> #include <QAction>
@@ -62,21 +64,41 @@ void RicViewZoomAllFeature::onActionTriggered(bool isChecked)
QList<QMdiSubWindow*> subwindows = mainPlotWindow->subWindowList(QMdiArea::StackingOrder); QList<QMdiSubWindow*> subwindows = mainPlotWindow->subWindowList(QMdiArea::StackingOrder);
if (subwindows.size() > 0) if (subwindows.size() > 0)
{ {
RiuSummaryQwtPlot* summaryQwtPlot = dynamic_cast<RiuSummaryQwtPlot*>(subwindows.back()->widget());
if (summaryQwtPlot)
{ {
RimViewWindow* viewWindow = summaryQwtPlot->ownerPlotDefinition(); RiuSummaryQwtPlot* summaryQwtPlot = dynamic_cast<RiuSummaryQwtPlot*>(subwindows.back()->widget());
if (summaryQwtPlot)
{
RimViewWindow* viewWindow = summaryQwtPlot->ownerPlotDefinition();
viewWindow->zoomAll(); viewWindow->zoomAll();
summaryQwtPlot->replot(); summaryQwtPlot->replot();
return;
}
} }
RiuWellLogPlot* wellLogPlot = dynamic_cast<RiuWellLogPlot*>(subwindows.back()->widget());
if (wellLogPlot)
{ {
RimViewWindow* viewWindow = wellLogPlot->ownerPlotDefinition(); RiuWellLogPlot* wellLogPlot = dynamic_cast<RiuWellLogPlot*>(subwindows.back()->widget());
viewWindow->zoomAll(); if (wellLogPlot)
wellLogPlot->update(); {
RimViewWindow* viewWindow = wellLogPlot->ownerPlotDefinition();
viewWindow->zoomAll();
wellLogPlot->update();
return;
}
}
{
RiuWellAllocationPlot* wellAllocationPlot = dynamic_cast<RiuWellAllocationPlot*>(subwindows.back()->widget());
if (wellAllocationPlot)
{
RimWellAllocationPlot* viewWindow = wellAllocationPlot->ownerPlotDefinition();
viewWindow->zoomAll();
wellAllocationPlot->update();
return;
}
} }
} }
} }

View File

@@ -491,6 +491,7 @@ QWidget* RimWellAllocationPlot::viewWidget()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::zoomAll() void RimWellAllocationPlot::zoomAll()
{ {
m_accumulatedWellFlowPlot()->zoomAll();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------