Fixes detected by cppcheck (#4974)

* Janitor : Remove obsolete pointer to dialog

* Janitor : Remove unused functions

* Janitor : Remove unused functions

* Janitor : Add explicit to constructors

* Janitor : Remove unused variables

* Janitor : Remove unused functions related to summary plot templates

* clang-tidy : Use nullptr instead of 0

* clang-tidy : Fix usage of virtual and override

* Upped to version 2019.08.2-dev.05

* Janitor : Remove unused variables

* Janitor : Clean up several cppcheck issues

* Janitor : Add cppcheck config files

* Janitor : Use const when possible
This commit is contained in:
Magne Sjaastad
2019-11-03 08:37:03 +01:00
committed by GitHub
parent 18eee02bb1
commit 67e7bb0cf3
64 changed files with 159 additions and 282 deletions

View File

@@ -260,8 +260,8 @@ RiaApplication::ApplicationStatus RiaConsoleApplication::handleArguments( cvf::P
{
QStringList fileNames = RicImportGeneralDataFeature::fileNamesFromCaseNames(
cvfqt::Utils::toQStringList( o.values() ) );
RicImportGeneralDataFeature::OpenCaseResults results =
RicImportGeneralDataFeature::openEclipseFilesFromFileNames( fileNames, true );
RicImportGeneralDataFeature::openEclipseFilesFromFileNames( fileNames, true );
}
if ( cvf::Option o = progOpt->option( "commandFile" ) )
@@ -434,4 +434,4 @@ void RiaConsoleApplication::runIdleProcessing()
m_grpcServer->processAllQueuedRequests();
}
#endif
}
}

View File

@@ -52,8 +52,8 @@ protected:
// Protected implementation specific overrides
void invokeProcessEvents( QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents ) override;
void onProjectOpeningError( const QString& errMsg ) override;
void onProjectOpened();
void onProjectClosed();
void onProjectOpened() override;
void onProjectClosed() override;
private slots:
void runIdleProcessing();

View File

