mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2505 CommandFile. Add scaleFractureTemplate command. Currently accepting arguments width and height
This commit is contained in:
@@ -93,16 +93,12 @@ void RimEllipseFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* cha
|
||||
|| changedField == &m_userDefinedEffectivePermeability
|
||||
|| changedField == &m_sizeScaleApplyButton)
|
||||
{
|
||||
m_sizeScaleApplyButton = false;
|
||||
|
||||
//Changes to one of these parameters should change all fractures with this fracture template attached.
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
if (proj)
|
||||
{
|
||||
//Regenerate geometry
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
setupFractureGridCells();
|
||||
}
|
||||
reload();
|
||||
}
|
||||
|
||||
if (changedField == &m_width || changedField == &m_userDefinedEffectivePermeability)
|
||||
{
|
||||
setupFractureGridCells();
|
||||
@@ -322,6 +318,21 @@ std::vector<std::pair<QString, QString>> RimEllipseFractureTemplate::uiResultNam
|
||||
return propertyNamesAndUnits;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEllipseFractureTemplate::reload()
|
||||
{
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
if (proj)
|
||||
{
|
||||
//Regenerate geometry
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
setupFractureGridCells();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -64,6 +64,7 @@ public:
|
||||
|
||||
void loadDataAndUpdate() override;
|
||||
std::vector<std::pair<QString, QString>> uiResultNamesWithUnit() const override;
|
||||
virtual void reload() override;
|
||||
|
||||
protected:
|
||||
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
|
||||
@@ -657,6 +657,15 @@ void RimFractureTemplate::setId(int id)
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFractureTemplate::setScaleFactors(double width, double height)
|
||||
{
|
||||
m_widthScaleFactor = width;
|
||||
m_heightScaleFactor = height;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -144,6 +144,8 @@ public:
|
||||
|
||||
void disconnectAllFracturesAndRedrawViews() const;
|
||||
void setId(int id);
|
||||
void setScaleFactors(double width, double height);
|
||||
virtual void reload() {}
|
||||
|
||||
protected:
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
||||
@@ -72,6 +72,18 @@ RimFractureTemplateCollection::~RimFractureTemplateCollection()
|
||||
m_fractureDefinitions.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFractureTemplate* RimFractureTemplateCollection::fractureTemplate(int id) const
|
||||
{
|
||||
for (auto templ : m_fractureDefinitions)
|
||||
{
|
||||
if (templ->id() == id) return templ;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
RimFractureTemplateCollection(void);
|
||||
virtual ~RimFractureTemplateCollection(void);
|
||||
|
||||
RimFractureTemplate* fractureTemplate(int id) const;
|
||||
std::vector<RimFractureTemplate*> fractureTemplates() const;
|
||||
void addFractureTemplate(RimFractureTemplate* templ);
|
||||
RiaEclipseUnitTools::UnitSystemType defaultUnitSystemType() const;
|
||||
|
||||
@@ -155,17 +155,7 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
||||
if (changedField == &m_sizeScaleApplyButton)
|
||||
{
|
||||
m_sizeScaleApplyButton = false;
|
||||
loadDataAndUpdate();
|
||||
//setDefaultsBasedOnXMLfile();
|
||||
|
||||
updateFractureGrid();
|
||||
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
if (proj)
|
||||
{
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
reload();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,6 +538,22 @@ void RimStimPlanFractureTemplate::convertToUnitSystem(RiaEclipseUnitTools::UnitS
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanFractureTemplate::reload()
|
||||
{
|
||||
loadDataAndUpdate();
|
||||
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
if (proj)
|
||||
{
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -91,6 +91,7 @@ public:
|
||||
|
||||
|
||||
void convertToUnitSystem(RiaEclipseUnitTools::UnitSystem neededUnit) override;
|
||||
virtual void reload() override;
|
||||
|
||||
protected:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
Reference in New Issue
Block a user