mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 05:37:21 -05:00
#14344 Update ensemble grid model views on polygon import
Include reservoir grid ensemble views in RimProject::allViews() so that polygon and surface imports update the view tree items and schedule a redraw for these views. Make RimReservoirGridEnsemble::allViews() robust against re-entrant calls during project close by iterating child array fields with childrenByType(), which skips entries nulled during deleteChildren().
This commit is contained in:
@@ -892,6 +892,16 @@ std::vector<Rim3dView*> RimProject::allViews() const
|
||||
views.push_back( view );
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto gridEnsemble : oilField->analysisModels()->reservoirGridEnsembles.childrenByType() )
|
||||
{
|
||||
if ( !gridEnsemble ) continue;
|
||||
|
||||
for ( auto view : gridEnsemble->allViews() )
|
||||
{
|
||||
views.push_back( view );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -503,20 +503,30 @@ std::vector<RimEclipseView*> RimReservoirGridEnsemble::allViews() const
|
||||
{
|
||||
std::vector<RimEclipseView*> views;
|
||||
|
||||
for ( auto view : m_viewCollection->views() )
|
||||
{
|
||||
views.push_back( view );
|
||||
}
|
||||
// Use childrenByType() and null checks here, as this function can be called while child objects
|
||||
// are being deleted during project close. PdmPointer entries in the child array fields are
|
||||
// nulled one by one as the objects are destroyed.
|
||||
|
||||
for ( auto statCase : m_statisticsCaseCollection->reservoirs() )
|
||||
if ( m_viewCollection )
|
||||
{
|
||||
for ( auto view : statCase->reservoirViews() )
|
||||
for ( auto view : m_viewCollection->views() )
|
||||
{
|
||||
views.push_back( view );
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto cmap : m_statisticsContourMaps )
|
||||
if ( m_statisticsCaseCollection )
|
||||
{
|
||||
for ( auto statCase : m_statisticsCaseCollection->reservoirs.childrenByType() )
|
||||
{
|
||||
for ( auto view : statCase->reservoirViews() )
|
||||
{
|
||||
views.push_back( view );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( auto cmap : m_statisticsContourMaps.childrenByType() )
|
||||
{
|
||||
for ( auto view : cmap->views() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user