Merge pull request #9048 from OPM/9047-performance-avoid-update-project

- Avoid update of project when creating new objects
- Added icon resource cache
- Avoid use of descendantsIncludingThisOfType()
This commit is contained in:
Magne Sjaastad
2022-06-13 13:54:55 +02:00
committed by GitHub
parent 7d246c1535
commit ccbda23b96
29 changed files with 184 additions and 149 deletions

View File

@@ -82,7 +82,7 @@ void RicImportPolylinesAnnotationFeature::onActionTriggered( bool isChecked )
RimPolylinesFromFileAnnotation* lastCreatedOrUpdated = annotColl->importOrUpdatePolylinesFromFile( fileNames );
proj->updateConnectedEditors();
proj->activeOilField()->updateConnectedEditors();
if ( lastCreatedOrUpdated )
{

View File

@@ -292,8 +292,6 @@ void RicNewStimPlanModelPlotFeature::createFaciesTrack( RimStimPlanModelPlot* pl
faciesTrack->updateConnectedEditors();
plot->updateConnectedEditors();
RiaApplication::instance()->project()->updateConnectedEditors();
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuPlotMainWindowTools::showPlotMainWindow();
}
@@ -343,8 +341,6 @@ void RicNewStimPlanModelPlotFeature::createLayersTrack( RimStimPlanModelPlot* pl
faciesTrack->updateConnectedEditors();
plot->updateConnectedEditors();
RiaApplication::instance()->project()->updateConnectedEditors();
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuPlotMainWindowTools::showPlotMainWindow();
}
@@ -430,8 +426,6 @@ void RicNewStimPlanModelPlotFeature::createParametersTrack( RimStimPlanModelPlot
plotTrack->updateConnectedEditors();
plot->updateConnectedEditors();
RiaApplication::instance()->project()->updateConnectedEditors();
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuPlotMainWindowTools::showPlotMainWindow();
}

View File

@@ -107,6 +107,8 @@ void RicCreateMultipleFracturesFeature::slotAppendFractures()
RiuCreateMultipleFractionsUi* multipleFractionsUi = this->multipleFractionsUi();
if ( !multipleFractionsUi ) return;
std::set<RimWellPathFractureCollection*> fractureCollectionToUpdate;
auto items = multipleFractionsUi->locationsForNewFractures();
for ( auto item : items )
{
@@ -127,6 +129,7 @@ void RicCreateMultipleFracturesFeature::slotAppendFractures()
RimWellPathFracture* fracture = new RimWellPathFracture();
fractureCollection->addFracture( fracture );
fractureCollectionToUpdate.insert( fractureCollection );
fracture->setFractureUnit( item.wellPath->unitSystem() );
fracture->setMeasuredDepth( item.measuredDepth );
@@ -145,7 +148,11 @@ void RicCreateMultipleFracturesFeature::slotAppendFractures()
RiaApplication* app = RiaApplication::instance();
RimProject* proj = app->project();
proj->updateConnectedEditors();
for ( auto coll : fractureCollectionToUpdate )
{
coll->updateConnectedEditors();
}
proj->reloadCompletionTypeResultsInAllViews();
}

View File

@@ -117,7 +117,7 @@ void RicNewSimWellFractureAtPosFeature::onActionTriggered( bool isChecked )
if ( eclipseCase )
{
proj->reloadCompletionTypeResultsForEclipseCase( eclipseCase );
proj->updateConnectedEditors();
fractureCollection->updateConnectedEditors();
}
Riu3DMainWindowTools::selectAsCurrentItem( fracture );
}

View File

@@ -101,7 +101,7 @@ void RicNewSimWellFractureFeature::onActionTriggered( bool isChecked )
if ( eclipseCase )
{
proj->reloadCompletionTypeResultsForEclipseCase( eclipseCase );
proj->updateConnectedEditors();
eclipseWell->simwellFractureCollection()->updateConnectedEditors();
}
Riu3DMainWindowTools::selectAsCurrentItem( fracture );
}

View File