@@ -106,16 +106,6 @@ bool RiaEclipseFileNameTools::isSummarySpecFile( const QString& fileName )
return hasMatchingSuffix( fileName, ECLIPSE_SMSPEC );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaEclipseFileNameTools::findBaseName( const QString& inputFilePath ) const
{
QFileInfo fi( inputFilePath );
return fi.baseName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -54,7 +54,6 @@ public:
static bool isSummarySpecFile( const QString& fileName );
private:
QString findBaseName( const QString& inputFilePath ) const;
QString relatedFilePath( EclipseFileType fileType ) const;
static bool hasMatchingSuffix( const QString& fileName, EclipseFileType fileType );

View File

@@ -54,7 +54,7 @@ private:
class RiaFeatureCommandContextHelper
{
public:
RiaFeatureCommandContextHelper( QObject* externalObject );
explicit RiaFeatureCommandContextHelper( QObject* externalObject );
~RiaFeatureCommandContextHelper();
};

View File

@@ -143,7 +143,7 @@ protected:
void onFileSuccessfullyLoaded( const QString& fileName, RiaDefines::ImportFileType fileType ) override;
void onProjectBeingOpened() override;
void onProjectOpeningError( const QString& errMsg );
void onProjectOpeningError( const QString& errMsg ) override;
void onProjectOpened() override;
void onProjectBeingClosed() override;
void onProjectClosed() override;

View File

@@ -28,7 +28,7 @@ class QStringList;
class RiaStringListSerializer
{
public:
RiaStringListSerializer( const QString& key );
explicit RiaStringListSerializer( const QString& key );
void addString( const QString& textString, int maxStringCount );
void removeString( const QString& textString );

View File

@@ -134,8 +134,6 @@ QString RiaFilePathTools::removeDuplicatePathSeparators( const QString& path )
//--------------------------------------------------------------------------------------------------
QString RiaFilePathTools::rootSearchPathFromSearchFilter( const QString& searchFilter )
{
std::set<QChar> globStartCharacters = {'*', '?', '['}; // ']' not needed
QStringList pathPartList = searchFilter.split( SEPARATOR );
QStringList::iterator pathPartIt = pathPartList.begin();

View File

@@ -84,7 +84,6 @@ bool RiaGitDiff::executeDiff( const QString& baseFolder )
return false;
}
QByteArray stdErr = proc.readAllStandardError();
QByteArray stdOut = proc.readAllStandardOutput();
m_diffOutput = stdOut;

View File

@@ -51,12 +51,12 @@ RiaTimeHistoryCurveResampler::RiaTimeHistoryCurveResampler() {}
//--------------------------------------------------------------------------------------------------
void RiaTimeHistoryCurveResampler::setCurveData( const std::vector<double>& values, const std::vector<time_t>& timeSteps )
{
if (values.empty() || timeSteps.empty())
if ( values.empty() || timeSteps.empty() )
{
return;
}
CVF_ASSERT(values.size() == timeSteps.size());
CVF_ASSERT( values.size() == timeSteps.size() );
clearData();
m_originalValues = std::make_pair( values, timeSteps );
@@ -123,10 +123,10 @@ std::vector<time_t>
//--------------------------------------------------------------------------------------------------
void RiaTimeHistoryCurveResampler::computeWeightedMeanValues( DateTimePeriod period )
{
size_t origDataSize = m_originalValues.second.size();
size_t oi = 0;
auto& origTimeSteps = m_originalValues.second;
auto& origValues = m_originalValues.first;
size_t origDataSize = m_originalValues.second.size();
size_t oi = 0;
const auto& origTimeSteps = m_originalValues.second;
const auto& origValues = m_originalValues.first;
computeResampledTimeSteps( period );
@@ -191,10 +191,10 @@ void RiaTimeHistoryCurveResampler::computeWeightedMeanValues( DateTimePeriod per
//--------------------------------------------------------------------------------------------------
void RiaTimeHistoryCurveResampler::computePeriodEndValues( DateTimePeriod period )
{
size_t origDataSize = m_originalValues.second.size();
size_t oi = 0;
auto& origTimeSteps = m_originalValues.second;
auto& origValues = m_originalValues.first;
size_t origDataSize = m_originalValues.second.size();
size_t oi = 0;
const auto& origTimeSteps = m_originalValues.second;
const auto& origValues = m_originalValues.first;
computeResampledTimeSteps( period );

View File

@@ -64,7 +64,6 @@ void RiaPolyArcLineSampler::sampledPointsAndMDs( double sample
m_totalMD = startMD;
cvf::Vec3d p1 = pointsNoDuplicates[0];
cvf::Vec3d p2 = pointsNoDuplicates[1];
m_points->push_back( p1 );
m_meshDs->push_back( m_totalMD );

View File

@@ -19,6 +19,7 @@
#include "RiaWellPlanCalculator.h"
#include "RiaArcCurveCalculator.h"
#include "RiaOffshoreSphericalCoords.h"
#include "cvfGeometryTools.h"
#include "cvfMatrix4.h"
@@ -32,7 +33,7 @@ RiaWellPlanCalculator::RiaWellPlanCalculator( const cvf::Vec3d& sta
{
if ( m_lineArcEndPoints.size() < 2 ) return;
WellPlanSegment segment = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
WellPlanSegment segment = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
RiaOffshoreSphericalCoords startAziIncRad( m_startTangent );
segment.inc = cvf::Math::toDegrees( startAziIncRad.inc() );
@@ -44,9 +45,6 @@ RiaWellPlanCalculator::RiaWellPlanCalculator( const cvf::Vec3d& sta
m_wpResult.push_back( segment );
cvf::Vec3d p1 = m_lineArcEndPoints[0];
cvf::Vec3d p2 = m_lineArcEndPoints[1];
cvf::Vec3d t2 = m_startTangent;
for ( size_t pIdx = 0; pIdx < m_lineArcEndPoints.size() - 1; ++pIdx )
@@ -79,7 +77,7 @@ void RiaWellPlanCalculator::addSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d
//--------------------------------------------------------------------------------------------------
void RiaWellPlanCalculator::addLineSegment( cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent )
{
WellPlanSegment segment = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
WellPlanSegment segment = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
cvf::Vec3d p1p2 = p2 - p1;
double length = p1p2.length();
@@ -109,7 +107,7 @@ void RiaWellPlanCalculator::addLineSegment( cvf::Vec3d p1, cvf::Vec3d p2, cvf::V
//--------------------------------------------------------------------------------------------------
void RiaWellPlanCalculator::addArcSegment( cvf::Vec3d t1, cvf::Vec3d p1, cvf::Vec3d p2, cvf::Vec3d* endTangent )
{
WellPlanSegment segment = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
WellPlanSegment segment = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
RiaArcCurveCalculator arcCalc( p1, t1, p2 );

View File

@@ -43,7 +43,7 @@ public:
public:
RicfCommandResponse( Status status = COMMAND_OK, const QString& message = "" );
RicfCommandResponse( caf::PdmObject* ok_result );
explicit RicfCommandResponse( caf::PdmObject* ok_result );
Status status() const;
QString sanitizedResponseMessage() const;

View File

@@ -51,7 +51,7 @@ public:
{
}
virtual bool isValid() const override
bool isValid() const override
{
return m_summaryPlot.notNull();
}
@@ -132,30 +132,30 @@ public:
{
}
virtual bool isValid() const override
bool isValid() const override
{
return m_crossPlot.notNull();
}
virtual QString description() const override
QString description() const override
{
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
return m_crossPlot->createAutoName();
}
virtual QString tabTitle( int tabIndex ) const override
QString tabTitle( int tabIndex ) const override
{
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
return m_crossPlot->asciiTitleForPlotExport( tabIndex );
}
virtual QString tabText( int tabIndex ) const override
QString tabText( int tabIndex ) const override
{
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
return m_crossPlot->asciiDataForGridCrossPlotExport( tabIndex );
}
virtual int tabCount() const override
int tabCount() const override
{
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
return (int)m_crossPlot->dataSets().size();

View File

@@ -53,10 +53,7 @@ void RicExportFishbonesLateralsFeature::onActionTriggered( bool isChecked )
fishbonesCollection->firstAncestorOrThisOfType( wellPath );
CVF_ASSERT( wellPath );
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectoryWithFallbackToProjectFolder( "WELL_PATH_EXPORT_DIR" );
auto fileName = caf::Utils::makeValidFileBasename( wellPath->name() ) + "_laterals.dev";
auto fileName = caf::Utils::makeValidFileBasename( wellPath->name() ) + "_laterals.dev";
auto dialogData = EXP::openDialog();
if ( dialogData )

View File

@@ -615,7 +615,7 @@ RigCompletionData RicWellPathExportCompletionDataFeatureImpl::combineEclipseCell
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData>
RicWellPathExportCompletionDataFeatureImpl::mainGridCompletions( std::vector<RigCompletionData>& allCompletions )
RicWellPathExportCompletionDataFeatureImpl::mainGridCompletions( const std::vector<RigCompletionData>& allCompletions )
{
std::vector<RigCompletionData> completions;
@@ -634,7 +634,7 @@ std::vector<RigCompletionData>
///
//--------------------------------------------------------------------------------------------------
std::map<QString, std::vector<RigCompletionData>>
RicWellPathExportCompletionDataFeatureImpl::subGridsCompletions( std::vector<RigCompletionData>& allCompletions )
RicWellPathExportCompletionDataFeatureImpl::subGridsCompletions( const std::vector<RigCompletionData>& allCompletions )
{
std::map<QString, std::vector<RigCompletionData>> completions;
@@ -873,7 +873,7 @@ void RicWellPathExportCompletionDataFeatureImpl::sortAndExportCompletionsToFile(
RimEclipseCase* eclipseCase,
const QString& folderName,
const QString& fileName,
std::vector<RigCompletionData>& completions,
const std::vector<RigCompletionData>& completions,
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
RicExportCompletionDataSettingsUi::CompdatExportType exportType )
{

View File

@@ -158,10 +158,10 @@ private:
static RigCompletionData combineEclipseCellCompletions( const std::vector<RigCompletionData>& completions,
const RicExportCompletionDataSettingsUi& settings );
static std::vector<RigCompletionData> mainGridCompletions( std::vector<RigCompletionData>& allCompletions );
static std::vector<RigCompletionData> mainGridCompletions( const std::vector<RigCompletionData>& allCompletions );
static std::map<QString, std::vector<RigCompletionData>>
subGridsCompletions( std::vector<RigCompletionData>& allCompletions );
subGridsCompletions( const std::vector<RigCompletionData>& allCompletions );
static void
exportWellPathFractureReport( RimEclipseCase* sourceCase,
@@ -180,7 +180,7 @@ private:
sortAndExportCompletionsToFile( RimEclipseCase* eclipseCase,
const QString& exportFolder,
const QString& fileName,
std::vector<RigCompletionData>& completions,
const std::vector<RigCompletionData>& completions,
const std::vector<RicWellPathFractureReportItem>& wellPathFractureReportItems,
RicExportCompletionDataSettingsUi::CompdatExportType exportType );

View File

@@ -205,9 +205,6 @@ void RicExportEclipseSectorModelFeature::executeCommand( RimEclipseView*
auto task = progress.task( "Export Faults", faultsProgressPercentage );
if ( exportSettings.exportFaults == RicExportEclipseSectorModelUi::EXPORT_TO_SEPARATE_FILE_PER_RESULT )
{
QFileInfo info( exportSettings.exportGridFilename() );
QDir dirPath = info.absoluteDir();
for ( auto faultInView : view->faultCollection()->faults() )
{
auto rigFault = faultInView->faultGeometry();

View File

@@ -162,8 +162,6 @@ void RicExportToLasFileFeature::onActionTriggered( bool isChecked )
RicExportFeatureImpl::configureForExport( propertyDialog.dialogButtonBox() );
propertyDialog.resize( QSize( 400, 330 ) );
std::vector<QString> writtenFiles;
if ( propertyDialog.exec() == QDialog::Accepted && !featureUi.exportFolder().isEmpty() )
{
double resampleInterval = 0.0;

View File

@@ -152,21 +152,13 @@ void RicCreateMultipleFracturesFeature::slotAppendFractures()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateMultipleFracturesFeature::slotClose()
{
if ( m_dialog )
{
m_dialog->close();
}
}
void RicCreateMultipleFracturesFeature::slotClose() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateMultipleFracturesFeature::onActionTriggered( bool isChecked )
{
m_dialog = nullptr;
RiuCreateMultipleFractionsUi* multipleFractionsUi = this->multipleFractionsUi();
if ( multipleFractionsUi )
{
@@ -217,8 +209,7 @@ void RicCreateMultipleFracturesFeature::onActionTriggered( bool isChecked )
"Create Multiple Fractures",
"" );
m_dialog = &propertyDialog;
multipleFractionsUi->setParentDialog( m_dialog );
multipleFractionsUi->setParentDialog( &propertyDialog );
propertyDialog.resize( QSize( 700, 450 ) );
@@ -246,7 +237,7 @@ void RicCreateMultipleFracturesFeature::onActionTriggered( bool isChecked )
{
QPushButton* pushButton = dialogButtonBox->addButton( "Close", QDialogButtonBox::ActionRole );
connect( pushButton, SIGNAL( clicked() ), this, SLOT( slotClose() ) );
connect( pushButton, SIGNAL( clicked() ), &propertyDialog, SLOT( close() ) );
pushButton->setDefault( false );
pushButton->setAutoDefault( false );
}

View File

@@ -61,6 +61,5 @@ private:
RiuCreateMultipleFractionsUi* multipleFractionsUi() const;
private:
QPointer<caf::PdmUiPropertyViewDialog> m_dialog;
QString m_copyOfObject;
QString m_copyOfObject;
};

View File

@@ -43,7 +43,7 @@ class RicGridStatisticsDialog : public QDialog
Q_OBJECT
public:
RicGridStatisticsDialog( QWidget* parent );
explicit RicGridStatisticsDialog( QWidget* parent );
~RicGridStatisticsDialog() override;
void setLabel( const QString& labelText );

View File

@@ -557,7 +557,6 @@ void RicRecursiveFileSearchDialog::slotFilterChanged( const QString& text )
void RicRecursiveFileSearchDialog::slotFileListCustomMenuRequested( const QPoint& point )
{
QMenu menu;
QPoint globalPoint = point;
QAction* action;
action = new QAction( QIcon( ":/Copy.png" ), "&Copy", this );
@@ -577,7 +576,7 @@ void RicRecursiveFileSearchDialog::slotFileListCustomMenuRequested( const QPoint
connect( action, SIGNAL( triggered() ), SLOT( slotToggleFileListItems() ) );
menu.addAction( action );
globalPoint = m_fileListWidget->mapToGlobal( point );
QPoint globalPoint = m_fileListWidget->mapToGlobal( point );
menu.exec( globalPoint );
}

View File

@@ -611,7 +611,6 @@ void RicSummaryCaseRestartDialog::slotDialogButtonClicked( QAbstractButton* butt
void RicSummaryCaseRestartDialog::slotFileNameCopyCustomMenuRequested( const QPoint& point )
{
QMenu menu;
QPoint globalPoint = point;
QAction* action;
QLabel* sourceLabel = dynamic_cast<QLabel*>( sender() );
@@ -621,7 +620,7 @@ void RicSummaryCaseRestartDialog::slotFileNameCopyCustomMenuRequested( const QPo
connect( action, SIGNAL( triggered() ), SLOT( slotCopyFileNameToClipboard() ) );
menu.addAction( action );
globalPoint = sourceLabel->mapToGlobal( point );
QPoint globalPoint = sourceLabel->mapToGlobal( point );
menu.exec( globalPoint );
}

View File

@@ -217,47 +217,42 @@ void RifCaseRealizationParametersReader::closeDataStream()
RifCaseRealizationRunspecificationReader::RifCaseRealizationRunspecificationReader( const QString& fileName )
: RifCaseRealizationReader( fileName )
{
m_xmlStream = nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifCaseRealizationRunspecificationReader::~RifCaseRealizationRunspecificationReader()
{
if ( m_xmlStream )
{
delete m_xmlStream;
}
}
RifCaseRealizationRunspecificationReader::~RifCaseRealizationRunspecificationReader() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifCaseRealizationRunspecificationReader::parse()
{
auto xml = openDataStream();
auto file = openFile();
QXmlStreamReader xml( file );
QString paramName;
while ( !xml->atEnd() )
while ( !xml.atEnd() )
{
xml->readNext();
xml.readNext();
if ( xml->isStartElement() )
if ( xml.isStartElement() )
{
if ( xml->name() == "modifier" )
if ( xml.name() == "modifier" )
{
paramName = "";
}
if ( xml->name() == "id" )
if ( xml.name() == "id" )
{
paramName = xml->readElementText();
paramName = xml.readElementText();
}
if ( xml->name() == "value" )
if ( xml.name() == "value" )
{
QString paramStrValue = xml->readElementText();
QString paramStrValue = xml.readElementText();
if ( paramName.isEmpty() ) continue;
@@ -272,7 +267,7 @@ void RifCaseRealizationRunspecificationReader::parse()
{
throw FileParseException(
QString( "RifEnsembleParametersReader: Invalid number format in line %1" )
.arg( xml->lineNumber() ) );
.arg( xml.lineNumber() ) );
}
bool parseOk = true;
@@ -281,44 +276,22 @@ void RifCaseRealizationRunspecificationReader::parse()
{
throw FileParseException(
QString( "RifEnsembleParametersReader: Invalid number format in line %1" )
.arg( xml->lineNumber() ) );
.arg( xml.lineNumber() ) );
}
m_parameters->addParameter( paramName, value );
}
}
}
else if ( xml->isEndElement() )
else if ( xml.isEndElement() )
{
if ( xml->name() == "modifier" )
if ( xml.name() == "modifier" )
{
paramName = "";
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QXmlStreamReader* RifCaseRealizationRunspecificationReader::openDataStream()
{
auto file = openFile();
m_xmlStream = new QXmlStreamReader( file );
return m_xmlStream;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifCaseRealizationRunspecificationReader::closeDataStream()
{
if ( m_xmlStream )
{
delete m_xmlStream;
m_xmlStream = nullptr;
}
closeFile();
}

View File

@@ -94,13 +94,6 @@ public:
~RifCaseRealizationRunspecificationReader() override;
void parse() override;
private:
QXmlStreamReader* openDataStream();
void closeDataStream();
private:
QXmlStreamReader* m_xmlStream;
};
//==================================================================================================

View File

@@ -231,7 +231,7 @@ void RifTextDataTableFormatter::outputBuffer()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifTextDataTableFormatter::outputComment( RifTextDataTableLine& comment )
void RifTextDataTableFormatter::outputComment( const RifTextDataTableLine& comment )
{
m_out << m_commentPrefix << comment.data[0] << "\n";
}

View File

@@ -157,7 +157,7 @@ protected:
QString formatColumn( const QString str, size_t columnIndex ) const;
void outputBuffer();
void outputComment( RifTextDataTableLine& comment );
void outputComment( const RifTextDataTableLine& comment );
void outputHorizontalLine( RifTextDataTableLine& comment );
bool isAllHeadersEmpty( const std::vector<RifTextDataTableColumn>& headers );

View File

@@ -89,7 +89,7 @@ void RivWellSpheresPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicLi
if ( gridIndex >= mainGrid->gridCount() ) continue;
const RigGridBase* rigGrid = rigGrid = mainGrid->gridByIndex( gridIndex );
const RigGridBase* rigGrid = mainGrid->gridByIndex( gridIndex );
size_t gridCellIndex = wellResultPoint.m_gridCellIndex;
if ( gridCellIndex >= rigGrid->cellCount() ) continue;

View File

@@ -733,7 +733,7 @@ void RimFlowCharacteristicsPlot::viewGeometryUpdated()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double interpolate( std::vector<double>& xData, std::vector<double>& yData, double x, bool extrapolate )
double interpolate( const std::vector<double>& xData, const std::vector<double>& yData, double x, bool extrapolate )
{
size_t itemCount = xData.size();
@@ -787,7 +787,7 @@ QString RimFlowCharacteristicsPlot::curveDataAsText() const
std::vector<QDateTime> timeStepDates = m_case->timeStepDates();
std::vector<double> storageCapacitySamplingValues = {0.08, 0.1, 0.2, 0.3, 0.4};
std::vector<double> storageCapacitySamplingValues = { 0.08, 0.1, 0.2, 0.3, 0.4 };
size_t sampleCount = storageCapacitySamplingValues.size();
for ( const auto& timeIndex : m_currentlyPlottedTimeSteps )

View File

@@ -1128,8 +1128,6 @@ std::map<QDateTime, std::set<RifDataSourceForRftPlt>> RimWellPlotTools::calculat
rftTimeSteps );
std::set<QDateTime> filteredGridTimeSteps = RimWellPlotTools::findMatchingOrAdjacentTimeSteps( baseTimeSteps,
gridTimeSteps );
std::set<QDateTime> filteredSummaryRftTimeSteps =
RimWellPlotTools::findMatchingOrAdjacentTimeSteps( baseTimeSteps, summaryRftTimeSteps );
std::set<QDateTime> filteredEnsembleRftTimeSteps =
RimWellPlotTools::findMatchingOrAdjacentTimeSteps( baseTimeSteps, ensembleRftTimeSteps );

View File

@@ -976,7 +976,6 @@ void RimWellPltPlot::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
void RimWellPltPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
RimViewWindow::defineUiOrdering( uiConfigName, uiOrdering );
const QString simWellName = RimWellPlotTools::simWellName( m_wellPathName );
uiOrdering.add( &m_wellPathName );

View File

@@ -562,8 +562,6 @@ QString Rim3dOverlayInfoConfig::caseInfoText( RimEclipseView* eclipseView )
QString totCellCount = QString::number( contourMap->contourMapProjection()->numberOfCells() );
cvf::uint validCellCount = contourMap->contourMapProjection()->numberOfValidCells();
QString activeCellCountText = QString::number( validCellCount );
QString iSize = QString::number( contourMap->contourMapProjection()->numberOfElementsIJ().x() );
QString jSize = QString::number( contourMap->contourMapProjection()->numberOfElementsIJ().y() );
QString aggregationType = contourMap->contourMapProjection()->resultAggregationText();
QString weightingParameterString;
if ( contourMap->contourMapProjection()->weightingParameter() != "None" )
@@ -632,8 +630,6 @@ QString Rim3dOverlayInfoConfig::caseInfoText( RimGeoMechView* geoMechView )
QString totCellCount = QString::number( contourMap->contourMapProjection()->numberOfCells() );
cvf::uint validCellCount = contourMap->contourMapProjection()->numberOfValidCells();
QString activeCellCountText = QString::number( validCellCount );
QString iSize = QString::number( contourMap->contourMapProjection()->numberOfElementsIJ().x() );
QString jSize = QString::number( contourMap->contourMapProjection()->numberOfElementsIJ().y() );
QString aggregationType = contourMap->contourMapProjection()->resultAggregationText();
infoText += QString( "<p><b>-- Contour Map: %1 --</b><p> "

View File

@@ -856,9 +856,6 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
{
menuBuilder << "RicCreatePlotFromSelectionFeature";
menuBuilder << "RicCreatePlotFromTemplateByShortcutFeature";
// TODO: Consider to remove plot template menus, only support dialog selection
// appendPlotTemplateMenus( menuBuilder );
}
menuBuilder << "Separator";
@@ -1051,19 +1048,6 @@ void RimContextCommandBuilder::createExecuteScriptForCasesFeatureMenu( caf::CmdF
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimContextCommandBuilder::appendPlotTemplateMenus( caf::CmdFeatureMenuBuilder& menuBuilder )
{
RiaApplication* app = RiaApplication::instance();
RimProject* proj = app->project();
if ( proj && proj->rootPlotTemlateItem() )
{
appendPlotTemplateItems( menuBuilder, proj->rootPlotTemlateItem() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1101,34 +1085,6 @@ void RimContextCommandBuilder::appendScriptItems( caf::CmdFeatureMenuBuilder& me
menuBuilder.subMenuEnd();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimContextCommandBuilder::appendPlotTemplateItems( caf::CmdFeatureMenuBuilder& menuBuilder,
RimPlotTemplateFolderItem* plotTemplateRoot )
{
if ( !plotTemplateRoot->fileNames().empty() )
{
auto folderName = plotTemplateRoot->uiName();
menuBuilder.subMenuStart( folderName );
for ( const auto& fileItem : plotTemplateRoot->fileNames() )
{
QString menuText = fileItem->uiName();
menuBuilder.addCmdFeatureWithUserData( "RicCreatePlotFromTemplateFeature",
menuText,
QVariant( fileItem->absoluteFilePath() ) );
}
menuBuilder.subMenuEnd();
}
for ( const auto& folder : plotTemplateRoot->subFolders() )
{
appendPlotTemplateItems( menuBuilder, folder );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -46,7 +46,6 @@ public:
private:
static std::vector<RimWellPath*> allWellPaths();
static void createExecuteScriptForCasesFeatureMenu( caf::CmdFeatureMenuBuilder& menuBuilder );
static void appendPlotTemplateMenus( caf::CmdFeatureMenuBuilder& menuBuilder );
static void appendScriptItems( caf::CmdFeatureMenuBuilder& menuBuilder, RimScriptCollection* scriptCollection );
static void appendPlotTemplateItems( caf::CmdFeatureMenuBuilder& menuBuilder,

View File

@@ -1467,8 +1467,6 @@ double RimContourMapProjection::interpolateValue( const cvf::Vec2d& gridPos2d )
double vertexValue = valueAtVertex( v[i].x(), v[i].y() );
if ( vertexValue == std::numeric_limits<double>::infinity() )
{
baryCentricCoords[i] = 0.0;
vertexValues[i] = 0.0;
return std::numeric_limits<double>::infinity();
}
else

View File

@@ -400,9 +400,9 @@ void RimEclipseResultDefinition::changedTracerSelectionField( bool injector )
{
m_flowSolution = m_flowSolutionUiField();
std::vector<QString>& selectedTracers = injector ? m_selectedInjectorTracers.v() : m_selectedProducerTracers.v();
std::vector<QString>& selectedTracersUi = injector ? m_selectedInjectorTracersUiField.v()
: m_selectedProducerTracersUiField.v();
std::vector<QString>& selectedTracers = injector ? m_selectedInjectorTracers.v() : m_selectedProducerTracers.v();
const std::vector<QString>& selectedTracersUi = injector ? m_selectedInjectorTracersUiField.v()
: m_selectedProducerTracersUiField.v();
selectedTracers = selectedTracersUi;

View File

@@ -570,8 +570,6 @@ std::vector<QDateTime> RimGeoMechCase::vectorOfValidDateTimesFromTimeStepStrings
{
std::vector<QDateTime> dates;
QString dateFormat = "yyyyMMdd";
for ( const QString& timeStepString : timeStepStrings )
{
QDateTime dateTime = dateTimeFromTimeStepString( timeStepString );

View File

@@ -177,12 +177,11 @@ QString RimOilField::uniqueShortNameForCase( RimSummaryCase* summaryCase )
}
}
QString candidate = shortName;
int autoNumber = 0;
while ( !foundUnique )
{
candidate = shortName + QString::number( autoNumber++ );
QString candidate = shortName + QString::number( autoNumber++ );
if ( allAutoShortNames.count( candidate ) == 0 )
{
shortName = candidate;

View File

@@ -234,8 +234,6 @@ void RimScaleLegendConfig::updateLegend()
adjustedMax = roundToNumSignificantDigits( m_userDefinedMaxValue, m_precision );
}
cvf::Color3ubArray legendColors = colorArrayFromColorType( m_colorRangeMode() );
double decadesInRange = 0;
{

View File

@@ -34,8 +34,8 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimViewManipulator::applySourceViewCameraOnDestinationViews( RimGridView* sourceView,
std::vector<RimGridView*>& destinationViews )
void RimViewManipulator::applySourceViewCameraOnDestinationViews( RimGridView* sourceView,
const std::vector<RimGridView*>& destinationViews )
{
bool setPointOfInterest = false;
cvf::Vec3d sourceCamUp;
@@ -57,7 +57,7 @@ void RimViewManipulator::applySourceViewCameraOnDestinationViews( RimGridView*
{
if ( sourceView->viewer()->currentScene() )
{
sourceSceneBB = sourceView->viewer()->currentScene()->boundingBox();
sourceSceneBB = sourceView->viewer()->currentScene()->boundingBox();
}
cvf::Vec3d offset = cvf::Vec3d::ZERO;
@@ -73,8 +73,8 @@ void RimViewManipulator::applySourceViewCameraOnDestinationViews( RimGridView*
if ( setPointOfInterest ) sourcePointOfInterest += offset;
cvf::Mat4d trans;
trans.setTranslation(offset);
sourceSceneBB.transform(trans);
trans.setTranslation( offset );
sourceSceneBB.transform( trans );
}
for ( RimGridView* destinationView : destinationViews )
@@ -89,15 +89,15 @@ void RimViewManipulator::applySourceViewCameraOnDestinationViews( RimGridView*
destinationViewer->enableParallelProjection( !sourceView->isPerspectiveView );
// Destination bounding box in global coordinates including scaleZ
cvf::BoundingBox destSceneBB;
cvf::BoundingBox destSceneBB;
if ( destinationViewer->currentScene() )
{
destSceneBB = destinationViewer->currentScene()->boundingBox();
destSceneBB = destinationViewer->currentScene()->boundingBox();
}
cvf::Vec3d destinationCamEye = sourceCamGlobalEye;
cvf::Vec3d destinationCamViewRefPoint = sourceCamGlobalViewRefPoint;
cvf::Vec3d offset = cvf::Vec3d::ZERO;
cvf::Vec3d destinationCamEye = sourceCamGlobalEye;
cvf::Vec3d destinationCamViewRefPoint = sourceCamGlobalViewRefPoint;
cvf::Vec3d offset = cvf::Vec3d::ZERO;
RimCase* destinationOwnerCase = destinationView->ownerCase();
if ( destinationOwnerCase )

View File

@@ -18,8 +18,8 @@
#pragma once
#include <vector>
#include "cvfVector3.h"
#include <vector>
namespace cvf
{
@@ -32,10 +32,10 @@ class Rim3dView;
class RimViewManipulator
{
public:
static void applySourceViewCameraOnDestinationViews( RimGridView* sourceView,
std::vector<RimGridView*>& destinationViews );
static cvf::Vec3d calculateEquivalentCamPosOffset(Rim3dView* sourceView, Rim3dView* destView);
static void applySourceViewCameraOnDestinationViews( RimGridView* sourceView,
const std::vector<RimGridView*>& destinationViews );
static cvf::Vec3d calculateEquivalentCamPosOffset( Rim3dView* sourceView, Rim3dView* destView );
private:
static bool isBoundingBoxesOverlappingOrClose( const cvf::BoundingBox& sourceBB, const cvf::BoundingBox& destBB );
};
};

View File

@@ -416,8 +416,8 @@ void RimWellLogCurveCommonDataSource::updateDefaultOptions()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurveCommonDataSource::updateCurvesAndTracks( std::vector<RimWellLogCurve*>& curves,
std::vector<RimWellLogTrack*>& tracks )
void RimWellLogCurveCommonDataSource::updateCurvesAndTracks( const std::vector<RimWellLogCurve*>& curves,
const std::vector<RimWellLogTrack*>& tracks )
{
std::set<RimWellLogPlot*> plots;
for ( RimWellLogCurve* curve : curves )
@@ -758,7 +758,7 @@ QList<caf::PdmOptionItemInfo>
}
}
std::vector<RimWellLogExtractionCurve::TrajectoryType> trajectoryTypes =
{RimWellLogExtractionCurve::WELL_PATH, RimWellLogExtractionCurve::SIMULATION_WELL};
{ RimWellLogExtractionCurve::WELL_PATH, RimWellLogExtractionCurve::SIMULATION_WELL };
for ( RimWellLogExtractionCurve::TrajectoryType trajectoryType : trajectoryTypes )
{
caf::PdmOptionItemInfo item( caf::AppEnum<RimWellLogExtractionCurve::TrajectoryType>::uiText( trajectoryType ),

View File

@@ -75,7 +75,7 @@ public:
void resetDefaultOptions();
void updateDefaultOptions( const std::vector<RimWellLogCurve*>& curves, const std::vector<RimWellLogTrack*>& tracks );
void updateDefaultOptions();
void updateCurvesAndTracks( std::vector<RimWellLogCurve*>& curves, std::vector<RimWellLogTrack*>& tracks );
void updateCurvesAndTracks( const std::vector<RimWellLogCurve*>& curves, const std::vector<RimWellLogTrack*>& tracks );
void updateCurvesAndTracks();
void applyPrevCase();
void applyNextCase();

View File

@@ -156,8 +156,8 @@ void RimDerivedEnsembleCase::calculate( const RifEclipseSummaryAddress& address
merger.addCurveData( reader2->timeSteps( address ), values2 );
merger.computeInterpolatedValues();
std::vector<double>& allValues1 = merger.interpolatedYValuesForAllXValues( 0 );
std::vector<double>& allValues2 = merger.interpolatedYValuesForAllXValues( 1 );
const std::vector<double>& allValues1 = merger.interpolatedYValuesForAllXValues( 0 );
const std::vector<double>& allValues2 = merger.interpolatedYValuesForAllXValues( 1 );
size_t sampleCount = merger.allXValues().size();
std::vector<double> calculatedValues;

View File

@@ -630,8 +630,6 @@ void RimEnsembleCurveSet::fieldChangedByUi( const caf::PdmFieldHandle* changedFi
void RimEnsembleCurveSet::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
{
QString curveDataGroupName = "Summary Vector";
// caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroupWithKeyword(curveDataGroupName, "Summary Vector Y");
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Summary Vector Y" );
curveDataGroup->add( &m_yValuesSummaryCaseCollection );
curveDataGroup->add( &m_yValuesSummaryAddressUiField );

View File

@@ -478,12 +478,11 @@ QString RimSummaryCaseMainCollection::uniqueShortNameForCase( RimSummaryCase* su
}
}
QString candidate = shortName;
int autoNumber = 0;
int autoNumber = 0;
while ( !foundUnique )
{
candidate = shortName + QString::number( autoNumber++ );
QString candidate = shortName + QString::number( autoNumber++ );
if ( allAutoShortNames.count( candidate ) == 0 )
{
shortName = candidate;

View File

@@ -1072,8 +1072,6 @@ void RimSummaryPlot::updateTimeAxis()
m_plotWidget->enableAxis( QwtPlot::xBottom, true );
{
QString axisTitle = m_timeAxisProperties->title();
Qt::AlignmentFlag alignment = Qt::AlignCenter;
if ( m_timeAxisProperties->titlePosition() == RimPlotAxisPropertiesInterface::AXIS_TITLE_END )
{

View File

@@ -182,8 +182,6 @@ void RimSummaryPlotFilterTextCurveSetEditor::updateTextFilter()
QStringList allCurveAddressFilters = curveFilterTextWithoutOutdatedLabel().split( QRegExp( "\\s+" ),
QString::SkipEmptyParts );
std::vector<bool> accumulatedUsedFilters( allCurveAddressFilters.size(), false );
std::vector<bool> usedFilters;
std::set<RifEclipseSummaryAddress> filteredAddressesFromSource;
RicSummaryPlotFeatureImpl::filteredSummaryAdressesFromCase( allCurveAddressFilters,
@@ -461,7 +459,7 @@ void RimSummaryPlotFilterTextCurveSetEditor::defineEditorAttribute( const caf::P
{
attr->enableEditableContent = true;
attr->adjustWidthToContents = true;
attr->minimumWidth = 100;
attr->minimumWidth = 140;
}
}
}

View File

@@ -746,7 +746,7 @@ size_t RigCaseCellResultsData::addStaticScalarResult( RiaDefines::ResultCatType
///
//--------------------------------------------------------------------------------------------------
bool RigCaseCellResultsData::updateResultName( RiaDefines::ResultCatType resultType,
QString& oldName,
const QString& oldName,
const QString& newName )
{
bool anyNameUpdated = false;
@@ -1117,12 +1117,12 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult( const RigEclipseResu
}
else if ( resVarAddr.m_resultCatType == RiaDefines::UNDEFINED )
{
std::vector<RiaDefines::ResultCatType> searchOrder = {RiaDefines::STATIC_NATIVE,
RiaDefines::DYNAMIC_NATIVE,
RiaDefines::SOURSIMRL,
RiaDefines::GENERATED,
RiaDefines::INPUT_PROPERTY,
RiaDefines::FORMATION_NAMES};
std::vector<RiaDefines::ResultCatType> searchOrder = { RiaDefines::STATIC_NATIVE,
RiaDefines::DYNAMIC_NATIVE,
RiaDefines::SOURSIMRL,
RiaDefines::GENERATED,
RiaDefines::INPUT_PROPERTY,
RiaDefines::FORMATION_NAMES };
size_t scalarResultIndex = this->findOrLoadKnownScalarResultByResultTypeOrder( resVarAddr, searchOrder );
@@ -1370,12 +1370,12 @@ size_t RigCaseCellResultsData::findOrLoadKnownScalarResult( const RigEclipseResu
size_t RigCaseCellResultsData::findOrLoadKnownScalarResultByResultTypeOrder(
const RigEclipseResultAddress& resVarAddr, const std::vector<RiaDefines::ResultCatType>& resultCategorySearchOrder )
{
std::set<RiaDefines::ResultCatType> otherResultTypesToSearch = {RiaDefines::STATIC_NATIVE,
RiaDefines::DYNAMIC_NATIVE,
RiaDefines::SOURSIMRL,
RiaDefines::INPUT_PROPERTY,
RiaDefines::GENERATED,
RiaDefines::FORMATION_NAMES};
std::set<RiaDefines::ResultCatType> otherResultTypesToSearch = { RiaDefines::STATIC_NATIVE,
RiaDefines::DYNAMIC_NATIVE,
RiaDefines::SOURSIMRL,
RiaDefines::INPUT_PROPERTY,
RiaDefines::GENERATED,
RiaDefines::FORMATION_NAMES };
for ( const auto& resultType : resultCategorySearchOrder )
{
@@ -2011,9 +2011,9 @@ void RigCaseCellResultsData::computeRiTransComponent( const QString& riTransComp
// Get all the actual result values
std::vector<double>& permResults = m_cellScalarResults[permResultIdx][0];
std::vector<double>& riTransResults = m_cellScalarResults[riTransResultIdx][0];
std::vector<double>* ntgResults = nullptr;
const std::vector<double>& permResults = m_cellScalarResults[permResultIdx][0];
std::vector<double>& riTransResults = m_cellScalarResults[riTransResultIdx][0];
std::vector<double>* ntgResults = nullptr;
if ( hasNTGResults )
{
ntgResults = &( m_cellScalarResults[ntgResultIdx][0] );
@@ -2385,9 +2385,9 @@ void RigCaseCellResultsData::computeRiMULTComponent( const QString& riMultCompNa
// Get all the actual result values
std::vector<double>& riTransResults = m_cellScalarResults[riTransResultIdx][0];
std::vector<double>& transResults = m_cellScalarResults[transResultIdx][0];
std::vector<double>& riMultResults = m_cellScalarResults[riMultResultIdx][0];
const std::vector<double>& riTransResults = m_cellScalarResults[riTransResultIdx][0];
const std::vector<double>& transResults = m_cellScalarResults[transResultIdx][0];
std::vector<double>& riMultResults = m_cellScalarResults[riMultResultIdx][0];
// Set up output container to correct number of results
@@ -2477,8 +2477,8 @@ void RigCaseCellResultsData::computeRiTRANSbyAreaComponent( const QString& riTra
// Get all the actual result values
std::vector<double>& transResults = m_cellScalarResults[tranCompScResIdx][0];
std::vector<double>& riTransByAreaResults = m_cellScalarResults[riTranByAreaScResIdx][0];
const std::vector<double>& transResults = m_cellScalarResults[tranCompScResIdx][0];
std::vector<double>& riTransByAreaResults = m_cellScalarResults[riTranByAreaScResIdx][0];
// Set up output container to correct number of results

View File

@@ -123,7 +123,7 @@ public:
QStringList resultNames( RiaDefines::ResultCatType type ) const;
std::vector<RigEclipseResultAddress> existingResults() const;
const RigEclipseResultInfo* resultInfo( const RigEclipseResultAddress& resVarAddr ) const;
bool updateResultName( RiaDefines::ResultCatType resultType, QString& oldName, const QString& newName );
bool updateResultName( RiaDefines::ResultCatType resultType, const QString& oldName, const QString& newName );
QString makeResultNameUnique( const QString& resultNameProposal ) const;
void ensureKnownResultLoadedForTimeStep( const RigEclipseResultAddress& resultAddress, size_t timeStepIndex );

View File

@@ -155,7 +155,8 @@ size_t RigCaseRealizationParameters::parameterHash( const QString& name ) const
}
QString s = QString::number( nameHash ) + QString::number( valueHash );
return stringHasher( ( QString::number( nameHash ) + QString::number( valueHash ) ).toStdString() );
return stringHasher( s.toStdString() );
}
//--------------------------------------------------------------------------------------------------
@@ -191,7 +192,7 @@ void RigCaseRealizationParameters::calculateParametersHash( const std::set<QStri
}
else
{
for ( auto paramName : paramNames )
for ( const auto& paramName : paramNames )
{
if ( m_parameters.find( paramName ) == m_parameters.end() ) return;
hashes.push_back( QString::number( parameterHash( paramName ) ) );

View File

@@ -97,14 +97,14 @@ bool RigCellGeometryTools::estimateHexOverlapWithBoundingBox( const std::array<c
std::array<cvf::Vec3d, 8> overlapCorners = hexCorners;
std::vector<cvf::Vec3d> uniqueTopPoints = {hexCorners[0], hexCorners[1], hexCorners[2], hexCorners[3]};
std::vector<cvf::Vec3d> uniqueTopPoints = { hexCorners[0], hexCorners[1], hexCorners[2], hexCorners[3] };
uniqueTopPoints.erase( std::unique( uniqueTopPoints.begin(), uniqueTopPoints.end() ), uniqueTopPoints.end() );
if ( uniqueTopPoints.size() < 3 ) return false;
cvf::Plane topPlane;
if ( !topPlane.setFromPoints( uniqueTopPoints[0], uniqueTopPoints[1], uniqueTopPoints[2] ) ) return false;
std::vector<cvf::Vec3d> uniqueBottomPoints = {hexCorners[4], hexCorners[5], hexCorners[6], hexCorners[7]};
std::vector<cvf::Vec3d> uniqueBottomPoints = { hexCorners[4], hexCorners[5], hexCorners[6], hexCorners[7] };
uniqueBottomPoints.erase( std::unique( uniqueBottomPoints.begin(), uniqueBottomPoints.end() ),
uniqueBottomPoints.end() );
if ( uniqueBottomPoints.size() < 3 ) return false;
@@ -256,7 +256,7 @@ void RigCellGeometryTools::simplifyPolygon( std::vector<cvf::Vec3d>* vertices, d
}
else
{
std::vector<cvf::Vec3d> newVertices = {vertices->front(), vertices->back()};
std::vector<cvf::Vec3d> newVertices = { vertices->front(), vertices->back() };
*vertices = newVertices;
}
}
@@ -508,7 +508,7 @@ std::vector<std::vector<cvf::Vec3d>>
}
//--------------------------------------------------------------------------------------------------
///
/// Note for cppcheck : First four parameter cannot be const to match the signature of the receiver
//--------------------------------------------------------------------------------------------------
void fillInterpolatedSubjectZ( ClipperLib::IntPoint& e1bot,
ClipperLib::IntPoint& e1top,
@@ -654,7 +654,7 @@ std::pair<cvf::Vec3d, cvf::Vec3d> RigCellGeometryTools::getLineThroughBoundingBo
}
std::pair<cvf::Vec3d, cvf::Vec3d> line;
line = {startPoint, endPoint};
line = { startPoint, endPoint };
return line;
}

View File

@@ -516,7 +516,6 @@ bool RigFlowDiagSolverInterface::ensureStaticDataObjectInstanceCreated()
if ( m_opmFlowDiagStaticData.isNull() )
{
// Get set of files
QString gridFileName = m_eclipseCase->gridFileName();
std::wstring initFileName = getInitFileName();
if ( initFileName.empty() ) return false;
@@ -528,7 +527,6 @@ bool RigFlowDiagSolverInterface::ensureStaticDataObjectInstanceCreated()
return false;
}
// ecl_grid_type* mainGrid = eclipseCaseData->results(RiaDefines::MATRIX_MODEL)->readerInterface();
auto fileReader = eclipseCaseData->results( RiaDefines::MATRIX_MODEL )->readerInterface();
auto eclOutput = dynamic_cast<const RifReaderEclipseOutput*>( fileReader );
if ( eclOutput )

View File

@@ -86,8 +86,8 @@ RigGridBase* RigMainGrid::gridAndGridLocalIdxFromGlobalCellIdx( size_t globalCel
{
CVF_ASSERT( globalCellIdx < m_cells.size() );
RigCell& cell = m_cells[globalCellIdx];
RigGridBase* hostGrid = cell.hostGrid();
const RigCell& cell = m_cells[globalCellIdx];
RigGridBase* hostGrid = cell.hostGrid();
CVF_ASSERT( hostGrid );
if ( gridLocalCellIdx )
@@ -856,10 +856,10 @@ void RigMainGrid::setDualPorosity( bool enable )
//--------------------------------------------------------------------------------------------------
std::array<double, 6> RigMainGrid::defaultMapAxes()
{
const double origin[2] = {0.0, 0.0};
const double xPoint[2] = {1.0, 0.0};
const double yPoint[2] = {0.0, 1.0};
const double origin[2] = { 0.0, 0.0 };
const double xPoint[2] = { 1.0, 0.0 };
const double yPoint[2] = { 0.0, 1.0 };
// Order (see Elipse Reference Manual for keyword MAPAXES): Y_x, Y_y, O_x, O_y, X_x, X_y
return {yPoint[0], yPoint[1], origin[0], origin[1], xPoint[0], xPoint[1]};
return { yPoint[0], yPoint[1], origin[0], origin[1], xPoint[0], xPoint[1] };
}

View File

@@ -518,7 +518,7 @@ public:
auto buildResBranchToBranchLineEndsDistMap = [&unusedBranchLineIterators,
&resBranchIdxToBranchLineEndPointsDists,
this]( cvf::Vec3d& fromPoint, int resultBranchIndex ) {
this]( const cvf::Vec3d& fromPoint, int resultBranchIndex ) {
for ( auto it : unusedBranchLineIterators )
{
{
@@ -887,9 +887,9 @@ private:
else // if ( endToGrow > 1 )
{
m_branchLines.push_back( std::make_pair( false,
std::deque<size_t>{branchList.front(),
cellWithNeighborsPair.first,
neighbour} ) );
std::deque<size_t>{ branchList.front(),
cellWithNeighborsPair.first,
neighbour } ) );
auto newBranchLineIt = std::prev( m_branchLines.end() );
growBranchListEnd( newBranchLineIt );
if ( newBranchLineIt->second.size() == 3 )
@@ -987,11 +987,11 @@ private:
{
if ( prevCell == cvf::UNDEFINED_SIZE_T )
{
m_branchLines.push_back( std::make_pair( false, std::deque<size_t>{startCell, nb} ) );
m_branchLines.push_back( std::make_pair( false, std::deque<size_t>{ startCell, nb } ) );
}
else
{
m_branchLines.push_back( std::make_pair( false, std::deque<size_t>{prevCell, startCell, nb} ) );
m_branchLines.push_back( std::make_pair( false, std::deque<size_t>{ prevCell, startCell, nb } ) );
}
m_unusedWellCellIndices.erase( nb );

View File

@@ -31,8 +31,6 @@ QString versionHeaderText()
{
QString text;
QDateTime dt = QDateTime::currentDateTime();
text += QString( "// ResInsight version string : %1\n" ).arg( STRPRODUCTVER );
text += QString( "// Report generated : %1\n" ).arg( QDateTime::currentDateTime().toString() );
text += "//\n";

View File

@@ -686,7 +686,7 @@ void RiuGridPlotWindow::clearGridLayout()
}
QLayoutItem* item;
while ( ( item = m_gridLayout->takeAt( 0 ) ) != 0 )
while ( ( item = m_gridLayout->takeAt( 0 ) ) != nullptr )
{
}
QWidget().setLayout( m_gridLayout );

View File

@@ -52,6 +52,9 @@ void RiuGridStatisticsHistogramWidget::paintEvent( QPaintEvent* event )
this->draw( &painter, 0, 0, this->width() - 1, this->height() - 1 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridStatisticsHistogramWidget::draw( QPainter* painter, int x, int y, int width, int height )
{
// Initialize variables
@@ -63,11 +66,9 @@ void RiuGridStatisticsHistogramWidget::draw( QPainter* painter, int x, int y, in
QRect r1( x, y, width, height );
// Frame around it all;
QColor windowColor = palette().color( QPalette::Window ); // QColor(144, 173, 208, 180);
QColor frameColor = palette().color( QPalette::WindowText ); // QColor(220, 240, 255, 100);
QColor foregroundColor = palette().color( QPalette::Dark ); // QColor(100, 141, 189);
// painter->fillRect(r1, windowColor);
painter->setPen( frameColor );
painter->drawRect( r1 );

View File

@@ -56,6 +56,9 @@ void RiuSimpleHistogramWidget::paintEvent( QPaintEvent* event )
this->draw( &painter, 0, 0, this->width() - 1, this->height() - 1 );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSimpleHistogramWidget::draw( QPainter* painter, int x, int y, int width, int height )
{
// Initialize variables
@@ -67,11 +70,9 @@ void RiuSimpleHistogramWidget::draw( QPainter* painter, int x, int y, int width,
QRect r1( x, y, width, height );
// Frame around it all;
QColor windowColor = palette().color( QPalette::Window ); // QColor(144, 173, 208, 180);
QColor frameColor = palette().color( QPalette::Midlight ); // QColor(220, 240, 255, 100);
QColor foregroundColor = palette().color( QPalette::Dark ); // QColor(100, 141, 189);
// painter->fillRect(r1, windowColor);
painter->setPen( frameColor );
painter->drawRect( r1 );

View File

@@ -575,7 +575,6 @@ void RiuSummaryCurveDefSelection::setDefaultSelection( const std::vector<Summary
{
RimProject* proj = RiaApplication::instance()->project();
auto allSumCases = proj->allSummaryCases();
auto allSumGroups = proj->summaryGroups();
if ( allSumCases.size() > 0 )
{

View File

@@ -243,8 +243,6 @@ void RiuViewerCommands::displayContextMenu( QMouseEvent* event )
break;
}
cvf::Vec3d displayModelOffset = cvf::Vec3d::ZERO;
if ( mainOrComparisonView )
{
cvf::ref<caf::DisplayCoordTransform> transForm = mainOrComparisonView->displayCoordTransform();

1
scripts/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
ResInsightApplicationCode-cppcheck-build-dir/

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="1">
<builddir>ResInsightApplicationCode-cppcheck-build-dir</builddir>
<platform>win64</platform>
<analyze-all-vs-configs>false</analyze-all-vs-configs>
<check-headers>true</check-headers>
<check-unused-templates>false</check-unused-templates>
<max-ctu-depth>10</max-ctu-depth>
<paths>
<dir name="../ApplicationCode"/>
</paths>
<libraries>
<library>googletest</library>
<library>opengl</library>
<library>qt</library>
</libraries>
</project>