From b6b1bf053ed2120901714317d8df180b87c8b431 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 10 Apr 2025 12:40:39 +0200 Subject: [PATCH] Show selected realizations using X-cross symbol --- .../RimParameterResultCrossPlot.cpp | 32 ++++++++++++++++--- .../Summary/RimSummaryEnsembleTools.cpp | 13 ++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterResultCrossPlot.cpp b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterResultCrossPlot.cpp index 4b5407d9fd..d3cd9f53cc 100644 --- a/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterResultCrossPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/CorrelationPlots/RimParameterResultCrossPlot.cpp @@ -31,6 +31,7 @@ #include "RimSummaryEnsemble.h" #include "RiuContextMenuLauncher.h" +#include "RiuDockWidgetTools.h" #include "RiuPlotCurve.h" #include "RiuQwtPlotCurve.h" #include "RiuQwtPlotRectAnnotation.h" @@ -338,6 +339,16 @@ void RimParameterResultCrossPlot::createPoints() bool showEnsembleName = ensembles().size() > 1u; + std::set selectedSummaryCases; + auto selectedTreeViewItems = RiuDockWidgetTools::selectedItemsInTreeView( RiuDockWidgetTools::plotMainWindowDataSourceTreeName() ); + for ( auto item : selectedTreeViewItems ) + { + if ( auto summaryCase = dynamic_cast( item ) ) + { + selectedSummaryCases.insert( summaryCase ); + } + } + int idx = 0; auto caseData = createCaseData(); for ( const auto& [paramValue, closestValue, summaryCase] : caseData ) @@ -346,10 +357,23 @@ void RimParameterResultCrossPlot::createPoints() plotCurve->setSamplesValues( { paramValue }, { closestValue } ); plotCurve->setStyle( QwtPlotCurve::NoCurve ); - RiuQwtSymbol* symbol = new RiuQwtSymbol( RiuPlotCurveSymbol::SYMBOL_ELLIPSE ); - symbol->setSize( legendFontSize(), legendFontSize() ); - symbol->setColor( colorTable.cycledQColor( idx++ ) ); - plotCurve->setSymbol( symbol ); + if ( selectedSummaryCases.contains( summaryCase ) ) + { + RiuQwtSymbol* symbol = new RiuQwtSymbol( RiuPlotCurveSymbol::SYMBOL_XCROSS ); + auto fontSize = legendFontSize(); + symbol->setSize( fontSize, fontSize ); + symbol->setColor( colorTable.cycledQColor( idx++ ) ); + plotCurve->setSymbol( symbol ); + } + else + { + RiuQwtSymbol* symbol = new RiuQwtSymbol( RiuPlotCurveSymbol::SYMBOL_ELLIPSE ); + + auto fontSize = legendFontSize(); + symbol->setSize( fontSize, fontSize ); + symbol->setColor( colorTable.cycledQColor( idx++ ) ); + plotCurve->setSymbol( symbol ); + } QStringList curveName; if ( showEnsembleName && summaryCase->ensemble() ) diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryEnsembleTools.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryEnsembleTools.cpp index 0da54b9cb1..4f49e8b682 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryEnsembleTools.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryEnsembleTools.cpp @@ -25,7 +25,10 @@ #include "RigEnsembleParameter.h" +#include "RimCorrelationPlotCollection.h" #include "RimEnsembleCurveSet.h" +#include "RimMainPlotCollection.h" +#include "RimParameterResultCrossPlot.h" #include "RimSummaryCase.h" #include "RimSummaryCurve.h" #include "RimSummaryMultiPlot.h" @@ -438,6 +441,16 @@ void RimSummaryEnsembleTools::highlightCurvesForSummaryCases( const std::vector< plotWidget->replot(); } } + + auto plotColl = RimMainPlotCollection::current(); + if ( auto correlationPlotColl = plotColl->correlationPlotCollection() ) + { + auto crossPlots = correlationPlotColl->descendantsIncludingThisOfType(); + for ( auto c : crossPlots ) + { + c->loadDataAndUpdate(); + } + } } //--------------------------------------------------------------------------------------------------