Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYFaceSetWidget.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 
27 // Added by qt3to4:
28 #include <QGridLayout>
29 #include <QLabel>
30 #include <QtWidgets>
31 
32 #include "TYFaceSetWidget.h"
33 
34 #define TR(id) OLocalizator::getString("TYFaceSetWidget", (id))
35 
36 TYFaceSetWidget::TYFaceSetWidget(TYFaceSet* pElement, QWidget* _pParent /*=NULL*/)
37  : TYWidget(pElement, _pParent)
38 {
39 
40  resize(300, 540);
41  setWindowTitle(TR("id_caption"));
42  QGridLayout* _faceSetLayout = new QGridLayout();
43  setLayout(_faceSetLayout);
44 
45  _groupBoxVolume = new QGroupBox(this);
46  _groupBoxVolume->setTitle(TR("id_volume_label"));
47  _groupBoxVolumeLayout = new QGridLayout();
49 
50  _groupBoxSurface = new QGroupBox(this);
51  _groupBoxSurface->setTitle(TR("id_surface_label"));
52  _groupBoxSurfaceLayout = new QGridLayout();
54 
55  // Presentation du volume
57  _lineEditVolume->setEnabled(false);
58  _groupBoxVolumeLayout->addWidget(_lineEditVolume, 0, 0);
59 
60  QLabel* pUnitVolume = new QLabel(_groupBoxVolume);
61  pUnitVolume->setText(TR("id_unite_volume"));
62  _groupBoxVolumeLayout->addWidget(pUnitVolume, 0, 1);
63 
64  // Presentation de la surface
66  _lineEditSurface->setEnabled(false);
67  _groupBoxSurfaceLayout->addWidget(_lineEditSurface, 0, 0);
68 
69  QLabel* pUnitSurface = new QLabel(_groupBoxSurface);
70  pUnitSurface->setText(TR("id_unite_surface"));
71  _groupBoxSurfaceLayout->addWidget(pUnitSurface, 0, 1);
72 
73  // Insertion dans la boite de dialogue
74  _faceSetLayout->addWidget(_groupBoxVolume, 0, 0);
75  _faceSetLayout->addWidget(_groupBoxSurface, 0, 1);
76 
77  updateContent();
78 }
79 
81 
83 {
84  _lineEditVolume->setText(QString().setNum(getElement()->volume()));
85  _lineEditSurface->setText(QString().setNum(getElement()->surface()));
86 }
87 
89 {
91  emit modified();
92 }
#define TR(id)
Outil IHM pour un ensemble de faces (fichier header)
outil IHM pour une entrée utilisateur (fichier header)
static void setIsSavedOk(const bool &toSave)
Definition: TYElement.h:914
TYLineEdit * _lineEditVolume
virtual void apply()
virtual void updateContent()
QGridLayout * _faceSetLayout
TYFaceSetWidget(TYFaceSet *pElement, QWidget *_pParent=NULL)
QGridLayout * _groupBoxSurfaceLayout
TYLineEdit * _lineEditSurface
QGroupBox * _groupBoxSurface
QGroupBox * _groupBoxVolume
virtual ~TYFaceSetWidget()
QGridLayout * _groupBoxVolumeLayout
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
void modified()