![]() |
OGS
|
Contains the interfaces for all file types that can be read and/or written using OpenGeoSys.
Namespaces | |
GMSH | |
Gocad | |
Legacy | |
Classes | |
class | AsciiRasterInterface |
class | CsvInterface |
class | FEFLOWGeoInterface |
class | FEFLOWMeshInterface |
class | GMSInterface |
Manages the import and export of Aquaveo GMS files into and out of GeoLib. More... | |
class | PetrelInterface |
class | SHPInterface |
Manages the import of ESRI shape files into GeoLib. More... | |
class | SwmmInterface |
class | TetGenInterface |
class | XmlLutReader |
Reader for vtk-Lookup-Tables (in XML / ParaView Format) More... | |
class | XmlPrjInterface |
Enumerations | |
enum class | SwmmObject { SUBCATCHMENT = 0 , NODE = 1 , LINK = 2 , SYSTEM = 3 } |
SWMM object types. More... | |
Functions | |
static double | readDoubleFromStream (std::istream &in) |
Reads a double replacing comma by point. More... | |
static std::optional< GeoLib::RasterHeader > | readASCHeader (std::ifstream &in) |
static std::optional< std::tuple< GeoLib::RasterHeader, double, double > > | readSurferHeader (std::ifstream &in) |
static bool | allRastersExist (std::vector< std::string > const &raster_paths) |
Checks if all raster files actually exist. More... | |
std::optional< std::vector< GeoLib::Raster const * > > | readRasters (std::vector< std::string > const &raster_paths) |
bool | createSurface (GeoLib::Polyline const &ply, GeoLib::GEOObjects &geometries, std::string const &geometry_name, std::string const &gmsh_binary) |
std::unique_ptr< GeoLib::Surface > | createSurfaceWithEarClipping (GeoLib::Polyline const &line) |
void | readGeometryFromFile (std::string const &fname, GeoLib::GEOObjects &geo_objs, std::string const &gmsh_path) |
void | writeGeometryToFile (std::string const &geo_name, GeoLib::GEOObjects &geo_objs, std::string const &fname) |
void | addTextNode (QDomDocument &doc, QDomElement &parent, QString const &node_name, QString const &content) |
bool | PVarExists (std::string const &name, std::vector< DataHolderLib::ProcessVariable > const &p_vars) |
Variables | |
const std::array< std::string, 9 > | subcatchment_vars |
Variables that always exist for subcatchments. There might be more. More... | |
const std::array< std::string, 7 > | node_vars |
Variables that always exist for nodes. There might be more. More... | |
const std::array< std::string, 6 > | link_vars |
Variables that always exist for links. There might be more. More... | |
const std::array< std::string, 15 > | system_vars |
All variables that exist for the system. More... | |
std::array< std::size_t, 4 > const | n_obj_params = {8, 6, 5, 15} |
|
strong |
SWMM object types.
Enumerator | |
---|---|
SUBCATCHMENT | |
NODE | |
LINK | |
SYSTEM |
Definition at line 34 of file SWMMInterface.h.
void FileIO::addTextNode | ( | QDomDocument & | doc, |
QDomElement & | parent, | ||
QString const & | node_name, | ||
QString const & | content | ||
) |
Definition at line 426 of file XmlPrjInterface.cpp.
Referenced by FileIO::XmlPrjInterface::writeCondition(), and FileIO::XmlPrjInterface::writeProcessVariables().
|
static |
Checks if all raster files actually exist.
Definition at line 276 of file AsciiRasterInterface.cpp.
Referenced by readRasters().
bool FileIO::createSurface | ( | GeoLib::Polyline const & | ply, |
GeoLib::GEOObjects & | geometries, | ||
std::string const & | geometry_name, | ||
std::string const & | gmsh_binary | ||
) |
Creates a plane surface from the given polyline. The polyline has to be closed, i.e. the first and the last point have to be the identical. The triangulation of the polyline is done by the finite element meshing tool Gmsh. Finally, the resulting mesh is converted into a GeoLib::Surface which is inserted into the GeoLib::GEOObjects
instance geometries
using the name geometry_name
.
Definition at line 33 of file createSurface.cpp.
References MeshLib::convertMeshToGeo(), FileIO::GMSH::FixedMeshDensity, GeoLib::Polyline::getNumberOfPoints(), GeoLib::Polyline::getPointID(), GeoLib::Polyline::getPointsVec(), GeoLib::Polyline::isClosed(), GeoLib::GEOObjects::mergeGeometries(), BaseLib::randomString(), MeshLib::IO::readMeshFromFile(), GeoLib::GEOObjects::removePointVec(), GeoLib::GEOObjects::removePolylineVec(), GeoLib::GEOObjects::removeSurfaceVec(), GeoLib::GEOObjects::renameGeometry(), WARN(), BaseLib::IO::writeStringToFile(), and BaseLib::IO::Writer::writeToString().
Referenced by main(), FileIO::SHPInterface::readPolygons(), and FileIO::Legacy::readSurfaces().
std::unique_ptr< GeoLib::Surface > FileIO::createSurfaceWithEarClipping | ( | GeoLib::Polyline const & | line | ) |
Creates a plane surface from the given polyline. The polyline has to be closed, i.e. the first and the last point have to be the identical. The triangulation of the polyline is done via a simple ear clipping algorithm.
Definition at line 126 of file createSurface.cpp.
References GeoLib::Polyline::getNumberOfPoints(), GeoLib::Polyline::getPointsVec(), GeoLib::Polyline::isClosed(), and WARN().
Referenced by GEOModels::connectPolylineSegments().
bool FileIO::PVarExists | ( | std::string const & | name, |
std::vector< DataHolderLib::ProcessVariable > const & | p_vars | ||
) |
Definition at line 437 of file XmlPrjInterface.cpp.
Referenced by FileIO::XmlPrjInterface::getPrimaryVariableVec().
|
static |
Reads the header of a Esri asc-file. If the return value is empty, reading was not successful.
Definition at line 50 of file AsciiRasterInterface.cpp.
References GeoLib::RasterHeader::cell_size, GeoLib::RasterHeader::n_cols, GeoLib::RasterHeader::n_depth, GeoLib::RasterHeader::n_rows, GeoLib::RasterHeader::no_data, GeoLib::RasterHeader::origin, and readDoubleFromStream().
Referenced by FileIO::AsciiRasterInterface::getRasterFromASCFile().
|
static |
Reads a double replacing comma by point.
Definition at line 40 of file AsciiRasterInterface.cpp.
References BaseLib::replaceString().
Referenced by FileIO::AsciiRasterInterface::getRasterFromASCFile(), FileIO::AsciiRasterInterface::getRasterFromSurferFile(), and readASCHeader().
void FileIO::readGeometryFromFile | ( | std::string const & | fname, |
GeoLib::GEOObjects & | geo_objs, | ||
std::string const & | gmsh_path | ||
) |
Definition at line 23 of file readGeometryFromFile.cpp.
References BaseLib::getFileExtension(), GeoLib::GEOObjects::getGeometryNames(), OGS_FATAL, GeoLib::IO::BoostXmlGmlInterface::readFile(), and FileIO::Legacy::readGLIFileV4().
Referenced by main().
std::optional< std::vector< GeoLib::Raster const * > > FileIO::readRasters | ( | std::vector< std::string > const & | raster_paths | ) |
Reads a vector of rasters given by file names. On error nothing is returned, otherwise the returned vector contains pointers to the read rasters.
Definition at line 290 of file AsciiRasterInterface.cpp.
References allRastersExist().
Referenced by MeshLayerEditDialog::createPrismMesh(), MeshLayerEditDialog::createTetMesh(), and main().
|
static |
Reads the header of a Surfer grd-file with minimum and maximum values. If the return value is empty, reading was not successful.
Definition at line 164 of file AsciiRasterInterface.cpp.
References GeoLib::RasterHeader::cell_size, ERR(), GeoLib::RasterHeader::n_cols, GeoLib::RasterHeader::n_depth, GeoLib::RasterHeader::n_rows, GeoLib::RasterHeader::no_data, and GeoLib::RasterHeader::origin.
Referenced by FileIO::AsciiRasterInterface::getRasterFromSurferFile().
void FileIO::writeGeometryToFile | ( | std::string const & | geo_name, |
GeoLib::GEOObjects & | geo_objs, | ||
std::string const & | fname | ||
) |
Write geometry given by the geo_objs
object and specified by the name stored in param geo_name
either to a gml or a gli file. If the extension given in the fname
parameter is "gml" or "GML" a gml file is written. In case the extension is "gli" or "GLI" a gli file is written.
Definition at line 20 of file writeGeometryToFile.cpp.
References ERR(), BaseLib::IO::XMLInterface::export_name, BaseLib::getFileExtension(), FileIO::Legacy::writeGLIFileV4(), BaseLib::IO::writeStringToFile(), and BaseLib::IO::Writer::writeToString().
Referenced by main(), and writeBCsAndGeometry().
const std::array<std::string, 6> FileIO::link_vars |
Variables that always exist for links. There might be more.
Definition at line 55 of file SWMMInterface.cpp.
Referenced by FileIO::SwmmInterface::getArrayName().
std::array<std::size_t, 4> const FileIO::n_obj_params = {8, 6, 5, 15} |
Number of base variables for the four object types (subcatchments/nodes/links/system).
Definition at line 82 of file SWMMInterface.cpp.
Referenced by FileIO::SwmmInterface::getArrayAtTimeStep(), FileIO::SwmmInterface::getArrayForObject(), FileIO::SwmmInterface::getArrayName(), and FileIO::SwmmInterface::getNumberOfParameters().
const std::array<std::string, 7> FileIO::node_vars |
Variables that always exist for nodes. There might be more.
Definition at line 46 of file SWMMInterface.cpp.
Referenced by FileIO::SwmmInterface::getArrayName().
const std::array<std::string, 9> FileIO::subcatchment_vars |
Variables that always exist for subcatchments. There might be more.
Definition at line 34 of file SWMMInterface.cpp.
Referenced by FileIO::SwmmInterface::getArrayName().
const std::array<std::string, 15> FileIO::system_vars |
All variables that exist for the system.
Definition at line 63 of file SWMMInterface.cpp.
Referenced by FileIO::SwmmInterface::getArrayName().