mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
Merge pull request #8732 from OPM/summarymultiplot_updates2
Summary Multiplot updates
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
#include "RimProject.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotCollection.h"
|
||||
|
||||
@@ -78,61 +79,6 @@ std::vector<RimSummaryCurve*> RicSummaryPlotFeatureImpl::addDefaultCurvesToPlot(
|
||||
return addCurvesFromAddressFiltersToPlot( curveFilters, plot, summaryCase, addHistoryCurve );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSummaryPlotFeatureImpl::ensureAtLeastOnePlot( RimSummaryPlotCollection* summaryPlotCollection,
|
||||
RimSummaryCase* summaryCase )
|
||||
{
|
||||
if ( summaryPlotCollection && summaryCase )
|
||||
{
|
||||
if ( summaryPlotCollection->plots().empty() )
|
||||
{
|
||||
auto objectToSelect = createDefaultSummaryPlot( summaryCase );
|
||||
if ( objectToSelect )
|
||||
{
|
||||
RiuPlotMainWindowTools::setExpanded( objectToSelect );
|
||||
RiuPlotMainWindowTools::selectAsCurrentItem( objectToSelect );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
caf::PdmObject* RicSummaryPlotFeatureImpl::createDefaultSummaryPlot( RimSummaryCase* summaryCase )
|
||||
{
|
||||
RimSummaryPlotCollection* summaryPlotCollection = RimProject::current()->mainPlotCollection->summaryPlotCollection();
|
||||
|
||||
RiaPreferencesSummary* prefs = RiaPreferencesSummary::current();
|
||||
|
||||
caf::PdmObject* itemToSelect = nullptr;
|
||||
|
||||
if ( summaryPlotCollection && summaryCase && !prefs->defaultSummaryCurvesTextFilter().isEmpty() )
|
||||
{
|
||||
auto plot = summaryPlotCollection->createSummaryPlotWithAutoTitle();
|
||||
|
||||
std::vector<RimSummaryCurve*> curves = RicSummaryPlotFeatureImpl::addDefaultCurvesToPlot( plot, summaryCase );
|
||||
|
||||
plot->applyDefaultCurveAppearances();
|
||||
plot->loadDataAndUpdate();
|
||||
|
||||
summaryPlotCollection->updateConnectedEditors();
|
||||
|
||||
if ( curves.size() )
|
||||
{
|
||||
itemToSelect = curves[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
itemToSelect = plot;
|
||||
}
|
||||
}
|
||||
|
||||
return itemToSelect;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user