#1144 - pre-proto - Updating azimuth angles for fractures for connected fractures with this angle when angle is update in template.

This commit is contained in:
astridkbjorke 2017-02-01 10:49:50 +01:00
parent 701687b171
commit 3e65bcfa88
3 changed files with 31 additions and 1 deletions

View File

@ -107,6 +107,34 @@ void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* cha
proj->createDisplayModelAndRedrawAllViews();
}
}
if (changedField == &azimuthAngle)
{
RimProject* proj;
this->firstAncestorOrThisOfType(proj);
if (proj)
{
std::vector<RimFracture*> fractures;
proj->descendantsIncludingThisOfType(fractures);
for (RimFracture* fracture : fractures)
{
if (fracture->attachedFractureDefinition() == this)
{
if (abs(oldValue.toDouble() - fracture->azimuth()) < 1e-5 )
{
fracture->azimuth = azimuthAngle;
fracture->setRecomputeGeometryFlag();
}
}
}
proj->createDisplayModelAndRedrawAllViews();
}
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -245,8 +245,10 @@ cvf::Mat4f RimFracture::transformMatrix()
// Ellipsis geometry is produced in XY-plane, rotate 90 deg around X to get zero azimuth along Y
cvf::Mat4f rotationFromTesselator = cvf::Mat4f::fromRotation(cvf::Vec3f::X_AXIS, cvf::Math::toRadians(90.0f));
// Azimuth rotation
cvf::Mat4f azimuthRotation = cvf::Mat4f::fromRotation(cvf::Vec3f::Z_AXIS, cvf::Math::toRadians(-azimuth()));
//TODO: Adjust angle with 90 deg
cvf::Mat4f m = azimuthRotation * rotationFromTesselator;
m.setTranslation(cvf::Vec3f(center));

View File

@ -40,6 +40,7 @@ public:
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
void recomputeWellCenterlineCoordinates();
void updateFracturePositionFromLocation();
protected:
@ -48,7 +49,6 @@ protected:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
private:
void updateFracturePositionFromLocation();
void updateBranchGeometry();
void setBranchGeometry();