///////////////////////////////////////////////////////////////////////////////// // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RimSummaryAddressCollection.h" #include #include class RimSummaryCurve; class RimEnsembleCurveSet; class RimSummaryPlot; class RifEclipseSummaryAddress; class RiaSummaryCurveAddress; //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- class RimSummaryAddressModifier { public: // 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; static std::vector createAddressProviders( RimSummaryPlot* summaryPlot ); static std::vector curveAddresses( const std::vector& curveAddressProviders ); static void applyAddressesToCurveAddressProviders( const std::vector& curveAddressProviders, const std::vector& addresses ); static std::vector allSummaryAddressesY( RimSummaryPlot* summaryPlot ); static void updateAddressesByObjectName( const std::vector& curveAddressProviders, const std::string& objectName, RimSummaryAddressCollection::CollectionContentType contentType ); private: 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 ); };