#810, #813, #808 Display formation name when picking

This commit is contained in:
Jacob Støren
2016-08-24 15:19:39 +02:00
parent 1a3d8a13af
commit f03e6de1f2
9 changed files with 227 additions and 2 deletions

View File

@@ -31,6 +31,7 @@
#include "RimReservoirCellResultsStorage.h"
#include "RimEclipseView.h"
#include "RimEclipseCellColors.h"
#include "RimFormationNames.h"
@@ -109,6 +110,7 @@ QString RiuResultTextBuilder::mainResultText()
QString topoText = this->topologyText("\n");
text += topoText;
appendDetails(text, formationDetails());
text += "\n";
appendDetails(text, nncDetails());
@@ -228,6 +230,51 @@ QString RiuResultTextBuilder::faultResultDetails()
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiuResultTextBuilder::formationDetails()
{
QString text;
RimCase* rimCase = m_reservoirView->eclipseCase();
if(rimCase)
{
if(rimCase->activeFormationNames() && rimCase->activeFormationNames()->formationNamesData())
{
RigFormationNames* formNames = rimCase->activeFormationNames()->formationNamesData();
size_t k = cvf::UNDEFINED_SIZE_T;
{
const RigCaseData* eclipseData = m_reservoirView->eclipseCase()->reservoirData();
if(eclipseData)
{
if(m_cellIndex != cvf::UNDEFINED_SIZE_T)
{
size_t i = cvf::UNDEFINED_SIZE_T;
size_t j = cvf::UNDEFINED_SIZE_T;
eclipseData->grid(m_gridIndex)->ijkFromCellIndex(m_cellIndex, &i, &j, &k);
}
}
}
if (k != cvf::UNDEFINED_SIZE_T)
{
QString formName = formNames->formationNameFromKLayerIdx(k);
if(!formName.isEmpty())
{
//text += "-- Formation details --\n";
text += QString("Formation Name: %1\n").arg(formName);
}
}
}
}
return text;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------