mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2609 Well Path Creation: Discard disabled well targets
This commit is contained in:
parent
c516323acc
commit
48e93dab99
@ -82,7 +82,7 @@ cvf::ref<RigWellPath> RimWellPathGeometryDef::createWellPathGeometry()
|
||||
{
|
||||
cvf::ref<RigWellPath> wellPathGeometry = new RigWellPath;
|
||||
|
||||
if (m_wellTargets.size() < 2) return wellPathGeometry;
|
||||
if (activeWellTargets().size() < 2) return wellPathGeometry;
|
||||
|
||||
RiaPolyArcLineSampler arcLineSampler(startTangent(), lineArcEndpoints());
|
||||
|
||||
@ -189,21 +189,37 @@ void RimWellPathGeometryDef::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTree
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints()
|
||||
std::vector<RimWellPathTarget*> RimWellPathGeometryDef::activeWellTargets() const
|
||||
{
|
||||
CVF_ASSERT(m_wellTargets.size() > 1);
|
||||
std::vector<RimWellPathTarget*> active;
|
||||
for (const auto& wt : m_wellTargets)
|
||||
{
|
||||
if (wt->isEnabled())
|
||||
{
|
||||
active.push_back(wt);
|
||||
}
|
||||
}
|
||||
|
||||
return active;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
||||
{
|
||||
std::vector<RimWellPathTarget*> activeWellPathTargets = activeWellTargets();
|
||||
|
||||
CVF_ASSERT(activeWellPathTargets.size() > 1);
|
||||
|
||||
std::vector<cvf::Vec3d> endPoints;
|
||||
endPoints.push_back( activeWellPathTargets[0]->targetPointXYZ() + m_referencePoint() );
|
||||
|
||||
endPoints.push_back( m_wellTargets[0]->targetPointXYZ() + m_referencePoint() );
|
||||
|
||||
for ( size_t tIdx = 0; tIdx < m_wellTargets.size() - 1; ++tIdx)
|
||||
for ( size_t tIdx = 0; tIdx < activeWellPathTargets.size() - 1; ++tIdx)
|
||||
{
|
||||
RimWellPathTarget* target1 = activeWellPathTargets[tIdx];
|
||||
RimWellPathTarget* target2 = activeWellPathTargets[tIdx+1];
|
||||
|
||||
RimWellPathTarget* target1 = m_wellTargets[tIdx];
|
||||
RimWellPathTarget* target2 = m_wellTargets[tIdx+1];
|
||||
|
||||
|
||||
if (target1->targetType() == RimWellPathTarget::POINT_AND_TANGENT
|
||||
&& target2->targetType() == RimWellPathTarget::POINT_AND_TANGENT)
|
||||
{
|
||||
@ -231,15 +247,17 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RimWellPathGeometryDef::startTangent()
|
||||
cvf::Vec3d RimWellPathGeometryDef::startTangent() const
|
||||
{
|
||||
if (m_wellTargets[0]->targetType() == RimWellPathTarget::POINT_AND_TANGENT)
|
||||
std::vector<RimWellPathTarget*> wellTargets = activeWellTargets();
|
||||
|
||||
if (!wellTargets.empty() && wellTargets[0]->targetType() == RimWellPathTarget::POINT_AND_TANGENT)
|
||||
{
|
||||
return m_wellTargets[0]->tangent();
|
||||
return wellTargets[0]->tangent();
|
||||
}
|
||||
else
|
||||
{
|
||||
return { 0, 0, -1};
|
||||
return { 0, 0, -1 };
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,9 +61,11 @@ private:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
|
||||
std::vector<cvf::Vec3d> lineArcEndpoints();
|
||||
cvf::Vec3d startTangent();
|
||||
std::vector<RimWellPathTarget*> activeWellTargets() const;
|
||||
std::vector<cvf::Vec3d> lineArcEndpoints() const;
|
||||
cvf::Vec3d startTangent() const;
|
||||
|
||||
private:
|
||||
caf::PdmField<caf::AppEnum<WellStartType> > m_wellStartType;
|
||||
caf::PdmField<cvf::Vec3d> m_referencePoint;
|
||||
|
||||
@ -71,8 +73,6 @@ private:
|
||||
caf::PdmPtrField<RimWellPath*> m_parentWell;
|
||||
|
||||
caf::PdmChildArrayField<RimWellPathTarget*> m_wellTargets;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -41,6 +41,14 @@ RimWellPathTarget::~RimWellPathTarget()
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimWellPathTarget::isEnabled() const
|
||||
{
|
||||
return m_isEnabled;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -80,7 +88,7 @@ void RimWellPathTarget::setDerivedTangent(double azimuth, double inclination)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathTarget::TargetTypeEnum RimWellPathTarget::targetType()
|
||||
RimWellPathTarget::TargetTypeEnum RimWellPathTarget::targetType() const
|
||||
{
|
||||
return m_targetType();
|
||||
}
|
||||
@ -88,7 +96,7 @@ RimWellPathTarget::TargetTypeEnum RimWellPathTarget::targetType()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RimWellPathTarget::targetPointXYZ()
|
||||
cvf::Vec3d RimWellPathTarget::targetPointXYZ() const
|
||||
{
|
||||
cvf::Vec3d xyzPoint(m_targetPoint());
|
||||
xyzPoint.z() = -xyzPoint.z();
|
||||
@ -98,7 +106,7 @@ cvf::Vec3d RimWellPathTarget::targetPointXYZ()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathTarget::azimuth()
|
||||
double RimWellPathTarget::azimuth() const
|
||||
{
|
||||
if ( m_targetType() == POINT_AND_TANGENT )
|
||||
{
|
||||
@ -113,7 +121,7 @@ double RimWellPathTarget::azimuth()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathTarget::inclination()
|
||||
double RimWellPathTarget::inclination() const
|
||||
{
|
||||
if ( m_targetType() == POINT_AND_TANGENT )
|
||||
{
|
||||
@ -128,7 +136,7 @@ double RimWellPathTarget::inclination()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Vec3d RimWellPathTarget::tangent()
|
||||
cvf::Vec3d RimWellPathTarget::tangent() const
|
||||
{
|
||||
return cvf::Vec3d (sin(m_azimuth) * sin(m_inclination),
|
||||
cos(m_azimuth) * sin(m_inclination),
|
||||
|
@ -32,29 +32,29 @@ public:
|
||||
RimWellPathTarget();
|
||||
~RimWellPathTarget();
|
||||
|
||||
bool isEnabled() const;
|
||||
|
||||
void setAsPointTargetXYD(const cvf::Vec3d& point);
|
||||
void setAsPointAndTangentTarget(const cvf::Vec3d& point, double azimuth, double inclination);
|
||||
void setDerivedTangent(double azimuth, double inclination);
|
||||
|
||||
enum TargetTypeEnum { POINT_AND_TANGENT, POINT };
|
||||
TargetTypeEnum targetType();
|
||||
cvf::Vec3d targetPointXYZ();
|
||||
double azimuth();
|
||||
double inclination();
|
||||
cvf::Vec3d tangent();
|
||||
|
||||
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
TargetTypeEnum targetType() const;
|
||||
cvf::Vec3d targetPointXYZ() const;
|
||||
double azimuth() const;
|
||||
double inclination() const;
|
||||
cvf::Vec3d tangent() const;
|
||||
|
||||
private:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_isEnabled;
|
||||
caf::PdmField<caf::AppEnum<TargetTypeEnum> > m_targetType;
|
||||
caf::PdmField<cvf::Vec3d> m_targetPoint;
|
||||
caf::PdmField<double> m_azimuth;
|
||||
caf::PdmField<double> m_inclination;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user