mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8411 Flow Cell Results : Set useful default legend
This commit is contained in:
parent
13425ce0e9
commit
d578771a40
@ -84,6 +84,17 @@ bool RiaResultNames::isLogarithmicResult( const QString& resultName )
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaResultNames::isFlowResultWithBothPosAndNegValues( const QString& resultName )
|
||||
{
|
||||
if ( resultName.startsWith( "FLR", Qt::CaseInsensitive ) ) return true;
|
||||
if ( resultName.startsWith( "FLO", Qt::CaseInsensitive ) ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -28,6 +28,7 @@ namespace RiaResultNames
|
||||
{
|
||||
bool isPerCellFaceResult( const QString& resultName );
|
||||
bool isLogarithmicResult( const QString& resultName );
|
||||
bool isFlowResultWithBothPosAndNegValues( const QString& resultName );
|
||||
|
||||
QString undefinedResultName();
|
||||
QString undefinedGridFaultName();
|
||||
|
@ -208,6 +208,12 @@ RimRegularLegendConfig* RimEclipseCellColors::createLegendForResult( const QStri
|
||||
newLegend->resetUserDefinedValues();
|
||||
}
|
||||
|
||||
if ( RiaResultNames::isFlowResultWithBothPosAndNegValues( resultName ) )
|
||||
{
|
||||
colorRangeType = RimRegularLegendConfig::ColorRangesType::BLUE_WHITE_RED;
|
||||
newLegend->setCenterLegendAroundZero( true );
|
||||
}
|
||||
|
||||
if ( colorRangeType != RimRegularLegendConfig::ColorRangesType::UNDEFINED )
|
||||
{
|
||||
RimColorLegend* colorLegend = RimRegularLegendConfig::mapToColorLegend( colorRangeType );
|
||||
|
Loading…
Reference in New Issue
Block a user