2022-04-26 08:03:45 -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.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-11-01 08:18:40 -05:00
|
|
|
#include "RimSummaryAddressCollection.h"
|
|
|
|
|
|
|
|
#include <variant>
|
|
|
|
#include <vector>
|
|
|
|
|
2022-04-26 08:03:45 -05:00
|
|
|
class RimSummaryCurve;
|
|
|
|
class RimEnsembleCurveSet;
|
|
|
|
class RimSummaryPlot;
|
|
|
|
class RifEclipseSummaryAddress;
|
2023-11-01 08:18:40 -05:00
|
|
|
class RiaSummaryCurveAddress;
|
2022-04-26 08:03:45 -05:00
|
|
|
|
2023-11-01 08:18:40 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2022-04-26 08:03:45 -05:00
|
|
|
class RimSummaryAddressModifier
|
|
|
|
{
|
|
|
|
public:
|
2023-11-01 08:18:40 -05:00
|
|
|
// Define a variant for summary curves and ensemble curve set. This way we can treat them as similar object without a
|
|
|
|
// common base class
|
|
|
|
using CurveAddressProvider = std::variant<RimSummaryCurve*, RimEnsembleCurveSet*>;
|
2022-04-26 08:03:45 -05:00
|
|
|
|
2023-11-01 08:18:40 -05:00
|
|
|
static std::vector<CurveAddressProvider> createAddressProviders( RimSummaryPlot* summaryPlot );
|
|
|
|
static std::vector<RiaSummaryCurveAddress> curveAddresses( const std::vector<CurveAddressProvider>& curveAddressProviders );
|
|
|
|
static void applyAddressesToCurveAddressProviders( const std::vector<CurveAddressProvider>& curveAddressProviders,
|
|
|
|
const std::vector<RiaSummaryCurveAddress>& addresses );
|
2022-04-26 08:03:45 -05:00
|
|
|
|
2023-11-01 08:18:40 -05:00
|
|
|
static std::vector<RifEclipseSummaryAddress> allSummaryAddressesY( RimSummaryPlot* summaryPlot );
|
2022-04-26 08:03:45 -05:00
|
|
|
|
2023-11-01 08:18:40 -05:00
|
|
|
static void updateAddressesByObjectName( const std::vector<CurveAddressProvider>& curveAddressProviders,
|
|
|
|
const std::string& objectName,
|
|
|
|
RimSummaryAddressCollection::CollectionContentType contentType );
|
2022-04-26 08:03:45 -05:00
|
|
|
|
|
|
|
private:
|
2023-11-01 08:18:40 -05:00
|
|
|
static RiaSummaryCurveAddress curveAddress( RimSummaryCurve* curve );
|
|
|
|
static RiaSummaryCurveAddress curveAddress( RimEnsembleCurveSet* curveSet );
|
|
|
|
static void setCurveAddress( RimEnsembleCurveSet* curveSet, const RiaSummaryCurveAddress& curveAdr );
|
|
|
|
static void setCurveAddress( RimSummaryCurve* curve, const RiaSummaryCurveAddress& curveAdr );
|
|
|
|
static RifEclipseSummaryAddress replaceObjectName( const RifEclipseSummaryAddress& sourceAdr,
|
|
|
|
std::string objectName,
|
|
|
|
RimSummaryAddressCollection::CollectionContentType contentType );
|
2022-04-26 08:03:45 -05:00
|
|
|
};
|