A dialog window for mapping a 2d mesh based on a raster file.
Definition at line 22 of file MeshMapping2DDialog.h.
#include <MeshMapping2DDialog.h>
◆ MeshMapping2DDialog()
MeshMapping2DDialog::MeshMapping2DDialog |
( |
QDialog * | parent = nullptr | ) |
|
|
explicit |
Definition at line 19 of file MeshMapping2DDialog.cpp.
19 : QDialog(parent)
20{
21 setupUi(this);
22
24 this->noDataValueEdit->setValidator(no_data_validator);
26 this->staticValueEdit->setValidator(static_value_validator);
27}
A validator for an input field which only accepts decimals. Source code adapted from StackOverflow
◆ accept
void MeshMapping2DDialog::accept |
( |
| ) |
|
|
overrideprivateslot |
Instructions if the OK-Button has been pressed.
Definition at line 56 of file MeshMapping2DDialog.cpp.
57{
58 if (this->rasterValueButton->isChecked() &&
59 this->rasterPathEdit->text().isEmpty())
60 {
62 return;
63 }
64 if (this->rasterValueButton->isChecked() &&
65 !this->ignoreNoDataCheckbox->isChecked() &&
66 this->noDataValueEdit->text().isEmpty())
67 {
69 return;
70 }
71 if (this->staticValueButton->isChecked() &&
72 this->staticValueEdit->text().isEmpty())
73 {
75 return;
76 }
77 if (this->newNameEdit->text().isEmpty())
78 {
79 OGSError::box(
"Please specify a name for the resulting mesh.");
80 return;
81 }
82 if (this->noDataValueEdit->text().isEmpty())
83 {
84 this->noDataValueEdit->setText("0.0");
85 }
86
87 this->done(QDialog::Accepted);
88}
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 44 of file MeshMapping2DDialog.cpp.
45{
46 QSettings settings;
47 QString filename = QFileDialog::getOpenFileName(
48 this, "Select raster file to open",
49 settings.value("lastOpenedRasterFileDirectory").toString(),
50 "ASCII raster files (*.asc *.grd *.xyz);;All files (* *.*)");
51 this->rasterPathEdit->setText(filename);
52 QFileInfo fi(filename);
53 settings.setValue("lastOpenedRasterFileDirectory", fi.absolutePath());
54}
◆ on_rasterValueButton_toggled
void MeshMapping2DDialog::on_rasterValueButton_toggled |
( |
bool | isChecked | ) |
|
|
privateslot |
Definition at line 34 of file MeshMapping2DDialog.cpp.
35{
36 this->rasterPathEdit->setEnabled(isChecked);
37 this->ignoreNoDataCheckbox->setEnabled(isChecked);
38 this->noDataValueEdit->setEnabled(isChecked &&
39 !this->ignoreNoDataCheckbox->isChecked());
40 this->rasterSelectButton->setEnabled(isChecked);
41 this->staticValueEdit->setEnabled(!isChecked);
42}
◆ reject
void MeshMapping2DDialog::reject |
( |
| ) |
|
|
inlineoverrideprivateslot |
Instructions if the Cancel-Button has been pressed.
Definition at line 46 of file MeshMapping2DDialog.h.
46{ 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: