diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp index d57dd955e2..dc21079f9c 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlot.cpp @@ -398,7 +398,7 @@ void RimWellDistributionPlot::populatePlotWidgetWithCurveData( const RigTofWellD plotWidget->setAxisAutoScale( QwtPlot::xBottom, true ); plotWidget->setAxisAutoScale( QwtPlot::yLeft, true ); - const std::vector& tofValuesDays = calculator.sortedUniqueTOFValues(); + const std::vector& tofValuesDays = calculator.sortedUniqueTofValues(); if ( tofValuesDays.size() == 0 ) { // cvf::Trace::show("No TOF values!"); @@ -422,7 +422,7 @@ void RimWellDistributionPlot::populatePlotWidgetWithCurveData( const RigTofWellD for ( size_t i = 0; i < numWells; i++ ) { - QString wellName = calculator.contributingWellName( i ); + const QString& wellName = calculator.contributingWellName( i ); const std::vector& volArr = calculator.accumulatedVolumeForContributingWell( i ); cvf::Color3f cvfClr = flowDiagSolution.tracerColor( wellName ); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlot.h b/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlot.h index bc73244dfe..461bc62607 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlot.h +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlot.h @@ -47,35 +47,35 @@ public: void setPlotOptions( bool groupSmallContributions, double smallContributionsRelativeThreshold ); // RimPlot implementations - virtual RiuQwtPlotWidget* viewer() override; - virtual void setAutoScaleXEnabled( bool enabled ) override; - virtual void setAutoScaleYEnabled( bool enabled ) override; - virtual void updateAxes() override; - virtual void updateLegend() override; - virtual void updateZoomInQwt() override; - virtual void updateZoomFromQwt() override; - virtual QString asciiDataForPlotExport() const override; - virtual void reattachAllCurves() override; - virtual void detachAllCurves() override; - virtual caf::PdmObject* findPdmObjectFromQwtCurve( const QwtPlotCurve* curve ) const override; - virtual void onAxisSelected( int axis, bool toggle ) override; + RiuQwtPlotWidget* viewer() override; + void setAutoScaleXEnabled( bool enabled ) override; + void setAutoScaleYEnabled( bool enabled ) override; + void updateAxes() override; + void updateLegend() override; + void updateZoomInQwt() override; + void updateZoomFromQwt() override; + QString asciiDataForPlotExport() const override; + void reattachAllCurves() override; + void detachAllCurves() override; + caf::PdmObject* findPdmObjectFromQwtCurve( const QwtPlotCurve* curve ) const override; + void onAxisSelected( int axis, bool toggle ) override; // RimPlotWindow implementations - virtual QString description() const override; + QString description() const override; // RimViewWindow implementations - virtual QWidget* viewWidget() override; - virtual QImage snapshotWindowContent() override; - virtual void zoomAll() override; + QWidget* viewWidget() override; + QImage snapshotWindowContent() override; + void zoomAll() override; private: // RimPlot implementations - virtual void doRemoveFromCollection() override; + void doRemoveFromCollection() override; // RimViewWindow implementations - virtual QWidget* createViewWidget( QWidget* mainWindowParent ) override; - virtual void deleteViewWidget() override; - virtual void onLoadDataAndUpdate() override; + QWidget* createViewWidget( QWidget* mainWindowParent ) override; + void deleteViewWidget() override; + void onLoadDataAndUpdate() override; private: void fixupDependentFieldsAfterCaseChange(); @@ -83,12 +83,13 @@ private: const RimFlowDiagSolution& flowDiagSolution, RiuQwtPlotWidget* plotWidget ); - virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; - virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, - const QVariant& oldValue, - const QVariant& newValue ) override; - virtual QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, - bool* useOptionsOnly ) override; + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, + const QVariant& oldValue, + const QVariant& newValue ) override; + + QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) override; private: caf::PdmPtrField m_case; diff --git a/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.h b/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.h index 51a5b69fcb..04f3a9f407 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.h +++ b/ApplicationCode/ProjectDataModel/Flow/RimWellDistributionPlotCollection.h @@ -49,18 +49,18 @@ public: private: // RimPlotWindow overrides - virtual QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, - bool* useOptionsOnly ) override; - virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, - const QVariant& oldValue, - const QVariant& newValue ) override; + QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, + bool* useOptionsOnly ) override; + void fieldChangedByUi( const caf::PdmFieldHandle* changedField, + const QVariant& oldValue, + const QVariant& newValue ) override; - virtual void onLoadDataAndUpdate() override; + void onLoadDataAndUpdate() override; private: - virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; - void fixupDependentFieldsAfterCaseChange(); - void applyPlotParametersToContainedPlots(); + void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; + void fixupDependentFieldsAfterCaseChange(); + void applyPlotParametersToContainedPlots(); private: caf::PdmPtrField m_case; diff --git a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp index d1b72ee523..3a00b493b7 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofAccumulatedPhaseFractionsCalculator.cpp @@ -132,7 +132,7 @@ void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFract double fractionPorvPhaseSumSoil = 0.0; double fractionPorvPhaseSumSgas = 0.0; - for ( auto element : tofAndIndexMap ) + for ( const auto& element : tofAndIndexMap ) { double tofValue = element.first; for ( int index : element.second ) @@ -160,4 +160,4 @@ void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFract accumulatedPhaseFractionSoil.push_back( fractionPorvPhaseSumSoil / fractionPorvSum ); accumulatedPhaseFractionSgas.push_back( fractionPorvPhaseSumSgas / fractionPorvSum ); } -} \ No newline at end of file +} diff --git a/ApplicationCode/ReservoirDataModel/RigTofWellDistributionCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigTofWellDistributionCalculator.cpp index 89ab418e4b..df43d33288 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofWellDistributionCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTofWellDistributionCalculator.cpp @@ -91,7 +91,8 @@ RigTofWellDistributionCalculator::RigTofWellDistributionCalculator( RimEclipseRe const RigFlowDiagResultAddress resultAddrFraction( "Fraction", RigFlowDiagResultAddress::PhaseSelection::PHASE_ALL, targetWellname.toStdString() ); - const std::vector* tofData = flowDiagResults->resultValues( resultAddrTof, timeStepIndex ); + + const std::vector* tofData = flowDiagResults->resultValues( resultAddrTof, timeStepIndex ); const std::vector* targetWellFractionData = flowDiagResults->resultValues( resultAddrFraction, timeStepIndex ); if ( !tofData || !targetWellFractionData ) { @@ -103,8 +104,8 @@ RigTofWellDistributionCalculator::RigTofWellDistributionCalculator( RimEclipseRe const std::vector candidateContributingWellNames = findCandidateContributingWellNames( *flowDiagSolution, targetWellname, timeStepIndex ); - const size_t numContribWells = candidateContributingWellNames.size(); + const size_t numContribWells = candidateContributingWellNames.size(); for ( size_t iContribWell = 0; iContribWell < numContribWells; iContribWell++ ) { const QString contribWellName = candidateContributingWellNames[iContribWell]; @@ -124,7 +125,7 @@ RigTofWellDistributionCalculator::RigTofWellDistributionCalculator( RimEclipseRe ContribWellEntry contribWellEntry; contribWellEntry.name = contribWellName; - for ( auto mapElement : tofToCellIndicesMap ) + for ( const auto& mapElement : tofToCellIndicesMap ) { const double tofValue = mapElement.first; const std::vector& cellIndicesArr = mapElement.second; @@ -152,7 +153,7 @@ RigTofWellDistributionCalculator::RigTofWellDistributionCalculator( RimEclipseRe } } - for ( auto mapElement : tofToCellIndicesMap ) + for ( const auto& mapElement : tofToCellIndicesMap ) { const double tofValue = mapElement.first; m_tofInIncreasingOrder.push_back( tofValue ); @@ -262,7 +263,7 @@ std::vector : RimFlowDiagSolution::INJECTOR; const std::vector allWellNames = flowDiagSolution.tracerNames(); - for ( QString name : allWellNames ) + for ( const QString& name : allWellNames ) { const RimFlowDiagSolution::TracerStatusType status = flowDiagSolution.tracerStatusInTimeStep( name, timeStepIndex ); @@ -285,7 +286,7 @@ std::vector //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -const std::vector& RigTofWellDistributionCalculator::sortedUniqueTOFValues() const +const std::vector& RigTofWellDistributionCalculator::sortedUniqueTofValues() const { return m_tofInIncreasingOrder; } diff --git a/ApplicationCode/ReservoirDataModel/RigTofWellDistributionCalculator.h b/ApplicationCode/ReservoirDataModel/RigTofWellDistributionCalculator.h index 01de0fd9c9..61450ab690 100644 --- a/ApplicationCode/ReservoirDataModel/RigTofWellDistributionCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigTofWellDistributionCalculator.h @@ -45,7 +45,7 @@ public: void groupSmallContributions( double smallContribThreshold ); - const std::vector& sortedUniqueTOFValues() const; + const std::vector& sortedUniqueTofValues() const; size_t contributingWellCount() const; const QString& contributingWellName( size_t contribWellIndex ) const;