From a3ba1991dbf70e29b328ccde1a22e871ef6da4ed Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 4 Aug 2017 14:35:16 +0200 Subject: [PATCH] #1739 Ellipse Fracture : Recompute the fracture grid when opening project --- .../Completions/RimEllipseFractureTemplate.cpp | 11 +++++++---- .../Completions/RimEllipseFractureTemplate.h | 3 ++- .../Completions/RimFractureTemplateCollection.cpp | 7 +++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp index 754dc48e87..d1fca66680 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.cpp @@ -65,6 +65,13 @@ RimEllipseFractureTemplate::~RimEllipseFractureTemplate() { } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEllipseFractureTemplate::loadDataAndUpdate() +{ + setupFractureGridCells(); +} //-------------------------------------------------------------------------------------------------- /// @@ -139,7 +146,6 @@ void RimEllipseFractureTemplate::fractureTriangleGeometry(std::vectorsetWellCenterFractureCellIJ(wellCenterFractureCellIJ); m_fractureGrid->setICellCount(numberOfCellsX); m_fractureGrid->setJCellCount(numberOfCellsY); - - } - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.h b/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.h index 6d80565f38..48b0b4feae 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimEllipseFractureTemplate.h @@ -52,6 +52,8 @@ public: caf::PdmField width; caf::PdmField permeability; + void loadDataAndUpdate(); + virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; void fractureTriangleGeometry(std::vector* nodeCoords, @@ -68,5 +70,4 @@ protected: private: void setupFractureGridCells(); cvf::ref m_fractureGrid; - }; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp index 6d17663f82..fa8a54aeea 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFractureTemplateCollection.cpp @@ -18,6 +18,7 @@ #include "RimFractureTemplateCollection.h" +#include "RimEllipseFractureTemplate.h" #include "RimFractureTemplate.h" #include "RimStimPlanFractureTemplate.h" @@ -138,6 +139,12 @@ void RimFractureTemplateCollection::updateFilePathsFromProjectPath(const QString { stimPlanFracture->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath); } + + RimEllipseFractureTemplate* ellipseFracture = dynamic_cast(f); + if (ellipseFracture) + { + ellipseFracture->loadDataAndUpdate(); + } } }