(#415) Use AABB tree for searching after cells

close to line segment for Eclipse cases
Fixed crash when well path geometry is empty
This commit is contained in:
Jacob Støren
2015-09-07 16:15:37 +02:00
parent 6440215d21
commit 3468160d8f
3 changed files with 11 additions and 5 deletions

View File

@@ -26,6 +26,7 @@
#include "cvfGeometryTools.h"
#include "RigWellLogExtractionTools.h"
#include "RigMainGrid.h"
//==================================================================================================
///
@@ -47,6 +48,8 @@ void RigEclipseWellLogExtractor::calculateIntersection()
double globalMeasuredDepth = 0; // Where do we start ? z - of first well path point ?
if (!m_wellPath->m_wellPathPoints.size()) return ;
for (size_t wpp = 0; wpp < m_wellPath->m_wellPathPoints.size() - 1; ++wpp)
{
cvf::BoundingBox bb;
@@ -133,10 +136,13 @@ void RigEclipseWellLogExtractor::curveData(const RigResultAccessor* resultAccess
//--------------------------------------------------------------------------------------------------
std::vector<size_t> RigEclipseWellLogExtractor::findCloseCells(const cvf::BoundingBox& bb)
{
std::vector<size_t> closeCells;
m_caseData->mainGrid()->findIntersectingCells(bb, &closeCells);
#if 0
const std::vector<RigCell>& cells = m_caseData->mainGrid()->cells();
const std::vector<cvf::Vec3d>& nodeCoords = m_caseData->mainGrid()->nodes();
std::vector<size_t> closeCells;
size_t cellCount = cells.size();
for (size_t cIdx = 0; cIdx < cellCount; ++cIdx)
@@ -157,7 +163,7 @@ std::vector<size_t> RigEclipseWellLogExtractor::findCloseCells(const cvf::Boundi
closeCells.push_back(cIdx);
}
}
#endif
return closeCells;
}