mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Rename and moved azimuth updates to RimFracture
This commit is contained in:
parent
855960287d
commit
7717bf925f
@ -61,8 +61,9 @@ RimEllipseFractureTemplate::~RimEllipseFractureTemplate()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
{
|
{
|
||||||
|
RimFractureTemplate::fieldChangedByUi(changedField, oldValue, newValue);
|
||||||
|
|
||||||
if (changedField == &halfLength || changedField == &height || changedField == &azimuthAngle || changedField == &perforationLength || changedField == &orientation)
|
if (changedField == &halfLength || changedField == &height || changedField == &perforationLength)
|
||||||
{
|
{
|
||||||
//Changes to one of these parameters should change all fractures with this fracture template attached.
|
//Changes to one of these parameters should change all fractures with this fracture template attached.
|
||||||
RimProject* proj;
|
RimProject* proj;
|
||||||
@ -82,23 +83,6 @@ void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
|||||||
fracture->setRecomputeGeometryFlag();
|
fracture->setRecomputeGeometryFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changedField == &azimuthAngle && (abs(oldValue.toDouble() - fracture->azimuth()) < 1e-5))
|
|
||||||
{
|
|
||||||
fracture->azimuth = azimuthAngle;
|
|
||||||
fracture->setRecomputeGeometryFlag();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changedField == &orientation)
|
|
||||||
{
|
|
||||||
fracture->setAzimuth();
|
|
||||||
if (orientation() == FracOrientationEnum::AZIMUTH)
|
|
||||||
{
|
|
||||||
fracture->azimuth = azimuthAngle;
|
|
||||||
}
|
|
||||||
|
|
||||||
fracture->setRecomputeGeometryFlag();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changedField == &perforationLength && (abs(oldValue.toDouble() - fracture->perforationLength()) < 1e-5))
|
if (changedField == &perforationLength && (abs(oldValue.toDouble() - fracture->perforationLength()) < 1e-5))
|
||||||
{
|
{
|
||||||
fracture->perforationLength = perforationLength;
|
fracture->perforationLength = perforationLength;
|
||||||
@ -110,11 +94,6 @@ void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
|||||||
proj->createDisplayModelAndRedrawAllViews();
|
proj->createDisplayModelAndRedrawAllViews();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -167,7 +167,7 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
|
|||||||
//TODO: Find out if performationLength should be in RimFractureTemplate or in RimEllipseFracTemplate
|
//TODO: Find out if performationLength should be in RimFractureTemplate or in RimEllipseFracTemplate
|
||||||
if (attachedFractureDefinition()) azimuth = m_fractureTemplate->azimuthAngle();
|
if (attachedFractureDefinition()) azimuth = m_fractureTemplate->azimuthAngle();
|
||||||
else azimuth = 0.0;
|
else azimuth = 0.0;
|
||||||
setAzimuth();
|
updateAzimuthFromFractureDefinition();
|
||||||
|
|
||||||
RimStimPlanFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(attachedFractureDefinition());
|
RimStimPlanFractureTemplate* stimPlanFracTemplate = dynamic_cast<RimStimPlanFractureTemplate*>(attachedFractureDefinition());
|
||||||
if (stimPlanFracTemplate)
|
if (stimPlanFracTemplate)
|
||||||
@ -732,7 +732,7 @@ void RimFracture::setFractureTemplate(RimFractureTemplate* fractureTemplate)
|
|||||||
stimPlanTimeIndexToPlot = static_cast<int>(stimPlanFracTemplate->getStimPlanTimeValues().size() - 1);
|
stimPlanTimeIndexToPlot = static_cast<int>(stimPlanFracTemplate->getStimPlanTimeValues().size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->setAzimuth();
|
this->updateAzimuthFromFractureDefinition();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -57,7 +57,6 @@ public:
|
|||||||
|
|
||||||
cvf::Vec3d anchorPosition();
|
cvf::Vec3d anchorPosition();
|
||||||
void setAnchorPosition(const cvf::Vec3d& pos);
|
void setAnchorPosition(const cvf::Vec3d& pos);
|
||||||
virtual void setAzimuth() =0;
|
|
||||||
|
|
||||||
cvf::Mat4f transformMatrix();
|
cvf::Mat4f transformMatrix();
|
||||||
|
|
||||||
@ -82,12 +81,15 @@ public:
|
|||||||
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;
|
||||||
cvf::Vec3d fracturePosition() const;
|
cvf::Vec3d fracturePosition() const;
|
||||||
|
|
||||||
|
virtual void updateAzimuthFromFractureDefinition() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||||
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute * attribute) override;
|
||||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isRecomputeGeometryFlagSet();
|
bool isRecomputeGeometryFlagSet();
|
||||||
cvf::Vec3d fracturePositionForUi() const;
|
cvf::Vec3d fracturePositionForUi() const;
|
||||||
|
@ -97,7 +97,39 @@ caf::PdmFieldHandle* RimFractureTemplate::userDescriptionField()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
void RimFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
{
|
{
|
||||||
|
if (changedField == &azimuthAngle || changedField == &orientation)
|
||||||
|
{
|
||||||
|
//Changes to one of these parameters should change all fractures with this fracture template attached.
|
||||||
|
RimProject* proj;
|
||||||
|
this->firstAncestorOrThisOfType(proj);
|
||||||
|
if (proj)
|
||||||
|
{
|
||||||
|
//Regenerate geometry
|
||||||
|
std::vector<RimFracture*> fractures;
|
||||||
|
proj->descendantsIncludingThisOfType(fractures);
|
||||||
|
|
||||||
|
for (RimFracture* fracture : fractures)
|
||||||
|
{
|
||||||
|
if (fracture->attachedFractureDefinition() == this)
|
||||||
|
{
|
||||||
|
if (changedField == &azimuthAngle && (abs(oldValue.toDouble() - fracture->azimuth()) < 1e-5))
|
||||||
|
{
|
||||||
|
fracture->updateAzimuthFromFractureDefinition();
|
||||||
|
fracture->setRecomputeGeometryFlag();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changedField == &orientation)
|
||||||
|
{
|
||||||
|
fracture->updateAzimuthFromFractureDefinition();
|
||||||
|
|
||||||
|
fracture->setRecomputeGeometryFlag();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proj->createDisplayModelAndRedrawAllViews();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ void RimSimWellFracture::setClosestWellCoord(cvf::Vec3d& position, size_t branch
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSimWellFracture::setAzimuth()
|
void RimSimWellFracture::updateAzimuthFromFractureDefinition()
|
||||||
{
|
{
|
||||||
RimFractureTemplate::FracOrientationEnum orientation;
|
RimFractureTemplate::FracOrientationEnum orientation;
|
||||||
if (attachedFractureDefinition()) orientation = attachedFractureDefinition()->orientation();
|
if (attachedFractureDefinition()) orientation = attachedFractureDefinition()->orientation();
|
||||||
@ -80,18 +80,17 @@ void RimSimWellFracture::setAzimuth()
|
|||||||
|
|
||||||
if (orientation == RimFractureTemplate::ALONG_WELL_PATH || orientation== RimFractureTemplate::TRANSVERSE_WELL_PATH)
|
if (orientation == RimFractureTemplate::ALONG_WELL_PATH || orientation== RimFractureTemplate::TRANSVERSE_WELL_PATH)
|
||||||
{
|
{
|
||||||
updateBranchGeometry();
|
updateBranchGeometry();
|
||||||
double simWellAzimuth = m_branchCenterLines[m_branchIndex].simWellAzimuthAngle(fracturePosition());
|
double simWellAzimuth = m_branchCenterLines[m_branchIndex].simWellAzimuthAngle(fracturePosition());
|
||||||
if (orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH )
|
if (orientation == RimFractureTemplate::TRANSVERSE_WELL_PATH )
|
||||||
{
|
{
|
||||||
azimuth = simWellAzimuth;
|
azimuth = simWellAzimuth;
|
||||||
}
|
}
|
||||||
if (orientation == RimFractureTemplate::ALONG_WELL_PATH)
|
if (orientation == RimFractureTemplate::ALONG_WELL_PATH)
|
||||||
{
|
{
|
||||||
if (simWellAzimuth + 90 < 360) azimuth = simWellAzimuth + 90;
|
if (simWellAzimuth + 90 < 360) azimuth = simWellAzimuth + 90;
|
||||||
else azimuth = simWellAzimuth - 90;
|
else azimuth = simWellAzimuth - 90;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else //Azimuth value read from template
|
else //Azimuth value read from template
|
||||||
{
|
{
|
||||||
@ -112,7 +111,15 @@ void RimSimWellFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFiel
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
updateFracturePositionFromLocation();
|
updateFracturePositionFromLocation();
|
||||||
setAzimuth();
|
|
||||||
|
RimFractureTemplate::FracOrientationEnum orientation;
|
||||||
|
if (attachedFractureDefinition()) orientation = attachedFractureDefinition()->orientation();
|
||||||
|
else orientation = RimFractureTemplate::AZIMUTH;
|
||||||
|
|
||||||
|
if (orientation != RimFractureTemplate::AZIMUTH)
|
||||||
|
{
|
||||||
|
updateAzimuthFromFractureDefinition();
|
||||||
|
}
|
||||||
|
|
||||||
RimProject* proj;
|
RimProject* proj;
|
||||||
this->firstAncestorOrThisOfType(proj);
|
this->firstAncestorOrThisOfType(proj);
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
|
|
||||||
void recomputeWellCenterlineCoordinates();
|
void recomputeWellCenterlineCoordinates();
|
||||||
void updateFracturePositionFromLocation();
|
void updateFracturePositionFromLocation();
|
||||||
void setAzimuth() override;
|
void updateAzimuthFromFractureDefinition() override;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -70,6 +70,7 @@ RimStimPlanFractureTemplate::~RimStimPlanFractureTemplate()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||||
{
|
{
|
||||||
|
RimFractureTemplate::fieldChangedByUi(changedField, oldValue, newValue);
|
||||||
|
|
||||||
if (&m_stimPlanFileName == changedField)
|
if (&m_stimPlanFileName == changedField)
|
||||||
{
|
{
|
||||||
|
@ -76,7 +76,7 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
if (changedField == &m_measuredDepth)
|
if (changedField == &m_measuredDepth)
|
||||||
{
|
{
|
||||||
updatePositionFromMeasuredDepth();
|
updatePositionFromMeasuredDepth();
|
||||||
setAzimuth();
|
updateAzimuthFromFractureDefinition();
|
||||||
|
|
||||||
RimProject* proj = nullptr;
|
RimProject* proj = nullptr;
|
||||||
this->firstAncestorOrThisOfType(proj);
|
this->firstAncestorOrThisOfType(proj);
|
||||||
@ -87,7 +87,7 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimWellPathFracture::setAzimuth()
|
void RimWellPathFracture::updateAzimuthFromFractureDefinition()
|
||||||
{
|
{
|
||||||
RimFractureTemplate::FracOrientationEnum orientation;
|
RimFractureTemplate::FracOrientationEnum orientation;
|
||||||
if (attachedFractureDefinition()) orientation = attachedFractureDefinition()->orientation();
|
if (attachedFractureDefinition()) orientation = attachedFractureDefinition()->orientation();
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
void setMeasuredDepth(double mdValue);
|
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;
|
||||||
virtual void setAzimuth() override;
|
virtual void updateAzimuthFromFractureDefinition() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||||
|
Loading…
Reference in New Issue
Block a user