Well Lateral : Connect new lateral close to total depth

This commit is contained in:
Magne Sjaastad
2021-05-11 07:43:18 +02:00
parent 282c6f3586
commit 2eced13e28
2 changed files with 12 additions and 0 deletions

View File

@@ -20,6 +20,7 @@
#include "RicNewWellPathLateralAtDepthFeature.h"
#include "RigWellPath.h"
#include "RimWellPath.h"
#include "cafSelectionManager.h"
@@ -47,6 +48,14 @@ void RicNewWellPathLateralFeature::onActionTriggered( bool isChecked )
if ( !parentWellPath ) return;
double measuredDepth = 0.0;
if ( parentWellPath->wellPathGeometry() && parentWellPath->wellPathGeometry()->measuredDepths().size() > 2 )
{
// Create new well close to the total depth of parent well
double mdCandidate = parentWellPath->wellPathGeometry()->measuredDepths().back() - 100.0;
measuredDepth = std::max( 0.0, mdCandidate );
}
RicNewWellPathLateralAtDepthFeature::createLateralAtMeasuredDepth( parentWellPath, measuredDepth );
}