#2123 Formation/Well Path: Add func to find well paths with formations

This commit is contained in:
Rebecca Cox
2017-11-27 14:36:19 +01:00
parent bdc680bc03
commit a724049487
4 changed files with 48 additions and 0 deletions

View File

@@ -240,6 +240,30 @@ void RimTools::wellPathOptionItems(QList<caf::PdmOptionItemInfo>* options)
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimTools::wellPathWithFormationsOptionItems(QList<caf::PdmOptionItemInfo>* options)
{
CVF_ASSERT(options);
if (!options) return;
RimProject* proj = RiaApplication::instance()->project();
if (proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection())
{
caf::PdmChildArrayField<RimWellPath*>& wellPaths = proj->activeOilField()->wellPathCollection()->wellPaths;
QIcon wellIcon(":/Well.png");
for (RimWellPath* wellPath : wellPaths)
{
if (wellPath->hasFormations())
{
options->push_back(caf::PdmOptionItemInfo(wellPath->name(), wellPath, false, wellIcon));
}
}
}
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -42,6 +42,7 @@ public:
static QString relocateFile(const QString& fileName, const QString& newProjectPath, const QString& oldProjectPath, bool* foundFile, std::vector<QString>* searchedPaths); static QString relocateFile(const QString& fileName, const QString& newProjectPath, const QString& oldProjectPath, bool* foundFile, std::vector<QString>* searchedPaths);
static void wellPathOptionItems(QList<caf::PdmOptionItemInfo>* options); static void wellPathOptionItems(QList<caf::PdmOptionItemInfo>* options);
static void wellPathWithFormationsOptionItems(QList<caf::PdmOptionItemInfo>* options);
static void caseOptionItems(QList<caf::PdmOptionItemInfo>* options); static void caseOptionItems(QList<caf::PdmOptionItemInfo>* options);
static QString createTimeFormatStringFromDates(const std::vector<QDateTime>& dates); static QString createTimeFormatStringFromDates(const std::vector<QDateTime>& dates);

View File

@@ -726,6 +726,27 @@ bool RimWellPath::readWellPathFormationsFile(QString* errorMessage, RifWellPathF
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellPath::hasFormations() const
{
if (m_wellPathFormations.isNull())
{
return false;
}
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigWellPathFormations* RimWellPath::formationsGeometry() const
{
return m_wellPathFormations.p();
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------

View File

@@ -74,6 +74,8 @@ public:
void setFormationsGeometry(cvf::ref<RigWellPathFormations> wellPathFormations); void setFormationsGeometry(cvf::ref<RigWellPathFormations> wellPathFormations);
bool readWellPathFormationsFile(QString* errorMessage, RifWellPathFormationsImporter* wellPathFormationsImporter); bool readWellPathFormationsFile(QString* errorMessage, RifWellPathFormationsImporter* wellPathFormationsImporter);
bool hasFormations() const;
const RigWellPathFormations* formationsGeometry() const;
virtual caf::PdmFieldHandle* userDescriptionField() override; virtual caf::PdmFieldHandle* userDescriptionField() override;
virtual caf::PdmFieldHandle* objectToggleField() override; virtual caf::PdmFieldHandle* objectToggleField() override;