OGS
|
Reads and writes GeoObjects to and from XML files.
Definition at line 32 of file XmlGmlInterface.h.
#include <XmlGmlInterface.h>
Public Member Functions | |
XmlGmlInterface (GeoLib::GEOObjects &geo_objs) | |
int | readFile (const QString &fileName) override |
Reads an xml-file containing geometric object definitions into the GEOObjects used in the constructor. | |
bool | readFile (std::string const &fname) override |
Public Member Functions inherited from BaseLib::IO::Writer | |
Writer () | |
virtual | ~Writer ()=default |
std::string | writeToString () |
Writes the object to a string. | |
Public Member Functions inherited from BaseLib::IO::XMLQtInterface | |
XMLQtInterface (QString schemaFile="") | |
virtual | ~XMLQtInterface ()=default |
Protected Member Functions | |
bool | write () override |
Writes the object to the internal stream. This method must be implemented by a subclass. The implementation should return true on success, else false. | |
Protected Member Functions inherited from BaseLib::IO::XMLQtInterface | |
bool | checkHash () const |
QByteArray const & | getContent () const |
Private Member Functions | |
void | readPoints (const QDomNode &pointsRoot, std::vector< GeoLib::Point * > &points, std::map< std::string, std::size_t > *pnt_names) |
Reads GeoLib::Point-objects from an xml-file. | |
void | readPolylines (const QDomNode &polylinesRoot, std::vector< GeoLib::Polyline * > &polylines, std::vector< GeoLib::Point * > const &points, const std::vector< std::size_t > &pnt_id_map, GeoLib::PolylineVec::NameIdMap &ply_names) |
Reads GeoLib::Polyline-objects from an xml-file. | |
void | readSurfaces (const QDomNode &surfacesRoot, std::vector< GeoLib::Surface * > &surfaces, std::vector< GeoLib::Point * > const &points, const std::vector< std::size_t > &pnt_id_map, GeoLib::SurfaceVec::NameIdMap &sfc_names) |
Reads GeoLib::Surface-objects from an xml-file. | |
Private Attributes | |
GeoLib::GEOObjects & | _geo_objs |
std::map< std::size_t, std::size_t > | _idx_map |
Additional Inherited Members | |
Public Attributes inherited from BaseLib::IO::XMLInterface | |
std::string | export_name = {} |
Protected Attributes inherited from BaseLib::IO::Writer | |
std::ostringstream | out |
The stream to write to. | |
|
explicit |
Definition at line 29 of file XmlGmlInterface.cpp.
|
overridevirtual |
Reads an xml-file containing geometric object definitions into the GEOObjects used in the constructor.
Reimplemented from BaseLib::IO::XMLQtInterface.
Definition at line 34 of file XmlGmlInterface.cpp.
References _geo_objs, GeoLib::GEOObjects::addPointVec(), GeoLib::GEOObjects::addPolylineVec(), GeoLib::GEOObjects::addSurfaceVec(), BaseLib::cleanupVectorElements(), ERR(), BaseLib::IO::XMLQtInterface::getContent(), GeoLib::PointVec::getIDMap(), GeoLib::GEOObjects::getPointVec(), GeoLib::GEOObjects::getPointVecObj(), readPoints(), readPolylines(), readSurfaces(), GeoLib::GEOObjects::removePointVec(), and GeoLib::GEOObjects::removePolylineVec().
Referenced by consolidateGeometry(), OGSFileConverter::convertGML2GLI(), MainWindow::loadFile(), FileIO::XmlPrjInterface::readFile(), and readFile().
|
inlineoverridevirtual |
Implements BaseLib::IO::XMLInterface.
Definition at line 41 of file XmlGmlInterface.h.
References readFile().
|
private |
Reads GeoLib::Point-objects from an xml-file.
Definition at line 129 of file XmlGmlInterface.cpp.
References _idx_map.
Referenced by readFile().
|
private |
Reads GeoLib::Polyline-objects from an xml-file.
Definition at line 155 of file XmlGmlInterface.cpp.
References _idx_map, OGS_FATAL, and WARN().
Referenced by readFile().
|
private |
Reads GeoLib::Surface-objects from an xml-file.
Definition at line 217 of file XmlGmlInterface.cpp.
References _idx_map, and OGS_FATAL.
Referenced by readFile().
|
overrideprotectedvirtual |
Writes the object to the internal stream. This method must be implemented by a subclass. The implementation should return true on success, else false.
Implements BaseLib::IO::Writer.
Definition at line 268 of file XmlGmlInterface.cpp.
References _geo_objs, ERR(), BaseLib::IO::XMLInterface::export_name, GeoLib::PointVec::getItemNameByID(), GeoLib::TemplateVec< T >::getNameOfElementByID(), GeoLib::GEOObjects::getPointVecObj(), GeoLib::GEOObjects::getPolylineVecObj(), GeoLib::GEOObjects::getSurfaceVecObj(), GeoLib::TemplateVec< T >::getVector(), INFO(), and BaseLib::IO::Writer::out.
|
private |
Definition at line 69 of file XmlGmlInterface.h.
Referenced by readFile(), and write().
|
private |
Definition at line 70 of file XmlGmlInterface.h.
Referenced by readPoints(), readPolylines(), and readSurfaces().