(#557, #560, #561) WLP: White space cleanup

This commit is contained in:
Jacob Støren
2015-10-14 10:13:04 +02:00
parent 9fa2395fdc
commit 33aed754d9
2 changed files with 56 additions and 63 deletions

View File

@@ -46,71 +46,68 @@ void RigEclipseWellLogExtractor::calculateIntersection()
{
std::map<RigMDCellIdxEnterLeaveIntersectionSorterKey, HexIntersectionInfo > uniqueIntersections;
const std::vector<cvf::Vec3d>& nodeCoords = m_caseData->mainGrid()->nodes();
bool isCellFaceNormalsOut = m_caseData->mainGrid()->isFaceNormalsOutwards();
const std::vector<cvf::Vec3d>& nodeCoords = m_caseData->mainGrid()->nodes();
bool isCellFaceNormalsOut = m_caseData->mainGrid()->isFaceNormalsOutwards();
if (!m_wellPath->m_wellPathPoints.size()) return ;
if (!m_wellPath->m_wellPathPoints.size()) return ;
for (size_t wpp = 0; wpp < m_wellPath->m_wellPathPoints.size() - 1; ++wpp)
for (size_t wpp = 0; wpp < m_wellPath->m_wellPathPoints.size() - 1; ++wpp)
{
std::vector<HexIntersectionInfo> intersections;
cvf::Vec3d p1 = m_wellPath->m_wellPathPoints[wpp];
cvf::Vec3d p2 = m_wellPath->m_wellPathPoints[wpp+1];
cvf::BoundingBox bb;
bb.add(p1);
bb.add(p2);
std::vector<size_t> closeCells = findCloseCells(bb);
cvf::Vec3d hexCorners[8];
for (size_t cIdx = 0; cIdx < closeCells.size(); ++cIdx)
{
std::vector<HexIntersectionInfo> intersections;
cvf::Vec3d p1 = m_wellPath->m_wellPathPoints[wpp];
cvf::Vec3d p2 = m_wellPath->m_wellPathPoints[wpp+1];
const RigCell& cell = m_caseData->mainGrid()->cells()[closeCells[cIdx]];
const caf::SizeTArray8& cornerIndices = cell.cornerIndices();
cvf::BoundingBox bb;
bb.add(p1);
bb.add(p2);
std::vector<size_t> closeCells = findCloseCells(bb);
cvf::Vec3d hexCorners[8];
for (size_t cIdx = 0; cIdx < closeCells.size(); ++cIdx)
{
const RigCell& cell = m_caseData->mainGrid()->cells()[closeCells[cIdx]];
const caf::SizeTArray8& cornerIndices = cell.cornerIndices();
hexCorners[0] = nodeCoords[cornerIndices[0]];
hexCorners[1] = nodeCoords[cornerIndices[1]];
hexCorners[2] = nodeCoords[cornerIndices[2]];
hexCorners[3] = nodeCoords[cornerIndices[3]];
hexCorners[4] = nodeCoords[cornerIndices[4]];
hexCorners[5] = nodeCoords[cornerIndices[5]];
hexCorners[6] = nodeCoords[cornerIndices[6]];
hexCorners[7] = nodeCoords[cornerIndices[7]];
int intersectionCount = RigHexIntersector::lineHexCellIntersection(p1, p2, hexCorners, closeCells[cIdx], &intersections);
}
if (!isCellFaceNormalsOut)
{
for (size_t intIdx = 0; intIdx < intersections.size(); ++intIdx)
{
intersections[intIdx].m_isIntersectionEntering = !intersections[intIdx].m_isIntersectionEntering ;
}
}
// Now, with all the intersections of this piece of line, we need to
// sort them in order, and set the measured depth and corresponding cell index
// Inserting the intersections in this map will remove identical intersections
// and sort them according to MD, CellIdx, Leave/enter
double md1 = m_wellPath->m_measuredDepths[wpp];
double md2 = m_wellPath->m_measuredDepths[wpp+1];
insertIntersectionsInMap(intersections,
p1, md1, p2, md2,
&uniqueIntersections);
hexCorners[0] = nodeCoords[cornerIndices[0]];
hexCorners[1] = nodeCoords[cornerIndices[1]];
hexCorners[2] = nodeCoords[cornerIndices[2]];
hexCorners[3] = nodeCoords[cornerIndices[3]];
hexCorners[4] = nodeCoords[cornerIndices[4]];
hexCorners[5] = nodeCoords[cornerIndices[5]];
hexCorners[6] = nodeCoords[cornerIndices[6]];
hexCorners[7] = nodeCoords[cornerIndices[7]];
int intersectionCount = RigHexIntersector::lineHexCellIntersection(p1, p2, hexCorners, closeCells[cIdx], &intersections);
}
if (!isCellFaceNormalsOut)
{
for (size_t intIdx = 0; intIdx < intersections.size(); ++intIdx)
{
intersections[intIdx].m_isIntersectionEntering = !intersections[intIdx].m_isIntersectionEntering ;
}
}
// Now, with all the intersections of this piece of line, we need to
// sort them in order, and set the measured depth and corresponding cell index
// Inserting the intersections in this map will remove identical intersections
// and sort them according to MD, CellIdx, Leave/enter
double md1 = m_wellPath->m_measuredDepths[wpp];
double md2 = m_wellPath->m_measuredDepths[wpp+1];
insertIntersectionsInMap(intersections,
p1, md1, p2, md2,
&uniqueIntersections);
}
this->populateReturnArrays(uniqueIntersections);
}
//--------------------------------------------------------------------------------------------------