28 : QDialog(parent), _msh_vec(std::move(msh_vec))
32 this->scalingEdit->setEnabled(
false);
34 this->scalingEdit->setText(
"1.0");
39 this->meshBox->addItem(QString::fromStdString(mesh->getName()));
42 this->directButton->setChecked(
true);
54 QString geotiffExtension(
" *.tif");
56 QString geotiffExtension(
"");
58 QString fileName = QFileDialog::getOpenFileName(
59 this,
"Select raster file",
60 settings.value(
"lastOpenedRasterFileDirectory").toString(),
61 QString(
"Raster files (*.asc *.grd);;").arg(geotiffExtension));
63 if (!fileName.isEmpty())
65 this->rasterEdit->setText(fileName);
67 QFileInfo fi(fileName);
68 settings.setValue(
"lastOpenedRasterFileDirectory", fi.absolutePath());
74 std::string mesh_name(this->meshBox->currentText().toStdString());
75 std::string raster_name(this->rasterEdit->text().toStdString());
76 double scaling_factor = this->scalingEdit->text().toDouble();
77 std::vector<std::pair<std::size_t, double>> direct_values;
79 if (mesh_name.empty())
84 if (raster_name.empty())
93 if (mesh_->getName() == mesh_name)
100 if (this->directButton->isChecked())
108 if (scaling_factor <= 0)
122 this->done(QDialog::Accepted);
127 this->done(QDialog::Rejected);
132 this->scalingEdit->setEnabled(isSelected);
Definition of the CondFromRasterDialog class.
Definition of the DirectConditionGenerator class.
Definition of the Mesh class.
Definition of the OGSError class.
Implementation of the StrictDoubleValidator class.
void accept() override
Instructions if the OK-Button has been pressed.
StrictDoubleValidator * _scale_validator
void reject() override
Instructions if the Cancel-Button has been pressed.
void transmitDisValues(std::vector< std::pair< std::size_t, double > >)
CondFromRasterDialog(std::vector< MeshLib::Mesh * > msh_vec, QDialog *parent=nullptr)
void on_integrateButton_toggled(bool isSelected)
~CondFromRasterDialog() override
void on_selectButton_pressed()
const std::vector< MeshLib::Mesh * > _msh_vec
const std::vector< std::pair< std::size_t, double > > & directToSurfaceNodes(const MeshLib::Mesh &mesh, const std::string &filename)
const std::vector< std::pair< std::size_t, double > > & directWithSurfaceIntegration(MeshLib::Mesh &mesh, const std::string &filename, double scaling)
static void box(const QString &e)
A validator for an input field which only accepts decimals. Source code adapted from StackOverflow