mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1722 Completion Export : Use RimTools::wellPathCollection
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
@@ -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++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user