30 std::list<std::string>& well_path_fnames,
31 std::string& unique_model_name,
33 : _unique_name(unique_model_name),
36 ply_vec(new std::vector<
GeoLib::Polyline*>)
38 for (std::list<std::string>::const_iterator it(sfc_fnames.begin());
39 it != sfc_fnames.end();
42 INFO(
"PetrelInterface::PetrelInterface(): open surface file.");
43 std::ifstream in((*it).c_str());
46 INFO(
"PetrelInterface::PetrelInterface(): \tdone.");
53 "PetrelInterface::PetrelInterface(): \tCould not open file "
59 for (std::list<std::string>::const_iterator it(well_path_fnames.begin());
60 it != well_path_fnames.end();
63 INFO(
"PetrelInterface::PetrelInterface(): open well path file.");
64 std::ifstream in((*it).c_str());
67 INFO(
"PetrelInterface::PetrelInterface(): \tdone.");
74 "PetrelInterface::PetrelInterface(): \tCould not open well "
86 std::unique_ptr<std::vector<GeoLib::Point*>>(
well_vec),
92 std::unique_ptr<std::vector<GeoLib::Polyline*>>(
ply_vec),
101 std::string line(buffer);
103 if (line.find(
"# Petrel Points with attributes") != std::string::npos)
113 while (line.find(
"END HEADER") == std::string::npos)
120 std::size_t idx(
pnt_vec->size());
124 in >> *((*pnt_vec)[idx]);
127 delete (*pnt_vec)[idx];
139 "PetrelInterface::readPetrelSurface(): problem reading petrel "
140 "points from line\n'{:s}'.",
149 std::string line(buffer);
151 if (line.find(
"# WELL TRACE FROM PETREL") != std::string::npos)
158 std::list<std::string>::const_iterator it(str_list.begin());
159 while (it != str_list.end())
161 INFO(
"PetrelInterface::readPetrelWellTrace(): well name: {:s}.",
170 it = str_list.begin();
171 while (it != str_list.end())
174 "PetrelInterface::readPetrelWellTrace(): well head x coord: "
179 it = (str_list.end())--;
182 double well_head_x(strtod((*it).c_str(), &buf));
188 it = str_list.begin();
189 while (it != str_list.end())
192 "PetrelInterface::readPetrelWellTrace(): well head y coord: "
197 it = (str_list.end())--;
199 double well_head_y(strtod((*it).c_str(), &buf));
205 it = str_list.begin();
206 while (it != str_list.end())
208 INFO(
"PetrelInterface::readPetrelWellTrace(): well kb entry: {:s}.",
212 it = (str_list.end())--;
214 double well_kb(strtod((*it).c_str(), &buf));
216 INFO(
"PetrelInterface::readPetrelWellTrace(): {:f}, {:f}, {:f}.",
220 double const depth = 0.0;
221 std::string
const borehole_name =
"";
224 well_head_x, well_head_y, well_kb, depth, borehole_name, date));
238 std::string line(buffer);
243 while (line[0] ==
'#')
251 auto it = str_list.begin();
252 while (it != str_list.end())
255 "PetrelInterface::readPetrelWellTraceData(): column information: "
276 if (line.size() > 1 && line[0] !=
'#')
278 std::stringstream stream(line);
280 stream >> x >> y >> z;
284 ->addSoilLayer(x, y, z,
"unknown");
285 stream >> tvd >> dx >> dy >> azim >> incl >> dls;
Definition of the GEOObjects class.
void INFO(char const *fmt, Args const &... args)
void WARN(char const *fmt, Args const &... args)
Definition of the PetrelInterface class.
Definition of the StationBorehole class.
void readPetrelSurface(std::istream &in)
std::vector< GeoLib::Point * > * pnt_vec
std::vector< GeoLib::Point * > * well_vec
void readPetrelWellTrace(std::istream &in)
void readPetrelWellTraceData(std::istream &in)
static const std::size_t MAX_COLS_PER_ROW
std::vector< GeoLib::Polyline * > * ply_vec
PetrelInterface(std::list< std::string > &sfc_fnames, std::list< std::string > &well_path_fnames, std::string &unique_model_name, GeoLib::GEOObjects *geo_obj)
Container class for geometric objects.
void addStationVec(std::unique_ptr< std::vector< Point * >> stations, std::string &name)
Adds a vector of stations with the given name and colour to GEOObjects.
void addPointVec(std::unique_ptr< std::vector< Point * >> points, std::string &name, std::unique_ptr< std::map< std::string, std::size_t >> pnt_id_name_map=nullptr, double eps=std::sqrt(std::numeric_limits< double >::epsilon()))
void addPolylineVec(std::unique_ptr< std::vector< Polyline * >> lines, const std::string &name, std::unique_ptr< std::map< std::string, std::size_t >> ply_names=nullptr)
A borehole as a geometric object.
std::vector< std::string > splitString(std::string const &str)
TemplateElement< PointRule1 > Point