#829 Ordered the legend for formation names in the natural top to bottom order

This commit is contained in:
Jacob Støren
2016-09-09 12:10:24 +02:00
parent 077351cd04
commit 38c0b29b84
4 changed files with 20 additions and 35 deletions

View File

@@ -423,15 +423,7 @@ void RimGeoMechView::updateLegends()
if (cellResult()->hasCategoryResult())
{
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->setCategoriesWithNames(nameIndices, names);
cellResult()->legendConfig->setNamedCategoriesInverse(fnVector);
}
m_viewer->addColorLegendToBottomLeftCorner(cellResult()->legendConfig->legend());