2018-05-04 06:06:48 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017- Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-05-04 06:06:48 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2018-05-04 06:06:48 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2018-05-04 06:06:48 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "RiaDefines.h"
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#include "RimRegularLegendConfig.h"
|
2019-12-02 08:26:24 -06:00
|
|
|
#include "RimSummaryCaseCollection.h"
|
2018-05-04 06:06:48 -05:00
|
|
|
|
2021-05-31 04:00:23 -05:00
|
|
|
#include "RigEnsembleParameter.h"
|
|
|
|
|
2020-12-07 09:49:58 -06:00
|
|
|
#include "cafPdmPointer.h"
|
|
|
|
|
2018-05-04 06:06:48 -05:00
|
|
|
#include <map>
|
|
|
|
|
2019-12-02 08:26:24 -06:00
|
|
|
class RimEnsembleCurveSet;
|
2018-05-04 06:06:48 -05:00
|
|
|
class RimEnsembleCurveSetCollection;
|
2020-12-07 09:49:58 -06:00
|
|
|
class RimCustomObjectiveFunction;
|
|
|
|
class RimObjectiveFunction;
|
2018-05-04 06:06:48 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
class RimEnsembleCurveSetColorManager
|
|
|
|
{
|
2019-12-02 08:26:24 -06:00
|
|
|
public:
|
|
|
|
enum class ColorMode
|
|
|
|
{
|
|
|
|
SINGLE_COLOR,
|
2020-12-07 09:49:58 -06:00
|
|
|
BY_ENSEMBLE_PARAM,
|
|
|
|
BY_OBJECTIVE_FUNCTION,
|
|
|
|
BY_CUSTOM_OBJECTIVE_FUNCTION
|
2019-12-02 08:26:24 -06:00
|
|
|
};
|
2020-03-20 05:22:14 -05:00
|
|
|
using ColorModeEnum = caf::AppEnum<ColorMode>;
|
2019-12-02 08:26:24 -06:00
|
|
|
|
2018-05-04 06:06:48 -05:00
|
|
|
public:
|
2018-05-11 02:24:42 -05:00
|
|
|
static const std::map<RimRegularLegendConfig::ColorRangesType, cvf::Color3ubArray>& EnsembleColorRanges();
|
2018-05-04 06:06:48 -05:00
|
|
|
|
|
|
|
static const RimRegularLegendConfig::ColorRangesType DEFAULT_ENSEMBLE_COLOR_RANGE;
|
2019-09-06 03:40:57 -05:00
|
|
|
static RimRegularLegendConfig::ColorRangesType cycledEnsembleColorRange( int index );
|
2018-05-04 06:06:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static bool isEnsembleColorRange( RimRegularLegendConfig::ColorRangesType colorRange )
|
2018-05-04 06:06:48 -05:00
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
return m_ensembleColorRanges.find( colorRange ) != m_ensembleColorRanges.end();
|
2018-05-04 06:06:48 -05:00
|
|
|
}
|
|
|
|
|
2021-05-31 04:00:23 -05:00
|
|
|
static void initializeLegendConfig( RimRegularLegendConfig* legendConfig, const RigEnsembleParameter& parameter );
|
2021-06-09 09:25:19 -05:00
|
|
|
static void initializeLegendConfig( RimRegularLegendConfig* legendConfig,
|
|
|
|
RimObjectiveFunction* objectiveFunction,
|
|
|
|
const std::vector<RimSummaryCase*>& summaryCases,
|
|
|
|
const std::vector<RifEclipseSummaryAddress>& vectorSummaryAddresses,
|
|
|
|
const ObjectiveFunctionTimeConfig& timeConfig );
|
2020-12-07 09:49:58 -06:00
|
|
|
|
|
|
|
static void initializeLegendConfig( RimRegularLegendConfig* legendConfig,
|
|
|
|
caf::PdmPointer<RimCustomObjectiveFunction> customObjectiveFunction );
|
|
|
|
|
2019-12-02 08:26:24 -06:00
|
|
|
static cvf::Color3f caseColor( const RimRegularLegendConfig* legendConfig,
|
|
|
|
const RimSummaryCase* summaryCase,
|
2021-05-31 04:00:23 -05:00
|
|
|
const RigEnsembleParameter& parameter );
|
2019-12-02 08:26:24 -06:00
|
|
|
|
2020-12-07 09:49:58 -06:00
|
|
|
static cvf::Color3f caseColor( const RimRegularLegendConfig* legendConfig,
|
|
|
|
RimSummaryCase* summaryCase,
|
2021-06-09 09:25:19 -05:00
|
|
|
RimObjectiveFunction* objectiveFunction,
|
|
|
|
std::vector<RifEclipseSummaryAddress> vectorSummaryAddresses,
|
|
|
|
const ObjectiveFunctionTimeConfig& timeConfig );
|
2020-12-07 09:49:58 -06:00
|
|
|
|
|
|
|
static cvf::Color3f caseColor( const RimRegularLegendConfig* legendConfig,
|
|
|
|
RimSummaryCase* summaryCase,
|
|
|
|
caf::PdmPointer<RimCustomObjectiveFunction> customObjectiveFunction );
|
|
|
|
|
2018-05-04 06:06:48 -05:00
|
|
|
private:
|
2018-05-11 02:24:42 -05:00
|
|
|
static const std::map<RimRegularLegendConfig::ColorRangesType, cvf::Color3ubArray> m_ensembleColorRanges;
|
|
|
|
|
2018-05-04 06:06:48 -05:00
|
|
|
static std::map<RimEnsembleCurveSetCollection*, int> m_nextColorIndexes;
|
2020-02-12 04:43:15 -06:00
|
|
|
static std::map<RimEnsembleCurveSetCollection*, std::map<RimEnsembleCurveSet*, RimRegularLegendConfig::ColorRangesType>> m_colorCache;
|
2018-05-04 06:06:48 -05:00
|
|
|
};
|