Removing (never used) arguments with default in RigWellPathIntersectionTools::findCellsIntersectedByPath (and renaming inside function)

This commit is contained in:
astridkbjorke
2017-06-14 10:31:29 +02:00
parent 28460030e5
commit 4577ef973c
2 changed files with 22 additions and 25 deletions

View File

@@ -32,14 +32,14 @@
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
std::vector<WellPathCellIntersectionInfo> RigWellPathIntersectionTools::findCellsIntersectedByPath(const RigEclipseCaseData* caseData, const std::vector<cvf::Vec3d>& coords, bool includeStartCell, bool includeEndCell) std::vector<WellPathCellIntersectionInfo> RigWellPathIntersectionTools::findCellsIntersectedByPath(const RigEclipseCaseData* caseData, const std::vector<cvf::Vec3d>& pathCoords)
{ {
std::vector<WellPathCellIntersectionInfo> intersectionInfo; std::vector<WellPathCellIntersectionInfo> intersectionInfo;
const RigMainGrid* grid = caseData->mainGrid(); const RigMainGrid* grid = caseData->mainGrid();
if (coords.size() < 2) return intersectionInfo; if (pathCoords.size() < 2) return intersectionInfo;
std::vector<HexIntersectionInfo> intersections = getIntersectedCells(grid, coords); std::vector<HexIntersectionInfo> intersections = getIntersectedCells(grid, pathCoords);
removeEnteringIntersections(&intersections); removeEnteringIntersections(&intersections);
if (intersections.empty()) return intersectionInfo; if (intersections.empty()) return intersectionInfo;
@@ -51,10 +51,9 @@ std::vector<WellPathCellIntersectionInfo> RigWellPathIntersectionTools::findCell
auto intersection = intersections.cbegin(); auto intersection = intersections.cbegin();
if (includeStartCell) //start cell
{
bool foundCell; bool foundCell;
startPoint = coords[0]; startPoint = pathCoords[0];
cellIndex = findCellFromCoords(grid, startPoint, &foundCell); cellIndex = findCellFromCoords(grid, startPoint, &foundCell);
if (foundCell) if (foundCell)
{ {
@@ -66,8 +65,8 @@ std::vector<WellPathCellIntersectionInfo> RigWellPathIntersectionTools::findCell
{ {
RiaLogging::debug("Path starts outside valid cell"); RiaLogging::debug("Path starts outside valid cell");
} }
}
//center cells
startPoint = intersection->m_intersectionPoint; startPoint = intersection->m_intersectionPoint;
cellIndex = intersection->m_hexIndex; cellIndex = intersection->m_hexIndex;
@@ -84,12 +83,10 @@ std::vector<WellPathCellIntersectionInfo> RigWellPathIntersectionTools::findCell
++intersection; ++intersection;
} }
if (includeEndCell) //end cell
{ endPoint = pathCoords[pathCoords.size() - 1];
endPoint = coords[coords.size() - 1];
internalCellLengths = calculateLengthInCell(grid, cellIndex, startPoint, endPoint); internalCellLengths = calculateLengthInCell(grid, cellIndex, startPoint, endPoint);
intersectionInfo.push_back(WellPathCellIntersectionInfo(cellIndex, startPoint, endPoint, internalCellLengths)); intersectionInfo.push_back(WellPathCellIntersectionInfo(cellIndex, startPoint, endPoint, internalCellLengths));
}
return intersectionInfo; return intersectionInfo;
} }

View File

@@ -44,7 +44,7 @@ struct WellPathCellIntersectionInfo {
size_t cellIndex; size_t cellIndex;
cvf::Vec3d startPoint; cvf::Vec3d startPoint;
cvf::Vec3d endPoint; cvf::Vec3d endPoint;
cvf::Vec3d internalCellLengths; cvf::Vec3d internalCellLengths; // intersectionLengthsInCellCS
}; };
//================================================================================================== //==================================================================================================
@@ -53,7 +53,7 @@ struct WellPathCellIntersectionInfo {
class RigWellPathIntersectionTools class RigWellPathIntersectionTools
{ {
public: public:
static std::vector<WellPathCellIntersectionInfo> findCellsIntersectedByPath(const RigEclipseCaseData* caseData, const std::vector<cvf::Vec3d>& coords, bool includeStartCell = true, bool includeEndCell = true); static std::vector<WellPathCellIntersectionInfo> findCellsIntersectedByPath(const RigEclipseCaseData* caseData, const std::vector<cvf::Vec3d>& pathCoords);
static std::vector<HexIntersectionInfo> getIntersectedCells(const RigMainGrid* grid, const std::vector<cvf::Vec3d>& coords); static std::vector<HexIntersectionInfo> getIntersectedCells(const RigMainGrid* grid, const std::vector<cvf::Vec3d>& coords);