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:
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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 );
|
||||||
|
|||||||
Reference in New Issue
Block a user