mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
3D Well Log Curves(#2676): Enable pick selection of the 3D Tracks and curves
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user