#812 and related to #272 Formation and Category for Cell edge

This commit is contained in:
Jacob Støren
2016-09-06 12:17:02 +02:00
parent c903e87dfd
commit 3e8873c870
4 changed files with 77 additions and 26 deletions

View File

@@ -944,6 +944,23 @@ void RimEclipseView::updateLegends()
this->cellEdgeResult()->legendConfig->setClosestToZeroValues(globalPosClosestToZero, globalNegClosestToZero, globalPosClosestToZero, globalNegClosestToZero);
this->cellEdgeResult()->legendConfig->setAutomaticRanges(globalMin, globalMax, globalMin, globalMax);
if (this->cellEdgeResult()->hasCategoryResult())
{
if(cellEdgeResult()->singleVarEdgeResultColors()->resultType() != RimDefines::FORMATION_NAMES)
{
cellEdgeResult()->legendConfig()->setCategories(results->uniqueCellScalarValues(cellEdgeResult()->singleVarEdgeResultColors()->scalarResultIndex()),
results->uniqueCellScalarValues(cellEdgeResult()->singleVarEdgeResultColors()->scalarResultIndex(), 0));
}
else
{
const std::vector<QString>& fnVector =
eclipseCase->activeFormationNames()->formationNames();
std::set<int> nameIndices;
for(int i = 0; i < fnVector.size(); ++i) nameIndices.insert(i);
cellEdgeResult()->legendConfig()->setCategories(nameIndices, nameIndices);
}
}
m_viewer->addColorLegendToBottomLeftCorner(this->cellEdgeResult()->legendConfig->legend());
this->cellEdgeResult()->legendConfig->setTitle(cvfqt::Utils::toString(QString("Edge Results: \n") + this->cellEdgeResult()->resultVariable()));
}