From abf61090cc7dc7251140461c3fd5c8db6d1e6542 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Tue, 16 Apr 2024 12:55:06 +0200 Subject: [PATCH] Fix intersection view regression. --- .../RimIntersectionResultsDefinitionCollection.cpp | 7 ++++++- .../ProjectDataModel/Rim2dIntersectionView.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultsDefinitionCollection.cpp b/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultsDefinitionCollection.cpp index 2769f569bb..81cfec0ea0 100644 --- a/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultsDefinitionCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Intersections/RimIntersectionResultsDefinitionCollection.cpp @@ -72,7 +72,12 @@ void RimIntersectionResultsDefinitionCollection::appendIntersectionResultDefinit if ( interResDef->activeCase() == nullptr ) { - if ( auto gridView = firstAncestorOrThisOfType() ) + auto ownerCase = firstAncestorOrThisOfType(); + if ( ownerCase ) + { + interResDef->setActiveCase( ownerCase ); + } + else if ( auto gridView = firstAncestorOrThisOfType() ) { if ( auto ownerCase = gridView->ownerCase() ) { diff --git a/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp b/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp index 43b10d393e..f2952ac03b 100644 --- a/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp +++ b/ApplicationLibCode/ProjectDataModel/Rim2dIntersectionView.cpp @@ -176,7 +176,7 @@ RimCase* Rim2dIntersectionView::ownerCase() const if ( !rimCase ) { - rimCase = firstAncestorOrThisOfTypeAsserted()->ownerCase(); + rimCase = firstAncestorOrThisOfType(); } return rimCase; @@ -258,7 +258,7 @@ void Rim2dIntersectionView::update3dInfo() } } - if ( overlayInfoConfig->showCaseInfo() ) + if ( overlayInfoConfig->showCaseInfo() && ownerCase() ) { overlayInfoText += "--" + ownerCase()->caseUserDescription() + "--"; } @@ -467,7 +467,7 @@ bool Rim2dIntersectionView::hasResults() //-------------------------------------------------------------------------------------------------- size_t Rim2dIntersectionView::onTimeStepCountRequested() { - if ( isTimeStepDependentDataVisible() ) + if ( isTimeStepDependentDataVisible() && ownerCase() ) { return ownerCase()->timeStepStrings().size(); } @@ -557,7 +557,7 @@ void Rim2dIntersectionView::onCreateDisplayModel() if ( m_intersection->type() == RimExtrudedCurveIntersection::CrossSectionEnum::CS_WELL_PATH && m_intersection->wellPath() ) { Rim3dView* settingsView = m_intersection->firstAncestorOrThisOfType(); - if ( settingsView ) + if ( settingsView && ownerCase() ) { m_flatWellpathPartMgr = new RivWellPathPartMgr( m_intersection->wellPath(), settingsView ); m_flatWellpathPartMgr->appendFlattenedStaticGeometryPartsToModel( m_intersectionVizModel.p(),