mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#11771 Highlight all curves for a realization when picking
When selecting a single curve in an ensemble, select and highlight all curves connected to this realization.
This commit is contained in:
@@ -23,7 +23,11 @@
|
||||
|
||||
#include "RigEnsembleParameter.h"
|
||||
|
||||
#include "RimEnsembleCurveSet.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
#include "RimSummaryMultiPlotCollection.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -300,7 +304,7 @@ size_t RimSummaryEnsembleTools::calculateEnsembleParametersIntersectionHash( con
|
||||
|
||||
size_t commonAddressCount = 0;
|
||||
|
||||
// Find common addess count
|
||||
// Find common address count
|
||||
for ( const auto sumCase : summaryCases )
|
||||
{
|
||||
const auto reader = sumCase->summaryReader();
|
||||
@@ -323,3 +327,68 @@ size_t RimSummaryEnsembleTools::calculateEnsembleParametersIntersectionHash( con
|
||||
|
||||
return commonAddressCount;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryEnsembleTools::highlightCurvesForSameRealization( RimPlotCurve* sourceCurve )
|
||||
{
|
||||
auto sourceSummaryCurve = dynamic_cast<RimSummaryCurve*>( sourceCurve );
|
||||
if ( !sourceSummaryCurve ) return;
|
||||
|
||||
auto ensembleCurveSet = sourceSummaryCurve->firstAncestorOfType<RimEnsembleCurveSet>();
|
||||
if ( !ensembleCurveSet ) return;
|
||||
|
||||
auto summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
|
||||
|
||||
for ( auto multiPlot : summaryPlotColl->multiPlots() )
|
||||
{
|
||||
for ( auto plot : multiPlot->summaryPlots() )
|
||||
{
|
||||
auto plotWidget = dynamic_cast<RiuQwtPlotWidget*>( plot->plotWidget() );
|
||||
if ( !plotWidget ) continue;
|
||||
|
||||
auto summaryCurves = plot->summaryAndEnsembleCurves();
|
||||
|
||||
std::vector<RimSummaryCurve*> curvesForSameRealization;
|
||||
|
||||
for ( auto curve : summaryCurves )
|
||||
{
|
||||
if ( sourceSummaryCurve->summaryCaseY() == curve->summaryCaseY() )
|
||||
{
|
||||
curvesForSameRealization.push_back( curve );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !curvesForSameRealization.empty() )
|
||||
{
|
||||
bool updateCurveOrder = false;
|
||||
plotWidget->resetPlotItemHighlighting( updateCurveOrder );
|
||||
|
||||
std::set<RimPlotCurve*> realizationCurvesSet( curvesForSameRealization.begin(), curvesForSameRealization.end() );
|
||||
plotWidget->highlightCurvesUpdateOrder( realizationCurvesSet );
|
||||
plotWidget->replot();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSummaryEnsembleTools::resetHighlightAllPlots()
|
||||
{
|
||||
auto summaryPlotColl = RiaSummaryTools::summaryMultiPlotCollection();
|
||||
|
||||
for ( auto multiPlot : summaryPlotColl->multiPlots() )
|
||||
{
|
||||
for ( auto plot : multiPlot->summaryPlots() )
|
||||
{
|
||||
if ( auto plotWidget = dynamic_cast<RiuQwtPlotWidget*>( plot->plotWidget() ) )
|
||||
{
|
||||
plotWidget->resetPlotItemHighlighting();
|
||||
plotWidget->replot();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user