mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-07 06:33:05 -06:00
#5961 Color Legend : Creation custom color legend only when required
This commit is contained in:
parent
bd09f2de54
commit
e069dfe9cc
@ -66,7 +66,22 @@ RimFormationNames* RicImportFormationNamesFeature::importFormationFiles( const Q
|
||||
|
||||
for ( int i = 0; i < fileNames.size(); i++ )
|
||||
{
|
||||
RicImportFormationNamesFeature::addCustomColorLegend( QFileInfo( fileNames[i] ).baseName(), formationNames[i] );
|
||||
auto colors = formationNames[i]->formationNamesData()->formationColors();
|
||||
|
||||
bool anyValidColor = false;
|
||||
for ( const auto& color : colors )
|
||||
{
|
||||
if ( color.isValid() )
|
||||
{
|
||||
anyValidColor = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( anyValidColor )
|
||||
{
|
||||
RicImportFormationNamesFeature::addCustomColorLegend( QFileInfo( fileNames[i] ).baseName(), formationNames[i] );
|
||||
}
|
||||
}
|
||||
|
||||
return formationNames.back();
|
||||
@ -82,7 +97,7 @@ bool RicImportFormationNamesFeature::isCommandEnabled()
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// If only one formation file is imported, the formation will automatically be set in the active
|
||||
/// view’s case. Import of LYR files with colors create custom color legends according to color
|
||||
/// view<EFBFBD>s case. Import of LYR files with colors create custom color legends according to color
|
||||
/// definition on each file. However, color legend must be set by the user.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicImportFormationNamesFeature::onActionTriggered( bool isChecked )
|
||||
|
Loading…
Reference in New Issue
Block a user