2022-03-31 01:57:52 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2022 Equinor ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "RicAppendSummaryPlotsForObjectsFeature.h"
|
|
|
|
|
|
|
|
#include "RiaGuiApplication.h"
|
|
|
|
#include "RiaLogging.h"
|
2024-10-20 07:24:22 -05:00
|
|
|
#include "RiaPlotWindowRedrawScheduler.h"
|
2022-03-31 01:57:52 -05:00
|
|
|
#include "RiaStdStringTools.h"
|
2024-10-21 07:40:25 -05:00
|
|
|
#include "Summary/RiaSummaryAddressAnalyzer.h"
|
|
|
|
#include "Summary/RiaSummaryAddressModifier.h"
|
2025-02-12 06:06:58 -06:00
|
|
|
#include "Summary/RiaSummaryPlotTools.h"
|
2024-10-21 07:40:25 -05:00
|
|
|
#include "Summary/RiaSummaryTools.h"
|
2022-03-31 01:57:52 -05:00
|
|
|
|
|
|
|
#include "RimEnsembleCurveSet.h"
|
|
|
|
#include "RimSummaryAddressCollection.h"
|
2022-12-09 01:46:36 -06:00
|
|
|
#include "RimSummaryCase.h"
|
2022-03-31 01:57:52 -05:00
|
|
|
#include "RimSummaryCurve.h"
|
2024-07-29 08:38:17 -05:00
|
|
|
#include "RimSummaryEnsemble.h"
|
2022-03-31 01:57:52 -05:00
|
|
|
#include "RimSummaryMultiPlot.h"
|
|
|
|
#include "RimSummaryMultiPlotCollection.h"
|
|
|
|
#include "RimSummaryPlot.h"
|
|
|
|
|
|
|
|
#include "cafAssert.h"
|
2022-05-30 04:39:05 -05:00
|
|
|
#include "cafProgressInfo.h"
|
2022-03-31 01:57:52 -05:00
|
|
|
#include "cafSelectionManager.h"
|
|
|
|
|
|
|
|
#include <QAction>
|
|
|
|
|
|
|
|
CAF_CMD_SOURCE_INIT( RicAppendSummaryPlotsForObjectsFeature, "RicAppendSummaryPlotsForObjectsFeature" );
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-06-26 07:28:46 -05:00
|
|
|
bool RicAppendSummaryPlotsForObjectsFeature::isCommandEnabled() const
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
|
|
|
return !selectedCollections().empty();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
void RicAppendSummaryPlotsForObjectsFeature::appendPlots( RimSummaryMultiPlot* summaryMultiPlot,
|
2022-04-29 05:28:09 -05:00
|
|
|
const std::vector<RimSummaryAddressCollection*>& sumAddressCollections )
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
|
|
|
if ( sumAddressCollections.empty() ) return;
|
|
|
|
|
2022-04-20 08:17:59 -05:00
|
|
|
isSelectionCompatibleWithPlot( sumAddressCollections, summaryMultiPlot );
|
2022-03-31 01:57:52 -05:00
|
|
|
|
2022-04-29 05:28:09 -05:00
|
|
|
auto selectionType = sumAddressCollections.front()->contentType();
|
|
|
|
auto sourcePlots = summaryMultiPlot->summaryPlots();
|
|
|
|
auto plotsForOneInstance = plotsForOneInstanceOfObjectType( sourcePlots, selectionType );
|
2022-03-31 01:57:52 -05:00
|
|
|
|
2022-05-30 04:39:05 -05:00
|
|
|
caf::ProgressInfo info( sumAddressCollections.size(), "Appending plots..." );
|
|
|
|
|
2024-10-20 07:24:22 -05:00
|
|
|
summaryMultiPlot->startBatchAddOperation();
|
2024-11-04 09:12:06 -06:00
|
|
|
RiaPlotWindowRedrawScheduler::instance()->blockUpdate( true );
|
2024-10-20 07:24:22 -05:00
|
|
|
|
2022-04-20 08:17:59 -05:00
|
|
|
for ( auto summaryAdrCollection : sumAddressCollections )
|
|
|
|
{
|
2025-02-12 06:06:58 -06:00
|
|
|
auto duplicatedPlots = RiaSummaryPlotTools::duplicateSummaryPlots( plotsForOneInstance );
|
2022-04-29 05:28:09 -05:00
|
|
|
|
2022-04-20 08:17:59 -05:00
|
|
|
for ( auto duplicatedPlot : duplicatedPlots )
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
2022-04-29 05:28:09 -05:00
|
|
|
if ( summaryAdrCollection->contentType() == RimSummaryAddressCollection::CollectionContentType::SUMMARY_CASE )
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
2022-04-29 05:28:09 -05:00
|
|
|
summaryMultiPlot->addPlot( duplicatedPlot );
|
2023-10-28 03:50:10 -05:00
|
|
|
duplicatedPlot->resolveReferencesRecursively();
|
2022-04-20 08:17:59 -05:00
|
|
|
|
2022-04-29 05:28:09 -05:00
|
|
|
auto summaryCase = RiaSummaryTools::summaryCaseById( summaryAdrCollection->caseId() );
|
2022-07-08 07:54:48 -05:00
|
|
|
if ( summaryCase )
|
2022-04-29 05:28:09 -05:00
|
|
|
{
|
2022-07-08 07:54:48 -05:00
|
|
|
for ( auto c : duplicatedPlot->summaryCurves() )
|
|
|
|
{
|
|
|
|
c->setSummaryCaseY( summaryCase );
|
2023-10-28 03:50:10 -05:00
|
|
|
c->setSummaryCaseX( summaryCase );
|
2022-07-08 07:54:48 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto ensemble = RiaSummaryTools::ensembleById( summaryAdrCollection->ensembleId() );
|
|
|
|
if ( ensemble )
|
|
|
|
{
|
|
|
|
for ( auto c : duplicatedPlot->curveSets() )
|
|
|
|
{
|
2024-07-29 08:38:17 -05:00
|
|
|
c->setSummaryEnsemble( ensemble );
|
2022-07-08 07:54:48 -05:00
|
|
|
}
|
2022-04-29 05:28:09 -05:00
|
|
|
}
|
2022-03-31 01:57:52 -05:00
|
|
|
}
|
2022-04-29 05:28:09 -05:00
|
|
|
else
|
|
|
|
{
|
2023-11-01 08:18:40 -05:00
|
|
|
const auto objectName = summaryAdrCollection->name().toStdString();
|
|
|
|
auto contentType = summaryAdrCollection->contentType();
|
2024-10-21 07:40:25 -05:00
|
|
|
auto curveProviders = RiaSummaryAddressModifier::createAddressProviders( duplicatedPlot );
|
|
|
|
RiaSummaryAddressModifier::updateAddressesByObjectName( curveProviders, objectName, contentType );
|
2022-03-31 01:57:52 -05:00
|
|
|
|
2022-04-29 05:28:09 -05:00
|
|
|
summaryMultiPlot->addPlot( duplicatedPlot );
|
|
|
|
duplicatedPlot->resolveReferencesRecursively();
|
|
|
|
}
|
2022-04-20 08:17:59 -05:00
|
|
|
}
|
2024-10-20 07:24:22 -05:00
|
|
|
|
2022-05-30 04:39:05 -05:00
|
|
|
info.incrementProgress();
|
2022-03-31 01:57:52 -05:00
|
|
|
}
|
2024-10-20 07:24:22 -05:00
|
|
|
summaryMultiPlot->endBatchAddOperation();
|
|
|
|
|
|
|
|
RiaPlotWindowRedrawScheduler::instance()->clearAllScheduledUpdates();
|
2024-11-04 09:12:06 -06:00
|
|
|
RiaPlotWindowRedrawScheduler::instance()->blockUpdate( false );
|
2024-10-20 07:24:22 -05:00
|
|
|
|
|
|
|
summaryMultiPlot->loadDataAndUpdate();
|
2022-12-09 01:46:36 -06:00
|
|
|
|
|
|
|
summaryMultiPlot->updatePlotTitles();
|
2022-03-31 01:57:52 -05:00
|
|
|
}
|
|
|
|
|
2022-07-08 07:54:48 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2024-07-29 08:38:17 -05:00
|
|
|
void RicAppendSummaryPlotsForObjectsFeature::appendPlots( RimSummaryMultiPlot* summaryMultiPlot,
|
|
|
|
const std::vector<RimSummaryCase*>& cases,
|
|
|
|
const std::vector<RimSummaryEnsemble*>& ensembles )
|
2022-07-08 07:54:48 -05:00
|
|
|
{
|
2023-02-26 03:48:40 -06:00
|
|
|
auto addressCollectionsToBeDeleted = RicAppendSummaryPlotsForObjectsFeature::createAddressCollections( cases, ensembles );
|
2022-07-08 07:54:48 -05:00
|
|
|
RicAppendSummaryPlotsForObjectsFeature::appendPlots( summaryMultiPlot, addressCollectionsToBeDeleted );
|
|
|
|
|
|
|
|
for ( auto obj : addressCollectionsToBeDeleted )
|
|
|
|
{
|
|
|
|
delete obj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimSummaryAddressCollection*>
|
2024-07-29 08:38:17 -05:00
|
|
|
RicAppendSummaryPlotsForObjectsFeature::createAddressCollections( const std::vector<RimSummaryCase*>& cases,
|
|
|
|
const std::vector<RimSummaryEnsemble*>& ensembles )
|
2022-07-08 07:54:48 -05:00
|
|
|
{
|
|
|
|
std::vector<RimSummaryAddressCollection*> addresses;
|
|
|
|
|
|
|
|
for ( auto c : cases )
|
|
|
|
{
|
|
|
|
auto myColl = new RimSummaryAddressCollection;
|
|
|
|
myColl->setContentType( RimSummaryAddressCollection::CollectionContentType::SUMMARY_CASE );
|
|
|
|
myColl->setCaseId( c->caseId() );
|
|
|
|
addresses.push_back( myColl );
|
|
|
|
}
|
|
|
|
|
|
|
|
for ( auto c : ensembles )
|
|
|
|
{
|
|
|
|
auto myColl = new RimSummaryAddressCollection;
|
|
|
|
myColl->setContentType( RimSummaryAddressCollection::CollectionContentType::SUMMARY_CASE );
|
|
|
|
myColl->setEnsembleId( c->ensembleId() );
|
|
|
|
addresses.push_back( myColl );
|
|
|
|
}
|
|
|
|
|
|
|
|
return addresses;
|
|
|
|
}
|
|
|
|
|
2022-04-29 05:28:09 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicAppendSummaryPlotsForObjectsFeature::onActionTriggered( bool isChecked )
|
|
|
|
{
|
|
|
|
// - Select a set of objects in Data Source (wells, groups, regions, ..)
|
|
|
|
// - Use context menu to activate action
|
|
|
|
// - For each plot in the current active plot, create a duplicate plot and replace the object name
|
|
|
|
|
|
|
|
auto sumAddressCollections = selectedCollections();
|
|
|
|
if ( sumAddressCollections.empty() ) return;
|
|
|
|
|
|
|
|
RiaGuiApplication* app = RiaGuiApplication::instance();
|
|
|
|
|
|
|
|
auto summaryMultiPlot = dynamic_cast<RimSummaryMultiPlot*>( app->activePlotWindow() );
|
|
|
|
if ( !summaryMultiPlot ) return;
|
|
|
|
|
|
|
|
appendPlots( summaryMultiPlot, sumAddressCollections );
|
|
|
|
}
|
|
|
|
|
2022-03-31 01:57:52 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RicAppendSummaryPlotsForObjectsFeature::setupActionLook( QAction* actionToSetup )
|
|
|
|
{
|
|
|
|
QString objectType = "Objects";
|
|
|
|
|
|
|
|
auto addresses = selectedCollections();
|
|
|
|
|
|
|
|
if ( !addresses.empty() )
|
|
|
|
{
|
|
|
|
auto firstAdr = addresses.front();
|
2023-02-26 03:48:40 -06:00
|
|
|
objectType = caf::AppEnum<RimSummaryAddressCollection::CollectionContentType>::uiText( firstAdr->contentType() );
|
2022-03-31 01:57:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
auto text = QString( "Append Plots For " ) + objectType;
|
|
|
|
actionToSetup->setText( text );
|
|
|
|
actionToSetup->setIcon( QIcon( ":/SummaryPlotLight16x16.png" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
std::vector<RimSummaryAddressCollection*> RicAppendSummaryPlotsForObjectsFeature::selectedCollections()
|
|
|
|
{
|
|
|
|
std::vector<RimSummaryAddressCollection*> sumAddressCollections;
|
|
|
|
caf::SelectionManager::instance()->objectsByType( &sumAddressCollections );
|
|
|
|
|
|
|
|
if ( sumAddressCollections.size() == 1 )
|
|
|
|
{
|
|
|
|
auto coll = sumAddressCollections[0];
|
2022-04-28 02:03:40 -05:00
|
|
|
if ( coll->isFolder() )
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
|
|
|
// If a folder is selected, return all sub items in folder
|
|
|
|
auto childObjects = coll->subFolders();
|
|
|
|
|
|
|
|
return childObjects;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return sumAddressCollections;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
bool RicAppendSummaryPlotsForObjectsFeature::isSelectionCompatibleWithPlot( const std::vector<RimSummaryAddressCollection*>& selection,
|
|
|
|
RimSummaryMultiPlot* summaryMultiPlot )
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
|
|
|
if ( !summaryMultiPlot ) return false;
|
|
|
|
if ( selection.empty() ) return false;
|
|
|
|
|
2022-04-20 08:17:59 -05:00
|
|
|
auto selectionType = selection.front()->contentType();
|
|
|
|
|
2022-03-31 01:57:52 -05:00
|
|
|
RiaSummaryAddressAnalyzer analyzer;
|
|
|
|
|
|
|
|
{
|
2022-04-20 08:17:59 -05:00
|
|
|
// Find all plots for one object type
|
|
|
|
auto sourcePlots = summaryMultiPlot->summaryPlots();
|
2022-03-31 01:57:52 -05:00
|
|
|
|
2022-04-20 08:17:59 -05:00
|
|
|
std::vector<RimSummaryPlot*> plotsForObjectType =
|
|
|
|
RicAppendSummaryPlotsForObjectsFeature::plotsForOneInstanceOfObjectType( sourcePlots, selectionType );
|
|
|
|
|
|
|
|
for ( auto plot : plotsForObjectType )
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
2024-10-21 07:40:25 -05:00
|
|
|
auto addresses = RiaSummaryAddressModifier::allSummaryAddressesY( plot );
|
2022-04-20 08:17:59 -05:00
|
|
|
analyzer.appendAddresses( addresses );
|
2022-03-31 01:57:52 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QString errorText;
|
|
|
|
if ( selectionType == RimSummaryAddressCollection::CollectionContentType::WELL )
|
|
|
|
{
|
2022-04-20 08:17:59 -05:00
|
|
|
if ( analyzer.wellNames().empty() )
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
2022-04-20 08:17:59 -05:00
|
|
|
errorText = "Source plot must contain at least one well to be able to duplicate a selection of wells";
|
2022-03-31 01:57:52 -05:00
|
|
|
}
|
|
|
|
}
|
2022-04-08 03:46:54 -05:00
|
|
|
else if ( selectionType == RimSummaryAddressCollection::CollectionContentType::GROUP )
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
2022-04-20 08:17:59 -05:00
|
|
|
if ( analyzer.groupNames().empty() )
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
2022-04-20 08:17:59 -05:00
|
|
|
errorText = "Source plot must contain at least one group to be able to duplicate a selection of groups";
|
2022-03-31 01:57:52 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( selectionType == RimSummaryAddressCollection::CollectionContentType::REGION )
|
|
|
|
{
|
2022-04-20 08:17:59 -05:00
|
|
|
if ( analyzer.regionNumbers().empty() )
|
2022-03-31 01:57:52 -05:00
|
|
|
{
|
2022-04-20 08:17:59 -05:00
|
|
|
errorText = "Source plot must contain at least one region to be able to duplicate a selection of regions";
|
2022-03-31 01:57:52 -05:00
|
|
|
}
|
|
|
|
}
|
2024-10-20 07:24:22 -05:00
|
|
|
else if ( selectionType == RimSummaryAddressCollection::CollectionContentType::NETWORK )
|
|
|
|
{
|
|
|
|
if ( analyzer.networkNames().empty() )
|
|
|
|
{
|
|
|
|
errorText = "Source plot must contain at least one network to be able to duplicate a selection of networks";
|
|
|
|
}
|
|
|
|
}
|
2022-03-31 01:57:52 -05:00
|
|
|
|
|
|
|
if ( !errorText.isEmpty() )
|
|
|
|
{
|
|
|
|
RiaLogging::error( errorText );
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2022-04-20 08:17:59 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-02-26 03:48:40 -06:00
|
|
|
std::vector<RimSummaryPlot*>
|
|
|
|
RicAppendSummaryPlotsForObjectsFeature::plotsForOneInstanceOfObjectType( const std::vector<RimSummaryPlot*>& sourcePlots,
|
|
|
|
RimSummaryAddressCollection::CollectionContentType objectType )
|
2022-04-20 08:17:59 -05:00
|
|
|
{
|
|
|
|
std::vector<RimSummaryPlot*> plotsForOneInstance;
|
|
|
|
|
|
|
|
std::string wellNameToMatch;
|
|
|
|
std::string groupNameToMatch;
|
2024-10-20 07:24:22 -05:00
|
|
|
std::string networkNameToMatch;
|
2022-07-08 07:54:48 -05:00
|
|
|
int regionToMatch = -1;
|
|
|
|
int caseIdToMatch = -1;
|
|
|
|
int ensembleIdToMatch = -1;
|
2022-04-20 08:17:59 -05:00
|
|
|
|
|
|
|
RiaSummaryAddressAnalyzer myAnalyser;
|
|
|
|
for ( auto sourcePlot : sourcePlots )
|
|
|
|
{
|
2024-10-21 07:40:25 -05:00
|
|
|
auto addresses = RiaSummaryAddressModifier::allSummaryAddressesY( sourcePlot );
|
2022-04-20 08:17:59 -05:00
|
|
|
myAnalyser.appendAddresses( addresses );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( objectType == RimSummaryAddressCollection::CollectionContentType::WELL )
|
|
|
|
{
|
|
|
|
if ( !myAnalyser.wellNames().empty() ) wellNameToMatch = *( myAnalyser.wellNames().begin() );
|
|
|
|
}
|
|
|
|
else if ( objectType == RimSummaryAddressCollection::CollectionContentType::GROUP )
|
|
|
|
{
|
|
|
|
if ( !myAnalyser.groupNames().empty() ) groupNameToMatch = *( myAnalyser.groupNames().begin() );
|
|
|
|
}
|
|
|
|
else if ( objectType == RimSummaryAddressCollection::CollectionContentType::REGION )
|
|
|
|
{
|
|
|
|
if ( !myAnalyser.regionNumbers().empty() ) regionToMatch = *( myAnalyser.regionNumbers().begin() );
|
|
|
|
}
|
2024-10-20 07:24:22 -05:00
|
|
|
else if ( objectType == RimSummaryAddressCollection::CollectionContentType::NETWORK )
|
|
|
|
{
|
|
|
|
if ( !myAnalyser.networkNames().empty() ) networkNameToMatch = *( myAnalyser.networkNames().begin() );
|
|
|
|
}
|
2022-04-29 05:28:09 -05:00
|
|
|
else if ( objectType == RimSummaryAddressCollection::CollectionContentType::SUMMARY_CASE )
|
|
|
|
{
|
2022-05-23 07:25:53 -05:00
|
|
|
if ( !sourcePlots.empty() )
|
2022-04-29 05:28:09 -05:00
|
|
|
{
|
2022-05-23 07:25:53 -05:00
|
|
|
auto curves = sourcePlots.back()->summaryCurves();
|
|
|
|
if ( !curves.empty() )
|
|
|
|
{
|
|
|
|
caseIdToMatch = curves.front()->summaryCaseY()->caseId();
|
|
|
|
}
|
2022-07-08 07:54:48 -05:00
|
|
|
auto curveSets = sourcePlots.back()->curveSets();
|
|
|
|
if ( !curveSets.empty() )
|
|
|
|
{
|
|
|
|
ensembleIdToMatch = curveSets.front()->ensembleId();
|
|
|
|
}
|
2022-04-29 05:28:09 -05:00
|
|
|
}
|
|
|
|
}
|
2022-04-20 08:17:59 -05:00
|
|
|
|
|
|
|
for ( auto sourcePlot : sourcePlots )
|
|
|
|
{
|
|
|
|
bool isMatching = false;
|
2022-04-29 05:28:09 -05:00
|
|
|
|
|
|
|
if ( caseIdToMatch != -1 )
|
2022-04-20 08:17:59 -05:00
|
|
|
{
|
2022-04-29 05:28:09 -05:00
|
|
|
auto curves = sourcePlot->summaryCurves();
|
|
|
|
for ( auto c : curves )
|
2022-04-20 08:17:59 -05:00
|
|
|
{
|
2022-04-29 05:28:09 -05:00
|
|
|
if ( c->summaryCaseY()->caseId() == caseIdToMatch ) isMatching = true;
|
2022-04-20 08:17:59 -05:00
|
|
|
}
|
2022-04-29 05:28:09 -05:00
|
|
|
}
|
2022-07-08 07:54:48 -05:00
|
|
|
else if ( ensembleIdToMatch != -1 )
|
|
|
|
{
|
|
|
|
auto curveSets = sourcePlot->curveSets();
|
|
|
|
for ( auto c : curveSets )
|
|
|
|
{
|
2024-07-29 08:38:17 -05:00
|
|
|
if ( c->summaryEnsemble()->ensembleId() == ensembleIdToMatch ) isMatching = true;
|
2022-07-08 07:54:48 -05:00
|
|
|
}
|
|
|
|
}
|
2022-04-29 05:28:09 -05:00
|
|
|
else
|
|
|
|
{
|
2024-10-21 07:40:25 -05:00
|
|
|
auto addresses = RiaSummaryAddressModifier::allSummaryAddressesY( sourcePlot );
|
2022-04-29 05:28:09 -05:00
|
|
|
|
|
|
|
for ( const auto& a : addresses )
|
2022-04-20 08:17:59 -05:00
|
|
|
{
|
2022-04-29 05:28:09 -05:00
|
|
|
if ( !wellNameToMatch.empty() && a.wellName() == wellNameToMatch )
|
|
|
|
{
|
|
|
|
isMatching = true;
|
|
|
|
}
|
|
|
|
else if ( !groupNameToMatch.empty() && a.groupName() == groupNameToMatch )
|
|
|
|
{
|
|
|
|
isMatching = true;
|
|
|
|
}
|
2024-10-20 07:24:22 -05:00
|
|
|
else if ( !networkNameToMatch.empty() && a.networkName() == networkNameToMatch )
|
|
|
|
{
|
|
|
|
isMatching = true;
|
|
|
|
}
|
2022-04-29 05:28:09 -05:00
|
|
|
else if ( regionToMatch != -1 && a.regionNumber() == regionToMatch )
|
|
|
|
{
|
|
|
|
isMatching = true;
|
|
|
|
}
|
2022-04-20 08:17:59 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( isMatching ) plotsForOneInstance.push_back( sourcePlot );
|
|
|
|
}
|
|
|
|
|
|
|
|
return plotsForOneInstance;
|
|
|
|
}
|