diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp b/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp index dddd1fb349..61efb76450 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp +++ b/ApplicationLibCode/Application/Tools/RiaSummaryTools.cpp @@ -354,3 +354,26 @@ QList RiaSummaryTools::optionsForSummaryCases( const std return options; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryTools::copyCurveDataSources( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ) +{ + curve.setSummaryAddressX( otherCurve.summaryAddressX() ); + curve.setSummaryCaseX( otherCurve.summaryCaseX() ); + + curve.setSummaryAddressY( otherCurve.summaryAddressY() ); + curve.setSummaryCaseY( otherCurve.summaryCaseY() ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiaSummaryTools::copyCurveAxisData( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ) +{ + curve.setAxisTypeX( otherCurve.axisTypeX() ); + curve.setTopOrBottomAxisX( otherCurve.axisX() ); + + curve.setLeftOrRightAxisY( otherCurve.axisY() ); +} diff --git a/ApplicationLibCode/Application/Tools/RiaSummaryTools.h b/ApplicationLibCode/Application/Tools/RiaSummaryTools.h index ebb46308a9..02571787cd 100644 --- a/ApplicationLibCode/Application/Tools/RiaSummaryTools.h +++ b/ApplicationLibCode/Application/Tools/RiaSummaryTools.h @@ -36,6 +36,7 @@ class RimSummaryCaseCollection; class RimSummaryTable; class RimSummaryTableCollection; class RimObservedDataCollection; +class RimSummaryCurve; class RifEclipseSummaryAddress; @@ -88,4 +89,7 @@ class RiaSummaryTools static QList optionsForAllSummaryCases(); static QList optionsForSummaryCases( const std::vector& cases ); + + static void copyCurveDataSources( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ); + static void copyCurveAxisData( RimSummaryCurve& curve, const RimSummaryCurve& otherCurve ); }; diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp index 10de3fc79d..3946d2d9fe 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateDeclineCurvesFeature.cpp @@ -92,11 +92,7 @@ RimSummaryDeclineCurve* RicCreateDeclineCurvesFeature::createDeclineCurveAndAddT RimSummaryDeclineCurve* newCurve = new RimSummaryDeclineCurve(); CVF_ASSERT( newCurve ); - newCurve->setSummaryCaseX( sourceCurve->summaryCaseX() ); - newCurve->setSummaryAddressX( sourceCurve->summaryAddressX() ); - - newCurve->setSummaryCaseY( sourceCurve->summaryCaseY() ); - newCurve->setSummaryAddressY( sourceCurve->summaryAddressY() ); + RiaSummaryTools::copyCurveDataSources( *newCurve, *sourceCurve ); newCurve->setDeclineCurveType( declineCurveType ); @@ -105,6 +101,8 @@ RimSummaryDeclineCurve* RicCreateDeclineCurvesFeature::createDeclineCurveAndAddT summaryPlot->addCurveAndUpdate( newCurve ); + RiaSummaryTools::copyCurveAxisData( *newCurve, *sourceCurve ); + newCurve->updateDefaultValues(); newCurve->loadDataAndUpdate( true ); newCurve->updateConnectedEditors(); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp index 9ad8b0a9d5..f2387228c1 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicCreateRegressionAnalysisCurveFeature.cpp @@ -78,11 +78,7 @@ RimSummaryRegressionAnalysisCurve* RimSummaryRegressionAnalysisCurve* newCurve = new RimSummaryRegressionAnalysisCurve(); CVF_ASSERT( newCurve ); - newCurve->setSummaryCaseX( sourceCurve->summaryCaseX() ); - newCurve->setSummaryAddressX( sourceCurve->summaryAddressX() ); - - newCurve->setSummaryCaseY( sourceCurve->summaryCaseY() ); - newCurve->setSummaryAddressY( sourceCurve->summaryAddressY() ); + RiaSummaryTools::copyCurveDataSources( *newCurve, *sourceCurve ); newCurve->setColor( sourceCurve->color() ); newCurve->setSymbol( RiuPlotCurveSymbol::PointSymbolEnum::SYMBOL_RECT ); @@ -90,6 +86,8 @@ RimSummaryRegressionAnalysisCurve* summaryPlot->addCurveAndUpdate( newCurve ); + RiaSummaryTools::copyCurveAxisData( *newCurve, *sourceCurve ); + newCurve->updateDefaultValues(); newCurve->loadDataAndUpdate( true ); newCurve->updateConnectedEditors();