//////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2019- 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 #include #include namespace caf { class PdmObject; } class RimSummaryPlot; class RimSummaryCase; class RimSummaryCaseCollection; class RifEclipseSummaryAddress; class RimSummaryMultiPlot; class RimSummaryAddressCollection; class RimPlotTemplateFileItem; //================================================================================================== /// //================================================================================================== class RicSummaryPlotTemplateTools { public: static RimSummaryMultiPlot* create( const QString& fileName ); static RimSummaryMultiPlot* create( const QString& fileName, const std::vector& cases, const std::vector& ensembles ); static QString selectPlotTemplatePath(); static std::vector selectDefaultPlotTemplates( std::vector currentSelection ); static QString summaryCaseFieldKeyword(); static QString summaryCaseXFieldKeyword(); static QString summaryGroupFieldKeyword(); static QString placeholderTextForSummaryCase(); static QString placeholderTextForSummaryCaseX(); static QString placeholderTextForSummaryGroup(); static QString placeholderTextForWell(); static QString placeholderTextForGroup(); private: static RimSummaryMultiPlot* createMultiPlotFromTemplateFile( const QString& fileName ); static std::vector selectedSummaryCases(); static std::vector selectedSummaryCaseCollections(); static std::vector selectedSummaryAddressCollections(); static QString htmlTextFromPlotAndSelection( const RimSummaryPlot* templatePlot, const std::set& selectedSummaryAddresses, const std::vector& selectedSources ); static QString htmlTextFromCount( const QString& itemText, size_t requiredItemCount, size_t selectionCount ); static void setValuesForPlaceholders( RimSummaryMultiPlot* summaryMultiPlot, const std::vector& selectedSummaryCases, const std::vector& selectedEnsembles, const std::vector& wellNames, const std::vector& groupNames, const std::vector& regions ); static void setValuesForPlaceholders( RimSummaryPlot* summaryPlot, const std::vector& selectedSummaryCases, const std::vector& selectedEnsembles, const std::vector& wellNames, const std::vector& groupNames, const std::vector& regions ); static RifEclipseSummaryAddress firstAddressByQuantity( const RifEclipseSummaryAddress& sourceAddress, const std::set& allAddresses ); static int findValueForKeyword( const QString& keyword, const QString& valueString, bool* ok ); static void setPlaceholderWellName( RifEclipseSummaryAddress* summaryAddress, const std::vector& wellNames ); static void setPlaceholderGroupName( RifEclipseSummaryAddress* summaryAddress, const std::vector& groupNames ); static void setPlaceholderRegion( RifEclipseSummaryAddress* summaryAddress, const std::vector& regions ); };