(#829) Use std::vector instead of std::set for categories. Added categoryNames to RimLegendConfig

This commit is contained in:
Magne Sjaastad
2016-09-07 10:28:57 +02:00
parent 3e40db6ef0
commit f1c214c1d7
9 changed files with 65 additions and 95 deletions

View File

@@ -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());