mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix regressions for intersection views.
Introduced by cd08185678
Wrong scalar mappers used when coloring.
Wrong timestep used
This commit is contained in:
@@ -87,11 +87,12 @@ void RivIntersectionBoxPartMgr::updateCellResultColor( size_t timeStepIndex )
|
||||
RivIntersectionResultsColoringTools::updateCellResultColorStatic( timeStepIndex,
|
||||
m_rimIntersectionBox,
|
||||
m_intersectionBoxGenerator.p(),
|
||||
nullptr,
|
||||
nullptr,
|
||||
m_intersectionBoxFaces.p(),
|
||||
m_intersectionBoxFacesTextureCoords.p() );
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -156,6 +156,8 @@ void RivIntersectionPartMgr::updateCellResultColor( size_t
|
||||
RivIntersectionResultsColoringTools::updateCellResultColorStatic( timeStepIndex,
|
||||
m_rimCrossSection,
|
||||
m_crossSectionGenerator.p(),
|
||||
scalarColorMapper,
|
||||
ternaryColorMapper,
|
||||
m_crossSectionFaces.p(),
|
||||
m_crossSectionFacesTextureCoords.p() );
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ void RivIntersectionResultsColoringTools::updateCellResultColorStatic(
|
||||
size_t timeStepIndex,
|
||||
RimIntersectionHandle* rimIntersectionHandle,
|
||||
const RivIntersectionGeometryGeneratorIF* intersectionGeomGenIF,
|
||||
const cvf::ScalarMapper* explicitScalarColorMapper,
|
||||
const RivTernaryScalarMapper* explicitTernaryColorMapper,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
{
|
||||
@@ -66,8 +68,8 @@ void RivIntersectionResultsColoringTools::updateCellResultColorStatic(
|
||||
|
||||
RimEclipseResultDefinition* eclipseResDef = nullptr;
|
||||
RimGeoMechResultDefinition* geomResultDef = nullptr;
|
||||
const cvf::ScalarMapper* scalarColorMapper = nullptr;
|
||||
const RivTernaryScalarMapper* ternaryColorMapper = nullptr;
|
||||
const cvf::ScalarMapper* scalarColorMapper = explicitScalarColorMapper;
|
||||
const RivTernaryScalarMapper* ternaryColorMapper = explicitTernaryColorMapper;
|
||||
|
||||
// Separate intersection result
|
||||
|
||||
@@ -83,8 +85,8 @@ void RivIntersectionResultsColoringTools::updateCellResultColorStatic(
|
||||
geomResultDef = sepResDef->geoMechResultDefinition();
|
||||
}
|
||||
|
||||
scalarColorMapper = sepResDef->regularLegendConfig()->scalarMapper();
|
||||
ternaryColorMapper = sepResDef->ternaryLegendConfig()->scalarMapper();
|
||||
if ( !scalarColorMapper ) scalarColorMapper = sepResDef->regularLegendConfig()->scalarMapper();
|
||||
if ( !ternaryColorMapper ) ternaryColorMapper = sepResDef->ternaryLegendConfig()->scalarMapper();
|
||||
timeStepIndex = sepResDef->timeStep();
|
||||
}
|
||||
|
||||
@@ -98,9 +100,9 @@ void RivIntersectionResultsColoringTools::updateCellResultColorStatic(
|
||||
if ( eclipseView )
|
||||
{
|
||||
eclipseResDef = eclipseView->cellResult();
|
||||
scalarColorMapper = eclipseView->cellResult()->legendConfig()->scalarMapper();
|
||||
if ( !scalarColorMapper ) scalarColorMapper = eclipseView->cellResult()->legendConfig()->scalarMapper();
|
||||
if ( !ternaryColorMapper )
|
||||
ternaryColorMapper = eclipseView->cellResult()->ternaryLegendConfig()->scalarMapper();
|
||||
timeStepIndex = eclipseView->currentTimeStep();
|
||||
}
|
||||
|
||||
RimGeoMechView* geoView;
|
||||
@@ -109,8 +111,7 @@ void RivIntersectionResultsColoringTools::updateCellResultColorStatic(
|
||||
if ( geoView )
|
||||
{
|
||||
geomResultDef = geoView->cellResult();
|
||||
scalarColorMapper = geoView->cellResult()->legendConfig()->scalarMapper();
|
||||
timeStepIndex = geoView->currentTimeStep();
|
||||
if ( !scalarColorMapper ) scalarColorMapper = geoView->cellResult()->legendConfig()->scalarMapper();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,10 +44,12 @@ class RivIntersectionResultsColoringTools
|
||||
{
|
||||
public:
|
||||
static void updateCellResultColorStatic( size_t timeStepIndex,
|
||||
RimIntersectionHandle* m_rimIntersectionBox,
|
||||
const RivIntersectionGeometryGeneratorIF* m_intersectionBoxGenerator,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
RimIntersectionHandle* rimIntersectionHandle,
|
||||
const RivIntersectionGeometryGeneratorIF* intersectionGeomGenIF,
|
||||
const cvf::ScalarMapper* explicitScalarColorMapper,
|
||||
const RivTernaryScalarMapper* explicitTernaryColorMapper,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords );
|
||||
|
||||
private:
|
||||
static void updateEclipseCellResultColors( const RimEclipseResultDefinition* eclipseResDef,
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimGridView.h"
|
||||
#include "RimIntersection.h"
|
||||
#include "RimIntersectionResultDefinition.h"
|
||||
#include "RimRegularLegendConfig.h"
|
||||
#include "RimSimWellInView.h"
|
||||
#include "RimTernaryLegendConfig.h"
|
||||
@@ -643,9 +644,21 @@ void Rim2dIntersectionView::onUpdateLegends()
|
||||
caf::TitledOverlayFrame* legend = nullptr;
|
||||
|
||||
if ( eclView )
|
||||
{
|
||||
// Copy the legend settings from the real view
|
||||
|
||||
RimIntersectionResultDefinition* sepInterResDef = m_intersection->activeSeparateResultDefinition();
|
||||
if ( sepInterResDef )
|
||||
{
|
||||
m_legendConfig()->setUiValuesFromLegendConfig( sepInterResDef->regularLegendConfig() );
|
||||
m_ternaryLegendConfig()->setUiValuesFromLegendConfig( sepInterResDef->ternaryLegendConfig() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_legendConfig()->setUiValuesFromLegendConfig( eclView->cellResult()->legendConfig() );
|
||||
m_ternaryLegendConfig()->setUiValuesFromLegendConfig( eclView->cellResult()->ternaryLegendConfig() );
|
||||
}
|
||||
|
||||
eclView->cellResult()->updateLegendData( eclView->eclipseCase(),
|
||||
m_currentTimeStep(),
|
||||
m_legendConfig(),
|
||||
@@ -668,8 +681,16 @@ void Rim2dIntersectionView::onUpdateLegends()
|
||||
}
|
||||
|
||||
if ( geoView )
|
||||
{
|
||||
RimIntersectionResultDefinition* sepInterResDef = m_intersection->activeSeparateResultDefinition();
|
||||
if ( sepInterResDef )
|
||||
{
|
||||
m_legendConfig()->setUiValuesFromLegendConfig( sepInterResDef->regularLegendConfig() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_legendConfig()->setUiValuesFromLegendConfig( geoView->cellResult()->legendConfig() );
|
||||
}
|
||||
|
||||
geoView->updateLegendTextAndRanges( m_legendConfig(), m_currentTimeStep() );
|
||||
legend = m_legendConfig()->titledOverlayFrame();
|
||||
|
||||
Reference in New Issue
Block a user