mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1159 Fixed inaccurate position of new fracture when clicking in 3D view
This commit is contained in:
parent
49e0709dc6
commit
6d95d00863
@ -80,8 +80,7 @@ void RicNewWellPathFractureAtPosFeature::onActionTriggered(bool isChecked)
|
||||
RimWellPathFracture* fracture = new RimWellPathFracture();
|
||||
fractureCollection->fractures.push_back(fracture);
|
||||
|
||||
fracture->setAnchorPosition(wellPathItem->m_pipeCenterlineIntersectionInDomainCoords);
|
||||
fracture->measuredDepth = wellPathItem->m_measuredDepth;
|
||||
fracture->setMeasuredDepth(wellPathItem->m_measuredDepth);
|
||||
|
||||
RimOilField* oilfield = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType(oilfield);
|
||||
|
@ -63,7 +63,7 @@ void RicNewWellPathFractureFeature::onActionTriggered(bool isChecked)
|
||||
fractureCollection->fractures.push_back(fracture);
|
||||
|
||||
float md_default = 0.0f;
|
||||
fracture->measuredDepth = md_default;
|
||||
fracture->setMeasuredDepth(md_default);
|
||||
|
||||
RimWellPath* wellPath = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType(wellPath);
|
||||
|
@ -63,6 +63,10 @@ bool RicWellPathViewerEventHandler::handleEvent(cvf::Object* eventObject)
|
||||
cvf::Vec3d domainCoord = transForm->transformToDomainCoord(uiEvent->globalIntersectionPoint);
|
||||
|
||||
double measuredDepth = wellPathSourceInfo->measuredDepth(uiEvent->firstPartTriangleIndex, domainCoord);
|
||||
|
||||
// NOTE: This computation was used to find the location for a fracture when clicking on a well path
|
||||
// It turned out that the computation was a bit inaccurate
|
||||
// Consider to use code in RigSimulationWellCoordsAndMD instead
|
||||
cvf::Vec3d trueVerticalDepth = wellPathSourceInfo->trueVerticalDepth(uiEvent->firstPartTriangleIndex, domainCoord);
|
||||
|
||||
QString wellPathText;
|
||||
|
@ -35,8 +35,8 @@ RimWellPathFracture::RimWellPathFracture(void)
|
||||
{
|
||||
CAF_PDM_InitObject("Fracture", ":/FractureSymbol16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitField( &measuredDepth, "MeasuredDepth", 0.0f, "Measured Depth Location", "", "", "");
|
||||
measuredDepth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||
CAF_PDM_InitField( &m_measuredDepth, "MeasuredDepth", 0.0f, "Measured Depth Location", "", "", "");
|
||||
m_measuredDepth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -46,6 +46,24 @@ RimWellPathFracture::~RimWellPathFracture()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimWellPathFracture::measuredDepth() const
|
||||
{
|
||||
return m_measuredDepth();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathFracture::setMeasuredDepth(double mdValue)
|
||||
{
|
||||
m_measuredDepth = mdValue;
|
||||
|
||||
updatePositionFromMeasuredDepth();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -53,28 +71,36 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
{
|
||||
RimFracture::fieldChangedByUi(changedField, oldValue, newValue);
|
||||
|
||||
if (changedField == &measuredDepth)
|
||||
if (changedField == &m_measuredDepth)
|
||||
{
|
||||
cvf::Vec3d positionAtWellpath = cvf::Vec3d::ZERO;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(this);
|
||||
if (!objHandle) return;
|
||||
updatePositionFromMeasuredDepth();
|
||||
|
||||
RimWellPath* wellPath = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType(wellPath);
|
||||
if (!wellPath) return;
|
||||
|
||||
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
|
||||
positionAtWellpath = wellPathGeometry->interpolatedPointAlongWellPath(measuredDepth);
|
||||
|
||||
this->setAnchorPosition(positionAtWellpath);
|
||||
|
||||
RimProject* proj;
|
||||
RimProject* proj = nullptr;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
if (proj) proj->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathFracture::updatePositionFromMeasuredDepth()
|
||||
{
|
||||
cvf::Vec3d positionAlongWellpath = cvf::Vec3d::ZERO;
|
||||
|
||||
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(this);
|
||||
if (!objHandle) return;
|
||||
|
||||
RimWellPath* wellPath = nullptr;
|
||||
objHandle->firstAncestorOrThisOfType(wellPath);
|
||||
if (!wellPath) return;
|
||||
|
||||
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
|
||||
positionAlongWellpath = wellPathGeometry->interpolatedPointAlongWellPath(m_measuredDepth());
|
||||
|
||||
this->setAnchorPosition(positionAlongWellpath);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -82,7 +108,7 @@ void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
|
||||
{
|
||||
uiOrdering.add(&name);
|
||||
|
||||
uiOrdering.add(&measuredDepth);
|
||||
uiOrdering.add(&m_measuredDepth);
|
||||
|
||||
caf::PdmUiGroup* geometryGroup = uiOrdering.addNewGroup("Properties");
|
||||
geometryGroup->add(&azimuth);
|
||||
@ -100,7 +126,7 @@ void RimWellPathFracture::defineEditorAttribute(const caf::PdmFieldHandle* field
|
||||
{
|
||||
RimFracture::defineEditorAttribute(field, uiConfigName, attribute);
|
||||
|
||||
if (field == &measuredDepth)
|
||||
if (field == &m_measuredDepth)
|
||||
{
|
||||
caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>(attribute);
|
||||
|
||||
|
@ -37,12 +37,18 @@ public:
|
||||
RimWellPathFracture(void);
|
||||
virtual ~RimWellPathFracture(void);
|
||||
|
||||
caf::PdmField<float> measuredDepth;
|
||||
double measuredDepth() const;
|
||||
void setMeasuredDepth(double mdValue);
|
||||
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
protected:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
||||
|
||||
private:
|
||||
void updatePositionFromMeasuredDepth();
|
||||
|
||||
private:
|
||||
caf::PdmField<float> m_measuredDepth;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user