#2123 Formation/Well Path: Add access functions

This commit is contained in:
Rebecca Cox 2017-11-27 14:39:14 +01:00
parent a724049487
commit b8848317f4
2 changed files with 46 additions and 0 deletions

View File

@ -28,6 +28,47 @@ RigWellPathFormations::RigWellPathFormations(std::vector<std::pair<double, QStri
m_keyInFile = key;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const std::vector<std::pair<double, QString>>& RigWellPathFormations::measuredDepthAndFormationNames() const
{
return m_measuredDepthAndFormationNames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellPathFormations::measuredDepthAndFormationNames(std::vector<QString>& names, std::vector<double>& measuredDepths) const
{
for (std::pair<double, QString> mdAndFormName : m_measuredDepthAndFormationNames)
{
measuredDepths.push_back(mdAndFormName.first);
names.push_back(mdAndFormName.second);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellPathFormations::measuredDepthAndFormationNamesWithoutDuplicates(std::vector<QString>& names, std::vector<double>& measuredDepths) const
{
names.clear();
measuredDepths.clear();
std::map<double, QString> tempMakeVectorUniqueOnMeasuredDepth;
for (const std::pair<double, QString>& mdAndFormName : m_measuredDepthAndFormationNames)
{
if (tempMakeVectorUniqueOnMeasuredDepth.find(mdAndFormName.first) == tempMakeVectorUniqueOnMeasuredDepth.end())
{
measuredDepths.push_back(mdAndFormName.first);
names.push_back(mdAndFormName.second);
tempMakeVectorUniqueOnMeasuredDepth[mdAndFormName.first] = mdAndFormName.second;
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -32,6 +32,11 @@ class RigWellPathFormations : public cvf::Object
public:
RigWellPathFormations(std::vector<std::pair<double, QString>> measuredDepthAndFormationNames, const QString& filePath, const QString& key);
const std::vector<std::pair<double, QString>>& measuredDepthAndFormationNames() const;
void measuredDepthAndFormationNames(std::vector<QString>& names, std::vector<double>& measuredDepths) const;
void measuredDepthAndFormationNamesWithoutDuplicates(std::vector<QString>& names, std::vector<double>& measuredDepths) const;
QString filePath() const;
QString keyInFile() const;