diff --git a/ApplicationLibCode/Application/RiaApplication.cpp b/ApplicationLibCode/Application/RiaApplication.cpp index 86e2b1df0b..c9a0651f29 100644 --- a/ApplicationLibCode/Application/RiaApplication.cpp +++ b/ApplicationLibCode/Application/RiaApplication.cpp @@ -690,8 +690,7 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct } { - std::vector views = m_project->allViews(); - for ( auto view : views ) + for ( auto view : m_project->allViews() ) { if ( auto eclipseView = dynamic_cast( view ) ) { diff --git a/ApplicationLibCode/Commands/CompletionCommands/RicNewValveTemplateFeature.cpp b/ApplicationLibCode/Commands/CompletionCommands/RicNewValveTemplateFeature.cpp index 01deef6656..7a352b12aa 100644 --- a/ApplicationLibCode/Commands/CompletionCommands/RicNewValveTemplateFeature.cpp +++ b/ApplicationLibCode/Commands/CompletionCommands/RicNewValveTemplateFeature.cpp @@ -50,8 +50,7 @@ void RicNewValveTemplateFeature::selectValveTemplateAndUpdate( RimValveTemplate* RimProject* project = RimProject::current(); - std::vector views = project->allVisibleViews(); - for ( Rim3dView* view : views ) + for ( Rim3dView* view : project->allVisibleViews() ) { if ( dynamic_cast( view ) ) { diff --git a/ApplicationLibCode/Commands/RicExportContourMapToTextFeature.cpp b/ApplicationLibCode/Commands/RicExportContourMapToTextFeature.cpp index 8773dd0450..4614bb5be0 100644 --- a/ApplicationLibCode/Commands/RicExportContourMapToTextFeature.cpp +++ b/ApplicationLibCode/Commands/RicExportContourMapToTextFeature.cpp @@ -277,9 +277,8 @@ caf::PdmScriptResponse RicExportContourMapToTextFeature::execute() RimProject* proj = app->project(); CAF_ASSERT( proj ); - std::vector allViews = proj->allViews(); - Rim3dView* myView = nullptr; - for ( auto view : allViews ) + Rim3dView* myView = nullptr; + for ( auto view : proj->allViews() ) { if ( m_viewId == view->id() ) { diff --git a/ApplicationLibCode/Commands/RicWellMeasurementImportTools.cpp b/ApplicationLibCode/Commands/RicWellMeasurementImportTools.cpp index 2906b7a661..8f5438705a 100644 --- a/ApplicationLibCode/Commands/RicWellMeasurementImportTools.cpp +++ b/ApplicationLibCode/Commands/RicWellMeasurementImportTools.cpp @@ -102,8 +102,7 @@ void RicWellMeasurementImportTools::importWellMeasurementsFromFiles( const QStri auto proj = RimProject::current(); if ( proj ) { - std::vector views = proj->allViews(); - for ( auto& view : views ) + for ( auto& view : proj->allViews() ) { RimGridView* gridView = dynamic_cast( view ); if ( gridView ) diff --git a/ApplicationLibCode/Commands/SeismicCommands/RicNewSeismicViewFeature.cpp b/ApplicationLibCode/Commands/SeismicCommands/RicNewSeismicViewFeature.cpp index c0d21855dc..f8158a2e69 100644 --- a/ApplicationLibCode/Commands/SeismicCommands/RicNewSeismicViewFeature.cpp +++ b/ApplicationLibCode/Commands/SeismicCommands/RicNewSeismicViewFeature.cpp @@ -85,8 +85,7 @@ RimSeismicView* RicNewSeismicViewFeature::createInitialViewIfNeeded( RimSeismicD { auto proj = RimProject::current(); - std::vector views = proj->allViews(); - if ( !views.empty() ) return nullptr; + if ( !proj->allViews().empty() ) return nullptr; return createSeismicView( seisData ); } diff --git a/ApplicationLibCode/Commands/ViewLink/RicLinkVisibleViewsFeature.cpp b/ApplicationLibCode/Commands/ViewLink/RicLinkVisibleViewsFeature.cpp index d6295c11c2..cde23500b5 100644 --- a/ApplicationLibCode/Commands/ViewLink/RicLinkVisibleViewsFeature.cpp +++ b/ApplicationLibCode/Commands/ViewLink/RicLinkVisibleViewsFeature.cpp @@ -85,9 +85,7 @@ std::vector RicLinkVisibleViewsFeature::findLinkableVisibleViews() RimProject* proj = RimProject::current(); std::vector views; - - std::vector candidates = proj->allVisibleViews(); - for ( auto gridView : candidates ) + for ( auto gridView : proj->allVisibleViews() ) { if ( gridView && !gridView->assosiatedViewLinker() ) views.push_back( gridView ); } diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp index 2b06de3325..17cbcd59a2 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp @@ -316,8 +316,7 @@ void RimFractureTemplateCollection::onChildDeleted( caf::PdmChildArrayFieldHandl proj->scheduleCreateDisplayModelAndRedrawAllViews(); } - std::vector views = proj->allVisibleViews(); - for ( Rim3dView* visibleView : views ) + for ( Rim3dView* visibleView : proj->allVisibleViews() ) { if ( dynamic_cast( visibleView ) ) { diff --git a/ApplicationLibCode/ProjectDataModel/Polygons/RimPolygonCollection.cpp b/ApplicationLibCode/ProjectDataModel/Polygons/RimPolygonCollection.cpp index 96c30a8218..6298db2e68 100644 --- a/ApplicationLibCode/ProjectDataModel/Polygons/RimPolygonCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Polygons/RimPolygonCollection.cpp @@ -189,8 +189,7 @@ void RimPolygonCollection::updateViewTreeItems() RimProject* proj = RimProject::current(); // Make sure the tree items are synchronized - std::vector views = proj->allViews(); - for ( auto view : views ) + for ( auto view : proj->allViews() ) { view->updateViewTreeItems( RiaDefines::ItemIn3dView::POLYGON ); } diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp b/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp index 00ee9e06a9..584c719847 100644 --- a/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp +++ b/ApplicationLibCode/ProjectDataModel/Rim3dView.cpp @@ -197,8 +197,7 @@ Rim3dView::~Rim3dView() if ( auto proj = RimProject::current() ) { - std::vector allViews = proj->allViews(); - for ( auto v : allViews ) + for ( auto v : proj->allViews() ) { if ( v->activeComparisonView() == this ) { @@ -589,10 +588,8 @@ std::vector Rim3dView::validComparisonViews() const { auto isIntersectionView = []( const Rim3dView* view ) { return dynamic_cast( view ) != nullptr; }; - std::vector views = RimProject::current()->allViews(); - std::vector validComparisonViews; - for ( auto view : views ) + for ( auto view : RimProject::current()->allViews() ) { if ( dynamic_cast( view ) ) continue; diff --git a/ApplicationLibCode/ProjectDataModel/RimProject.cpp b/ApplicationLibCode/ProjectDataModel/RimProject.cpp index 0656f7f33f..ab1945d156 100644 --- a/ApplicationLibCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimProject.cpp @@ -514,8 +514,7 @@ void RimProject::assignCaseIdToSummaryCase( RimSummaryCase* summaryCase ) { if ( summaryCase ) { - std::vector summaryCases = allSummaryCases(); - for ( RimSummaryCase* s : summaryCases ) + for ( RimSummaryCase* s : allSummaryCases() ) { m_nextValidSummaryCaseId = std::max( m_nextValidSummaryCaseId, s->caseId() + 1 ); } @@ -531,8 +530,7 @@ void RimProject::assignIdToEnsemble( RimSummaryCaseCollection* summaryCaseCollec { if ( summaryCaseCollection ) { - std::vector summaryGroups = RimProject::summaryGroups(); - for ( RimSummaryCaseCollection* s : summaryGroups ) + for ( RimSummaryCaseCollection* s : RimProject::summaryGroups() ) { m_nextValidEnsembleId = std::max( m_nextValidEnsembleId, s->ensembleId() + 1 ); } @@ -745,13 +743,11 @@ std::vector RimProject::allNotLinkedViews() const std::vector views; - std::vector cases = allGridCases(); - for ( RimCase* rimCase : cases ) + for ( RimCase* rimCase : allGridCases() ) { if ( !rimCase ) continue; - std::vector caseViews = rimCase->views(); - for ( Rim3dView* caseView : caseViews ) + for ( Rim3dView* caseView : rimCase->views() ) { RimGridView* gridView = dynamic_cast( caseView ); @@ -782,13 +778,11 @@ std::vector RimProject::allViews() const { std::vector views; - std::vector cases = allGridCases(); - for ( RimCase* rimCase : cases ) + for ( RimCase* rimCase : allGridCases() ) { if ( !rimCase ) continue; - std::vector caseViews = rimCase->views(); - for ( Rim3dView* view : caseViews ) + for ( Rim3dView* view : rimCase->views() ) { if ( view ) { @@ -817,14 +811,11 @@ std::vector RimProject::allViews() const std::vector RimProject::allVisibleViews() const { std::vector views; - - std::vector cases = allGridCases(); - for ( RimCase* rimCase : cases ) + for ( RimCase* rimCase : allGridCases() ) { if ( !rimCase ) continue; - std::vector caseViews = rimCase->views(); - for ( Rim3dView* view : caseViews ) + for ( Rim3dView* view : rimCase->views() ) { if ( view && view->viewer() ) { @@ -842,8 +833,7 @@ std::vector RimProject::allVisibleViews() const std::vector RimProject::allVisibleGridViews() const { std::vector views; - std::vector visibleViews = allVisibleViews(); - for ( Rim3dView* view : visibleViews ) + for ( Rim3dView* view : allVisibleViews() ) { RimGridView* gridView = dynamic_cast( view ); if ( gridView ) views.push_back( gridView ); @@ -857,12 +847,10 @@ std::vector RimProject::allVisibleGridViews() const //-------------------------------------------------------------------------------------------------- void RimProject::scheduleCreateDisplayModelAndRedrawAllViews() { - std::vector cases = allGridCases(); - for ( RimCase* rimCase : cases ) + for ( RimCase* rimCase : allGridCases() ) { if ( !rimCase ) continue; - std::vector views = rimCase->views(); - for ( Rim3dView* view : views ) + for ( Rim3dView* view : rimCase->views() ) { view->scheduleCreateDisplayModelAndRedraw(); } @@ -913,11 +901,8 @@ const RimOilField* RimProject::activeOilField() const //-------------------------------------------------------------------------------------------------- void RimProject::computeUtmAreaOfInterest() { - std::vector cases = allGridCases(); - cvf::BoundingBox projectBB; - - for ( RimCase* rimCase : cases ) + for ( RimCase* rimCase : allGridCases() ) { RimEclipseCase* eclipseCase = dynamic_cast( rimCase ); if ( eclipseCase && eclipseCase->eclipseCaseData() ) @@ -1173,8 +1158,7 @@ std::vector RimProject::textAnnotations() const } // 'Local' text annotations - std::vector visibleViews = allVisibleGridViews(); - for ( const auto& view : visibleViews ) + for ( const auto& view : allVisibleGridViews() ) { std::vector annotationColls = view->descendantsIncludingThisOfType(); @@ -1314,11 +1298,9 @@ std::vector RimProject::allValveTemplates() const //-------------------------------------------------------------------------------------------------- caf::AppEnum RimProject::commonUnitSystemForAllCases() const { - std::vector rimCases = allGridCases(); - RiaDefines::EclipseUnitSystem commonUnitSystem = RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN; - for ( const auto& c : rimCases ) + for ( const auto& c : allGridCases() ) { auto eclipseCase = dynamic_cast( c ); if ( eclipseCase && eclipseCase->eclipseCaseData() ) @@ -1370,8 +1352,7 @@ std::vector RimProject::allFilePaths() const //-------------------------------------------------------------------------------------------------- void RimProject::reloadCompletionTypeResultsForEclipseCase( RimEclipseCase* eclipseCase ) { - std::vector views = eclipseCase->views(); - for ( Rim3dView* view : views ) + for ( Rim3dView* view : eclipseCase->views() ) { view->scheduleCreateDisplayModelAndRedraw(); } @@ -1537,8 +1518,7 @@ void RimProject::transferPathsToGlobalPathList() { RiaVariableMapper variableMapper( m_globalPathList() ); - std::vector filePaths = allFilePaths(); - for ( caf::FilePath* filePath : filePaths ) + for ( caf::FilePath* filePath : allFilePaths() ) { QString path = filePath->path(); if ( !path.isEmpty() ) @@ -1602,8 +1582,7 @@ void RimProject::distributePathsFromGlobalPathList() { RiaVariableMapper pathListMapper( m_globalPathList() ); - std::vector filePaths = allFilePaths(); - for ( caf::FilePath* filePath : filePaths ) + for ( caf::FilePath* filePath : allFilePaths() ) { QString pathIdCandidate = filePath->path().trimmed(); QStringList pathIdComponents = pathIdCandidate.split( RiaVariableMapper::variableToken() ); diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp index f577a3746b..c26cc39498 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimSurfaceCollection.cpp @@ -298,8 +298,7 @@ void RimSurfaceCollection::updateViews( const std::vector& surfsToR RimProject* proj = RimProject::current(); // Make sure the tree items are synchronized - std::vector views = proj->allViews(); - for ( auto view : views ) + for ( auto view : proj->allViews() ) { view->updateViewTreeItems( RiaDefines::ItemIn3dView::SURFACE ); diff --git a/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp b/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp index f44f9e195c..e71596e7f7 100644 --- a/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp +++ b/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp @@ -325,12 +325,10 @@ void RiuSelectionChangedHandler::scheduleUpdateForAllVisibleViews() const RimProject* proj = RimProject::current(); if ( proj ) { - std::vector visibleViews = proj->allVisibleViews(); - - for ( size_t i = 0; i < visibleViews.size(); i++ ) + for ( Rim3dView* visibleView : proj->allVisibleViews() ) { - visibleViews[i]->createHighlightAndGridBoxDisplayModelAndRedraw(); - visibleViews[i]->createMeasurementDisplayModelAndRedraw(); + visibleView->createHighlightAndGridBoxDisplayModelAndRedraw(); + visibleView->createMeasurementDisplayModelAndRedraw(); } } }