mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4003 Use the preferences settings when creating default summary plots.
Refactored to make assigning default curve appearance easier.
This commit is contained in:
@@ -196,33 +196,33 @@ void RicNewDefaultSummaryPlotFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
auto sumPlotSumCasesPair = extractSumPlotCollectionOrSelectedSumCasesFromSelection();
|
||||
|
||||
RimSummaryPlotCollection* sumPlotColl = RiaApplication::instance()->project()->mainPlotCollection()->summaryPlotCollection();
|
||||
|
||||
RimSummaryPlot* newPlot = nullptr;
|
||||
std::vector<RimSummaryCase*> summaryCasesToUse;
|
||||
|
||||
if (sumPlotSumCasesPair.first)
|
||||
{
|
||||
auto sumCaseVector = RiaApplication::instance()->project()->allSummaryCases();
|
||||
|
||||
newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
|
||||
if (sumCaseVector.size())
|
||||
{
|
||||
RicSummaryPlotFeatureImpl::addDefaultCurveToPlot(newPlot, sumCaseVector[0]);
|
||||
summaryCasesToUse.push_back(sumCaseVector[0]);
|
||||
}
|
||||
}
|
||||
else if (sumPlotSumCasesPair.second.size())
|
||||
{
|
||||
newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
|
||||
for (RimSummaryCase* sumCase : sumPlotSumCasesPair.second)
|
||||
{
|
||||
RicSummaryPlotFeatureImpl::addDefaultCurveToPlot(newPlot, sumCase);
|
||||
}
|
||||
summaryCasesToUse = sumPlotSumCasesPair.second;
|
||||
}
|
||||
|
||||
if ( newPlot )
|
||||
if ( summaryCasesToUse.size() )
|
||||
{
|
||||
RimSummaryPlotCollection* sumPlotColl = RiaApplication::instance()->project()->mainPlotCollection()->summaryPlotCollection();
|
||||
RimSummaryPlot* newPlot = sumPlotColl->createSummaryPlotWithAutoTitle();
|
||||
|
||||
for (RimSummaryCase* sumCase : summaryCasesToUse)
|
||||
{
|
||||
RicSummaryPlotFeatureImpl::addDefaultCurvesToPlot(newPlot, sumCase);
|
||||
}
|
||||
|
||||
newPlot->applyDefaultCurveAppearances();
|
||||
newPlot->loadDataAndUpdate();
|
||||
|
||||
sumPlotColl->updateConnectedEditors();
|
||||
|
||||
Reference in New Issue
Block a user