mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Improve history curve color and symbols
This commit is contained in:
@@ -1702,7 +1702,14 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vector<RimSummaryCase
|
||||
curve->setSummaryCaseY( sumCase );
|
||||
curve->setSummaryAddressYAndApplyInterpolation( addr->address() );
|
||||
curve->setResampling( m_resampling() );
|
||||
curve->setLineThickness( 1 );
|
||||
|
||||
int lineThickness = 1;
|
||||
if ( addr->address().isHistoryVector() )
|
||||
{
|
||||
lineThickness = 2;
|
||||
curve->setCurveAppearanceFromCaseType();
|
||||
}
|
||||
curve->setLineThickness( lineThickness );
|
||||
|
||||
addCurve( curve );
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "RimSummaryCurveAppearanceCalculator.h"
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaColorTools.h"
|
||||
#include "RiaPreferencesSummary.h"
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
|
||||
@@ -387,6 +388,29 @@ cvf::Color3f RimSummaryCurveAppearanceCalculator::assignColorByPhase( const RifE
|
||||
return cycledNoneRGBBrColor( 0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RimSummaryCurveAppearanceCalculator::computeTintedCurveColorForAddress( const RifEclipseSummaryAddress& address,
|
||||
int colorIndex )
|
||||
{
|
||||
bool usePhaseColor = RiaPreferencesSummary::current()->colorCurvesByPhase();
|
||||
|
||||
cvf::Color3f curveColor;
|
||||
if ( usePhaseColor )
|
||||
{
|
||||
curveColor = RimSummaryCurveAppearanceCalculator::assignColorByPhase( address );
|
||||
}
|
||||
else
|
||||
{
|
||||
curveColor = RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f( colorIndex );
|
||||
}
|
||||
|
||||
float scalingFactor = 0.25;
|
||||
curveColor = RiaColorTools::makeLighter( curveColor, scalingFactor );
|
||||
return curveColor;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -61,8 +61,7 @@ public:
|
||||
void setupCurveLook( RimSummaryCurve* curve );
|
||||
|
||||
static cvf::Color3f assignColorByPhase( const RifEclipseSummaryAddress& address );
|
||||
|
||||
void assignColorByPhase( RimSummaryCurve* curve, int colorIndex );
|
||||
static cvf::Color3f computeTintedCurveColorForAddress( const RifEclipseSummaryAddress& address, int colorIndex );
|
||||
|
||||
static cvf::Color3f cycledPaletteColor( int colorIndex );
|
||||
static cvf::Color3f cycledNoneRGBBrColor( int colorIndex );
|
||||
@@ -84,6 +83,7 @@ private:
|
||||
float gradient( size_t totalCount, int index );
|
||||
|
||||
cvf::Color3f gradeColor( const cvf::Color3f& color, float factor );
|
||||
void assignColorByPhase( RimSummaryCurve* curve, int colorIndex );
|
||||
|
||||
static std::set<std::string> getAllSummaryCaseNames();
|
||||
static std::set<std::string> getAllSummaryWellNames();
|
||||
|
||||
@@ -776,20 +776,12 @@ void RimSummaryPlot::applyDefaultCurveAppearances()
|
||||
{
|
||||
if ( curveSet->colorMode() != RimEnsembleCurveSet::ColorMode::SINGLE_COLOR ) continue;
|
||||
|
||||
cvf::Color3f curveColor;
|
||||
if ( RiaPreferencesSummary::current()->colorCurvesByPhase() )
|
||||
{
|
||||
curveColor = RimSummaryCurveAppearanceCalculator::assignColorByPhase( curveSet->summaryAddress() );
|
||||
}
|
||||
else
|
||||
{
|
||||
curveColor = RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f( colorIndex++ );
|
||||
}
|
||||
cvf::Color3f curveColor =
|
||||
RimSummaryCurveAppearanceCalculator::computeTintedCurveColorForAddress( curveSet->summaryAddress(),
|
||||
colorIndex++ );
|
||||
|
||||
int weightBaseColor = 10;
|
||||
int weightWhite = 25;
|
||||
|
||||
curveColor = RiaColorTools::blendCvfColors( curveColor, cvf::Color3f::WHITE, weightBaseColor, weightWhite );
|
||||
auto adr = curveSet->summaryAddress();
|
||||
if ( adr.isHistoryVector() ) curveColor = RiaPreferencesSummary::current()->historyCurveContrastColor();
|
||||
|
||||
curveSet->setColor( curveColor );
|
||||
}
|
||||
@@ -1991,17 +1983,6 @@ std::pair<int, std::vector<RimSummaryCurve*>> RimSummaryPlot::handleSummaryCaseD
|
||||
{
|
||||
const auto addr = curve->summaryAddressY();
|
||||
dataVectorMap[addr].insert( curve->summaryCaseY() );
|
||||
|
||||
if ( !addr.isHistoryVector() && RiaPreferencesSummary::current()->appendHistoryVectorForDragDrop() )
|
||||
{
|
||||
auto historyAddr = addr;
|
||||
historyAddr.setVectorName( addr.vectorName() + RifReaderEclipseSummary::historyIdentifier() );
|
||||
|
||||
if ( summaryCase->summaryReader() && summaryCase->summaryReader()->hasAddress( historyAddr ) )
|
||||
{
|
||||
dataVectorMap[historyAddr].insert( curve->summaryCaseY() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( const auto& [addr, cases] : dataVectorMap )
|
||||
@@ -2083,7 +2064,7 @@ std::pair<int, std::vector<RimSummaryCurve*>>
|
||||
{
|
||||
newCurveDefsWithObjectNames[newCurveDef].insert( objectIdentifierString );
|
||||
const auto& addr = curveDef.summaryAddress();
|
||||
if ( !addr.isHistoryVector() && RiaPreferencesSummary::current()->appendHistoryVectorForDragDrop() )
|
||||
if ( !addr.isHistoryVector() && RiaPreferencesSummary::current()->appendHistoryVectors() )
|
||||
{
|
||||
auto historyAddr = addr;
|
||||
historyAddr.setVectorName( addr.vectorName() + RifReaderEclipseSummary::historyIdentifier() );
|
||||
@@ -2133,7 +2114,7 @@ std::pair<int, std::vector<RimSummaryCurve*>> RimSummaryPlot::handleSummaryAddre
|
||||
|
||||
std::vector<RifEclipseSummaryAddress> newCurveAddresses;
|
||||
newCurveAddresses.push_back( summaryAddr->address() );
|
||||
if ( !summaryAddr->address().isHistoryVector() && RiaPreferencesSummary::current()->appendHistoryVectorForDragDrop() )
|
||||
if ( !summaryAddr->address().isHistoryVector() && RiaPreferencesSummary::current()->appendHistoryVectors() )
|
||||
{
|
||||
auto historyAddr = summaryAddr->address();
|
||||
historyAddr.setVectorName( summaryAddr->address().vectorName() + RifReaderEclipseSummary::historyIdentifier() );
|
||||
@@ -2294,18 +2275,15 @@ void RimSummaryPlot::addNewEnsembleCurveY( const RifEclipseSummaryAddress& addre
|
||||
curveSet->setSummaryCaseCollection( ensemble );
|
||||
curveSet->setSummaryAddress( address );
|
||||
|
||||
cvf::Color3f curveColor;
|
||||
if ( RiaPreferencesSummary::current()->colorCurvesByPhase() )
|
||||
{
|
||||
auto basePhaseColor = RimSummaryCurveAppearanceCalculator::assignColorByPhase( curveSet->summaryAddress() );
|
||||
cvf::Color3f curveColor =
|
||||
RimSummaryCurveAppearanceCalculator::computeTintedCurveColorForAddress( curveSet->summaryAddress(),
|
||||
static_cast<int>(
|
||||
ensembleCurveSetCollection()
|
||||
->curveSetCount() ) );
|
||||
|
||||
auto adr = curveSet->summaryAddress();
|
||||
if ( adr.isHistoryVector() ) curveColor = RiaPreferencesSummary::current()->historyCurveContrastColor();
|
||||
|
||||
curveColor = RiaColorTools::blendCvfColors( basePhaseColor, cvf::Color3f::WHITE, 1, 3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
curveColor = RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f(
|
||||
ensembleCurveSetCollection()->curveSetCount() );
|
||||
}
|
||||
curveSet->setColor( curveColor );
|
||||
|
||||
ensembleCurveSetCollection()->addCurveSet( curveSet );
|
||||
|
||||
Reference in New Issue
Block a user