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

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