mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -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 "RimEclipseContourMapView.h"
|
||||||
#include "RimEclipseResultDefinition.h"
|
#include "RimEclipseResultDefinition.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
#include "RimProject.h"
|
|
||||||
#include "RimRegularLegendConfig.h"
|
#include "RimRegularLegendConfig.h"
|
||||||
#include "RimTextAnnotation.h"
|
#include "RimTextAnnotation.h"
|
||||||
|
|
||||||
@ -163,16 +162,16 @@ double RimEclipseContourMapProjection::sampleSpacing() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEclipseContourMapProjection::updatedWeightingResult()
|
void RimEclipseContourMapProjection::clearGridMappingAndRedraw()
|
||||||
{
|
{
|
||||||
this->clearGridMapping();
|
this->clearGridMapping();
|
||||||
this->updateConnectedEditors();
|
this->updateConnectedEditors();
|
||||||
this->generateResultsIfNecessary( view()->currentTimeStep() );
|
this->generateResultsIfNecessary( view()->currentTimeStep() );
|
||||||
this->updateLegend();
|
this->updateLegend();
|
||||||
|
|
||||||
RimProject* proj;
|
RimEclipseView* parentView = nullptr;
|
||||||
this->firstAncestorOrThisOfTypeAsserted( proj );
|
this->firstAncestorOrThisOfTypeAsserted( parentView );
|
||||||
proj->scheduleCreateDisplayModelAndRedrawAllViews();
|
parentView->scheduleCreateDisplayModelAndRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -228,7 +227,11 @@ std::vector<double> RimEclipseContourMapProjection::generateResults( int timeSte
|
|||||||
cellColors->resultVariable(),
|
cellColors->resultVariable(),
|
||||||
cellColors->timeLapseBaseTimeStep(),
|
cellColors->timeLapseBaseTimeStep(),
|
||||||
cellColors->caseDiffIndex() );
|
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 );
|
gridResultValues = gridCellResult->cellScalarResults( resAddr, timeStep );
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "RimCheckableNamedObject.h"
|
|
||||||
#include "RimContourMapProjection.h"
|
#include "RimContourMapProjection.h"
|
||||||
|
|
||||||
#include "cafDisplayCoordTransform.h"
|
#include "cafDisplayCoordTransform.h"
|
||||||
@ -51,7 +50,7 @@ public:
|
|||||||
~RimEclipseContourMapProjection() override;
|
~RimEclipseContourMapProjection() override;
|
||||||
|
|
||||||
QString weightingParameter() const;
|
QString weightingParameter() const;
|
||||||
void updatedWeightingResult();
|
void clearGridMappingAndRedraw();
|
||||||
|
|
||||||
// Eclipse case overrides for contour map methods
|
// Eclipse case overrides for contour map methods
|
||||||
QString resultDescriptionText() const override;
|
QString resultDescriptionText() const override;
|
||||||
|
@ -350,7 +350,7 @@ void RimEclipseResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
|||||||
|
|
||||||
if ( contourMapView )
|
if ( contourMapView )
|
||||||
{
|
{
|
||||||
contourMapView->contourMapProjection()->updatedWeightingResult();
|
contourMapView->contourMapProjection()->clearGridMappingAndRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadDataAndUpdate();
|
loadDataAndUpdate();
|
||||||
@ -360,7 +360,7 @@ void RimEclipseResultDefinition::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
|||||||
{
|
{
|
||||||
if ( contourMapView )
|
if ( contourMapView )
|
||||||
{
|
{
|
||||||
contourMapView->contourMapProjection()->updatedWeightingResult();
|
contourMapView->contourMapProjection()->clearGridMappingAndRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadDataAndUpdate();
|
loadDataAndUpdate();
|
||||||
@ -508,7 +508,7 @@ void RimEclipseResultDefinition::updateAnyFieldHasChanged()
|
|||||||
this->firstAncestorOrThisOfType( contourMap );
|
this->firstAncestorOrThisOfType( contourMap );
|
||||||
if ( contourMap )
|
if ( contourMap )
|
||||||
{
|
{
|
||||||
contourMap->updatedWeightingResult();
|
contourMap->clearGridMappingAndRedraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
RimWellLogTrack* wellLogTrack = nullptr;
|
RimWellLogTrack* wellLogTrack = nullptr;
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
#include "Rim2dIntersectionView.h"
|
#include "Rim2dIntersectionView.h"
|
||||||
#include "Rim2dIntersectionViewCollection.h"
|
#include "Rim2dIntersectionViewCollection.h"
|
||||||
#include "RimEclipseCase.h"
|
#include "RimEclipseCase.h"
|
||||||
|
#include "RimEclipseCellColors.h"
|
||||||
|
#include "RimEclipseContourMapProjection.h"
|
||||||
#include "RimEclipseContourMapView.h"
|
#include "RimEclipseContourMapView.h"
|
||||||
#include "RimEclipseContourMapViewCollection.h"
|
#include "RimEclipseContourMapViewCollection.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
@ -134,6 +136,16 @@ void RimReloadCaseTools::updateAll3dViews( RimEclipseCase* eclipseCase )
|
|||||||
for ( RimEclipseContourMapView* contourMap : eclipseCase->contourMapCollection()->views() )
|
for ( RimEclipseContourMapView* contourMap : eclipseCase->contourMapCollection()->views() )
|
||||||
{
|
{
|
||||||
CVF_ASSERT( contourMap );
|
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->loadDataAndUpdate();
|
||||||
contourMap->updateGridBoxData();
|
contourMap->updateGridBoxData();
|
||||||
contourMap->updateAnnotationItems();
|
contourMap->updateAnnotationItems();
|
||||||
|
Loading…
Reference in New Issue
Block a user