Simplify access to RimMainPlotCollection

* Add current() to RimMainPlotCollection to avoid include of RimProject
* Remove "segment" prefix
* Reload data when RftCase changes
This commit is contained in:
Magne Sjaastad
2022-08-19 05:30:25 -07:00
committed by GitHub
parent 506bfbd638
commit 4cd38d7daf
51 changed files with 240 additions and 418 deletions

View File

@@ -30,18 +30,8 @@
#include "RimEclipseContourMapView.h"
#include "RimEclipseContourMapViewCollection.h"
#include "RimEclipseView.h"
#include "RimFlowPlotCollection.h"
#include "RimGridCrossPlot.h"
#include "RimGridCrossPlotCollection.h"
#include "RimMainPlotCollection.h"
#include "RimMultiPlot.h"
#include "RimMultiPlotCollection.h"
#include "RimProject.h"
#include "RimSummaryCaseMainCollection.h"
#include "RimSummaryMultiPlot.h"
#include "RimSummaryMultiPlotCollection.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h"
//--------------------------------------------------------------------------------------------------
///
@@ -143,51 +133,5 @@ void RimReloadCaseTools::updateAll3dViews( RimEclipseCase* eclipseCase )
//--------------------------------------------------------------------------------------------------
void RimReloadCaseTools::updateAllPlots()
{
RimProject* project = RimProject::current();
if ( project && project->mainPlotCollection() )
{
RimWellLogPlotCollection* wellPlotCollection = project->mainPlotCollection()->wellLogPlotCollection();
if ( wellPlotCollection )
{
for ( RimWellLogPlot* wellLogPlot : wellPlotCollection->wellLogPlots() )
{
wellLogPlot->loadDataAndUpdate();
}
}
RimSummaryMultiPlotCollection* summaryMultiPlotCollection =
project->mainPlotCollection()->summaryMultiPlotCollection();
if ( summaryMultiPlotCollection )
{
for ( RimSummaryMultiPlot* summaryPlot : summaryMultiPlotCollection->multiPlots() )
{
summaryPlot->loadDataAndUpdate();
}
}
RimGridCrossPlotCollection* gridCrossPlotCollection = project->mainPlotCollection()->gridCrossPlotCollection();
if ( gridCrossPlotCollection )
{
for ( RimGridCrossPlot* crossPlot : gridCrossPlotCollection->plots() )
{
crossPlot->loadDataAndUpdate();
}
}
RimFlowPlotCollection* flowPlotCollection = project->mainPlotCollection()->flowPlotCollection();
if ( flowPlotCollection )
{
flowPlotCollection->loadDataAndUpdateAllPlots();
}
RimMultiPlotCollection* multiPlotCollection = project->mainPlotCollection()->multiPlotCollection();
if ( multiPlotCollection )
{
for ( RimMultiPlot* plotWindow : multiPlotCollection->multiPlots() )
{
plotWindow->loadDataAndUpdate();
}
}
}
RimMainPlotCollection::current()->loadDataAndUpdateAllPlots();
}