#1722 Completion Export : Use RimTools::wellPathCollection

This commit is contained in:
Magne Sjaastad
2018-06-26 10:12:49 +02:00
parent 7347e0ecc3
commit 4ae3290e3c
10 changed files with 44 additions and 43 deletions

View File

@@ -227,10 +227,10 @@ void RimTools::wellPathOptionItems(QList<caf::PdmOptionItemInfo>* options)
CVF_ASSERT(options);
if (!options) return;
RimProject* proj = RiaApplication::instance()->project();
if (proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection())
auto wellPathColl = RimTools::wellPathCollection();
if (wellPathColl)
{
caf::PdmChildArrayField<RimWellPath*>& wellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
caf::PdmChildArrayField<RimWellPath*>& wellPaths = wellPathColl->wellPaths;
QIcon wellIcon(":/Well.png");
for (RimWellPath* wellPath : wellPaths)
@@ -263,10 +263,10 @@ void RimTools::wellPathWithFormationsOptionItems(QList<caf::PdmOptionItemInfo>*
//--------------------------------------------------------------------------------------------------
void RimTools::wellPathWithFormations(std::vector<RimWellPath*>* wellPaths)
{
RimProject* proj = RiaApplication::instance()->project();
if (proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection())
auto wellPathColl = RimTools::wellPathCollection();
if (wellPathColl)
{
caf::PdmChildArrayField<RimWellPath*>& allWellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
caf::PdmChildArrayField<RimWellPath*>& allWellPaths = wellPathColl->wellPaths;
for (RimWellPath* wellPath : allWellPaths)
{
@@ -352,3 +352,17 @@ QString RimTools::dateFormatString()
{
return "dd.MMM yyyy";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathCollection* RimTools::wellPathCollection()
{
RimProject* proj = RiaApplication::instance()->project();
if (proj && proj->activeOilField())
{
return proj->activeOilField()->wellPathCollection();
}
return nullptr;
}