Curve Colors : Add support for color assignment based on summary phase (oil, gas or water)

This commit is contained in:
Magne Sjaastad
2022-04-20 14:29:40 +02:00
committed by GitHub
parent ed87c9028c
commit caaca138c0
6 changed files with 259 additions and 158 deletions

View File

@@ -24,6 +24,8 @@
#include <map>
#include <set>
#include <unordered_map>
#include <vector>
class RimSummaryCurve;
class RimSummaryCase;
@@ -34,6 +36,7 @@ class RimSummaryCurveAppearanceCalculator
{
public:
explicit RimSummaryCurveAppearanceCalculator( const std::set<RiaSummaryCurveDefinition>& curveDefinitions );
explicit RimSummaryCurveAppearanceCalculator( const std::vector<RiaSummaryCurveDefinition>& curveDefinitions );
enum CurveAppearanceType
{
NONE,
@@ -57,6 +60,8 @@ public:
void setupCurveLook( RimSummaryCurve* curve );
void assignColorByPhase( RimSummaryCurve* curve, int colorIndex );
static cvf::Color3f cycledPaletteColor( int colorIndex );
static cvf::Color3f cycledNoneRGBBrColor( int colorIndex );
static cvf::Color3f cycledGreenColor( int colorIndex );
@@ -66,6 +71,7 @@ public:
static RiuPlotCurveSymbol::PointSymbolEnum cycledSymbol( int index );
private:
void init( const std::vector<RiaSummaryCurveDefinition>& curveDefinitions );
void setOneCurveAppearance( CurveAppearanceType appeaType, size_t totalCount, int appeaIdx, RimSummaryCurve* curve );
void updateApperanceIndices();
std::map<std::string, size_t> mapNameToAppearanceIndex( CurveAppearanceType& appearance,
@@ -91,11 +97,11 @@ private:
CurveAppearanceType m_groupAppearanceType;
CurveAppearanceType m_regionAppearanceType;
std::map<RimSummaryCase*, int> m_caseToAppearanceIdxMap;
std::map<std::string, int> m_varToAppearanceIdxMap;
std::map<std::string, int> m_welToAppearanceIdxMap;
std::map<std::string, int> m_grpToAppearanceIdxMap;
std::map<int, int> m_regToAppearanceIdxMap;
std::map<RimSummaryCase*, int> m_caseToAppearanceIdxMap;
std::unordered_map<std::string, int> m_varToAppearanceIdxMap;
std::unordered_map<std::string, int> m_welToAppearanceIdxMap;
std::unordered_map<std::string, int> m_grpToAppearanceIdxMap;
std::unordered_map<int, int> m_regToAppearanceIdxMap;
std::map<char, std::map<std::string, int>> m_secondCharToVarToAppearanceIdxMap;