@@ -86,7 +86,7 @@ RimStimPlanModel* RicNewStimPlanModelFeature::addStimPlanModel( RimWellPath*
if ( project )
{
project->reloadCompletionTypeResultsInAllViews();
project->updateAllRequiredEditors();
stimPlanModelCollection->updateAllRequiredEditors();
}
if ( measuredDepth > 0.0 )

View File

@@ -101,7 +101,7 @@ RimWellPathFracture* RicNewWellPathFractureFeature::addFracture( gsl::not_null<R
if ( project )
{
project->reloadCompletionTypeResultsInAllViews();
project->updateAllRequiredEditors();
fractureCollection->updateAllRequiredEditors();
}
Riu3DMainWindowTools::selectAsCurrentItem( fracture );

View File

@@ -325,7 +325,6 @@ ExtractionCurveType* RicWellLogTools::addExtractionCurve( RimWellLogTrack*
plotTrack->updateConnectedEditors();
plot->updateConnectedEditors();
RimProject::current()->updateConnectedEditors();
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuPlotMainWindowTools::selectAsCurrentItem( curve );
@@ -387,7 +386,6 @@ RimWellLogRftCurve*
plotTrack->setFormationTrajectoryType( RimWellLogTrack::SIMULATION_WELL );
plotTrack->updateConnectedEditors();
RimProject::current()->updateConnectedEditors();
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuPlotMainWindowTools::selectAsCurrentItem( curve );
@@ -416,7 +414,6 @@ RimWellLogFileCurve* RicWellLogTools::addFileCurve( RimWellLogTrack* plotTrack,
plotTrack->updateConnectedEditors();
RimProject::current()->updateConnectedEditors();
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuPlotMainWindowTools::selectAsCurrentItem( curve );
@@ -489,7 +486,6 @@ RimWellMeasurementCurve* RicWellLogTools::addWellMeasurementCurve( RimWellLogTra
plotTrack->addCurve( curve );
plotTrack->updateConnectedEditors();
RimProject::current()->updateConnectedEditors();
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuPlotMainWindowTools::selectAsCurrentItem( curve );

View File

@@ -164,7 +164,7 @@ void RicLinkVisibleViewsFeature::linkViews( std::vector<RimGridView*>& linkableV
viewLinker->updateUiNameAndIcon();
proj->viewLinkerCollection.uiCapability()->updateConnectedEditors();
proj->updateConnectedEditors();
proj->viewLinkerCollection->updateConnectedEditors();
Riu3DMainWindowTools::setExpanded( proj->viewLinkerCollection() );
}

View File

@@ -75,7 +75,7 @@ void RicSetMasterViewFeature::onActionTriggered( bool isChecked )
viewLinker->addDependentView( previousMasterView );
proj->viewLinkerCollection.uiCapability()->updateConnectedEditors();
proj->updateConnectedEditors();
proj->viewLinkerCollection->updateConnectedEditors();
// Set managed view collection to selected and expanded in project tree
Riu3DMainWindowTools::selectAsCurrentItem( viewLinker );

View File

@@ -68,8 +68,6 @@ void RicAdd3dWellLogCurveFeature::onActionTriggered( bool isChecked )
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
RimProject::current()->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( rim3dWellLogExtractionCurve );
Riu3DMainWindowTools::setExpanded( selectedWellPath );

View File

@@ -56,7 +56,6 @@ void RicAdd3dWellLogFileCurveFeature::onActionTriggered( bool isChecked )
rim3dWellLogFileCurve->setDefaultFileCurveDataInfo();
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
RimProject::current()->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( rim3dWellLogFileCurve );
Riu3DMainWindowTools::setExpanded( selectedWellPath );

View File

@@ -63,7 +63,6 @@ void RicAdd3dWellLogRftCurveFeature::onActionTriggered( bool isChecked )
selectedWellPath->add3dWellLogCurve( rim3dWellLogRftCurve );
RimProject::current()->scheduleCreateDisplayModelAndRedrawAllViews();
RimProject::current()->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem( rim3dWellLogRftCurve );
Riu3DMainWindowTools::setExpanded( selectedWellPath );

View File

@@ -104,8 +104,6 @@ void RicAddWellLogToPlotFeature::onActionTriggered( bool isChecked )
}
plot->updateLayout();
RimProject::current()->updateConnectedEditors();
RiuPlotMainWindowTools::showPlotMainWindow();
RiuPlotMainWindowTools::selectAsCurrentItem( plot );
RiuPlotMainWindowTools::setExpanded( plotTrack );

View File

@@ -106,6 +106,8 @@ RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot( bool showAfterC
QString( "Well Log Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots().size() ) );
}
wellLogPlotColl->updateConnectedEditors();
if ( showAfterCreation )
{
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();