17 : QDialog(parent),
_msh_vec(std::move(msh_vec))
21 this->scalingEdit->setEnabled(
false);
23 this->scalingEdit->setText(
"1.0");
28 this->meshBox->addItem(QString::fromStdString(mesh->getName()));
31 this->directButton->setChecked(
true);
43 QString geotiffExtension(
" *.tif");
45 QString geotiffExtension(
"");
47 QString fileName = QFileDialog::getOpenFileName(
48 this,
"Select raster file",
49 settings.value(
"lastOpenedRasterFileDirectory").toString(),
50 QString(
"Raster files (*.asc *.grd);;").arg(geotiffExtension));
52 if (!fileName.isEmpty())
54 this->rasterEdit->setText(fileName);
56 QFileInfo fi(fileName);
57 settings.setValue(
"lastOpenedRasterFileDirectory", fi.absolutePath());
63 std::string mesh_name(this->meshBox->currentText().toStdString());
64 std::string raster_name(this->rasterEdit->text().toStdString());
65 double scaling_factor = this->scalingEdit->text().toDouble();
66 std::vector<std::pair<std::size_t, double>> direct_values;
68 if (mesh_name.empty())
73 if (raster_name.empty())
82 if (mesh_->getName() == mesh_name)
89 if (this->directButton->isChecked())
97 if (scaling_factor <= 0)
111 this->done(QDialog::Accepted);
116 this->done(QDialog::Rejected);
121 this->scalingEdit->setEnabled(isSelected);
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