Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticFaceSetWidget.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
21 // Added by qt3to4:
22 #include <QGridLayout>
23 #include <QtWidgets>
24 
31 #include "TYElementWidget.h"
32 
33 #define TR(id) OLocalizator::getString("TYAcousticFaceSetWidget", (id))
34 
36  : TYWidget(pElement, _pParent)
37 {
38 
39  resize(300, 425);
40  setWindowTitle(TR("id_caption"));
41  _acousticVolumeLayout = new QGridLayout();
42  setLayout(_acousticVolumeLayout);
43 
44  _elmW = new TYElementWidget(pElement, this);
45  _colorW = new TYColorInterfaceWidget(dynamic_cast<TYColorInterface*>(pElement), this);
46  _volumeW = new TYFaceSetWidget(pElement->getFaceSet(), this);
47 
48  _acousticVolumeLayout->addWidget(_elmW, 0, 0);
49  _acousticVolumeLayout->addWidget(_colorW, 1, 0);
50  _acousticVolumeLayout->addWidget(_volumeW, 2, 0);
51 
52  _groupBoxMat = new QGroupBox(this);
53  _groupBoxMat->setTitle(TR("id_mat"));
54  _groupBoxMatLayout = new QGridLayout();
55  _groupBoxMat->setLayout(_groupBoxMatLayout);
56 
57  _lineEditNomMat = new QLineEdit(_groupBoxMat);
58  _lineEditNomMat->setEnabled(false);
59  _groupBoxMatLayout->addWidget(_lineEditNomMat, 0, 0);
60 
61  _pushButtonMat = new QPushButton(_groupBoxMat);
62  _pushButtonMat->setText(TR("id_proprietes_button"));
63  _groupBoxMatLayout->addWidget(_pushButtonMat, 0, 1);
64 
65  if (getElement()->getMateriau() != NULL)
66  {
67  _lineEditNomMat->setText(getElement()->getMateriau()->getName());
68  }
69  else
70  {
71  _groupBoxMat->setEnabled(false);
72  }
73 
74  _acousticVolumeLayout->addWidget(_groupBoxMat, 3, 0);
75 
76  connect(_pushButtonMat, &QPushButton::clicked, this, &TYAcousticFaceSetWidget::editMat);
77 }
78 
80 
82 {
86 }
87 
89 {
90  _elmW->apply();
91  _colorW->apply();
92  _volumeW->apply();
93 
94  emit modified();
95 }
96 
98 {
99  // Si l'utilisateur annule, on restitue l'etat du regime courant
100  getElement()->setCurRegime(getElement()->getCurRegime());
101 }
102 
104 {
105  int ret = getElement()->getMateriau()->edit(this);
106 
107  if ((ret == QDialog::Accepted) && (getElement()->getMateriau() != NULL))
108  {
109  _lineEditNomMat->setText(getElement()->getMateriau()->getName());
110  }
111 }
#define TR(id)
outil IHM pour l'objet ColorInterface (fichier header)
outil IHM pour un element (fichier header)
Outil IHM pour un ensemble de faces (fichier header)
TYColorInterfaceWidget * _colorW
TYAcousticFaceSetWidget(TYAcousticFaceSet *pElement, QWidget *_pParent=NULL)
TYFaceSet * getFaceSet()
classe de l'objet IHM pour l'objet ColorInterface
classe de l'objet IHM pour un element
virtual void apply()
virtual void updateContent()
classe de l'objet IHM pour un ensemble de faces
virtual void apply()
virtual void updateContent()
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
void modified()