A dialog window for mapping a 2d mesh based on a raster file.
Definition at line 15 of file MeshMapping2DDialog.h.
#include <MeshMapping2DDialog.h>
◆ MeshMapping2DDialog()
| MeshMapping2DDialog::MeshMapping2DDialog |
( |
QDialog * | parent = nullptr | ) |
|
|
explicit |
Definition at line 12 of file MeshMapping2DDialog.cpp.
12 : QDialog(parent)
13{
14 setupUi(this);
15
16 auto* no_data_validator = new StrictDoubleValidator(this);
17 this->noDataValueEdit->setValidator(no_data_validator);
18 auto* static_value_validator = new StrictDoubleValidator(this);
19 this->staticValueEdit->setValidator(static_value_validator);
20}
◆ accept
| void MeshMapping2DDialog::accept |
( |
| ) |
|
|
overrideprivateslot |
Instructions if the OK-Button has been pressed.
Definition at line 49 of file MeshMapping2DDialog.cpp.
50{
51 if (this->rasterValueButton->isChecked() &&
52 this->rasterPathEdit->text().isEmpty())
53 {
55 return;
56 }
57 if (this->rasterValueButton->isChecked() &&
58 !this->ignoreNoDataCheckbox->isChecked() &&
59 this->noDataValueEdit->text().isEmpty())
60 {
62 return;
63 }
64 if (this->staticValueButton->isChecked() &&
65 this->staticValueEdit->text().isEmpty())
66 {
68 return;
69 }
70 if (this->newNameEdit->text().isEmpty())
71 {
72 OGSError::box(
"Please specify a name for the resulting mesh.");
73 return;
74 }
75 if (this->noDataValueEdit->text().isEmpty())
76 {
77 this->noDataValueEdit->setText("0.0");
78 }
79
80 this->done(QDialog::Accepted);
81}
static void box(const QString &e)
References OGSError::box().
◆ getIgnoreNoData()
| bool MeshMapping2DDialog::getIgnoreNoData |
( |
| ) |
const |
|
inline |
◆ getNewMeshName()
| std::string MeshMapping2DDialog::getNewMeshName |
( |
| ) |
const |
|
inline |
◆ getNoDataReplacement()
| double MeshMapping2DDialog::getNoDataReplacement |
( |
| ) |
const |
|
inline |
◆ getRasterPath()
| std::string MeshMapping2DDialog::getRasterPath |
( |
| ) |
const |
|
inline |
◆ getStaticValue()
| double MeshMapping2DDialog::getStaticValue |
( |
| ) |
const |
|
inline |
◆ on_ignoreNoDataCheckbox_toggled
| void MeshMapping2DDialog::on_ignoreNoDataCheckbox_toggled |
( |
bool | isChecked | ) |
|
|
privateslot |
◆ on_rasterSelectButton_pressed
| void MeshMapping2DDialog::on_rasterSelectButton_pressed |
( |
| ) |
|
|
privateslot |
Definition at line 37 of file MeshMapping2DDialog.cpp.
38{
39 QSettings settings;
40 QString filename = QFileDialog::getOpenFileName(
41 this, "Select raster file to open",
42 settings.value("lastOpenedRasterFileDirectory").toString(),
43 "ASCII raster files (*.asc *.grd *.xyz);;All files (* *.*)");
44 this->rasterPathEdit->setText(filename);
45 QFileInfo fi(filename);
46 settings.setValue("lastOpenedRasterFileDirectory", fi.absolutePath());
47}
◆ on_rasterValueButton_toggled
| void MeshMapping2DDialog::on_rasterValueButton_toggled |
( |
bool | isChecked | ) |
|
|
privateslot |
Definition at line 27 of file MeshMapping2DDialog.cpp.
28{
29 this->rasterPathEdit->setEnabled(isChecked);
30 this->ignoreNoDataCheckbox->setEnabled(isChecked);
31 this->noDataValueEdit->setEnabled(isChecked &&
32 !this->ignoreNoDataCheckbox->isChecked());
33 this->rasterSelectButton->setEnabled(isChecked);
34 this->staticValueEdit->setEnabled(!isChecked);
35}
◆ reject
| void MeshMapping2DDialog::reject |
( |
| ) |
|
|
inlineoverrideprivateslot |
Instructions if the Cancel-Button has been pressed.
Definition at line 39 of file MeshMapping2DDialog.h.
39{ this->done(QDialog::Rejected); }
◆ useRasterMapping()
| bool MeshMapping2DDialog::useRasterMapping |
( |
| ) |
const |
|
inline |
◆ useStaticMapping()
| bool MeshMapping2DDialog::useStaticMapping |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: