mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#829) Use std::vector instead of std::set for categories. Added categoryNames to RimLegendConfig
This commit is contained in:
@@ -422,12 +422,16 @@ void RimGeoMechView::updateLegends()
|
||||
|
||||
if (cellResult()->hasCategoryResult())
|
||||
{
|
||||
const std::vector<QString>& fnVector =
|
||||
gmCase->femPartResults()->activeFormationNames()->formationNames();
|
||||
std::set<int> nameIndices;
|
||||
for (int i = 0; i < fnVector.size(); ++i) nameIndices.insert(i);
|
||||
const std::vector<QString>& fnVector = gmCase->femPartResults()->activeFormationNames()->formationNames();
|
||||
std::vector<int> nameIndices;
|
||||
std::vector<cvf::String> names;
|
||||
for (int i = 0; i < fnVector.size(); ++i)
|
||||
{
|
||||
nameIndices.push_back(i);
|
||||
names.push_back(cvfqt::Utils::toString(fnVector[i]));
|
||||
}
|
||||
|
||||
cellResult()->legendConfig->setCategories(nameIndices, nameIndices);
|
||||
cellResult()->legendConfig->setCategoriesWithNames(nameIndices, names);
|
||||
}
|
||||
|
||||
m_viewer->addColorLegendToBottomLeftCorner(cellResult()->legendConfig->legend());
|
||||
|
||||
Reference in New Issue
Block a user