#2413 2D intersection view: Use correct cell result in infoText

This commit is contained in:
Rebecca Cox 2018-02-14 10:54:28 +01:00
parent cb38d435cd
commit eedf182620
3 changed files with 32 additions and 20 deletions

View File

@ -340,9 +340,6 @@ void Rim2dIntersectionView::updateLegends()
if (!hasResults()) return;
RimCase* rimCase = nullptr;
m_intersection->firstAncestorOrThisOfType(rimCase);
QString overlayInfoText;
overlayInfoText += "<b>--" + ownerCase()->caseUserDescription() + "--</b>";
@ -387,7 +384,38 @@ void Rim2dIntersectionView::updateLegends()
m_intersection->firstAncestorOrThisOfType(geoView);
if (geoView)
{
overlayInfoText += "<b>Cell Result:</b> " + geoView->cellResult()->legendConfig()->title() + "<br>";
QString resultPos;
QString fieldName = geoView->cellResultResultDefinition()->resultFieldUiName();
QString compName = geoView->cellResultResultDefinition()->resultComponentUiName();
switch (geoView->cellResultResultDefinition()->resultPositionType())
{
case RIG_NODAL:
resultPos = "Nodal";
break;
case RIG_ELEMENT_NODAL:
resultPos = "Element nodal";
break;
case RIG_INTEGRATION_POINT:
resultPos = "Integration point";
break;
case RIG_ELEMENT:
resultPos = "Element";
break;
default:
break;
}
if (compName == "")
{
overlayInfoText += QString("<b>Cell result:</b> %1, %2<br>").arg(resultPos).arg(fieldName);
}
else
{
overlayInfoText += QString("<b>Cell result:</b> %1, %2, %3<br>").arg(resultPos).arg(fieldName).arg(compName);
}
m_legendConfig()->setUiValuesFromLegendConfig(geoView->cellResult()->legendConfig());

View File

@ -674,21 +674,6 @@ void RimLegendConfig::setTitle(const QString& title)
m_categoryLegend->setTitle(cvfTitle);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimLegendConfig::title() const
{
if (m_currentScalarMapper == m_categoryMapper)
{
return cvfqt::Utils::toQString(m_categoryLegend->title());
}
else
{
return cvfqt::Utils::toQString(m_scalarMapperLegend->title());
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -115,7 +115,6 @@ public:
QString categoryNameFromCategoryValue(double categoryResultValue) const;
void setTitle(const QString& title);
QString title() const;
void setUiValuesFromLegendConfig(const RimLegendConfig* otherLegendConfig);