#3945 Fix bug related to updating Contour Map when changing result and weighting parameter

This commit is contained in:
Gaute Lindkvist 2019-01-11 12:32:46 +01:00
parent d1a457bf07
commit 4f09b6fbf6
2 changed files with 23 additions and 0 deletions

View File

@ -463,6 +463,7 @@ size_t RimContourMapProjection::numberOfVertices() const
//--------------------------------------------------------------------------------------------------
void RimContourMapProjection::updatedWeightingResult()
{
this->clearGridMapping();
this->updateConnectedEditors();
this->generateResultsIfNecessary(view()->currentTimeStep());
this->updateLegend();
@ -815,6 +816,7 @@ void RimContourMapProjection::generateResults(int timeStep)
if (isColumnResult())
{
m_currentResultName = "";
resultData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORO");
resultData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "NTG");
resultData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
@ -829,6 +831,7 @@ void RimContourMapProjection::generateResults(int timeStep)
}
else
{
m_currentResultName = cellColors->resultVariable();
m_resultAccessor =
RigResultAccessorFactory::createFromResultDefinition(eclipseCase->eclipseCaseData(), 0, timeStep, cellColors);
@ -1087,6 +1090,16 @@ void RimContourMapProjection::generateContourPolygons()
int nContourLevels = static_cast<int>(contourLevels.size());
if (nContourLevels > 2)
{
if (legendConfig()->mappingMode() == RimRegularLegendConfig::LINEAR_DISCRETE ||
legendConfig()->mappingMode() == RimRegularLegendConfig::LINEAR_CONTINUOUS)
{
contourLevels.front() -= 0.01 * (contourLevels.back() - contourLevels.front());
}
else
{
contourLevels.front() *= 0.5;
}
std::vector<caf::ContourLines::ClosedPolygons> closedContourLines = caf::ContourLines::create(
m_aggregatedVertexResults, xVertexPositions(), yVertexPositions(), contourLevels, areaTreshold);
@ -1165,6 +1178,15 @@ bool RimContourMapProjection::resultsNeedUpdating(int timeStep) const
return true;
}
if (!m_currentResultName.isEmpty())
{
RimEclipseCellColors* cellColors = view()->cellResult();
if (cellColors->resultVariable() != m_currentResultName)
{
return true;
}
}
return false;
}

View File

@ -213,5 +213,6 @@ protected:
double m_sampleSpacing;
std::vector<ContourPolygons> m_contourPolygons;
std::vector<cvf::Vec4d> m_trianglesWithVertexValues;
QString m_currentResultName;
int m_currentResultTimestep;
};