OGS
MeshFromRasterDialog.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include "Base/OGSError.h"
8
10 : QDialog(parent), _mesh_name("mesh"), _array_name("MaterialIDs")
11{
12 setupUi(this);
13
14 this->elevationButton->setChecked(true);
15 this->triButton->setChecked(true);
16 this->mshNameEdit->setText("RasterDataMesh");
17}
18
20
22{
23 if (isChecked)
24 {
25 if (this->prismButton->isChecked())
26 {
27 this->triButton->setChecked(true);
28 }
29 if (this->hexButton->isChecked())
30 {
31 this->quadButton->setChecked(true);
32 }
33 }
34
35 this->prismButton->setEnabled(!isChecked);
36 this->hexButton->setEnabled(!isChecked);
37}
38
40{
41 if (this->mshNameEdit->text().isEmpty())
42 {
43 OGSError::box("Please specify a name for the resulting mesh.");
44 return;
45 }
46 _mesh_name = this->mshNameEdit->text().toStdString();
47
49 if (this->materialButton->isChecked())
50 {
52 }
53 else if (this->otherButton->isChecked())
54 {
56 }
57 else if (this->ignoreButton->isChecked())
58 {
60 }
61
63 {
64 if (this->arrayNameEdit->text().isEmpty())
65 {
66 OGSError::box("Please specify a name for the data vector.");
67 return;
68 }
69
70 _array_name = this->arrayNameEdit->text().toStdString();
71 }
73 if (this->quadButton->isChecked())
74 {
76 }
77 else if (this->prismButton->isChecked())
78 {
80 }
81 else if (this->hexButton->isChecked())
82 {
84 }
85
86 this->done(QDialog::Accepted);
87}
88
90{
91 this->done(QDialog::Rejected);
92}
MeshFromRasterDialog(QDialog *parent=nullptr)
Constructor.
~MeshFromRasterDialog() override
void accept() override
Instructions if the OK-Button has been pressed.
MeshLib::MeshElemType _element_selection
void reject() override
Instructions if the Cancel-Button has been pressed.
MeshLib::UseIntensityAs _intensity_selection
void on_elevationButton_toggled(bool isChecked)
static void box(const QString &e)
Definition OGSError.cpp:13