mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3322 Well Path Creation: Use positive depth in UTM reference point
Obsoleted the original field to facilitate conversion in a transition period. Should be removed before release. Also removed output of unused fields.
This commit is contained in:
parent
98dbc4946c
commit
b9a2a382b1
@ -73,7 +73,7 @@ bool RicCreateWellTargetsPickEventHandler::handlePickEvent(const Ric3DPickEvent&
|
|||||||
cvf::Vec3d domainCoord = transForm->transformToDomainCoord(eventObject.m_pickItemInfos.front().globalPickedPoint());
|
cvf::Vec3d domainCoord = transForm->transformToDomainCoord(eventObject.m_pickItemInfos.front().globalPickedPoint());
|
||||||
if (!m_geometryToAddTargetsTo->firstActiveTarget())
|
if (!m_geometryToAddTargetsTo->firstActiveTarget())
|
||||||
{
|
{
|
||||||
m_geometryToAddTargetsTo->setReferencePoint(domainCoord);
|
m_geometryToAddTargetsTo->setReferencePointXyz(domainCoord);
|
||||||
}
|
}
|
||||||
cvf::Vec3d referencePoint = m_geometryToAddTargetsTo->referencePointXyz();
|
cvf::Vec3d referencePoint = m_geometryToAddTargetsTo->referencePointXyz();
|
||||||
cvf::Vec3d relativeTagetPoint = domainCoord - referencePoint;
|
cvf::Vec3d relativeTagetPoint = domainCoord - referencePoint;
|
||||||
|
@ -60,11 +60,8 @@ RimWellPathGeometryDef::RimWellPathGeometryDef()
|
|||||||
{
|
{
|
||||||
CAF_PDM_InitObject("Trajectory", ":/Well.png", "", "");
|
CAF_PDM_InitObject("Trajectory", ":/Well.png", "", "");
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_wellStartType, "WellStartType", "Start Type", "", "", "");
|
CAF_PDM_InitField(&m_referencePointUtmXyd, "ReferencePosUtmXyd", cvf::Vec3d(0,0,0), "UTM Reference Point", "", "", "");
|
||||||
CAF_PDM_InitField(&m_referencePointXyz, "ReferencePos", cvf::Vec3d(0,0,0), "UTM Reference Point", "", "", "");
|
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_parentWell, "ParentWell", "Parent Well", "", "", "");
|
|
||||||
CAF_PDM_InitField(&m_kickoffDepthOrMD, "KickoffDepthOrMD", 100.0, "Kickoff Depth", "", "", "");
|
|
||||||
|
|
||||||
CAF_PDM_InitFieldNoDefault(&m_wellTargets, "WellPathTargets", "Well Targets", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_wellTargets, "WellPathTargets", "Well Targets", "", "", "");
|
||||||
m_wellTargets.uiCapability()->setUiEditorTypeName(caf::PdmUiTableViewEditor::uiEditorTypeName());
|
m_wellTargets.uiCapability()->setUiEditorTypeName(caf::PdmUiTableViewEditor::uiEditorTypeName());
|
||||||
@ -75,6 +72,21 @@ RimWellPathGeometryDef::RimWellPathGeometryDef()
|
|||||||
|
|
||||||
CAF_PDM_InitField(&m_pickPointsEnabled, "m_pickPointsEnabled", false, "", "", "", "");
|
CAF_PDM_InitField(&m_pickPointsEnabled, "m_pickPointsEnabled", false, "", "", "", "");
|
||||||
caf::PdmUiPushButtonEditor::configureEditorForField(&m_pickPointsEnabled);
|
caf::PdmUiPushButtonEditor::configureEditorForField(&m_pickPointsEnabled);
|
||||||
|
|
||||||
|
// Temp conversion field.
|
||||||
|
CAF_PDM_InitField(&m_referencePointXyz_OBSOLETE, "ReferencePos", cvf::Vec3d(0,0,0), "UTM Reference Point", "", "", "");
|
||||||
|
m_referencePointXyz_OBSOLETE.uiCapability()->setUiHidden(true);
|
||||||
|
m_referencePointXyz_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||||
|
|
||||||
|
/// To be removed ?
|
||||||
|
|
||||||
|
CAF_PDM_InitFieldNoDefault(&m_wellStartType, "WellStartType", "Start Type", "", "", "");
|
||||||
|
m_wellStartType.xmlCapability()->disableIO();
|
||||||
|
CAF_PDM_InitFieldNoDefault(&m_parentWell, "ParentWell", "Parent Well", "", "", "");
|
||||||
|
m_parentWell.xmlCapability()->disableIO();
|
||||||
|
CAF_PDM_InitField(&m_kickoffDepthOrMD, "KickoffDepthOrMD", 100.0, "Kickoff Depth", "", "", "");
|
||||||
|
m_kickoffDepthOrMD.xmlCapability()->disableIO();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -89,6 +101,26 @@ RimWellPathGeometryDef::~RimWellPathGeometryDef()
|
|||||||
m_pickTargetsEventHandler = nullptr;
|
m_pickTargetsEventHandler = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
cvf::Vec3d RimWellPathGeometryDef::referencePointXyz() const
|
||||||
|
{
|
||||||
|
cvf::Vec3d xyz(m_referencePointUtmXyd());
|
||||||
|
xyz.z() = -xyz.z();
|
||||||
|
return xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellPathGeometryDef::setReferencePointXyz(const cvf::Vec3d& refPointXyz)
|
||||||
|
{
|
||||||
|
cvf::Vec3d xyd(refPointXyz);
|
||||||
|
xyd.z() = -xyd.z();
|
||||||
|
m_referencePointUtmXyd = xyd;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -273,7 +305,7 @@ void RimWellPathGeometryDef::fieldChangedByUi(const caf::PdmFieldHandle* changed
|
|||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue)
|
const QVariant& newValue)
|
||||||
{
|
{
|
||||||
if (&m_referencePointXyz == changedField)
|
if (&m_referencePointUtmXyd == changedField)
|
||||||
{
|
{
|
||||||
std::cout << "fieldChanged" << std::endl;
|
std::cout << "fieldChanged" << std::endl;
|
||||||
}
|
}
|
||||||
@ -304,7 +336,7 @@ void RimWellPathGeometryDef::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
|||||||
uiOrdering.add(&m_kickoffDepthOrMD);
|
uiOrdering.add(&m_kickoffDepthOrMD);
|
||||||
}
|
}
|
||||||
|
|
||||||
uiOrdering.add(&m_referencePointXyz);
|
uiOrdering.add(&m_referencePointUtmXyd);
|
||||||
uiOrdering.add(&m_wellTargets);
|
uiOrdering.add(&m_wellTargets);
|
||||||
uiOrdering.add(&m_pickPointsEnabled);
|
uiOrdering.add(&m_pickPointsEnabled);
|
||||||
uiOrdering.skipRemainingFields(true);
|
uiOrdering.skipRemainingFields(true);
|
||||||
@ -348,7 +380,7 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
|||||||
CVF_ASSERT(activeWellPathTargets.size() > 1);
|
CVF_ASSERT(activeWellPathTargets.size() > 1);
|
||||||
|
|
||||||
std::vector<cvf::Vec3d> endPoints;
|
std::vector<cvf::Vec3d> endPoints;
|
||||||
endPoints.push_back( activeWellPathTargets[0]->targetPointXYZ() + m_referencePointXyz() );
|
endPoints.push_back( activeWellPathTargets[0]->targetPointXYZ() + referencePointXyz() );
|
||||||
|
|
||||||
for ( size_t tIdx = 0; tIdx < activeWellPathTargets.size() - 1; ++tIdx)
|
for ( size_t tIdx = 0; tIdx < activeWellPathTargets.size() - 1; ++tIdx)
|
||||||
{
|
{
|
||||||
@ -382,9 +414,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
|||||||
RiaLogging::warning("Using fall-back calculation of well path geometry between active target number: " + QString::number(tIdx+1) + " and " + QString::number(tIdx+2));
|
RiaLogging::warning("Using fall-back calculation of well path geometry between active target number: " + QString::number(tIdx+1) + " and " + QString::number(tIdx+2));
|
||||||
}
|
}
|
||||||
|
|
||||||
endPoints.push_back( sCurveCalc.firstArcEndpoint() + m_referencePointXyz() );
|
endPoints.push_back( sCurveCalc.firstArcEndpoint() + referencePointXyz() );
|
||||||
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePointXyz() );
|
endPoints.push_back( sCurveCalc.secondArcStartpoint() + referencePointXyz() );
|
||||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePointXyz() );
|
endPoints.push_back( target2->targetPointXYZ() + referencePointXyz() );
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ( target1->targetType() == RimWellPathTarget::POINT
|
else if ( target1->targetType() == RimWellPathTarget::POINT
|
||||||
@ -414,9 +446,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
|||||||
RiaLogging::warning("Using fall-back calculation of well path geometry between active target number: " + QString::number(tIdx+1) + " and " + QString::number(tIdx+2));
|
RiaLogging::warning("Using fall-back calculation of well path geometry between active target number: " + QString::number(tIdx+1) + " and " + QString::number(tIdx+2));
|
||||||
}
|
}
|
||||||
|
|
||||||
endPoints.push_back( sCurveCalc.firstArcEndpoint() + m_referencePointXyz() );
|
endPoints.push_back( sCurveCalc.firstArcEndpoint() + referencePointXyz() );
|
||||||
endPoints.push_back( sCurveCalc.secondArcStartpoint() + m_referencePointXyz() );
|
endPoints.push_back( sCurveCalc.secondArcStartpoint() + referencePointXyz() );
|
||||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePointXyz() );
|
endPoints.push_back( target2->targetPointXYZ() + referencePointXyz() );
|
||||||
}
|
}
|
||||||
else if ( target1->targetType() == RimWellPathTarget::POINT_AND_TANGENT
|
else if ( target1->targetType() == RimWellPathTarget::POINT_AND_TANGENT
|
||||||
&& target2->targetType() == RimWellPathTarget::POINT)
|
&& target2->targetType() == RimWellPathTarget::POINT)
|
||||||
@ -428,9 +460,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
|||||||
target2->targetPointXYZ());
|
target2->targetPointXYZ());
|
||||||
if ( jCurve.isOk() )
|
if ( jCurve.isOk() )
|
||||||
{
|
{
|
||||||
endPoints.push_back(jCurve.firstArcEndpoint() + m_referencePointXyz());
|
endPoints.push_back(jCurve.firstArcEndpoint() + referencePointXyz());
|
||||||
}
|
}
|
||||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePointXyz() );
|
endPoints.push_back( target2->targetPointXYZ() + referencePointXyz() );
|
||||||
prevSegmentEndAzi = jCurve.endAzimuth();
|
prevSegmentEndAzi = jCurve.endAzimuth();
|
||||||
prevSegmentEndInc = jCurve.endInclination();
|
prevSegmentEndInc = jCurve.endInclination();
|
||||||
|
|
||||||
@ -447,9 +479,9 @@ std::vector<cvf::Vec3d> RimWellPathGeometryDef::lineArcEndpoints() const
|
|||||||
target2->targetPointXYZ());
|
target2->targetPointXYZ());
|
||||||
if ( jCurve.isOk() )
|
if ( jCurve.isOk() )
|
||||||
{
|
{
|
||||||
endPoints.push_back(jCurve.firstArcEndpoint() + m_referencePointXyz());
|
endPoints.push_back(jCurve.firstArcEndpoint() + referencePointXyz());
|
||||||
}
|
}
|
||||||
endPoints.push_back( target2->targetPointXYZ() + m_referencePointXyz() );
|
endPoints.push_back( target2->targetPointXYZ() + referencePointXyz() );
|
||||||
prevSegmentEndAzi = jCurve.endAzimuth();
|
prevSegmentEndAzi = jCurve.endAzimuth();
|
||||||
prevSegmentEndInc = jCurve.endInclination();
|
prevSegmentEndInc = jCurve.endInclination();
|
||||||
|
|
||||||
@ -528,3 +560,16 @@ void RimWellPathGeometryDef::defineEditorAttribute(const caf::PdmFieldHandle* fi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimWellPathGeometryDef::initAfterRead()
|
||||||
|
{
|
||||||
|
// To be removed before release 2018.11
|
||||||
|
|
||||||
|
if (m_referencePointXyz_OBSOLETE != cvf::Vec3d::ZERO && m_referencePointUtmXyd == cvf::Vec3d::ZERO)
|
||||||
|
{
|
||||||
|
m_referencePointUtmXyd = cvf::Vec3d(m_referencePointXyz_OBSOLETE().x(), m_referencePointXyz_OBSOLETE().y(), -m_referencePointXyz_OBSOLETE().z());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -43,8 +43,8 @@ public:
|
|||||||
|
|
||||||
enum WellStartType { START_AT_FIRST_TARGET, START_AT_SURFACE, START_FROM_OTHER_WELL, START_AT_AUTO_SURFACE };
|
enum WellStartType { START_AT_FIRST_TARGET, START_AT_SURFACE, START_FROM_OTHER_WELL, START_AT_AUTO_SURFACE };
|
||||||
|
|
||||||
cvf::Vec3d referencePointXyz() { return m_referencePointXyz;}
|
cvf::Vec3d referencePointXyz() const;
|
||||||
void setReferencePoint(const cvf::Vec3d& refPointXyz ) {m_referencePointXyz = refPointXyz;}
|
void setReferencePointXyz(const cvf::Vec3d& refPointXyz );
|
||||||
|
|
||||||
cvf::ref<RigWellPath> createWellPathGeometry();
|
cvf::ref<RigWellPath> createWellPathGeometry();
|
||||||
|
|
||||||
@ -73,7 +73,9 @@ protected:
|
|||||||
QString uiConfigName,
|
QString uiConfigName,
|
||||||
caf::PdmUiEditorAttribute* attribute) override;
|
caf::PdmUiEditorAttribute* attribute) override;
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
private:
|
||||||
void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
void fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||||
const QVariant& oldValue,
|
const QVariant& oldValue,
|
||||||
const QVariant& newValue) override;
|
const QVariant& newValue) override;
|
||||||
@ -81,20 +83,24 @@ private:
|
|||||||
caf::PdmUiOrdering& uiOrdering) override;
|
caf::PdmUiOrdering& uiOrdering) override;
|
||||||
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering,
|
void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering,
|
||||||
QString uiConfigName) override;
|
QString uiConfigName) override;
|
||||||
|
void initAfterRead() override;
|
||||||
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||||
|
|
||||||
std::vector<cvf::Vec3d> lineArcEndpoints() const;
|
std::vector<cvf::Vec3d> lineArcEndpoints() const;
|
||||||
cvf::Vec3d startTangent() const;
|
cvf::Vec3d startTangent() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
caf::PdmField<caf::AppEnum<WellStartType> > m_wellStartType;
|
caf::PdmField<cvf::Vec3d> m_referencePointUtmXyd;
|
||||||
caf::PdmField<cvf::Vec3d> m_referencePointXyz;
|
caf::PdmField<cvf::Vec3d> m_referencePointXyz_OBSOLETE;
|
||||||
|
|
||||||
caf::PdmField<double> m_kickoffDepthOrMD;
|
|
||||||
caf::PdmPtrField<RimWellPath*> m_parentWell;
|
|
||||||
|
|
||||||
caf::PdmField< bool > m_pickPointsEnabled;
|
|
||||||
|
|
||||||
caf::PdmChildArrayField<RimWellPathTarget*> m_wellTargets;
|
caf::PdmChildArrayField<RimWellPathTarget*> m_wellTargets;
|
||||||
|
|
||||||
|
caf::PdmField< bool > m_pickPointsEnabled;
|
||||||
RicCreateWellTargetsPickEventHandler* m_pickTargetsEventHandler;
|
RicCreateWellTargetsPickEventHandler* m_pickTargetsEventHandler;
|
||||||
|
|
||||||
|
// Unused for now. Remove when dust settles
|
||||||
|
|
||||||
|
caf::PdmField<caf::AppEnum<WellStartType> > m_wellStartType;
|
||||||
|
caf::PdmField<double> m_kickoffDepthOrMD;
|
||||||
|
caf::PdmPtrField<RimWellPath*> m_parentWell;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user