3D Well Log Curves(#2676): Enable pick selection of the 3D Tracks and curves

This commit is contained in:
Gaute Lindkvist
2018-04-20 16:08:17 +02:00
parent e2d5dd0381
commit 803b6b8179
12 changed files with 348 additions and 129 deletions

View File

@@ -24,6 +24,7 @@
#include "RimProject.h"
#include "cafPdmUiDoubleSliderEditor.h"
#include "cvfMath.h"
CAF_PDM_SOURCE_INIT(Rim3dWellLogCurveCollection, "Rim3dWellLogCurveCollection");
@@ -176,6 +177,36 @@ void Rim3dWellLogCurveCollection::redrawAffectedViewsAndEditors()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
Rim3dWellLogCurve* Rim3dWellLogCurveCollection::checkForCurveIntersection(const cvf::Vec3d& globalIntersection,
cvf::Vec3d* closestPoint,
double* measuredDepthAtPoint,
double* valueAtPoint)
{
double smallestDistance = std::numeric_limits<double>::max();
Rim3dWellLogCurve* closestCurve = nullptr;
for (auto& wellLogCurve : m_3dWellLogCurves)
{
cvf::Vec3d closestPointOnCurve;
double measuredDepthAtPointOnCurve;
double valueAtPointOnCurve;
if (wellLogCurve->findClosestPointOnCurve(globalIntersection, &closestPointOnCurve, &measuredDepthAtPointOnCurve, &valueAtPointOnCurve))
{
double distance = globalIntersection.pointDistance(closestPointOnCurve);
if (distance < smallestDistance)
{
closestCurve = wellLogCurve.p();
*closestPoint = closestPointOnCurve;
*measuredDepthAtPoint = measuredDepthAtPointOnCurve;
*valueAtPoint = valueAtPointOnCurve;
}
}
}
return closestCurve;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------