#811, #812 WIP, Formation names coloring of cells. First shot. Works but needs refinment.

This commit is contained in:
Jacob Støren
2016-09-06 10:27:30 +02:00
parent ca6e650a72
commit c903e87dfd
28 changed files with 373 additions and 50 deletions

View File

@@ -61,6 +61,7 @@
#include "cvfqtUtils.h"
#include <QMessageBox>
#include "RigFormationNames.h"
CAF_PDM_SOURCE_INIT(RimGeoMechView, "GeoMechView");
@@ -418,7 +419,17 @@ void RimGeoMechView::updateLegends()
cellResult()->legendConfig->setClosestToZeroValues(globalPosClosestToZero, globalNegClosestToZero, localPosClosestToZero, localNegClosestToZero);
cellResult()->legendConfig->setAutomaticRanges(globalMin, globalMax, localMin, localMax);
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);
cellResult()->legendConfig->setCategories(nameIndices, nameIndices);
}
m_viewer->addColorLegendToBottomLeftCorner(cellResult()->legendConfig->legend());
cvf::String legendTitle = cvfqt::Utils::toString(