mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3945 Fix bug related to updating Contour Map when changing result and weighting parameter
This commit is contained in:
parent
d1a457bf07
commit
4f09b6fbf6
@ -463,6 +463,7 @@ size_t RimContourMapProjection::numberOfVertices() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimContourMapProjection::updatedWeightingResult()
|
void RimContourMapProjection::updatedWeightingResult()
|
||||||
{
|
{
|
||||||
|
this->clearGridMapping();
|
||||||
this->updateConnectedEditors();
|
this->updateConnectedEditors();
|
||||||
this->generateResultsIfNecessary(view()->currentTimeStep());
|
this->generateResultsIfNecessary(view()->currentTimeStep());
|
||||||
this->updateLegend();
|
this->updateLegend();
|
||||||
@ -815,6 +816,7 @@ void RimContourMapProjection::generateResults(int timeStep)
|
|||||||
|
|
||||||
if (isColumnResult())
|
if (isColumnResult())
|
||||||
{
|
{
|
||||||
|
m_currentResultName = "";
|
||||||
resultData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORO");
|
resultData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "PORO");
|
||||||
resultData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "NTG");
|
resultData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "NTG");
|
||||||
resultData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
resultData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, "DZ");
|
||||||
@ -829,6 +831,7 @@ void RimContourMapProjection::generateResults(int timeStep)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
m_currentResultName = cellColors->resultVariable();
|
||||||
m_resultAccessor =
|
m_resultAccessor =
|
||||||
RigResultAccessorFactory::createFromResultDefinition(eclipseCase->eclipseCaseData(), 0, timeStep, cellColors);
|
RigResultAccessorFactory::createFromResultDefinition(eclipseCase->eclipseCaseData(), 0, timeStep, cellColors);
|
||||||
|
|
||||||
@ -1087,6 +1090,16 @@ void RimContourMapProjection::generateContourPolygons()
|
|||||||
int nContourLevels = static_cast<int>(contourLevels.size());
|
int nContourLevels = static_cast<int>(contourLevels.size());
|
||||||
if (nContourLevels > 2)
|
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(
|
std::vector<caf::ContourLines::ClosedPolygons> closedContourLines = caf::ContourLines::create(
|
||||||
m_aggregatedVertexResults, xVertexPositions(), yVertexPositions(), contourLevels, areaTreshold);
|
m_aggregatedVertexResults, xVertexPositions(), yVertexPositions(), contourLevels, areaTreshold);
|
||||||
|
|
||||||
@ -1165,6 +1178,15 @@ bool RimContourMapProjection::resultsNeedUpdating(int timeStep) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_currentResultName.isEmpty())
|
||||||
|
{
|
||||||
|
RimEclipseCellColors* cellColors = view()->cellResult();
|
||||||
|
if (cellColors->resultVariable() != m_currentResultName)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,5 +213,6 @@ protected:
|
|||||||
double m_sampleSpacing;
|
double m_sampleSpacing;
|
||||||
std::vector<ContourPolygons> m_contourPolygons;
|
std::vector<ContourPolygons> m_contourPolygons;
|
||||||
std::vector<cvf::Vec4d> m_trianglesWithVertexValues;
|
std::vector<cvf::Vec4d> m_trianglesWithVertexValues;
|
||||||
|
QString m_currentResultName;
|
||||||
int m_currentResultTimestep;
|
int m_currentResultTimestep;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user