#950 Some guarding and data update on changing the active formation names reference in case. More to do.

This commit is contained in:
Jacob Støren
2016-11-02 17:03:59 +01:00
parent 9e0cf779b6
commit ca7bd5b2b0
2 changed files with 12 additions and 2 deletions

View File

@@ -369,7 +369,7 @@ void RimEclipsePropertyFilter::updateFilterName()
{
newFiltername += " (";
if (m_selectedCategoryValues().size() == m_categoryValues.size())
if ( m_selectedCategoryValues().size() && m_selectedCategoryValues().size() == m_categoryValues.size() )
{
newFiltername += QString::number(m_selectedCategoryValues()[0]);
newFiltername += "..";

View File

@@ -503,7 +503,6 @@ void RigCaseData::computeActiveCellsGeometryBoundingBox()
void RigCaseData::setActiveFormationNames(RigFormationNames* activeFormationNames)
{
m_activeFormationNamesData = activeFormationNames;
if (!activeFormationNames) return;
size_t totalGlobCellCount = m_mainGrid->globalCellArray().size();
size_t resIndex = m_matrixModelResults->addStaticScalarResult(RimDefines::FORMATION_NAMES,
@@ -512,6 +511,17 @@ void RigCaseData::setActiveFormationNames(RigFormationNames* activeFormationName
totalGlobCellCount);
std::vector<double>& fnData = m_matrixModelResults->cellScalarResults(resIndex,0);
if (m_activeFormationNamesData.isNull())
{
for ( size_t cIdx = 0; cIdx < totalGlobCellCount; ++cIdx )
{
fnData[cIdx] = HUGE_VAL;
}
return;
}
size_t localCellCount = m_mainGrid->cellCount();
for (size_t cIdx = 0; cIdx < localCellCount; ++cIdx)
{