Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYPointWidget.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 
26 // Added by qt3to4:
27 #include <QGridLayout>
28 #include <QLabel>
29 #include <QtWidgets>
30 
31 #include "TYPointWidget.h"
32 
33 #define TR(id) OLocalizator::getString("TYPointWidget", (id))
34 
35 TYPointWidget::TYPointWidget(TYPoint* pElement, QWidget* _pParent /*=NULL*/) : TYWidget(pElement, _pParent)
36 {
37 
38  // _elmW = new TYElementWidget(pElement, this);
39  // _colorW = new TYColorInterfaceWidget(pElement, this);
40 
41  resize(300, 174);
42  setWindowTitle(TR("id_caption"));
43  _pointLayout = new QGridLayout();
44  setLayout(_pointLayout);
45 
46  // _pointLayout->addWidget( _elmW, 0, 0 );
47  // _pointLayout->addWidget( _colorW, 1, 0 );
48 
49  _groupBox = new QGroupBox(this);
50  _groupBox->setTitle(TR("id_position"));
51  _groupBoxLayout = new QGridLayout();
52  _groupBox->setLayout(_groupBoxLayout);
53 
54  _labelX = new QLabel(_groupBox);
55  _labelX->setText(TR("id_x_label"));
56  _groupBoxLayout->addWidget(_labelX, 0, 0);
57 
58  _labelZ = new QLabel(_groupBox);
59  _labelZ->setText(TR("id_z_label"));
60  _groupBoxLayout->addWidget(_labelZ, 2, 0);
61 
62  _labelY = new QLabel(_groupBox);
63  _labelY->setText(TR("id_y_label"));
64  _groupBoxLayout->addWidget(_labelY, 1, 0);
65 
67  _groupBoxLayout->addWidget(_lineEditX, 0, 1);
68 
70  _groupBoxLayout->addWidget(_lineEditY, 1, 1);
71 
73  _groupBoxLayout->addWidget(_lineEditZ, 2, 1);
74 
75  _pointLayout->addWidget(_groupBox, 2, 0);
76 
77  updateContent();
78 }
79 
81 
83 {
84  // _elmW->updateContent();
85  // _colorW->updateContent();
86 
87  _lineEditX->setText(QString().setNum(getElement()->_x, 'f', 3));
88  _lineEditY->setText(QString().setNum(getElement()->_y, 'f', 3));
89  _lineEditZ->setText(QString().setNum(getElement()->_z, 'f', 3));
90 }
91 
93 {
94  // _elmW->apply();
95  // _colorW->apply();
96 
97  getElement()->_x = _lineEditX->text().toDouble();
98  getElement()->_y = _lineEditY->text().toDouble();
99  getElement()->_z = _lineEditZ->text().toDouble();
100 
101  emit modified();
102 }
103 
105 {
106  _lineEditZ->setEnabled(false);
107 }
108 
110 {
111  _lineEditZ->setEnabled(false);
112 }
outil IHM pour une entrée utilisateur (fichier header)
#define TR(id)
outil IHM pour un point (fichier header)
TYLineEdit * _lineEditZ
Definition: TYPointWidget.h:91
QGroupBox * _groupBox
Definition: TYPointWidget.h:85
virtual void apply()
QGridLayout * _pointLayout
Definition: TYPointWidget.h:93
QLabel * _labelX
Definition: TYPointWidget.h:86
QLabel * _labelY
Definition: TYPointWidget.h:88
virtual ~TYPointWidget()
TYPointWidget(TYPoint *pElement, QWidget *_pParent=NULL)
QLabel * _labelZ
Definition: TYPointWidget.h:87
QGridLayout * _groupBoxLayout
Definition: TYPointWidget.h:94
virtual void updateContent()
TYLineEdit * _lineEditX
Definition: TYPointWidget.h:89
TYLineEdit * _lineEditY
Definition: TYPointWidget.h:90
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
void modified()