#2127 Sim Well Branches : Major refactor of sim well branch computation

Remove local branch geometry caches
Add checkbox to control if branch detection should be used
Add RiaSimWllBranchTools and move helper functions from RimProject
This commit is contained in:
Magne Sjaastad
2017-12-07 14:51:58 +01:00
parent 94a4bfeea5
commit 1841379e64
23 changed files with 345 additions and 312 deletions

View File

@@ -20,6 +20,10 @@
#include "RimWellPath.h"
#include "RiaApplication.h"
#include "RiaSimWellBranchTools.h"
#include "RiaWellNameComparer.h"
#include "RifWellPathFormationsImporter.h"
#include "RifWellPathImporter.h"
@@ -40,9 +44,6 @@
#include "RivWellPathPartMgr.h"
#include "RiaApplication.h"
#include "RiaWellNameComparer.h"
#include "cafPdmUiTreeOrdering.h"
#include "cafUtils.h"
@@ -345,9 +346,8 @@ QList<caf::PdmOptionItemInfo> RimWellPath::calculateValueOptions(const caf::PdmF
}
else if (fieldNeedingOptions == &m_branchIndex)
{
RimProject* proj = RiaApplication::instance()->project();
size_t branchCount = RimWellPath::simulationWellBranchCount(m_simWellName);
size_t branchCount = proj->simulationWellBranches(m_simWellName).size();
if (branchCount == 0)
branchCount = 1;
@@ -471,9 +471,10 @@ void RimWellPath::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiO
caf::PdmUiGroup* simWellGroup = uiOrdering.addNewGroup("Simulation Well");
simWellGroup->add(&m_simWellName);
RimProject* proj = RiaApplication::instance()->project();
if(proj->simulationWellBranches(m_simWellName).size() > 1)
if (simulationWellBranchCount(m_simWellName) > 1)
{
simWellGroup->add(&m_branchIndex);
}
caf::PdmUiGroup* ssihubGroup = uiOrdering.addNewGroup("Well Info");
ssihubGroup->add(&id);
@@ -581,6 +582,18 @@ void RimWellPath::setupBeforeSave()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimWellPath::simulationWellBranchCount(const QString& simWellName)
{
bool detectBranches = true;
auto branches = RiaSimWellBranchTools::simulationWellBranches(simWellName, detectBranches);
return branches.size();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------