Enable polygons in contourmaps (#12073)

* Enable polygons in ensemble statistics views and allow adding polygons in contour maps
This commit is contained in:
jonjenssen 2025-01-16 16:53:05 +01:00 committed by GitHub
parent d37bc104e4
commit c13ce39b5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 66 additions and 29 deletions

View File

@ -65,7 +65,7 @@ RimPolygonInView::RimPolygonInView()
CAF_PDM_InitField( &m_selectPolygon, "SelectPolygon", false, "" ); CAF_PDM_InitField( &m_selectPolygon, "SelectPolygon", false, "" );
caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_selectPolygon ); caf::PdmUiPushButtonEditor::configureEditorLabelHidden( &m_selectPolygon );
CAF_PDM_InitField( &m_handleScalingFactor, "HandleScalingFactor", 1.0, "Handle Scaling Factor" ); CAF_PDM_InitField( &m_handleScalingFactor, "HandleScalingFactor", 2.0, "Handle Scaling Factor" );
CAF_PDM_InitFieldNoDefault( &m_targets, "Targets", "Targets" ); CAF_PDM_InitFieldNoDefault( &m_targets, "Targets", "Targets" );
m_targets.uiCapability()->setUiEditorTypeName( caf::PdmUiTableViewEditor::uiEditorTypeName() ); m_targets.uiCapability()->setUiEditorTypeName( caf::PdmUiTableViewEditor::uiEditorTypeName() );

View File

