#3685 Well Path Creation: Set MDRKB at first target when starting from an existing wellpath

This commit is contained in:
Magne Sjaastad 2018-11-16 11:35:13 +01:00
parent 9cd695278e
commit 3c3bb153ac
3 changed files with 28 additions and 2 deletions

View File

@ -34,6 +34,7 @@
#include <vector>
#include "RiuViewerCommands.h"
#include "RimModeledWellPath.h"
//--------------------------------------------------------------------------------------------------
@ -83,8 +84,10 @@ bool RicCreateWellTargetsPickEventHandler::handlePickEvent(const Ric3DPickEvent&
auto wellPathSourceInfo = dynamic_cast<const RivWellPathSourceInfo*>(firstPickItem.sourceInfo());
auto intersectionPointInDomain = rimView->displayCoordTransform()->transformToDomainCoord(firstPickItem.globalPickedPoint());
bool doSetAzimuthAndInclination;
double azimuth = 0.0, inclination = 0.0;
bool doSetAzimuthAndInclination = false;
double azimuth = 0.0;
double inclination = 0.0;
if (wellPathSourceInfo)
{
targetPointInDomain = wellPathSourceInfo->closestPointOnCenterLine(firstPickItem.faceIdx(), intersectionPointInDomain);
@ -101,7 +104,21 @@ bool RicCreateWellTargetsPickEventHandler::handlePickEvent(const Ric3DPickEvent&
if (!m_geometryToAddTargetsTo->firstActiveTarget())
{
m_geometryToAddTargetsTo->setReferencePointXyz(targetPointInDomain);
if (wellPathSourceInfo)
{
double mdrkbAtFirstTarget = wellPathSourceInfo->measuredDepth(firstPickItem.faceIdx(), intersectionPointInDomain);
RimModeledWellPath* modeledWellPath = dynamic_cast<RimModeledWellPath*>(wellPathSourceInfo->wellPath());
if (modeledWellPath)
{
mdrkbAtFirstTarget += modeledWellPath->geometryDefinition()->mdrkbAtFirstTarget();
}
m_geometryToAddTargetsTo->setMdrkbAtFirstTarget(mdrkbAtFirstTarget);
}
}
cvf::Vec3d referencePoint = m_geometryToAddTargetsTo->referencePointXyz();
cvf::Vec3d relativeTagetPoint = targetPointInDomain - referencePoint;

View File

@ -133,6 +133,14 @@ double RimWellPathGeometryDef::mdrkbAtFirstTarget() const
return m_mdrkbAtFirstTarget;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathGeometryDef::setMdrkbAtFirstTarget(double mdrkb)
{
m_mdrkbAtFirstTarget = mdrkb;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -49,6 +49,7 @@ public:
void setReferencePointXyz(const cvf::Vec3d& refPointXyz );
double mdrkbAtFirstTarget() const;
void setMdrkbAtFirstTarget(double mdrkb);
cvf::ref<RigWellPath> createWellPathGeometry();