A dialog window for changing the MaterialID for mesh elements.
Definition at line 28 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 20 of file MeshValueEditDialog.cpp.
21 : QDialog(parent),
_mesh(mesh)
22{
23 setupUi(this);
24 this->edit_old_value->setEnabled(false);
25 this->edit_new_value->setEnabled(false);
26 this->replaceCheckBox->setEnabled(false);
27}
◆ ~MeshValueEditDialog()
MeshValueEditDialog::~MeshValueEditDialog |
( |
| ) |
|
|
overridedefault |
◆ accept
void MeshValueEditDialog::accept |
( |
| ) |
|
|
overrideprivateslot |
Instructions if the OK-Button has been pressed.
Definition at line 31 of file MeshValueEditDialog.cpp.
32{
33 if (this->condenseButton->isChecked())
34 {
36 }
37 else
38 {
39 if (this->edit_old_value->text().isEmpty())
40 {
41 OGSError::box(
"Please input which material you want to replace.");
42 return;
43 }
44 unsigned old_value =
45 static_cast<unsigned>(this->edit_old_value->text().toInt());
46 if (this->edit_new_value->text().isEmpty())
47 {
48 OGSError::box(
"Please input the new material to replace group " +
49 this->edit_old_value->text() + ".");
50 return;
51 }
52 unsigned new_value =
53 static_cast<unsigned>(this->edit_new_value->text().toInt());
54 bool do_not_replace = this->replaceCheckBox->isChecked();
56 *
_mesh, old_value, new_value, !do_not_replace);
57 if (!result && do_not_replace)
58 {
60 return;
61 }
62 }
63
65 this->done(QDialog::Accepted);
66}
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 73 of file MeshValueEditDialog.cpp.
74{
75 this->edit_old_value->setEnabled(isSelected);
76 this->edit_new_value->setEnabled(isSelected);
77 this->replaceCheckBox->setEnabled(isSelected);
78}
◆ reject
void MeshValueEditDialog::reject |
( |
| ) |
|
|
overrideprivateslot |
Instructions if the Cancel-Button has been pressed.
Definition at line 68 of file MeshValueEditDialog.cpp.
69{
70 this->done(QDialog::Rejected);
71}
◆ valueEditFinished
◆ _mesh
The documentation for this class was generated from the following files: