#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

@@ -30,11 +30,11 @@
#include "RimEllipseFractureTemplate.h"
#include "RimFracture.h"
#include "RimFractureTemplate.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimSimWellInViewCollection.h"
#include "RimStimPlanColors.h"
#include "RimStimPlanFractureTemplate.h"
#include "RimTools.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPathFracture.h"
@@ -329,7 +329,7 @@ void RimFractureTemplateCollection::initAfterRead()
bool setAllShowMeshToFalseOnAllEclipseViews = false;
std::vector<RimWellPathFracture*> wellPathFractures;
RimWellPathCollection* wellPathCollection = proj->activeOilField()->wellPathCollection();
RimWellPathCollection* wellPathCollection = RimTools::wellPathCollection();
wellPathCollection->descendantsIncludingThisOfType(wellPathFractures);
for (RimWellPathFracture* fracture : wellPathFractures)

View File

@@ -26,8 +26,8 @@
#include "RimCase.h"
#include "RimGridView.h"
#include "RimMainPlotCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimTools.h"
#include "RimViewController.h"
#include "RimViewLinker.h"
#include "RimWellPathCollection.h"
@@ -407,11 +407,7 @@ void Rim3dView::endAnimation()
//--------------------------------------------------------------------------------------------------
RimWellPathCollection* Rim3dView::wellPathCollection() const
{
RimProject* proj = nullptr;
this->firstAncestorOrThisOfTypeAsserted(proj);
CVF_ASSERT(proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection());
return proj->activeOilField()->wellPathCollection();
return RimTools::wellPathCollection();
}
//--------------------------------------------------------------------------------------------------

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;
}

View File

@@ -33,6 +33,8 @@ namespace caf {
class PdmOptionItemInfo;
}
class RimWellPathCollection;
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -51,4 +53,6 @@ public:
static QString createTimeFormatStringFromDates(const std::vector<QDateTime>& dates);
static QString dateFormatString();
static RimWellPathCollection* wellPathCollection();
};

View File

@@ -22,16 +22,16 @@
#include "RigWellLogCurveData.h"
#include "RigWellPath.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimTools.h"
#include "RimWellLogFile.h"
#include "RimWellLogFileChannel.h"
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellRftPlot.h"
#include "RimWellPlotTools.h"
#include "RimWellRftPlot.h"
#include "RiuLineSegmentQwtPlotCurve.h"
#include "RiuWellLogTrack.h"
@@ -275,10 +275,10 @@ QList<caf::PdmOptionItemInfo> RimWellLogFileCurve::calculateValueOptions(const c
if (fieldNeedingOptions == &m_wellPath)
{
RimProject* proj = RiaApplication::instance()->project();
if (proj->activeOilField()->wellPathCollection())
auto wellPathColl = RimTools::wellPathCollection();
if (wellPathColl)
{
caf::PdmChildArrayField<RimWellPath*>& wellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
caf::PdmChildArrayField<RimWellPath*>& wellPaths = wellPathColl->wellPaths;
for (size_t i = 0; i < wellPaths.size(); i++)
{