mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1334 Fixed
This commit is contained in:
@@ -626,20 +626,22 @@ void RimLegendConfig::setCategoryItems(const std::vector< std::tuple<QString, in
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimLegendConfig::categoryNameFromCategoryValue(int categoryValue) const
|
||||
QString RimLegendConfig::categoryNameFromCategoryValue(double categoryResultValue) const
|
||||
{
|
||||
if (categoryResultValue == HUGE_VAL) return "Undefined";
|
||||
|
||||
if (m_categoryNames.size() > 0)
|
||||
{
|
||||
for (size_t categoryIndex = 0; categoryIndex < m_categories.size(); categoryIndex++)
|
||||
{
|
||||
if (categoryValue == m_categories[categoryIndex])
|
||||
if (categoryResultValue == m_categories[categoryIndex])
|
||||
{
|
||||
return cvfqt::Utils::toQString(m_categoryNames[categoryIndex]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return QString("%1").arg(categoryValue);
|
||||
return QString("%1").arg(categoryResultValue);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
void setIntegerCategories(const std::vector<int>& categories);
|
||||
void setNamedCategoriesInverse(const std::vector<QString>& categoryNames);
|
||||
void setCategoryItems(const std::vector<std::tuple<QString, int, cvf::Color3ub>>& categories);
|
||||
QString categoryNameFromCategoryValue(int categoryValue) const;
|
||||
QString categoryNameFromCategoryValue(double categoryResultValue) const;
|
||||
|
||||
void setTitle(const cvf::String& title);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user