OGS
|
Manages the import of ESRI shape files into GeoLib.
Definition at line 40 of file SHPInterface.h.
#include <SHPInterface.h>
Public Types | |
enum class | OGSType { UNDEFINED = 0 , POINT = 1 , STATION = 2 , POLYLINE = 3 , POLYGON = 4 } |
Connection between ESRI type system for shape files and OGS GeoLib. More... | |
Public Member Functions | |
SHPInterface (GeoLib::GEOObjects &geoObjects) | |
Constructor. | |
void | readSHPFile (const std::string &filename, OGSType choice, const std::string &listName, std::string const &gmsh_path) |
Reads data from the shape file. | |
Static Public Member Functions | |
static bool | readSHPInfo (const std::string &filename, int &shapeType, int &numberOfEntities) |
Reads the header of the shape file. | |
static bool | write2dMeshToSHP (const std::string &file_name, const MeshLib::Mesh &mesh) |
Private Member Functions | |
void | readPoints (const SHPHandle &hSHP, int numberOfElements, std::string listName) |
Reads points into a vector of Point objects. | |
void | readStations (const SHPHandle &hSHP, int numberOfElements, std::string listName) |
Reads points into a vector of Point objects and marks them as Station. | |
void | readPolylines (const SHPHandle &hSHP, int numberOfElements, std::string listName) |
Reads lines into a vector of Polyline objects. | |
void | readPolygons (const SHPHandle &hSHP, int numberOfElements, const std::string &listName, std::string const &gmsh_path) |
Reads lines into a vector of Polyline and Surface objects. | |
Static Private Member Functions | |
static SHPObject * | createShapeObject (MeshLib::Element const &e, std::size_t const shp_record) |
Creates a shape object polygon out of a 2D mesh element. | |
Private Attributes | |
GeoLib::GEOObjects & | _geoObjects |
|
strong |
|
inlineexplicit |
|
staticprivate |
Creates a shape object polygon out of a 2D mesh element.
Definition at line 327 of file SHPInterface.cpp.
References MeshLib::Element::getNode(), and MeshLib::Element::getNumberOfBaseNodes().
Referenced by write2dMeshToSHP().
|
private |
Reads points into a vector of Point objects.
Definition at line 85 of file SHPInterface.cpp.
References _geoObjects, and GeoLib::GEOObjects::addPointVec().
Referenced by readSHPFile().
|
private |
Reads lines into a vector of Polyline and Surface objects.
Definition at line 216 of file SHPInterface.cpp.
References _geoObjects, FileIO::createSurface(), GeoLib::GEOObjects::getPolylineVec(), INFO(), readPolylines(), and WARN().
Referenced by readSHPFile().
|
private |
Reads lines into a vector of Polyline objects.
Definition at line 134 of file SHPInterface.cpp.
References _geoObjects, GeoLib::GEOObjects::addPointVec(), GeoLib::GEOObjects::addPolylineVec(), GeoLib::PointVec::getIDMap(), GeoLib::GEOObjects::getPointVecObj(), GeoLib::TemplateVec< T >::getVector(), and INFO().
Referenced by readPolygons(), and readSHPFile().
void FileIO::SHPInterface::readSHPFile | ( | const std::string & | filename, |
OGSType | choice, | ||
const std::string & | listName, | ||
std::string const & | gmsh_path ) |
Reads data from the shape file.
Definition at line 52 of file SHPInterface.cpp.
References POINT, POLYGON, POLYLINE, readPoints(), readPolygons(), readPolylines(), readStations(), and STATION.
Referenced by SHPImportDialog::accept().
|
static |
Reads the header of the shape file.
Definition at line 31 of file SHPInterface.cpp.
Referenced by SHPImportDialog::setupDialog().
|
private |
Reads points into a vector of Point objects and marks them as Station.
Definition at line 109 of file SHPInterface.cpp.
References _geoObjects, GeoLib::GEOObjects::addStationVec(), and GeoLib::Station::createStation().
Referenced by readSHPFile().
|
static |
Writes a 2D mesh into a shapefile using one polygon for every element (based on request by AS, open for discussion)
Definition at line 240 of file SHPInterface.cpp.
References createShapeObject(), ERR(), MeshLib::Mesh::getDimension(), MeshLib::Mesh::getElements(), MeshLib::Mesh::getName(), MeshLib::Mesh::getNumberOfElements(), MeshLib::Mesh::getProperties(), INFO(), MeshLib::QUAD, and MeshLib::TRIANGLE.
Referenced by MeshView::exportToShapefile(), and main().
|
private |
Definition at line 90 of file SHPInterface.h.
Referenced by readPoints(), readPolygons(), readPolylines(), and readStations().