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:
@@ -97,7 +97,39 @@ caf::PdmFieldHandle* RimFractureTemplate::userDescriptionField()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user