OGS
XmlStnInterface.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <vector>
7
10
11namespace GeoLib {
12class GEOObjects;
13class Point;
14class StationBorehole;
15
16namespace IO
17{
18
24{
25public:
26 explicit XmlStnInterface(GeoLib::GEOObjects& geo_objs);
27
29 int readFile(const QString& fileName) override;
30
31 bool readFile(std::string const& fname) override
32 {
33 return readFile(QString(fname.c_str())) != 0;
34 }
35
36protected:
37 bool write() override;
38
39private:
41 void readStations(const QDomNode& stationsRoot,
42 std::vector<GeoLib::Point*>& stations,
43 const std::string& station_file_name);
44
46 void writeBoreholeData(QDomDocument &doc,
47 QDomElement &boreholeTag,
48 GeoLib::StationBorehole* borehole) const;
49
51 void readStratigraphy( const QDomNode &stratRoot, GeoLib::StationBorehole* borehole );
52
54};
55
56} // end namespace IO
57} // end namespace GeoLib
Container class for geometric objects.
Definition GEOObjects.h:46
void readStratigraphy(const QDomNode &stratRoot, GeoLib::StationBorehole *borehole)
Reads the stratigraphy of a borehole from an xml-file.
bool readFile(std::string const &fname) override
bool write() override
Writes the object to the internal stream. This method must be implemented by a subclass....
void readStations(const QDomNode &stationsRoot, std::vector< GeoLib::Point * > &stations, const std::string &station_file_name)
Reads GeoLib::Station- or StationBorehole-objects from an xml-file.
XmlStnInterface(GeoLib::GEOObjects &geo_objs)
int readFile(const QString &fileName) override
Reads an xml-file containing station object definitions into the GEOObjects used in the constructor (...
void writeBoreholeData(QDomDocument &doc, QDomElement &boreholeTag, GeoLib::StationBorehole *borehole) const
Writes borehole-specific data to a station-xml-file.
GeoLib::GEOObjects & _geo_objs
A borehole as a geometric object.
Base class for writing any information to and from XML files.