Fix regressions for intersection views.

Introduced by cd08185678
Wrong scalar mappers used when coloring.
Wrong timestep used
This commit is contained in:
Jacob Støren
2019-11-21 15:14:17 +01:00
parent c1df283369
commit f3b458dfbc
5 changed files with 47 additions and 20 deletions

View File

@@ -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() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -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() );
}

View File

@@ -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,9 +85,9 @@ void RivIntersectionResultsColoringTools::updateCellResultColorStatic(
geomResultDef = sepResDef->geoMechResultDefinition();
}
scalarColorMapper = sepResDef->regularLegendConfig()->scalarMapper();
ternaryColorMapper = sepResDef->ternaryLegendConfig()->scalarMapper();
timeStepIndex = sepResDef->timeStep();
if ( !scalarColorMapper ) scalarColorMapper = sepResDef->regularLegendConfig()->scalarMapper();
if ( !ternaryColorMapper ) ternaryColorMapper = sepResDef->ternaryLegendConfig()->scalarMapper();
timeStepIndex = sepResDef->timeStep();
}
// Ordinary result
@@ -97,10 +99,10 @@ void RivIntersectionResultsColoringTools::updateCellResultColorStatic(
if ( eclipseView )
{
eclipseResDef = eclipseView->cellResult();
scalarColorMapper = eclipseView->cellResult()->legendConfig()->scalarMapper();
ternaryColorMapper = eclipseView->cellResult()->ternaryLegendConfig()->scalarMapper();
timeStepIndex = eclipseView->currentTimeStep();
eclipseResDef = eclipseView->cellResult();
if ( !scalarColorMapper ) scalarColorMapper = eclipseView->cellResult()->legendConfig()->scalarMapper();
if ( !ternaryColorMapper )
ternaryColorMapper = eclipseView->cellResult()->ternaryLegendConfig()->scalarMapper();
}
RimGeoMechView* geoView;
@@ -108,9 +110,8 @@ void RivIntersectionResultsColoringTools::updateCellResultColorStatic(
if ( geoView )
{
geomResultDef = geoView->cellResult();
scalarColorMapper = geoView->cellResult()->legendConfig()->scalarMapper();
timeStepIndex = geoView->currentTimeStep();
geomResultDef = geoView->cellResult();
if ( !scalarColorMapper ) scalarColorMapper = geoView->cellResult()->legendConfig()->scalarMapper();
}
}

View File

@@ -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,

View File

@@ -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"
@@ -644,8 +645,20 @@ void Rim2dIntersectionView::onUpdateLegends()
if ( eclView )
{
m_legendConfig()->setUiValuesFromLegendConfig( eclView->cellResult()->legendConfig() );
m_ternaryLegendConfig()->setUiValuesFromLegendConfig( eclView->cellResult()->ternaryLegendConfig() );
// 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(),
@@ -669,7 +682,15 @@ void Rim2dIntersectionView::onUpdateLegends()
if ( geoView )
{
m_legendConfig()->setUiValuesFromLegendConfig( geoView->cellResult()->legendConfig() );
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();