A dialog window for changing the MaterialID for mesh elements.
Definition at line 17 of file MeshValueEditDialog.h.
#include <MeshValueEditDialog.h>
|
| void | accept () override |
| | Instructions if the OK-Button has been pressed.
|
| void | reject () override |
| | Instructions if the Cancel-Button has been pressed.
|
| void | on_replaceButton_toggled (bool isSelected) |
◆ MeshValueEditDialog()
| MeshValueEditDialog::MeshValueEditDialog |
( |
MeshLib::Mesh * | mesh, |
|
|
QDialog * | parent = nullptr ) |
|
explicit |
Constructor for creating a new FEM condition.
Definition at line 9 of file MeshValueEditDialog.cpp.
10 : QDialog(parent),
_mesh(mesh)
11{
12 setupUi(this);
13 this->edit_old_value->setEnabled(false);
14 this->edit_new_value->setEnabled(false);
15 this->replaceCheckBox->setEnabled(false);
16}
References _mesh.
◆ ~MeshValueEditDialog()
| MeshValueEditDialog::~MeshValueEditDialog |
( |
| ) |
|
|
overridedefault |
◆ accept
| void MeshValueEditDialog::accept |
( |
| ) |
|
|
overrideprivateslot |
Instructions if the OK-Button has been pressed.
Definition at line 20 of file MeshValueEditDialog.cpp.
21{
22 if (this->condenseButton->isChecked())
23 {
25 }
26 else
27 {
28 if (this->edit_old_value->text().isEmpty())
29 {
30 OGSError::box(
"Please input which material you want to replace.");
31 return;
32 }
33 unsigned old_value =
34 static_cast<unsigned>(this->edit_old_value->text().toInt());
35 if (this->edit_new_value->text().isEmpty())
36 {
37 OGSError::box(
"Please input the new material to replace group " +
38 this->edit_old_value->text() + ".");
39 return;
40 }
41 unsigned new_value =
42 static_cast<unsigned>(this->edit_new_value->text().toInt());
43 bool do_not_replace = this->replaceCheckBox->isChecked();
45 *
_mesh, old_value, new_value, !do_not_replace);
46 if (!result && do_not_replace)
47 {
49 return;
50 }
51 }
52
54 this->done(QDialog::Accepted);
55}
void valueEditFinished(MeshLib::Mesh *)
static void box(const QString &e)
References _mesh, OGSError::box(), MeshToolsLib::ElementValueModification::condense(), MeshToolsLib::ElementValueModification::replace(), and valueEditFinished().
◆ on_replaceButton_toggled
| void MeshValueEditDialog::on_replaceButton_toggled |
( |
bool | isSelected | ) |
|
|
privateslot |
Definition at line 62 of file MeshValueEditDialog.cpp.
63{
64 this->edit_old_value->setEnabled(isSelected);
65 this->edit_new_value->setEnabled(isSelected);
66 this->replaceCheckBox->setEnabled(isSelected);
67}
◆ reject
| void MeshValueEditDialog::reject |
( |
| ) |
|
|
overrideprivateslot |
Instructions if the Cancel-Button has been pressed.
Definition at line 57 of file MeshValueEditDialog.cpp.
58{
59 this->done(QDialog::Rejected);
60}
◆ valueEditFinished
◆ _mesh
The documentation for this class was generated from the following files: