ResInsight/ApplicationLibCode/Commands/PlotTemplateCommands/RicSummaryPlotTemplateTools.h
Magne Sjaastad 64bed1d611
Summary Multi Plot: Minor adjustments (#8856)
Remove obsolete single summary template code
Always use maximized state of the QMdiSubWindow when a plot or view is deleted.
Move time axis to top
Set correct text for unused axis
Avoid assert when layout is requested for non existing legend
2022-04-29 15:31:07 +02:00

93 lines
4.3 KiB
C++

////////////////////////////////////////////////////////////////////////////////
//
// 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QString>
#include <set>
#include <vector>
namespace caf
{
class PdmObject;
}
class RimSummaryPlot;
class RimSummaryCase;
class RimSummaryCaseCollection;
class RifEclipseSummaryAddress;
class RimSummaryMultiPlot;
class RimSummaryAddressCollection;
//==================================================================================================
///
//==================================================================================================
class RicSummaryPlotTemplateTools
{
public:
static RimSummaryMultiPlot* create( const QString& fileName );
static QString selectPlotTemplatePath();
static QString summaryCaseFieldKeyword();
static QString summaryGroupFieldKeyword();
static QString placeholderTextForSummaryCase();
static QString placeholderTextForSummaryGroup();
static QString placeholderTextForWell();
static QString placeholderTextForGroup();
private:
static RimSummaryMultiPlot* createMultiPlotFromTemplateFile( const QString& fileName );
static std::vector<RimSummaryCase*> selectedSummaryCases();
static std::vector<RimSummaryCaseCollection*> selectedSummaryCaseCollections();
static std::vector<RimSummaryAddressCollection*> selectedSummaryAddressCollections();
static QString htmlTextFromPlotAndSelection( const RimSummaryPlot* templatePlot,
const std::set<RifEclipseSummaryAddress>& selectedSummaryAddresses,
const std::vector<caf::PdmObject*>& selectedSources );
static QString htmlTextFromCount( const QString& itemText, size_t requiredItemCount, size_t selectionCount );
static void setValuesForPlaceholders( RimSummaryMultiPlot* summaryMultiPlot,
const std::vector<RimSummaryCase*>& selectedSummaryCases,
const std::vector<RimSummaryCaseCollection*>& selectedEnsembles,
const std::vector<QString>& wellNames,
const std::vector<QString>& groupNames,
const std::vector<QString>& regions );
static void setValuesForPlaceholders( RimSummaryPlot* summaryPlot,
const std::vector<RimSummaryCase*>& selectedSummaryCases,
const std::vector<RimSummaryCaseCollection*>& selectedEnsembles,
const std::vector<QString>& wellNames,
const std::vector<QString>& groupNames,
const std::vector<QString>& regions );
static RifEclipseSummaryAddress firstAddressByQuantity( const RifEclipseSummaryAddress& sourceAddress,
const std::set<RifEclipseSummaryAddress>& allAddresses );
static int findValueForKeyword( const QString& keyword, const QString& valueString, bool* ok );
static void setPlaceholderWellName( RifEclipseSummaryAddress* summaryAddress, const std::vector<QString>& wellNames );
static void setPlaceholderGroupName( RifEclipseSummaryAddress* summaryAddress, const std::vector<QString>& groupNames );
static void setPlaceholderRegion( RifEclipseSummaryAddress* summaryAddress, const std::vector<QString>& regions );
};