From fc2106edb09dc82d15013188fdd70ab49dc07651 Mon Sep 17 00:00:00 2001 From: magnesj <1793152+magnesj@users.noreply.github.com> Date: Mon, 2 Sep 2024 11:35:00 +0000 Subject: [PATCH] Fixes by clang-tidy --- .../Application/Tools/RiaFilePathTools.cpp | 4 +-- .../RicExportSelectedWellPathsFeature.cpp | 2 +- .../Commands/RicGridCalculatorDialog.cpp | 4 ++- .../RicSummaryCurveCalculatorDialog.cpp | 5 ++-- .../RicSummaryPlotEditorWidgetCreator.cpp | 3 +- .../RifCaseRealizationParametersReader.cpp | 3 +- .../FileInterface/RifColumnBasedUserData.cpp | 3 +- .../FileInterface/RifCsvUserData.cpp | 3 +- .../RifKeywordVectorUserData.cpp | 3 +- .../RifRevealCsvSectionSummaryReader.cpp | 3 +- .../RifStimPlanCsvSummaryReader.cpp | 3 +- .../Completions/RimFishbones.cpp | 3 +- .../Flow/RimWellAllocationPlot.cpp | 16 +++++----- .../ProjectDataModel/Flow/RimWellPltPlot.cpp | 5 ++-- .../Rim3dOverlayInfoConfig.cpp | 5 ++-- .../RimGridTimeHistoryCurve.cpp | 30 +++++++++---------- .../ProjectDataModel/RimProject.cpp | 3 +- .../RimUserDefinedCalculation.cpp | 3 +- .../StimPlanModel/RimStimPlanModel.cpp | 3 +- .../Summary/RimDerivedSummaryCase.cpp | 3 +- .../Summary/RimEnsembleCurveSet.cpp | 7 +++-- .../Summary/RimSummaryCaseMainCollection.cpp | 5 ++-- .../Surfaces/RimFileSurface.cpp | 3 +- .../WellLog/RimEnsembleWellLogCurveSet.cpp | 3 +- .../WellLog/RimWellLogTrack.cpp | 6 ++-- .../RigEclipseCrossPlotDataExtractor.cpp | 3 +- .../RigFlowDiagSolverInterface.cpp | 22 +++++++------- .../UserInterface/RiuGridCrossQwtPlot.cpp | 3 +- .../RiuSelectionChangedHandler.cpp | 29 +++++++++--------- .../UserInterface/RiuSummaryQwtPlot.cpp | 3 +- .../RiuSummaryVectorSelectionDialog.cpp | 3 +- ...RiuSummaryVectorSelectionWidgetCreator.cpp | 3 +- .../UserInterface/RiuViewer.cpp | 3 +- 33 files changed, 115 insertions(+), 85 deletions(-) diff --git a/ApplicationLibCode/Application/Tools/RiaFilePathTools.cpp b/ApplicationLibCode/Application/Tools/RiaFilePathTools.cpp index 9cb625acd1..aa3d25796b 100644 --- a/ApplicationLibCode/Application/Tools/RiaFilePathTools.cpp +++ b/ApplicationLibCode/Application/Tools/RiaFilePathTools.cpp @@ -259,7 +259,7 @@ void addToPathTree( PathNode* node, QStringList pathComponents, const QString& f } } - node->children.push_back( std::unique_ptr( new PathNode( pathComponent, node ) ) ); + node->children.push_back( std::make_unique( pathComponent, node ) ); addToPathTree( node->children.back().get(), pathComponents, fileName ); } else @@ -335,7 +335,7 @@ std::map RiaFilePathTools::keyPathComponentsForEachFilePat allComponents[fileName] = pathComponentsForFile; } - auto topNode = std::unique_ptr( new PathNode( "", nullptr ) ); + auto topNode = std::make_unique( "", nullptr ); for ( auto keyComponentsPair : allComponents ) { diff --git a/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.cpp b/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.cpp index 9c692e92fc..452eb0d040 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicExportSelectedWellPathsFeature.cpp @@ -168,7 +168,7 @@ QFilePtr RicExportSelectedWellPathsFeature::openFileForExport( const QString& fo //-------------------------------------------------------------------------------------------------- QTextStreamPtr RicExportSelectedWellPathsFeature::createOutputFileStream( QFile& file ) { - auto stream = QTextStreamPtr( new QTextStream( &file ) ); + auto stream = std::make_shared( &file ); stream->setRealNumberNotation( QTextStream::FixedNotation ); stream->setRealNumberPrecision( 2 ); return stream; diff --git a/ApplicationLibCode/Commands/RicGridCalculatorDialog.cpp b/ApplicationLibCode/Commands/RicGridCalculatorDialog.cpp index 3a5e53a941..0ec9ab3c48 100644 --- a/ApplicationLibCode/Commands/RicGridCalculatorDialog.cpp +++ b/ApplicationLibCode/Commands/RicGridCalculatorDialog.cpp @@ -18,6 +18,8 @@ #include "RicGridCalculatorDialog.h" +#include + #include "RicCalculatorWidgetCreator.h" #include "RicGridCalculatorUi.h" @@ -75,7 +77,7 @@ QWidget* RicGridCalculatorDialog::getCalculatorWidget() { if ( !m_calcEditor ) { - m_calcEditor = std::unique_ptr( new RicCalculatorWidgetCreator( std::make_unique() ) ); + m_calcEditor = std::make_unique( std::make_unique() ); } return m_calcEditor->getOrCreateWidget( this ); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp index a3cf6e491f..ad99dafa5c 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryCurveCalculatorDialog.cpp @@ -18,6 +18,8 @@ #include "RicSummaryCurveCalculatorDialog.h" +#include + #include "RicCalculatorWidgetCreator.h" #include "RicSummaryCurveCalculatorUi.h" @@ -75,8 +77,7 @@ QWidget* RicSummaryCurveCalculatorDialog::getCalculatorWidget() { if ( !m_summaryCalcEditor ) { - m_summaryCalcEditor = - std::unique_ptr( new RicCalculatorWidgetCreator( std::make_unique() ) ); + m_summaryCalcEditor = std::make_unique( std::make_unique() ); } return m_summaryCalcEditor->getOrCreateWidget( this ); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorWidgetCreator.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorWidgetCreator.cpp index ecb14439c4..602c66c27b 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorWidgetCreator.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotEditorWidgetCreator.cpp @@ -38,6 +38,7 @@ #include #include #include +#include //-------------------------------------------------------------------------------------------------- /// @@ -46,7 +47,7 @@ RicSummaryPlotEditorWidgetCreator::RicSummaryPlotEditorWidgetCreator( QWidget* p { m_parentWidget = parent; - m_summaryCurveCreator.reset( new RicSummaryPlotEditorUi() ); + m_summaryCurveCreator = std::make_unique(); setPdmObject( m_summaryCurveCreator.get() ); } diff --git a/ApplicationLibCode/FileInterface/RifCaseRealizationParametersReader.cpp b/ApplicationLibCode/FileInterface/RifCaseRealizationParametersReader.cpp index afaf99d583..979b6301b0 100644 --- a/ApplicationLibCode/FileInterface/RifCaseRealizationParametersReader.cpp +++ b/ApplicationLibCode/FileInterface/RifCaseRealizationParametersReader.cpp @@ -27,13 +27,14 @@ #include #include +#include //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- RifCaseRealizationReader::RifCaseRealizationReader( const QString& fileName ) { - m_parameters = std::shared_ptr( new RigCaseRealizationParameters() ); + m_parameters = std::make_shared(); m_fileName = fileName; } diff --git a/ApplicationLibCode/FileInterface/RifColumnBasedUserData.cpp b/ApplicationLibCode/FileInterface/RifColumnBasedUserData.cpp index dbf3bca8ca..e3eabc5405 100644 --- a/ApplicationLibCode/FileInterface/RifColumnBasedUserData.cpp +++ b/ApplicationLibCode/FileInterface/RifColumnBasedUserData.cpp @@ -31,6 +31,7 @@ #include #include #include +#include //-------------------------------------------------------------------------------------------------- /// @@ -56,7 +57,7 @@ bool RifColumnBasedUserData::parse( const QString& data, QString* errorText ) m_mapFromAddressToTimeStepIndex.clear(); m_mapFromAddressToResultIndex.clear(); - m_parser = std::unique_ptr( new RifColumnBasedUserDataParser( data, errorText ) ); + m_parser = std::make_unique( data, errorText ); if ( !m_parser ) { RiaLogging::error( QString( "Failed to parse file" ) ); diff --git a/ApplicationLibCode/FileInterface/RifCsvUserData.cpp b/ApplicationLibCode/FileInterface/RifCsvUserData.cpp index 3559a23682..d60fe4bb77 100644 --- a/ApplicationLibCode/FileInterface/RifCsvUserData.cpp +++ b/ApplicationLibCode/FileInterface/RifCsvUserData.cpp @@ -31,6 +31,7 @@ #include #include #include +#include //-------------------------------------------------------------------------------------------------- /// @@ -54,7 +55,7 @@ bool RifCsvUserData::parse( const QString& fileName, const RifAsciiDataParseOpti m_allResultAddresses.clear(); m_mapFromAddressToResultIndex.clear(); - m_parser = std::unique_ptr( new RifCsvUserDataFileParser( fileName, errorText ) ); + m_parser = std::make_unique( fileName, errorText ); if ( !m_parser->parse( parseOptions ) ) { RiaLogging::error( QString( "Failed to parse file" ) ); diff --git a/ApplicationLibCode/FileInterface/RifKeywordVectorUserData.cpp b/ApplicationLibCode/FileInterface/RifKeywordVectorUserData.cpp index e1b7d9de93..ef5df2e43a 100644 --- a/ApplicationLibCode/FileInterface/RifKeywordVectorUserData.cpp +++ b/ApplicationLibCode/FileInterface/RifKeywordVectorUserData.cpp @@ -31,6 +31,7 @@ #include #include #include +#include //-------------------------------------------------------------------------------------------------- /// @@ -54,7 +55,7 @@ bool RifKeywordVectorUserData::parse( const QString& data, const QString& custom m_allResultAddresses.clear(); m_timeSteps.clear(); - m_parser = std::unique_ptr( new RifKeywordVectorParser( data ) ); + m_parser = std::make_unique( data ); if ( !m_parser ) { RiaLogging::error( QString( "Failed to parse file" ) ); diff --git a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp index aead5bff80..810ecfb2a8 100644 --- a/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp +++ b/ApplicationLibCode/FileInterface/RifRevealCsvSectionSummaryReader.cpp @@ -34,6 +34,7 @@ #include #include #include +#include //-------------------------------------------------------------------------------------------------- /// @@ -68,7 +69,7 @@ bool RifRevealCsvSectionSummaryReader::parse( const QString& parseOptions.timeSeriesColumnName = "Date"; parseOptions.defaultCategory = defaultCategory; - m_parser = std::unique_ptr( new RifCsvUserDataPastedTextParser( text, errorText ) ); + m_parser = std::make_unique( text, errorText ); std::map> unitMapping = { { "Sm3", { "SM3", 1.0 } }, { "Sm3/day", { "SM3/DAY", 1.0 } }, { "Sm3/day/bar", { "SM3/DAY/BAR", 1.0 } }, diff --git a/ApplicationLibCode/FileInterface/RifStimPlanCsvSummaryReader.cpp b/ApplicationLibCode/FileInterface/RifStimPlanCsvSummaryReader.cpp index c16989036f..474829495b 100644 --- a/ApplicationLibCode/FileInterface/RifStimPlanCsvSummaryReader.cpp +++ b/ApplicationLibCode/FileInterface/RifStimPlanCsvSummaryReader.cpp @@ -33,6 +33,7 @@ #include #include #include +#include //-------------------------------------------------------------------------------------------------- /// @@ -76,7 +77,7 @@ std::pair RifStimPlanCsvSummaryReader::parse( const QString& file parseOptions.timeSeriesColumnName = "Time"; parseOptions.startDateTime = startDateTime; - m_parser = std::unique_ptr( new RifCsvUserDataPastedTextParser( fileContents, errorText ) ); + m_parser = std::make_unique( fileContents, errorText ); if ( !m_parser->parse( parseOptions ) ) { diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.cpp index 2007363447..5e7bd42c9b 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimFishbones.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include CAF_PDM_SOURCE_INIT( RimFishbones, "FishbonesMultipleSubs" ); @@ -126,7 +127,7 @@ RimFishbones::RimFishbones() m_pipeProperties = new RimFishbonesPipeProperties; - m_rigFishbonesGeometry = std::unique_ptr( new RigFisbonesGeometry( this ) ); + m_rigFishbonesGeometry = std::make_unique( this ); setDeletable( true ); } diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp index b81e7766e6..a35e8c677e 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellAllocationPlot.cpp @@ -18,6 +18,8 @@ #include "RimWellAllocationPlot.h" +#include + #include "RiaNumericalTools.h" #include "RiaPlotDefines.h" #include "RiaPreferences.h" @@ -332,18 +334,18 @@ void RimWellAllocationPlot::updateFromWell() RigEclCellIndexCalculator cellIdxCalc( m_case->eclipseCaseData()->mainGrid(), m_case->eclipseCaseData()->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL ), nullptr ); - wfCalculator.reset( new RigAccWellFlowCalculator( pipeBranchesCLCoords, - pipeBranchesCellIds, - tracerFractionCellValues, - cellIdxCalc, - smallContributionThreshold, - isProducer ) ); + wfCalculator = std::make_unique( pipeBranchesCLCoords, + pipeBranchesCellIds, + tracerFractionCellValues, + cellIdxCalc, + smallContributionThreshold, + isProducer ); } else { if ( !pipeBranchesCLCoords.empty() ) { - wfCalculator.reset( new RigAccWellFlowCalculator( pipeBranchesCLCoords, pipeBranchesCellIds, smallContributionThreshold ) ); + wfCalculator = std::make_unique( pipeBranchesCLCoords, pipeBranchesCellIds, smallContributionThreshold ); } } diff --git a/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp b/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp index 81aba6b70e..089c1fdf8d 100644 --- a/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/Flow/RimWellPltPlot.cpp @@ -67,6 +67,7 @@ #include #include +#include #include CAF_PDM_SOURCE_INIT( RimWellPltPlot, "WellPltPlot" ); @@ -507,11 +508,11 @@ void RimWellPltPlot::syncCurvesFromUiSelection() if ( sourceDef.sourceType() == RifDataSourceForRftPlt::SourceType::RFT_SIM_WELL_DATA ) { - resultPointCalc.reset( new RigRftResultPointCalculator( m_wellPathName, rimEclipseResultCase, timeStep ) ); + resultPointCalc = std::make_unique( m_wellPathName, rimEclipseResultCase, timeStep ); } else if ( sourceDef.sourceType() == RifDataSourceForRftPlt::SourceType::GRID_MODEL_CELL_DATA ) { - resultPointCalc.reset( new RigSimWellResultPointCalculator( m_wellPathName, rimEclipseResultCase, timeStep ) ); + resultPointCalc = std::make_unique( m_wellPathName, rimEclipseResultCase, timeStep ); } RiaDefines::EclipseUnitSystem unitSet = RiaDefines::EclipseUnitSystem::UNITS_UNKNOWN; diff --git a/ApplicationLibCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp b/ApplicationLibCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp index 86f6ef7e2e..7a3c08ed59 100644 --- a/ApplicationLibCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp +++ b/ApplicationLibCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp @@ -66,6 +66,7 @@ #include "caf.h" #include +#include CAF_PDM_SOURCE_INIT( Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig" ); //-------------------------------------------------------------------------------------------------- @@ -98,7 +99,7 @@ Rim3dOverlayInfoConfig::Rim3dOverlayInfoConfig() RimHistogramCalculator::StatisticsCellRangeType::VISIBLE_CELLS; CAF_PDM_InitField( &m_statisticsCellRange, "StatisticsCellRange", defaultCellRange, "Statistics Cell Range" ); - m_histogramCalculator.reset( new RimHistogramCalculator ); + m_histogramCalculator = std::make_unique(); } //-------------------------------------------------------------------------------------------------- @@ -240,7 +241,7 @@ RicGridStatisticsDialog* Rim3dOverlayInfoConfig::getOrCreateGridStatisticsDialog { if ( !m_gridStatisticsDialog ) { - m_gridStatisticsDialog.reset( new RicGridStatisticsDialog( nullptr ) ); + m_gridStatisticsDialog = std::make_unique( nullptr ); } CVF_ASSERT( m_gridStatisticsDialog ); return m_gridStatisticsDialog.get(); diff --git a/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp b/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp index 030f63e3ec..34d25a2358 100644 --- a/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp @@ -18,6 +18,8 @@ #include "RimGridTimeHistoryCurve.h" +#include + #include "RigCaseCellResultsData.h" #include "RigEclipseCaseData.h" #include "RigFemResultAddress.h" @@ -714,24 +716,22 @@ std::unique_ptr RimGridTimeHistoryCurve::femTim intersectionTriangle[1] = cvf::Vec3f( geoMechTopItem->m_intersectionTriangle_1() ); intersectionTriangle[2] = cvf::Vec3f( geoMechTopItem->m_intersectionTriangle_2() ); - timeHistResultAccessor = std::unique_ptr( - new RiuFemTimeHistoryResultAccessor( geoMechTopItem->geoMechCase()->geoMechData(), - m_geoMechResultDefinition()->resultAddress(), - geoMechTopItem->m_gridIndex, - static_cast( geoMechTopItem->m_cellIndex ), - geoMechTopItem->m_elementFace, - geoMechTopItem->m_localIntersectionPoint, - intersectionTriangle ) ); + timeHistResultAccessor = std::make_unique( geoMechTopItem->geoMechCase()->geoMechData(), + m_geoMechResultDefinition()->resultAddress(), + geoMechTopItem->m_gridIndex, + static_cast( geoMechTopItem->m_cellIndex ), + geoMechTopItem->m_elementFace, + geoMechTopItem->m_localIntersectionPoint, + intersectionTriangle ); } else { - timeHistResultAccessor = std::unique_ptr( - new RiuFemTimeHistoryResultAccessor( geoMechTopItem->geoMechCase()->geoMechData(), - m_geoMechResultDefinition()->resultAddress(), - geoMechTopItem->m_gridIndex, - static_cast( geoMechTopItem->m_cellIndex ), - geoMechTopItem->m_elementFace, - geoMechTopItem->m_localIntersectionPoint ) ); + timeHistResultAccessor = std::make_unique( geoMechTopItem->geoMechCase()->geoMechData(), + m_geoMechResultDefinition()->resultAddress(), + geoMechTopItem->m_gridIndex, + static_cast( geoMechTopItem->m_cellIndex ), + geoMechTopItem->m_elementFace, + geoMechTopItem->m_localIntersectionPoint ); } } diff --git a/ApplicationLibCode/ProjectDataModel/RimProject.cpp b/ApplicationLibCode/ProjectDataModel/RimProject.cpp index 30d25a2dd8..1e9a193247 100644 --- a/ApplicationLibCode/ProjectDataModel/RimProject.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimProject.cpp @@ -129,6 +129,7 @@ #include #include +#include CAF_PDM_SOURCE_INIT( RimProject, "ResInsightProject" ); //-------------------------------------------------------------------------------------------------- @@ -1545,7 +1546,7 @@ QString RimProject::updatedFilePathFromPathId( QString filePath, RiaVariableMapp if ( pathListMapper == nullptr ) { - internalMapper.reset( new RiaVariableMapper( m_globalPathList ) ); + internalMapper = std::make_unique( m_globalPathList ); pathListMapper = internalMapper.get(); } diff --git a/ApplicationLibCode/ProjectDataModel/RimUserDefinedCalculation.cpp b/ApplicationLibCode/ProjectDataModel/RimUserDefinedCalculation.cpp index cdfdb98b86..9a581ed373 100644 --- a/ApplicationLibCode/ProjectDataModel/RimUserDefinedCalculation.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimUserDefinedCalculation.cpp @@ -35,6 +35,7 @@ #include "cafPdmUiTextEditor.h" #include +#include CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimUserDefinedCalculation, "RimUserDefinedCalculation" ); @@ -77,7 +78,7 @@ RimUserDefinedCalculation::RimUserDefinedCalculation() CAF_PDM_InitField( &m_id, "Id", -1, "Id" ); m_id.uiCapability()->setUiHidden( true ); - m_exprContextMenuMgr = std::unique_ptr( new RiuExpressionContextMenuManager() ); + m_exprContextMenuMgr = std::make_unique(); m_isDirty = false; } diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp index 7fc1ba1220..8e4c7b2303 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModel.cpp @@ -78,6 +78,7 @@ #include #include +#include CAF_PDM_SOURCE_INIT( RimStimPlanModel, "StimPlanModel" ); @@ -240,7 +241,7 @@ RimStimPlanModel::RimStimPlanModel() CAF_PDM_InitScriptableFieldNoDefault( &m_perforationInterval, "PerforationInterval", "Perforation Interval" ); - m_calculator = std::shared_ptr( new RimStimPlanModelCalculator ); + m_calculator = std::make_shared(); m_calculator->setStimPlanModel( this ); setDeletable( true ); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimDerivedSummaryCase.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimDerivedSummaryCase.cpp index 63cfb84b44..84c28cea23 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimDerivedSummaryCase.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimDerivedSummaryCase.cpp @@ -33,6 +33,7 @@ #include #include +#include namespace caf { @@ -297,7 +298,7 @@ void RimDerivedSummaryCase::createSummaryReaderInterface() summaryCase1Reader2 = m_summaryCase2->summaryReader(); } - m_reader.reset( new RifDerivedEnsembleReader( this, summaryCase1Reader1, summaryCase1Reader2 ) ); + m_reader = std::make_unique( this, summaryCase1Reader1, summaryCase1Reader2 ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 0b24911b66..43b11fb23e 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -79,6 +79,7 @@ #include "cafTitledOverlayFrame.h" #include +#include #include //-------------------------------------------------------------------------------------------------- @@ -254,8 +255,8 @@ RimEnsembleCurveSet::RimEnsembleCurveSet() m_summaryAddressNameTools = new RimSummaryCurveAutoName; - m_ensembleStatCaseY.reset( new RimEnsembleStatisticsCase() ); - m_ensembleStatCaseXY.reset( new RimEnsembleCrossPlotStatisticsCase() ); + m_ensembleStatCaseY = std::make_unique(); + m_ensembleStatCaseXY = std::make_unique(); m_disableStatisticCurves = false; m_isCurveSetFiltered = false; @@ -1636,7 +1637,7 @@ RiaSummaryCurveDefinitionAnalyser* RimEnsembleCurveSet::getOrCreateSelectedCurve { if ( !m_analyserOfSelectedCurveDefs ) { - m_analyserOfSelectedCurveDefs = std::unique_ptr( new RiaSummaryCurveDefinitionAnalyser ); + m_analyserOfSelectedCurveDefs = std::make_unique(); } m_analyserOfSelectedCurveDefs->setCurveDefinitions( curveDefinitions() ); return m_analyserOfSelectedCurveDefs.get(); diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseMainCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseMainCollection.cpp index 6de76eac6e..edeecd0f0b 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseMainCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseMainCollection.cpp @@ -50,6 +50,7 @@ #include #include +#include CAF_PDM_SOURCE_INIT( RimSummaryCaseMainCollection, "SummaryCaseCollection" ); @@ -78,7 +79,7 @@ void addCaseRealizationParametersIfFound( RimSummaryCase& sumCase, const QString } else { - parameters = std::shared_ptr( new RigCaseRealizationParameters() ); + parameters = std::make_shared(); } if ( dynamic_cast( &sumCase ) == nullptr ) @@ -548,7 +549,7 @@ std::vector if ( showProgress ) { - progress.reset( new caf::ProgressInfo( summaryHeaderFileInfos.size(), "Creating summary cases" ) ); + progress = std::make_unique( summaryHeaderFileInfos.size(), "Creating summary cases" ); } for ( const RifSummaryCaseFileResultInfo& fileInfo : summaryHeaderFileInfos ) diff --git a/ApplicationLibCode/ProjectDataModel/Surfaces/RimFileSurface.cpp b/ApplicationLibCode/ProjectDataModel/Surfaces/RimFileSurface.cpp index 81e6c9a30a..6cdce72d8e 100644 --- a/ApplicationLibCode/ProjectDataModel/Surfaces/RimFileSurface.cpp +++ b/ApplicationLibCode/ProjectDataModel/Surfaces/RimFileSurface.cpp @@ -30,6 +30,7 @@ #include "cafPdmObjectScriptingCapability.h" #include +#include CAF_PDM_SOURCE_INIT( RimFileSurface, "Surface", "FileSurface" ); @@ -170,7 +171,7 @@ bool RimFileSurface::loadDataFromFile() } else if ( filePath.endsWith( "ts", Qt::CaseInsensitive ) ) { - m_gocadData.reset( new RigGocadData ); + m_gocadData = std::make_unique(); RifSurfaceImporter::readGocadFile( filePath, m_gocadData.get() ); diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp index 3edfe71131..dcde97ec4e 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimEnsembleWellLogCurveSet.cpp @@ -68,6 +68,7 @@ #include "qwt_symbol.h" #include +#include #include //-------------------------------------------------------------------------------------------------- @@ -143,7 +144,7 @@ RimEnsembleWellLogCurveSet::RimEnsembleWellLogCurveSet() m_qwtPlotCurveForLegendText = new QwtPlotCurve; m_qwtPlotCurveForLegendText->setLegendAttribute( QwtPlotCurve::LegendShowSymbol, true ); - m_ensembleWellLogStatistics.reset( new RimEnsembleWellLogStatistics ); + m_ensembleWellLogStatistics = std::make_unique(); m_disableStatisticCurves = false; m_isCurveSetFiltered = false; diff --git a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp index 6b60209760..2dc922f73d 100644 --- a/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellLog/RimWellLogTrack.cpp @@ -102,6 +102,7 @@ #include #include +#include #include #define RI_LOGPLOTTRACK_MINX_DEFAULT -10.0 @@ -2842,7 +2843,7 @@ void RimWellLogTrack::updateRegionAnnotationsOnPlot() if ( m_annotationTool == nullptr ) { - m_annotationTool = std::unique_ptr( new RiuPlotAnnotationTool() ); + m_annotationTool = std::make_unique(); } if ( m_regionAnnotationType == RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS ) @@ -3280,8 +3281,7 @@ void RimWellLogTrack::updateWellPathAttributesOnPlot() if ( wellPathAttributeSource()->wellPathGeometry() && ( m_showWellPathAttributes || m_showWellPathCompletions ) ) { - m_wellPathAttributePlotObjects.push_back( - std::unique_ptr( new RiuWellPathComponentPlotItem( wellPathAttributeSource() ) ) ); + m_wellPathAttributePlotObjects.push_back( std::make_unique( wellPathAttributeSource() ) ); } if ( m_showWellPathAttributes ) diff --git a/ApplicationLibCode/ReservoirDataModel/RigEclipseCrossPlotDataExtractor.cpp b/ApplicationLibCode/ReservoirDataModel/RigEclipseCrossPlotDataExtractor.cpp index 4dd84b6125..67a1fb691c 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigEclipseCrossPlotDataExtractor.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigEclipseCrossPlotDataExtractor.cpp @@ -110,7 +110,8 @@ RigEclipseCrossPlotResult RigEclipseCrossPlotDataExtractor::extract( RigEclipseC if ( catValuesForAllSteps ) { int catIndex = timeStep >= (int)catValuesForAllSteps->size() ? 0 : timeStep; - catAccessor.reset( new RigActiveCellsResultAccessor( mainGrid, &( catValuesForAllSteps->at( catIndex ) ), activeCellInfo ) ); + catAccessor = + std::make_unique( mainGrid, &( catValuesForAllSteps->at( catIndex ) ), activeCellInfo ); } for ( size_t globalCellIdx = 0; globalCellIdx < activeCellInfo->reservoirCellCount(); ++globalCellIdx ) diff --git a/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp b/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp index a246f0f78e..3e21bfa9db 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigFlowDiagSolverInterface.cpp @@ -18,6 +18,8 @@ #include "RigFlowDiagSolverInterface.h" +#include + #include "RiaLogging.h" #include "RifEclipseOutputFileTools.h" @@ -122,12 +124,12 @@ class RigOpmFlowDiagStaticData : public cvf::Object try { - m_eclGraph.reset( new Opm::ECLGraph( Opm::ECLGraph::load( mainGrid, initData ) ) ); + m_eclGraph = std::make_unique( Opm::ECLGraph::load( mainGrid, initData ) ); m_hasUnifiedRestartFile = false; m_poreVolume = m_eclGraph->poreVolume(); - m_eclSaturationFunc.reset( new Opm::ECLSaturationFunc( *m_eclGraph, initData ) ); + m_eclSaturationFunc = std::make_unique( *m_eclGraph, initData ); } catch ( ... ) { @@ -137,7 +139,7 @@ class RigOpmFlowDiagStaticData : public cvf::Object try { - m_eclPvtCurveCollection.reset( new Opm::ECLPVT::ECLPvtCurveCollection( *m_eclGraph, initData ) ); + m_eclPvtCurveCollection = std::make_unique( *m_eclGraph, initData ); } catch ( ... ) { @@ -256,7 +258,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t // Create the Toolbox. - m_opmFlowDiagStaticData->m_fldToolbox.reset( new Opm::FlowDiagnostics::Toolbox{ connGraph } ); + m_opmFlowDiagStaticData->m_fldToolbox = std::make_unique( connGraph ); // Look for unified restart file QStringList m_filesWithSameBaseName; @@ -267,8 +269,8 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t QString firstRestartFileName = RifEclipseOutputFileTools::firstFileNameOfType( m_filesWithSameBaseName, ECL_UNIFIED_RESTART_FILE ); if ( !firstRestartFileName.isEmpty() ) { - m_opmFlowDiagStaticData->m_unifiedRestartData.reset( - new Opm::ECLRestartData( Opm::ECLRestartData( firstRestartFileName.toStdString() ) ) ); + m_opmFlowDiagStaticData->m_unifiedRestartData = + std::make_unique( Opm::ECLRestartData( firstRestartFileName.toStdString() ) ); m_opmFlowDiagStaticData->m_hasUnifiedRestartFile = true; } else @@ -400,8 +402,8 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t injectorCellSets.push_back( CellSet( CellSetID( tracerName ), tIt.second ) ); } - injectorSolution.reset( - new Toolbox::Forward( m_opmFlowDiagStaticData->m_fldToolbox->computeInjectionDiagnostics( injectorCellSets ) ) ); + injectorSolution = + std::make_unique( m_opmFlowDiagStaticData->m_fldToolbox->computeInjectionDiagnostics( injectorCellSets ) ); for ( const CellSetID& tracerId : injectorSolution->fd.startPoints() ) { @@ -434,8 +436,8 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate( size_t prodjCellSets.push_back( CellSet( CellSetID( tracerName ), tIt.second ) ); } - producerSolution.reset( - new Toolbox::Reverse( m_opmFlowDiagStaticData->m_fldToolbox->computeProductionDiagnostics( prodjCellSets ) ) ); + producerSolution = + std::make_unique( m_opmFlowDiagStaticData->m_fldToolbox->computeProductionDiagnostics( prodjCellSets ) ); for ( const CellSetID& tracerId : producerSolution->fd.startPoints() ) { diff --git a/ApplicationLibCode/UserInterface/RiuGridCrossQwtPlot.cpp b/ApplicationLibCode/UserInterface/RiuGridCrossQwtPlot.cpp index e3d993e8b4..6006f91a72 100644 --- a/ApplicationLibCode/UserInterface/RiuGridCrossQwtPlot.cpp +++ b/ApplicationLibCode/UserInterface/RiuGridCrossQwtPlot.cpp @@ -58,6 +58,7 @@ #include #include #include +#include //-------------------------------------------------------------------------------------------------- /// @@ -83,7 +84,7 @@ RiuGridCrossQwtPlot::RiuGridCrossQwtPlot( RimGridCrossPlot* plot, QWidget* paren SIGNAL( plotItemSelected( std::shared_ptr, bool, int ) ), SLOT( onPlotItemSelected( std::shared_ptr, bool, int ) ) ); - m_annotationTool = std::unique_ptr( new RiuPlotAnnotationTool() ); + m_annotationTool = std::make_unique(); m_selectedPointMarker = new QwtPlotMarker; // QwtPlotMarker takes ownership of the symbol, it is deleted in destructor of QwtPlotMarker diff --git a/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp b/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp index e71596e7f7..baa220bac9 100644 --- a/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp +++ b/ApplicationLibCode/UserInterface/RiuSelectionChangedHandler.cpp @@ -58,6 +58,7 @@ #include #include +#include //================================================================================================== // @@ -206,24 +207,22 @@ void RiuSelectionChangedHandler::addResultCurveFromSelectionItem( const RiuGeoMe if ( geomSelectionItem->m_hasIntersectionTriangle ) { - timeHistResultAccessor = std::unique_ptr( - new RiuFemTimeHistoryResultAccessor( geomResDef->geoMechCase()->geoMechData(), - geomResDef->resultAddress(), - geomSelectionItem->m_gridIndex, - static_cast( geomSelectionItem->m_cellIndex ), - geomSelectionItem->m_elementFace, - intersectionPointInDomain, - geomSelectionItem->m_intersectionTriangle ) ); + timeHistResultAccessor = std::make_unique( geomResDef->geoMechCase()->geoMechData(), + geomResDef->resultAddress(), + geomSelectionItem->m_gridIndex, + static_cast( geomSelectionItem->m_cellIndex ), + geomSelectionItem->m_elementFace, + intersectionPointInDomain, + geomSelectionItem->m_intersectionTriangle ); } else { - timeHistResultAccessor = std::unique_ptr( - new RiuFemTimeHistoryResultAccessor( geomResDef->geoMechCase()->geoMechData(), - geomResDef->resultAddress(), - geomSelectionItem->m_gridIndex, - static_cast( geomSelectionItem->m_cellIndex ), - geomSelectionItem->m_elementFace, - intersectionPointInDomain ) ); + timeHistResultAccessor = std::make_unique( geomResDef->geoMechCase()->geoMechData(), + geomResDef->resultAddress(), + geomSelectionItem->m_gridIndex, + static_cast( geomSelectionItem->m_cellIndex ), + geomSelectionItem->m_elementFace, + intersectionPointInDomain ); } QString curveName; diff --git a/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp b/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp index f821b33fac..cf6cec3da7 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryQwtPlot.cpp @@ -67,6 +67,7 @@ #include #include +#include static RimEnsembleCurveInfoTextProvider ensembleCurveInfoTextProvider; @@ -105,7 +106,7 @@ RiuSummaryQwtPlot::RiuSummaryQwtPlot( RimSummaryPlot* plot, QWidget* parent /*= // Do not set internal legends visible, as this will cause a performance hit. m_plotWidget->clearLegend(); - m_annotationTool = std::unique_ptr( new RiuPlotAnnotationTool() ); + m_annotationTool = std::make_unique(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionDialog.cpp b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionDialog.cpp index c18d65dd5c..48bf71bb0d 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionDialog.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionDialog.cpp @@ -30,6 +30,7 @@ #include #include #include +#include //-------------------------------------------------------------------------------------------------- /// @@ -37,7 +38,7 @@ RiuSummaryVectorSelectionDialog::RiuSummaryVectorSelectionDialog( QWidget* parent ) : QDialog( parent, RiuTools::defaultDialogFlags() ) { - m_addrSelWidget = std::unique_ptr( new RiuSummaryVectorSelectionWidgetCreator() ); + m_addrSelWidget = std::make_unique(); QWidget* addrWidget = m_addrSelWidget->getOrCreateWidget( this ); QVBoxLayout* mainLayout = new QVBoxLayout( this ); diff --git a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionWidgetCreator.cpp b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionWidgetCreator.cpp index d366550c8f..beafa7a200 100644 --- a/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionWidgetCreator.cpp +++ b/ApplicationLibCode/UserInterface/RiuSummaryVectorSelectionWidgetCreator.cpp @@ -29,13 +29,14 @@ #include #include #include +#include //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- RiuSummaryVectorSelectionWidgetCreator::RiuSummaryVectorSelectionWidgetCreator() { - m_summaryAddressSelection = std::unique_ptr( new RiuSummaryVectorSelectionUi() ); + m_summaryAddressSelection = std::make_unique(); setPdmObject( m_summaryAddressSelection.get() ); } diff --git a/ApplicationLibCode/UserInterface/RiuViewer.cpp b/ApplicationLibCode/UserInterface/RiuViewer.cpp index dbbe9b31e2..ff55dfc44e 100644 --- a/ApplicationLibCode/UserInterface/RiuViewer.cpp +++ b/ApplicationLibCode/UserInterface/RiuViewer.cpp @@ -66,6 +66,7 @@ #include #include +#include using cvf::ManipulatorTrackball; @@ -1321,7 +1322,7 @@ void RiuViewer::showScaleLegend( bool show ) //-------------------------------------------------------------------------------------------------- void RiuViewer::setHoverCursor( const QCursor& cursor ) { - s_hoverCursor.reset( new QCursor( cursor ) ); + s_hoverCursor = std::make_unique( cursor ); } //--------------------------------------------------------------------------------------------------