#1040 - pre-proto - Updating size of ellipse visualizing fracture when template height / halflength is updated

This commit is contained in:
astridkbjorke 2017-01-06 13:55:26 +01:00
parent 2a6cceff62
commit 31505c3b49
3 changed files with 41 additions and 12 deletions

View File

@ -19,6 +19,8 @@
#include "RimFractureDefinition.h"
#include "cafPdmObject.h"
#include "RimProject.h"
#include "RimFracture.h"
@ -73,6 +75,35 @@ caf::PdmFieldHandle* RimFractureDefinition::userDescriptionField()
return &name;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureDefinition::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
if (changedField == &halfLength || changedField == &height)
{
RimProject* proj;
this->firstAncestorOrThisOfType(proj);
if (proj)
{
//Regenerate geometry
std::vector<RimFracture*> fractures;
proj->descendantsIncludingThisOfType(fractures);
for (RimFracture* fracture : fractures)
{
if (fracture->attachedFractureDefinition() == this)
{
fracture->setRecomputeGeometryFlag();
}
}
proj->createDisplayModelAndRedrawAllViews();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -20,6 +20,7 @@
#include "cafAppEnum.h"
#include "cafPdmField.h"
#include "cafPdmFieldHandle.h"
#include "cafPdmObject.h"
@ -52,7 +53,8 @@ public:
};
caf::PdmField< caf::AppEnum< FracOrientationEnum > > orientation;
virtual caf::PdmFieldHandle* userDescriptionField() override;
virtual caf::PdmFieldHandle* userDescriptionField() override;
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering);

View File

@ -143,18 +143,14 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
RigWellPath* wellPathGeometry = wellPath->wellPathGeometry();
positionAtWellpath = wellPathGeometry->interpolatedPointAlongWellPath(measuredDepth);
//wellPath->partMgr()->scheduleGeometryRegen();
setRecomputeGeometryFlag();
RimProject* proj;
this->firstAncestorOrThisOfType(proj);
if (proj)
{
proj->createDisplayModelAndRedrawAllViews();
}
}
setRecomputeGeometryFlag();
RimProject* proj;
this->firstAncestorOrThisOfType(proj);
if (proj) proj->createDisplayModelAndRedrawAllViews();
}
//--------------------------------------------------------------------------------------------------