#1044 Contour maps in 3d views: wire the contour map collection into Eclipse and GeoMech 3d views

Give RimGridView a RimContourMapInViewCollection and let RimEclipseView and RimGeoMechView build their 3d model from it. A dedicated contour map view (RimEclipseContourMapView/RimStatisticsContourMapView) shows its own contour map and returns no collection of its own, so it is unaffected. Adjust RimSurfaceInViewCollection so surfaces and contour maps coexist in the same 3d view without z-fighting.
This commit is contained in:
Magne Sjaastad committed 2026-09-07 09:32:04 +02:00
1 parent d6c5774da9
commit c8023e8803
13 files changed
+176 -3

No files matched your search

@@ -29,6 +29,8 @@
#include "HoloLensCommands/RicExportToSharingServerScheduler.h"
#include "ContourMap/RimContourMapInViewCollection.h"
#include "RicfCommandObject.h"
#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"
@@ -850,6 +852,10 @@ void RimEclipseView::onCreateDisplayModel()
}
else
{
// onUpdateDisplayModelForCurrentTimeStep is not called for a view showing only static results,
// so the contour maps have to be appended here to be shown at all
appendContourMapsToModel();
m_overlayInfoConfig()->update3DInfo();
onUpdateLegends();
}
@@ -957,6 +963,7 @@ void RimEclipseView::onUpdateDisplayModelForCurrentTimeStep()
appendWellsAndFracturesToModel();
appendElementVectorResultToModel();
appendStreamlinesToModel();
appendContourMapsToModel();
m_overlayInfoConfig()->update3DInfo();
@@ -1234,6 +1241,35 @@ void RimEclipseView::appendStreamlinesToModel()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::appendContourMapsToModel()
{
if ( !nativeOrOverrideViewer() ) return;
if ( !contourMapInViewCollection() ) return;
// A contour map draped on the geometry follows the cell visibility, which is time step dependent, so
// the parts belong to the frame scene rather than to a static model. A view showing only static
// results has no frame scenes at all, and everything it shows lives in the main scene.
cvf::Scene* scene = nativeOrOverrideViewer()->frame( m_currentTimeStep, isUsingOverrideViewer() );
if ( !scene ) scene = nativeOrOverrideViewer()->mainScene( isUsingOverrideViewer() );
if ( !scene ) return;
cvf::String name = "ContourMapsInView";
RimEclipseView::removeModelByName( scene, name );
cvf::ref<cvf::ModelBasicList> frameParts = new cvf::ModelBasicList;
frameParts->setName( name );
cvf::ref<caf::DisplayCoordTransform> transform = displayCoordTransform();
contourMapInViewCollection()->appendPartsToModel( frameParts.p(), transform.p(), nativeOrOverrideViewer()->mainCamera() );
frameParts->updateBoundingBoxesRecursive();
scene->addModel( frameParts.p() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1681,6 +1717,11 @@ void RimEclipseView::onUpdateLegends()
m_seismicSectionCollection->updateLegendRangesTextAndVisibility( nativeOrOverrideViewer(), isUsingOverrideViewer() );
}
if ( auto contourMaps = contourMapInViewCollection() )
{
contourMaps->updateLegendRangesTextAndVisibility( nativeOrOverrideViewer(), isUsingOverrideViewer() );
}
if ( m_streamlineCollection )
{
m_streamlineCollection->updateLegendRangesTextAndVisibility( nativeOrOverrideViewer(), isUsingOverrideViewer() );
@@ -2141,6 +2182,7 @@ void RimEclipseView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
uiTreeOrdering.add( m_polygonInViewCollection );
if ( surfaceInViewCollection() ) uiTreeOrdering.add( surfaceInViewCollection() );
if ( contourMapInViewCollection() ) uiTreeOrdering.add( contourMapInViewCollection() );
if ( seismicSectionCollection()->shouldBeVisibleInTree() ) uiTreeOrdering.add( seismicSectionCollection() );
uiTreeOrdering.add( annotationCollection() );
@@ -2541,6 +2583,14 @@ std::vector<RimLegendConfig*> RimEclipseView::legendConfigs() const
}
}
if ( auto contourMaps = contourMapInViewCollection() )
{
for ( auto legendConfig : contourMaps->legendConfigs() )
{
absLegends.push_back( legendConfig );
}
}
for ( auto section : seismicSectionCollection()->seismicSections() )
{
absLegends.push_back( section->legendConfig() );