17#include <QDialogButtonBox>
21#include <QRadioButton>
30 std::string
const& gmsh_path,
35 _shpContentLabel(nullptr),
37 _listName(new QLineEdit()),
40 _filename(std::move(filename)),
42 _shpInterface(new
FileIO::SHPInterface(geo_objects)),
63 _layout =
new QGridLayout(
this);
65 int numberOfEntities = 0;
68 setWindowTitle(
"Import SHP File");
72 if ((shpType - 1) % 10 == 0)
76 if ((shpType - 3) % 10 == 0)
80 if ((shpType - 5) % 10 == 0)
84 if ((shpType - 8) % 10 == 0)
90 type =
"TIN elements";
94 new QLabel(
"The selected file contains " +
95 QString::number(numberOfEntities) +
" " + type,
99 QFileInfo fi(QString::fromStdString(
_filename));
102 if ((shpType - 1) % 10 == 0 && shpType != 31)
104 _choice1 =
new QRadioButton(
"Read as Geometry Points");
105 _choice2 =
new QRadioButton(
"Read as Station Points");
114 else if ((shpType - 3) % 10 == 0 ||
115 (shpType - 5) % 10 == 0)
117 _choice1 =
new QRadioButton(
"Read Polylines only");
118 _choice2 =
new QRadioButton(
"Read Polylines/Surfaces");
119 if ((shpType - 3) % 10 == 0)
135 "This element type is currently not supported.");
140 _buttonBox =
new QDialogButtonBox(QDialogButtonBox::Ok |
141 QDialogButtonBox::Cancel);
157 if (list_name.compare(
"") == 0)
159 OGSError::box(
"Please insert a name for the data in this file.");
189 this->done(QDialog::Accepted);
194 this->done(QDialog::Rejected);
Definition of the GEOObjects class.
Definition of the OGSError class.
Definition of the SHPImportDialog class.
Implementation of the SHPInterface class.
static bool readSHPInfo(const std::string &filename, int &shapeType, int &numberOfEntities)
Reads the header of the shape file.
void readSHPFile(const std::string &filename, OGSType choice, const std::string &listName, std::string const &gmsh_path)
Reads data from the shape file.
Container class for geometric objects.
static void box(const QString &e)
void accept() override
Instructions if the OK-Button has been pressed.
void reject() override
Instructions if the Cancel-Button has been pressed.
void setupDialog()
The buttons used in this dialog.
QLabel * _shpContentLabel
~SHPImportDialog() override
SHPImportDialog(std::string filename, GeoLib::GEOObjects &geo_objects, std::string const &gmsh_path, QDialog *parent=nullptr)
Constructor.
QDialogButtonBox * _buttonBox
FileIO::SHPInterface * _shpInterface
std::string const _gmsh_path