mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -25,7 +25,6 @@
|
||||
#include "RimGridCrossPlotDataSet.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
#include "RiuPlotMainWindowTools.h"
|
||||
#include "RiuViewer.h"
|
||||
@@ -50,12 +49,11 @@ bool RicCreateGridCrossPlotFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateGridCrossPlotFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimProject* project = RimProject::current();
|
||||
RimGridCrossPlotCollection* collection =
|
||||
caf::SelectionManager::instance()->selectedItemAncestorOfType<RimGridCrossPlotCollection>();
|
||||
if ( !collection )
|
||||
{
|
||||
collection = project->mainPlotCollection()->gridCrossPlotCollection();
|
||||
collection = RimMainPlotCollection::current()->gridCrossPlotCollection();
|
||||
}
|
||||
RimGridCrossPlot* plot = collection->createGridCrossPlot();
|
||||
RimGridCrossPlotDataSet* dataSet = plot->createDataSet();
|
||||
|
||||
@@ -58,9 +58,7 @@ std::vector<RimSaturationPressurePlot*>
|
||||
return plots;
|
||||
}
|
||||
|
||||
RimProject* project = RimProject::current();
|
||||
|
||||
RimSaturationPressurePlotCollection* collection = project->mainPlotCollection()->saturationPressurePlotCollection();
|
||||
RimSaturationPressurePlotCollection* collection = RimMainPlotCollection::current()->saturationPressurePlotCollection();
|
||||
|
||||
if ( eclipseResultCase && eclipseResultCase->ensureReservoirCaseIsOpen() )
|
||||
{
|
||||
@@ -123,9 +121,7 @@ bool RicCreateSaturationPressurePlotsFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateSaturationPressurePlotsFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimProject* project = RimProject::current();
|
||||
|
||||
RimSaturationPressurePlotCollection* collection = project->mainPlotCollection()->saturationPressurePlotCollection();
|
||||
RimSaturationPressurePlotCollection* collection = RimMainPlotCollection::current()->saturationPressurePlotCollection();
|
||||
|
||||
std::vector<RimEclipseResultCase*> eclipseCases;
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user