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