#8411 Flow Cell Results : Set useful default legend

This commit is contained in:
Magne Sjaastad
2022-01-05 13:31:58 +01:00
parent 13425ce0e9
commit d578771a40
3 changed files with 18 additions and 0 deletions

View File

@@ -84,6 +84,17 @@ bool RiaResultNames::isLogarithmicResult( const QString& resultName )
return false; 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;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -28,6 +28,7 @@ namespace RiaResultNames
{ {
bool isPerCellFaceResult( const QString& resultName ); bool isPerCellFaceResult( const QString& resultName );
bool isLogarithmicResult( const QString& resultName ); bool isLogarithmicResult( const QString& resultName );
bool isFlowResultWithBothPosAndNegValues( const QString& resultName );
QString undefinedResultName(); QString undefinedResultName();
QString undefinedGridFaultName(); QString undefinedGridFaultName();

View File

@@ -208,6 +208,12 @@ RimRegularLegendConfig* RimEclipseCellColors::createLegendForResult( const QStri
newLegend->resetUserDefinedValues(); newLegend->resetUserDefinedValues();
} }
if ( RiaResultNames::isFlowResultWithBothPosAndNegValues( resultName ) )
{
colorRangeType = RimRegularLegendConfig::ColorRangesType::BLUE_WHITE_RED;
newLegend->setCenterLegendAroundZero( true );
}
if ( colorRangeType != RimRegularLegendConfig::ColorRangesType::UNDEFINED ) if ( colorRangeType != RimRegularLegendConfig::ColorRangesType::UNDEFINED )
{ {
RimColorLegend* colorLegend = RimRegularLegendConfig::mapToColorLegend( colorRangeType ); RimColorLegend* colorLegend = RimRegularLegendConfig::mapToColorLegend( colorRangeType );