Fix warnings

This commit is contained in:
Magne Sjaastad 2018-09-27 20:40:05 +02:00
parent 4877e058ed
commit acf6a17c40
14 changed files with 84 additions and 80 deletions

View File

@ -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
{

View File

@ -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);
}
}

View File

@ -2591,9 +2591,9 @@ std::vector<SubSegmentIntersectionInfo> 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);

View File

@ -165,11 +165,11 @@ void RicDeleteItemExec::redo()
std::vector<Rim3dView*> views;
proj->allVisibleViews(views);
for (Rim3dView* view : views)
for (Rim3dView* visibleView : views)
{
if (dynamic_cast<RimEclipseView*>(view))
if (dynamic_cast<RimEclipseView*>(visibleView))
{
view->updateConnectedEditors();
visibleView->updateConnectedEditors();
}
}
}

View File

@ -127,10 +127,10 @@ bool RicImportSummaryCasesFeature::createAndAddSummaryCasesFromFiles(const QStri
mainPlotWindow->updateSummaryPlotToolBar();
// Close main window if there are no eclipse cases imported
std::vector<RimCase*> cases;
app->project()->allCases(cases);
std::vector<RimCase*> allCases;
app->project()->allCases(allCases);
if (cases.size() == 0)
if (allCases.size() == 0)
{
RiuMainWindow::instance()->close();
}

View File

@ -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)

View File

@ -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());

View File

@ -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

View File

@ -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);

View File

@ -362,18 +362,17 @@ cvf::ref<cvf::DrawableGeo> 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

View File

@ -333,8 +333,8 @@ void RivSimWellPipesPartMgr::buildWellPipeParts(const caf::DisplayCoordTransform
cvf::ref<cvf::Part> part = pbd.m_connectionFactorGeometryGenerator->createSurfacePart(scalarMapper, eclipseView->isLightingDisabled());
if (part.notNull())
{
cvf::ref<RivSimWellConnectionSourceInfo> sourceInfo = new RivSimWellConnectionSourceInfo(m_simWellInView, pbd.m_connectionFactorGeometryGenerator.p());
part->setSourceInfo(sourceInfo.p());
cvf::ref<RivSimWellConnectionSourceInfo> simWellSourceInfo = new RivSimWellConnectionSourceInfo(m_simWellInView, pbd.m_connectionFactorGeometryGenerator.p());
part->setSourceInfo(simWellSourceInfo.p());
}
pbd.m_connectionFactorsPart = part;

View File

@ -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);

View File

@ -261,9 +261,9 @@ void RimFaultInViewCollection::syncronizeFaults()
RigMainGrid* mainGrid = parentView()->mainGrid();
std::vector<RigConnection>& 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))

View File

@ -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();