mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-03 04:00:57 -06:00
#9522 Contour Map: Ensure correct update of grid calculator maps
This commit is contained in:
parent
500b4d2922
commit
16239cd80c
@ -35,7 +35,6 @@
|
||||
#include "RimEclipseContourMapView.h"
|
||||
#include "RimEclipseResultDefinition.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimTextAnnotation.h"
|
||||
|
||||
@ -163,16 +162,16 @@ double RimEclipseContourMapProjection::sampleSpacing() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseContourMapProjection::updatedWeightingResult()
|
||||
void RimEclipseContourMapProjection::clearGridMappingAndRedraw()
|
||||
{
|
||||
this->clearGridMapping();
|
||||
this->updateConnectedEditors();
|
||||
this->generateResultsIfNecessary( view()->currentTimeStep() );
|
||||
this->updateLegend();
|
||||
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfTypeAsserted( proj );
|
||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
||||
RimEclipseView* parentView = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted( parentView );
|
||||
parentView->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -228,7 +227,11 @@ std::vector<double> RimEclipseContourMapProjection::generateResults( int timeSte
|
||||
cellColors->resultVariable(),
|
||||
cellColors->timeLapseBaseTimeStep(),
|
||||
cellColors->caseDiffIndex() );
|
||||
if ( resAddr.isValid() && gridCellResult->hasResultEntry( resAddr ) )
|
||||
|
||||
// When loading a project file, grid calculator results are not computed the first time this function is
|
||||
// called. Must check if result is loaded. See RimReloadCaseTools::updateAll3dViews()
|
||||
if ( resAddr.isValid() && gridCellResult->hasResultEntry( resAddr ) &&
|
||||
gridCellResult->isResultLoaded( resAddr ) )
|
||||
{
|
||||
gridResultValues = gridCellResult->cellScalarResults( resAddr, timeStep );
|
||||
}
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimCheckableNamedObject.h"
|
||||
#include "RimContourMapProjection.h"
|
||||
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
@ -51,7 +50,7 @@ public:
|
||||
~RimEclipseContourMapProjection() override;
|
||||
|
||||
QString weightingParameter() const;
|
||||
void updatedWeightingResult();
|
||||
void clearGridMappingAndRedraw();
|
||||
|
||||
// Eclipse case overrides for contour map methods
|
||||
QString resultDescriptionText() const override;
|
||||
|
@ -350,7 +350,7 @@ void RimEclipseResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
|
||||
if ( contourMapView )
|
||||
{
|
||||
contourMapView->contourMapProjection()->updatedWeightingResult();
|
||||
contourMapView->contourMapProjection()->clearGridMappingAndRedraw();
|
||||
}
|
||||
|
||||
loadDataAndUpdate();
|
||||
@ -360,7 +360,7 @@ void RimEclipseResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
{
|
||||
if ( contourMapView )
|
||||
{
|
||||
contourMapView->contourMapProjection()->updatedWeightingResult();
|
||||
contourMapView->contourMapProjection()->clearGridMappingAndRedraw();
|
||||
}
|
||||
|
||||
loadDataAndUpdate();
|
||||
@ -508,7 +508,7 @@ void RimEclipseResultDefinition::updateAnyFieldHasChanged()
|
||||
this->firstAncestorOrThisOfType( contourMap );
|
||||
if ( contourMap )
|
||||
{
|
||||
contourMap->updatedWeightingResult();
|
||||
contourMap->clearGridMappingAndRedraw();
|
||||
}
|
||||
|
||||
RimWellLogTrack* wellLogTrack = nullptr;
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include "Rim2dIntersectionView.h"
|
||||
#include "Rim2dIntersectionViewCollection.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseContourMapProjection.h"
|
||||
#include "RimEclipseContourMapView.h"
|
||||
#include "RimEclipseContourMapViewCollection.h"
|
||||
#include "RimEclipseView.h"
|
||||
@ -134,6 +136,16 @@ void RimReloadCaseTools::updateAll3dViews( RimEclipseCase* eclipseCase )
|
||||
for ( RimEclipseContourMapView* contourMap : eclipseCase->contourMapCollection()->views() )
|
||||
{
|
||||
CVF_ASSERT( contourMap );
|
||||
|
||||
if ( contourMap->cellResult()->resultType() == RiaDefines::ResultCatType::GENERATED )
|
||||
{
|
||||
// When a generated result is selected, the data might come from a calculation. Make sure that all
|
||||
// computations are updated based on new data.
|
||||
// See RimEclipseContourMapProjection::generateResults()
|
||||
contourMap->contourMapProjection()->clearGeometry();
|
||||
contourMap->contourMapProjection()->clearGridMappingAndRedraw();
|
||||
}
|
||||
|
||||
contourMap->loadDataAndUpdate();
|
||||
contourMap->updateGridBoxData();
|
||||
contourMap->updateAnnotationItems();
|
||||
|
Loading…
Reference in New Issue
Block a user