#2122 Formation/Well Path: Set formations path and key on RimWellPath

This commit is contained in:
Rebecca Cox
2017-11-27 10:33:41 +01:00
parent 5ed072007d
commit 8c57fdf22a
10 changed files with 103 additions and 50 deletions

View File

@@ -36,7 +36,8 @@ std::map<QString, std::vector<std::pair<double, QString>>> RifWellPathFormationR
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<QString, cvf::ref<RigWellPathFormations>> RifWellPathFormationReader::readWellFormationsToGeometry(const QString& filePath)
std::map<QString, cvf::ref<RigWellPathFormations>>
RifWellPathFormationReader::readWellFormationsToGeometry(const QString& filePath)
{
std::map<QString, cvf::ref<RigWellPathFormations>> result;
@@ -48,9 +49,10 @@ std::map<QString, cvf::ref<RigWellPathFormations>> RifWellPathFormationReader::r
for (it = formations.begin(); it != formations.end(); it++)
{
cvf::ref<RigWellPathFormations> wellPathFormations = new RigWellPathFormations(it->second);
result[it->first] = wellPathFormations;
cvf::ref<RigWellPathFormations> wellPathFormations = new RigWellPathFormations(it->second, filePath, it->first);
result[it->first] = wellPathFormations;
}
return result;
}

View File

@@ -26,7 +26,33 @@ cvf::ref<RigWellPathFormations> RifWellPathFormationsImporter::readWellPathForma
const QString& wellName)
{
readAllWellPathFormations(formationFilePath);
return m_fileNameToWellPathFormationMap[formationFilePath][wellName];
if (m_fileNameToWellPathFormationMap[formationFilePath].find(wellName) != m_fileNameToWellPathFormationMap[formationFilePath].end())
{
return m_fileNameToWellPathFormationMap[formationFilePath][wellName];
}
else
{
return nullptr;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<QString, cvf::ref<RigWellPathFormations>> RifWellPathFormationsImporter::readWellPathFormationsFromPath(const QString& filePath)
{
// If we have the file in the map, assume it is already read.
if (m_fileNameToWellPathFormationMap.find(filePath) != m_fileNameToWellPathFormationMap.end())
{
return m_fileNameToWellPathFormationMap[filePath];
}
std::map<QString, cvf::ref<RigWellPathFormations>> wellPathToFormationMap =
RifWellPathFormationReader::readWellFormationsToGeometry(filePath);
m_fileNameToWellPathFormationMap[filePath] = wellPathToFormationMap;
return wellPathToFormationMap;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -38,6 +38,8 @@ class RifWellPathFormationsImporter
public:
cvf::ref<RigWellPathFormations> readWellPathFormations(const QString& formationFilePath, const QString& wellName);
std::map<QString, cvf::ref<RigWellPathFormations>> readWellPathFormationsFromPath(const QString& filePath);
private:
void readAllWellPathFormations(const QString& filePath);