@ -23,6 +23,7 @@
#include "RimEclipseView.h" #include "RimEclipseView.h"
#include "RimEclipseViewCollection.h" #include "RimEclipseViewCollection.h"
#include "RimStatisticsContourMap.h" #include "RimStatisticsContourMap.h"
#include "RimStatisticsContourMapView.h"
#include "RimWellTargetCandidatesGenerator.h" #include "RimWellTargetCandidatesGenerator.h"
#include "cafCmdFeatureMenuBuilder.h" #include "cafCmdFeatureMenuBuilder.h"
@ -184,6 +185,30 @@ RimEclipseViewCollection* RimEclipseCaseEnsemble::viewCollection() const
return m_viewCollection; return m_viewCollection;
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimEclipseView*> RimEclipseCaseEnsemble::allViews() const
{
std::vector<RimEclipseView*> retList;
if ( !viewCollection() ) return retList;
for ( auto view : viewCollection()->views() )
{
retList.push_back( view );
}
for ( auto cmap : m_statisticsContourMaps.childrenByType() )
{
for ( auto view : cmap->views() )
{
retList.push_back( view );
}
}
return retList;
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -59,6 +59,8 @@ public:
void addView( RimEclipseView* view ); void addView( RimEclipseView* view );
RimEclipseView* addViewForCase( RimEclipseCase* eclipseCase ); RimEclipseView* addViewForCase( RimEclipseCase* eclipseCase );
std::vector<RimEclipseView*> allViews() const;
RimEclipseViewCollection* viewCollection() const; RimEclipseViewCollection* viewCollection() const;
void addWellTargetsGenerator( RimWellTargetCandidatesGenerator* generator ); void addWellTargetsGenerator( RimWellTargetCandidatesGenerator* generator );

View File

@ -54,6 +54,7 @@
#include "RimEclipseCaseCollection.h" #include "RimEclipseCaseCollection.h"
#include "RimEclipseCaseEnsemble.h" #include "RimEclipseCaseEnsemble.h"
#include "RimEclipseContourMapViewCollection.h" #include "RimEclipseContourMapViewCollection.h"
#include "RimEclipseView.h"
#include "RimEclipseViewCollection.h" #include "RimEclipseViewCollection.h"
#include "RimEnsembleWellLogsCollection.h" #include "RimEnsembleWellLogsCollection.h"
#include "RimFileWellPath.h" #include "RimFileWellPath.h"
@ -829,11 +830,26 @@ std::vector<Rim3dView*> RimProject::allViews() const
for ( RimOilField* oilField : oilFields() ) for ( RimOilField* oilField : oilFields() )
{ {
if ( !oilField ) continue; if ( !oilField ) continue;
if ( !oilField->seismicViewCollection() ) continue;
for ( auto seisview : oilField->seismicViewCollection()->views() ) if ( oilField->seismicViewCollection() )
{ {
views.push_back( seisview ); for ( auto seisview : oilField->seismicViewCollection()->views() )
{
views.push_back( seisview );
}
}
if ( oilField->analysisModels() )
{
for ( auto ensemble : oilField->analysisModels()->caseEnsembles.childrenByType() )
{
if ( !ensemble ) continue;
for ( auto view : ensemble->allViews() )
{
views.push_back( view );
}
}
} }
} }
@ -846,16 +862,12 @@ std::vector<Rim3dView*> RimProject::allViews() const
std::vector<Rim3dView*> RimProject::allVisibleViews() const std::vector<Rim3dView*> RimProject::allVisibleViews() const
{ {
std::vector<Rim3dView*> views; std::vector<Rim3dView*> views;
for ( RimCase* rimCase : allGridCases() )
{
if ( !rimCase ) continue;
for ( Rim3dView* view : rimCase->views() ) for ( auto view : allViews() )
{
if ( view && view->viewer() )
{ {
if ( view && view->viewer() ) views.push_back( view );
{
views.push_back( view );
}
} }
} }
@ -882,22 +894,9 @@ std::vector<RimGridView*> RimProject::allVisibleGridViews() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RimProject::scheduleCreateDisplayModelAndRedrawAllViews() void RimProject::scheduleCreateDisplayModelAndRedrawAllViews()
{ {
for ( RimCase* rimCase : allGridCases() ) for ( auto view : allViews() )
{ {
if ( !rimCase ) continue; if ( view ) view->scheduleCreateDisplayModelAndRedraw();
for ( Rim3dView* view : rimCase->views() )
{
view->scheduleCreateDisplayModelAndRedraw();
}
}
auto seismicViewCollection = activeOilField()->seismicViewCollection();
if ( seismicViewCollection )
{
for ( auto seisview : seismicViewCollection->views() )
{
seisview->scheduleCreateDisplayModelAndRedraw();
}
} }
} }

View File

@ -588,6 +588,14 @@ double RimStatisticsContourMap::sampleSpacingFactor() const
return RimContourMapResolutionTools::resolutionFromEnumValue( m_resolution() ); return RimContourMapResolutionTools::resolutionFromEnumValue( m_resolution() );
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RimStatisticsContourMapView*> RimStatisticsContourMap::views() const
{
return m_views.childrenByType();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@ -63,7 +63,8 @@ public:
RigContourMapGrid* contourMapGrid() const; RigContourMapGrid* contourMapGrid() const;
std::vector<double> result( size_t timeStep, StatisticsType statisticsType ) const; std::vector<double> result( size_t timeStep, StatisticsType statisticsType ) const;
void addView( RimStatisticsContourMapView* view ); void addView( RimStatisticsContourMapView* view );
std::vector<RimStatisticsContourMapView*> views() const;
void ensureResultsComputed(); void ensureResultsComputed();

View File

@ -22,6 +22,7 @@
#include "RivContourMapProjectionPartMgr.h" #include "RivContourMapProjectionPartMgr.h"
#include "Polygons/RimPolygonInViewCollection.h"
#include "Rim3dOverlayInfoConfig.h" #include "Rim3dOverlayInfoConfig.h"
#include "RimAnnotationInViewCollection.h" #include "RimAnnotationInViewCollection.h"
#include "RimCase.h" #include "RimCase.h"
@ -157,6 +158,7 @@ void RimStatisticsContourMapView::defineUiTreeOrdering( caf::PdmUiTreeOrdering&
uiTreeOrdering.add( wellCollection() ); uiTreeOrdering.add( wellCollection() );
uiTreeOrdering.add( faultCollection() ); uiTreeOrdering.add( faultCollection() );
uiTreeOrdering.add( annotationCollection() ); uiTreeOrdering.add( annotationCollection() );
uiTreeOrdering.add( polygonInViewCollection() );
uiTreeOrdering.skipRemainingChildren(); uiTreeOrdering.skipRemainingChildren();
} }

View File

@ -438,8 +438,8 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
menuBuilder << "RicToggleMeasurementModeFeature"; menuBuilder << "RicToggleMeasurementModeFeature";
menuBuilder << "RicTogglePolyMeasurementModeFeature"; menuBuilder << "RicTogglePolyMeasurementModeFeature";
menuBuilder.addCmdFeature( "RicCreatePolygonFeature", "Polygon" );
} }
menuBuilder.addCmdFeature( "RicCreatePolygonFeature", "Polygon" );
} }
// Well log curve creation commands // Well log curve creation commands