diff --git a/ApplicationCode/Application/Tools/RiaRegressionTestRunner.cpp b/ApplicationCode/Application/Tools/RiaRegressionTestRunner.cpp index a90255cdf3..aba4858dd4 100644 --- a/ApplicationCode/Application/Tools/RiaRegressionTestRunner.cpp +++ b/ApplicationCode/Application/Tools/RiaRegressionTestRunner.cpp @@ -101,16 +101,19 @@ void RiaRegressionTestRunner::runRegressionTest(const QString& testRootPath, con { m_runningRegressionTests = true; - RiaRegressionTest regressionTestConfig; - regressionTestConfig.readSettingsFromApplicationStore(); - QString currentApplicationPath = QDir::currentPath(); - if (!regressionTestConfig.folderContainingCompareTool().isEmpty()) - { - // Windows Only : The image compare tool requires current working directory to be at the folder - // containing the image compare tool - QDir::setCurrent(regressionTestConfig.folderContainingCompareTool()); + { + RiaRegressionTest regressionTestConfig; + regressionTestConfig.readSettingsFromApplicationStore(); + + if (!regressionTestConfig.folderContainingCompareTool().isEmpty()) + { + // Windows Only : The image compare tool requires current working directory to be at the folder + // containing the image compare tool + + QDir::setCurrent(regressionTestConfig.folderContainingCompareTool()); + } } QString generatedFolderName = RegTestNames::generatedFolderName; @@ -225,7 +228,7 @@ void RiaRegressionTestRunner::runRegressionTest(const QString& testRootPath, con QFileInfoList commandFileEntries = testCaseFolder.entryInfoList(filterList); if (!commandFileEntries.empty()) { - QString currentApplicationPath = QDir::current().absolutePath(); + QString currentAbsolutePath = QDir::current().absolutePath(); // Set current path to the folder containing the command file, as this is required when using file references // in the command file @@ -247,7 +250,7 @@ void RiaRegressionTestRunner::runRegressionTest(const QString& testRootPath, con } } - QDir::setCurrent(currentApplicationPath); + QDir::setCurrent(currentAbsolutePath); // Create diff based on generated folders { diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicExportFracturesWellSegmentsFeature.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicExportFracturesWellSegmentsFeature.cpp index fc00e3726d..6a74d631c2 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicExportFracturesWellSegmentsFeature.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicExportFracturesWellSegmentsFeature.cpp @@ -130,9 +130,9 @@ void RicExportFracturesWellSegmentsFeature::onActionTriggered(bool isChecked) } else { - for (RimWellPathFracture* fracture : collection->activeFractures()) + for (RimWellPathFracture* activeFracture : collection->activeFractures()) { - fractures.push_back(fracture); + fractures.push_back(activeFracture); } } diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 49c708c730..a3c33b7bc9 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -2591,9 +2591,9 @@ std::vector spiltIntersectionSegmentsToMaxLength(con double currEndMd = currStartMd; double lastTvd = -intersection.startPoint.z(); - for(int i = 0; i < segCount; i++) + for(int segIndex = 0; segIndex < segCount; segIndex++) { - bool lasti = i == (segCount - 1); + bool lasti = segIndex == (segCount - 1); currEndMd = currStartMd + effectiveMaxSegLen; cvf::Vec3d segEndPoint = pathGeometry->interpolatedPointAlongWellPath(currEndMd); diff --git a/ApplicationCode/Commands/RicDeleteItemExec.cpp b/ApplicationCode/Commands/RicDeleteItemExec.cpp index ea9241c03b..9c16e4f55f 100644 --- a/ApplicationCode/Commands/RicDeleteItemExec.cpp +++ b/ApplicationCode/Commands/RicDeleteItemExec.cpp @@ -165,11 +165,11 @@ void RicDeleteItemExec::redo() std::vector views; proj->allVisibleViews(views); - for (Rim3dView* view : views) + for (Rim3dView* visibleView : views) { - if (dynamic_cast(view)) + if (dynamic_cast(visibleView)) { - view->updateConnectedEditors(); + visibleView->updateConnectedEditors(); } } } diff --git a/ApplicationCode/Commands/RicImportSummaryCasesFeature.cpp b/ApplicationCode/Commands/RicImportSummaryCasesFeature.cpp index 3a73990061..90f0630013 100644 --- a/ApplicationCode/Commands/RicImportSummaryCasesFeature.cpp +++ b/ApplicationCode/Commands/RicImportSummaryCasesFeature.cpp @@ -127,10 +127,10 @@ bool RicImportSummaryCasesFeature::createAndAddSummaryCasesFromFiles(const QStri mainPlotWindow->updateSummaryPlotToolBar(); // Close main window if there are no eclipse cases imported - std::vector cases; - app->project()->allCases(cases); + std::vector allCases; + app->project()->allCases(allCases); - if (cases.size() == 0) + if (allCases.size() == 0) { RiuMainWindow::instance()->close(); } diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogFileCurveFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogFileCurveFeature.cpp index 7d6c2770cc..fcd3018290 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogFileCurveFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogFileCurveFeature.cpp @@ -68,8 +68,8 @@ void RicNewWellLogFileCurveFeature::onActionTriggered(bool isChecked) RimWellPath* wellPath = RicWellLogTools::selectedWellPathWithLogFile(); if (wellPath) { - RimWellLogTrack* wellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(); - RimWellLogFileCurve* plotCurve = RicWellLogTools::addFileCurve(wellLogPlotTrack); + RimWellLogTrack* newWellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(); + RimWellLogFileCurve* plotCurve = RicWellLogTools::addFileCurve(newWellLogPlotTrack); plotCurve->setWellPath(wellPath); if (wellPath->wellLogFiles().size() == 1) diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogRftCurveFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogRftCurveFeature.cpp index d443ef6f45..c7451876e3 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewWellLogRftCurveFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewWellLogRftCurveFeature.cpp @@ -83,13 +83,13 @@ void RicNewWellLogRftCurveFeature::onActionTriggered(bool isChecked) RimSimWellInView* simWell = RicWellLogTools::selectedSimulationWell(&branchIndex); if (simWell) { - RimWellLogTrack* wellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(); - RimWellLogRftCurve* plotCurve = RicWellLogTools::addRftCurve(wellLogPlotTrack, simWell); + RimWellLogTrack* newWellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(); + RimWellLogRftCurve* plotCurve = RicWellLogTools::addRftCurve(newWellLogPlotTrack, simWell); plotCurve->loadDataAndUpdate(true); RimWellLogPlot* plot = nullptr; - wellLogPlotTrack->firstAncestorOrThisOfType(plot); + newWellLogPlotTrack->firstAncestorOrThisOfType(plot); if (plot && plotCurve->curveData()) { plot->setDepthUnit(plotCurve->curveData()->depthUnit()); diff --git a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp index 0e117e2a77..ed8d4ff94b 100644 --- a/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp +++ b/ApplicationCode/ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp @@ -361,24 +361,24 @@ void RivIntersectionGeometryGenerator::calculateArrays() // Accumulate triangle vertices - cvf::Vec3d p0(clippedTriangleVxes[triVxIdx+0].vx); - cvf::Vec3d p1(clippedTriangleVxes[triVxIdx+1].vx); - cvf::Vec3d p2(clippedTriangleVxes[triVxIdx+2].vx); + cvf::Vec3d point0(clippedTriangleVxes[triVxIdx+0].vx); + cvf::Vec3d point1(clippedTriangleVxes[triVxIdx+1].vx); + cvf::Vec3d point2(clippedTriangleVxes[triVxIdx+2].vx); - p0 = p0.getTransformedPoint(invSectionCS); - p1 = p1.getTransformedPoint(invSectionCS); - p2 = p2.getTransformedPoint(invSectionCS); + point0 = point0.getTransformedPoint(invSectionCS); + point1 = point1.getTransformedPoint(invSectionCS); + point2 = point2.getTransformedPoint(invSectionCS); - triangleVertices.emplace_back(p0); - triangleVertices.emplace_back(p1); - triangleVertices.emplace_back(p2); + triangleVertices.emplace_back(point0); + triangleVertices.emplace_back(point1); + triangleVertices.emplace_back(point2); // Accumulate mesh lines - meshAcc.accumulateMeshLines(cellFaceForEachClippedTriangleEdge, triVxIdx + 0, globalCellIdx, p0, p1); - meshAcc.accumulateMeshLines(cellFaceForEachClippedTriangleEdge, triVxIdx + 1, globalCellIdx, p1, p2); - meshAcc.accumulateMeshLines(cellFaceForEachClippedTriangleEdge, triVxIdx + 2, globalCellIdx, p2, p0); + meshAcc.accumulateMeshLines(cellFaceForEachClippedTriangleEdge, triVxIdx + 0, globalCellIdx, point0, point1); + meshAcc.accumulateMeshLines(cellFaceForEachClippedTriangleEdge, triVxIdx + 1, globalCellIdx, point1, point2); + meshAcc.accumulateMeshLines(cellFaceForEachClippedTriangleEdge, triVxIdx + 2, globalCellIdx, point2, point0); // Mapping to cell index diff --git a/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp b/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp index 5af982f9ef..66df45f070 100644 --- a/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp +++ b/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp @@ -140,10 +140,10 @@ void CellEdgeEffectGenerator::updateForShaderBasedRendering(cvf::Effect* effect) cvf::ShaderProgramGenerator shaderGen("CellEdgeFaceShaderProgramGenerator", cvf::ShaderSourceProvider::instance()); { - QFile data(":/Shader/fs_CellFace.glsl"); - if (data.open(QFile::ReadOnly)) + QFile file(":/Shader/fs_CellFace.glsl"); + if (file.open(QFile::ReadOnly)) { - QTextStream in(&data); + QTextStream in(&file); QString data = in.readAll(); cvf::String cvfString = cvfqt::Utils::toString(data); @@ -155,10 +155,10 @@ void CellEdgeEffectGenerator::updateForShaderBasedRendering(cvf::Effect* effect) if (m_ternaryCellScalarMapper.notNull()) { { - QFile data(":/Shader/vs_2dTextureCellFace.glsl"); - if (data.open(QFile::ReadOnly)) + QFile file(":/Shader/vs_2dTextureCellFace.glsl"); + if (file.open(QFile::ReadOnly)) { - QTextStream in(&data); + QTextStream in(&file); QString data = in.readAll(); cvf::String cvfString = cvfqt::Utils::toString(data); @@ -170,10 +170,10 @@ void CellEdgeEffectGenerator::updateForShaderBasedRendering(cvf::Effect* effect) else { { - QFile data(":/Shader/vs_CellFace.glsl"); - if (data.open(QFile::ReadOnly)) + QFile file(":/Shader/vs_CellFace.glsl"); + if (file.open(QFile::ReadOnly)) { - QTextStream in(&data); + QTextStream in(&file); QString data = in.readAll(); cvf::String cvfString = cvfqt::Utils::toString(data); diff --git a/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp b/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp index 6abefded1b..47687e3cbc 100644 --- a/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp +++ b/ApplicationCode/ModelVisualization/RivPipeGeometryGenerator.cpp @@ -362,18 +362,17 @@ cvf::ref RivPipeGeometryGenerator::generateExtrudedCylinder(do size_t segmentIdx = 0; for (segmentIdx = 0; segmentIdx < segmentCount; segmentIdx++) { - size_t i; - for (i = 0; i < crossSectionNodeCount - 1; i++) + for (size_t nodeIdx = 0; nodeIdx < crossSectionNodeCount - 1; nodeIdx++) { - quadVertexArray->add(crossSectionVertices[( (segmentIdx + 0) * crossSectionNodeCount) + i + 0]); - quadVertexArray->add(crossSectionVertices[( (segmentIdx + 0) * crossSectionNodeCount) + i + 1]); - quadVertexArray->add(crossSectionVertices[( (segmentIdx + 1) * crossSectionNodeCount) + i + 1]); - quadVertexArray->add(crossSectionVertices[( (segmentIdx + 1) * crossSectionNodeCount) + i + 0]); + quadVertexArray->add(crossSectionVertices[( (segmentIdx + 0) * crossSectionNodeCount) + nodeIdx + 0]); + quadVertexArray->add(crossSectionVertices[( (segmentIdx + 0) * crossSectionNodeCount) + nodeIdx + 1]); + quadVertexArray->add(crossSectionVertices[( (segmentIdx + 1) * crossSectionNodeCount) + nodeIdx + 1]); + quadVertexArray->add(crossSectionVertices[( (segmentIdx + 1) * crossSectionNodeCount) + nodeIdx + 0]); - quadNormalArray->add(cylinderSegmentNormals[( (segmentIdx + 0) * crossSectionNodeCount) + i + 0]); - quadNormalArray->add(cylinderSegmentNormals[( (segmentIdx + 0) * crossSectionNodeCount) + i + 1]); - quadNormalArray->add(cylinderSegmentNormals[( (segmentIdx + 0) * crossSectionNodeCount) + i + 1]); - quadNormalArray->add(cylinderSegmentNormals[( (segmentIdx + 0) * crossSectionNodeCount) + i + 0]); + quadNormalArray->add(cylinderSegmentNormals[( (segmentIdx + 0) * crossSectionNodeCount) + nodeIdx + 0]); + quadNormalArray->add(cylinderSegmentNormals[( (segmentIdx + 0) * crossSectionNodeCount) + nodeIdx + 1]); + quadNormalArray->add(cylinderSegmentNormals[( (segmentIdx + 0) * crossSectionNodeCount) + nodeIdx + 1]); + quadNormalArray->add(cylinderSegmentNormals[( (segmentIdx + 0) * crossSectionNodeCount) + nodeIdx + 0]); } // Last quad closing the cylinder diff --git a/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp b/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp index 29dfef3c0d..1a9759c4ca 100644 --- a/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivSimWellPipesPartMgr.cpp @@ -333,8 +333,8 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform cvf::ref part = pbd.m_connectionFactorGeometryGenerator->createSurfacePart(scalarMapper, eclipseView->isLightingDisabled()); if (part.notNull()) { - cvf::ref sourceInfo = new RivSimWellConnectionSourceInfo(m_simWellInView, pbd.m_connectionFactorGeometryGenerator.p()); - part->setSourceInfo(sourceInfo.p()); + cvf::ref simWellSourceInfo = new RivSimWellConnectionSourceInfo(m_simWellInView, pbd.m_connectionFactorGeometryGenerator.p()); + part->setSourceInfo(simWellSourceInfo.p()); } pbd.m_connectionFactorsPart = part; diff --git a/ApplicationCode/ModelVisualization/RivWellConnectionFactorPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellConnectionFactorPartMgr.cpp index a2f8d3d269..dadcbfd0b5 100644 --- a/ApplicationCode/ModelVisualization/RivWellConnectionFactorPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellConnectionFactorPartMgr.cpp @@ -129,30 +129,32 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode cvf::Vec3d direction = cvf::Vec3d::X_AXIS; bool foundLocation = false; - size_t i = 0; - while (!foundLocation && (i < wellPathCellIntersections.size())) { - const WellPathCellIntersectionInfo& intersectionInfo = wellPathCellIntersections[i]; - - if (intersectionInfo.globCellIndex == completionsForCell.first.globalCellIndex()) + size_t i = 0; + while (!foundLocation && (i < wellPathCellIntersections.size())) { - double startMD = intersectionInfo.startMD; - double endMD = intersectionInfo.endMD; + const WellPathCellIntersectionInfo& intersectionInfo = wellPathCellIntersections[i]; - double middleMD = (startMD + endMD) / 2.0; + if (intersectionInfo.globCellIndex == completionsForCell.first.globalCellIndex()) + { + double startMD = intersectionInfo.startMD; + double endMD = intersectionInfo.endMD; - locationInDomainCoord = m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(middleMD); + double middleMD = (startMD + endMD) / 2.0; - cvf::Vec3d p1; - cvf::Vec3d p2; - m_rimWellPath->wellPathGeometry()->twoClosestPoints(locationInDomainCoord, &p1, &p2); + locationInDomainCoord = m_rimWellPath->wellPathGeometry()->interpolatedPointAlongWellPath(middleMD); - direction = (p2 - p1).getNormalized(); + cvf::Vec3d p1; + cvf::Vec3d p2; + m_rimWellPath->wellPathGeometry()->twoClosestPoints(locationInDomainCoord, &p1, &p2); - foundLocation = true; + direction = (p2 - p1).getNormalized(); + + foundLocation = true; + } + + i++; } - - i++; } cvf::Vec3d displayCoord = coordTransform->transformToDisplayCoord(locationInDomainCoord); diff --git a/ApplicationCode/ProjectDataModel/RimFaultInViewCollection.cpp b/ApplicationCode/ProjectDataModel/RimFaultInViewCollection.cpp index 33cfd5872e..c643a62012 100644 --- a/ApplicationCode/ProjectDataModel/RimFaultInViewCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimFaultInViewCollection.cpp @@ -261,9 +261,9 @@ void RimFaultInViewCollection::syncronizeFaults() RigMainGrid* mainGrid = parentView()->mainGrid(); std::vector& nncConnections = mainGrid->nncData()->connections(); - for (size_t i = 0; i < nncConnections.size(); i++) + for (size_t connIndex = 0; connIndex < nncConnections.size(); connIndex++) { - if (!nncConnections[i].hasCommonArea()) + if (!nncConnections[connIndex].hasCommonArea()) { RimNoCommonAreaNNC* noCommonAreaNnc = new RimNoCommonAreaNNC(); @@ -272,7 +272,7 @@ void RimFaultInViewCollection::syncronizeFaults() { size_t gridLocalCellIndex; - const RigGridBase* hostGrid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(nncConnections[i].m_c1GlobIdx, &gridLocalCellIndex); + const RigGridBase* hostGrid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(nncConnections[connIndex].m_c1GlobIdx, &gridLocalCellIndex); size_t i, j, k; if (hostGrid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k)) @@ -293,7 +293,7 @@ void RimFaultInViewCollection::syncronizeFaults() { size_t gridLocalCellIndex; - const RigGridBase* hostGrid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(nncConnections[i].m_c2GlobIdx, &gridLocalCellIndex); + const RigGridBase* hostGrid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(nncConnections[connIndex].m_c2GlobIdx, &gridLocalCellIndex); size_t i, j, k; if (hostGrid->ijkFromCellIndex(gridLocalCellIndex, &i, &j, &k)) diff --git a/ApplicationCode/UserInterface/RiuViewer.cpp b/ApplicationCode/UserInterface/RiuViewer.cpp index 5c32072c58..c00b795ad3 100644 --- a/ApplicationCode/UserInterface/RiuViewer.cpp +++ b/ApplicationCode/UserInterface/RiuViewer.cpp @@ -620,9 +620,9 @@ void RiuViewer::updateLegendLayout() yPos = border + edgeAxisBorderHeight; // Set same width to all legends in the column - for (caf::TitledOverlayFrame* legend : columnLegends ) + for (caf::TitledOverlayFrame* columnLegend : columnLegends ) { - legend->setRenderSize(cvf::Vec2ui(maxColumnWidht, legend->renderSize().y())); + columnLegend->setRenderSize(cvf::Vec2ui(maxColumnWidht, columnLegend->renderSize().y())); } maxColumnWidht = 0; columnLegends.clear();