mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#6252 Category Colors : Name and corresponding color do not match
Set category data directly to the category mapper with no reverse ordering When drawing the color legend, always draw categories with lower index first
This commit is contained in:
@@ -214,7 +214,7 @@ RimRegularLegendConfig::~RimRegularLegendConfig()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimRegularLegendConfig::setNamedCategories( const std::vector<QString>& categoryNames, bool inverse )
|
||||
void RimRegularLegendConfig::setNamedCategories( const std::vector<QString>& categoryNames )
|
||||
{
|
||||
std::list<int> nameIndices;
|
||||
std::list<cvf::String> names;
|
||||
@@ -222,16 +222,8 @@ void RimRegularLegendConfig::setNamedCategories( const std::vector<QString>& cat
|
||||
int categoriesCount = static_cast<int>( categoryNames.size() );
|
||||
for ( int i = 0; i < categoriesCount; i++ )
|
||||
{
|
||||
if ( !inverse )
|
||||
{
|
||||
nameIndices.push_back( i );
|
||||
names.push_back( cvfqt::Utils::toString( categoryNames[i] ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
nameIndices.push_front( i );
|
||||
names.push_front( cvfqt::Utils::toString( categoryNames[i] ) );
|
||||
}
|
||||
nameIndices.push_back( i );
|
||||
names.push_back( cvfqt::Utils::toString( categoryNames[i] ) );
|
||||
}
|
||||
|
||||
m_categories = std::vector<int>( nameIndices.begin(), nameIndices.end() );
|
||||
@@ -766,22 +758,6 @@ void RimRegularLegendConfig::setIntegerCategories( const std::vector<int>& categ
|
||||
updateLegend();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimRegularLegendConfig::setNamedCategories( const std::vector<QString>& categoryNames )
|
||||
{
|
||||
setNamedCategories( categoryNames, false );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimRegularLegendConfig::setNamedCategoriesInverse( const std::vector<QString>& categoryNames )
|
||||
{
|
||||
setNamedCategories( categoryNames, true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user