Salome HOME
Copyright update 2022
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_HomardListGroup.h
1 // Copyright (C) 2011-2022  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library 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.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef MON_CREATELISTGROUPCAO_H
21 #define MON_CREATELISTGROUPCAO_H
22
23 #include "SMESH_SMESHGUI.hxx"
24
25 #include <SALOMEconfig.h>
26 #include <SalomeApp_Module.h>
27
28 //#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
29 #include CORBA_CLIENT_HEADER(SMESH_Homard)
30
31 #include <QDialog>
32 #include <QtCore/QVariant>
33 #include <QtWidgets/QApplication>
34 #include <QtWidgets/QDialog>
35 #include <QtWidgets/QGridLayout>
36 #include <QtWidgets/QGroupBox>
37 #include <QtWidgets/QHeaderView>
38 #include <QtWidgets/QPushButton>
39 #include <QtWidgets/QTableWidget>
40
41 class SMESH_CreateBoundaryCAO;
42 class SMESH_CreateBoundaryDi;
43
44
45 QT_BEGIN_NAMESPACE
46
47 class SMESH_Ui_CreateListGroup
48 {
49 public:
50     QGridLayout *gridLayout;
51     QGroupBox *GBButtons;
52     QGridLayout *gridLayout1;
53     QPushButton *buttonHelp;
54     QPushButton *buttonCancel;
55     QPushButton *buttonApply;
56     QPushButton *buttonOk;
57     QGroupBox *GBOptions;
58     QGridLayout *gridLayout2;
59     QTableWidget *TWGroupe;
60
61     void setupUi(QDialog *CreateListGroup)
62     {
63         if (CreateListGroup->objectName().isEmpty())
64             CreateListGroup->setObjectName(QString::fromUtf8("CreateListGroup"));
65         CreateListGroup->resize(717, 600);
66         QSizePolicy sizePolicy(static_cast<QSizePolicy::Policy>(0), static_cast<QSizePolicy::Policy>(0));
67         sizePolicy.setHorizontalStretch(0);
68         sizePolicy.setVerticalStretch(0);
69         sizePolicy.setHeightForWidth(CreateListGroup->sizePolicy().hasHeightForWidth());
70         CreateListGroup->setSizePolicy(sizePolicy);
71         CreateListGroup->setAutoFillBackground(true);
72         CreateListGroup->setSizeGripEnabled(true);
73         gridLayout = new QGridLayout(CreateListGroup);
74 #ifndef Q_OS_MAC
75         gridLayout->setSpacing(6);
76 #endif
77 #ifndef Q_OS_MAC
78         gridLayout->setContentsMargins(9, 9, 9, 9);
79 #endif
80         gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
81         GBButtons = new QGroupBox(CreateListGroup);
82         GBButtons->setObjectName(QString::fromUtf8("GBButtons"));
83         gridLayout1 = new QGridLayout(GBButtons);
84 #ifndef Q_OS_MAC
85         gridLayout1->setSpacing(6);
86 #endif
87 #ifndef Q_OS_MAC
88         gridLayout1->setContentsMargins(9, 9, 9, 9);
89 #endif
90         gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
91         buttonHelp = new QPushButton(GBButtons);
92         buttonHelp->setObjectName(QString::fromUtf8("buttonHelp"));
93
94         gridLayout1->addWidget(buttonHelp, 0, 3, 1, 1);
95
96         buttonCancel = new QPushButton(GBButtons);
97         buttonCancel->setObjectName(QString::fromUtf8("buttonCancel"));
98
99         gridLayout1->addWidget(buttonCancel, 0, 2, 1, 1);
100
101         buttonApply = new QPushButton(GBButtons);
102         buttonApply->setObjectName(QString::fromUtf8("buttonApply"));
103
104         gridLayout1->addWidget(buttonApply, 0, 1, 1, 1);
105
106         buttonOk = new QPushButton(GBButtons);
107         buttonOk->setObjectName(QString::fromUtf8("buttonOk"));
108
109         gridLayout1->addWidget(buttonOk, 0, 0, 1, 1);
110
111
112         gridLayout->addWidget(GBButtons, 1, 0, 1, 1);
113
114         GBOptions = new QGroupBox(CreateListGroup);
115         GBOptions->setObjectName(QString::fromUtf8("GBOptions"));
116         gridLayout2 = new QGridLayout(GBOptions);
117 #ifndef Q_OS_MAC
118         gridLayout2->setSpacing(6);
119 #endif
120 #ifndef Q_OS_MAC
121         gridLayout2->setContentsMargins(9, 9, 9, 9);
122 #endif
123         gridLayout2->setObjectName(QString::fromUtf8("gridLayout2"));
124         TWGroupe = new QTableWidget(GBOptions);
125         if (TWGroupe->columnCount() < 2)
126             TWGroupe->setColumnCount(2);
127         QTableWidgetItem *__qtablewidgetitem = new QTableWidgetItem();
128         TWGroupe->setHorizontalHeaderItem(0, __qtablewidgetitem);
129         QTableWidgetItem *__qtablewidgetitem1 = new QTableWidgetItem();
130         TWGroupe->setHorizontalHeaderItem(1, __qtablewidgetitem1);
131         TWGroupe->setObjectName(QString::fromUtf8("TWGroupe"));
132         TWGroupe->setShowGrid(true);
133         TWGroupe->setRowCount(0);
134         TWGroupe->setColumnCount(2);
135
136         gridLayout2->addWidget(TWGroupe, 0, 0, 1, 1);
137
138
139         gridLayout->addWidget(GBOptions, 0, 0, 1, 1);
140
141
142         retranslateUi(CreateListGroup);
143
144         QMetaObject::connectSlotsByName(CreateListGroup);
145     } // setupUi
146
147     void retranslateUi(QDialog *CreateListGroup)
148     {
149         CreateListGroup->setWindowTitle(QApplication::translate("CreateListGroup", "Selection of groups", nullptr));
150         GBButtons->setTitle(QString());
151         buttonHelp->setText(QApplication::translate("CreateListGroup", "Help", nullptr));
152         buttonCancel->setText(QApplication::translate("CreateListGroup", "Cancel", nullptr));
153         buttonApply->setText(QApplication::translate("CreateListGroup", "Apply", nullptr));
154         buttonOk->setText(QApplication::translate("CreateListGroup", "OK", nullptr));
155         GBOptions->setTitle(QApplication::translate("CreateListGroup", "Selected groups", nullptr));
156         QTableWidgetItem *___qtablewidgetitem = TWGroupe->horizontalHeaderItem(0);
157         ___qtablewidgetitem->setText(QApplication::translate("CreateListGroup", "Selection", nullptr));
158         QTableWidgetItem *___qtablewidgetitem1 = TWGroupe->horizontalHeaderItem(1);
159         ___qtablewidgetitem1->setText(QApplication::translate("CreateListGroup", "Group", nullptr));
160     } // retranslateUi
161
162 };
163
164 namespace Ui {
165     class CreateListGroup: public SMESH_Ui_CreateListGroup {};
166 } // namespace Ui
167
168 QT_END_NAMESPACE
169
170 class SMESHGUI_EXPORT SMESH_CreateListGroupCAO : public QDialog, public SMESH_Ui_CreateListGroup
171 {
172     Q_OBJECT
173
174 public:
175     SMESH_CreateListGroupCAO( SMESH_CreateBoundaryCAO* parentBound, bool modal, SMESHHOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName,  QStringList listeGroupesHypo);
176     SMESH_CreateListGroupCAO( SMESH_CreateBoundaryCAO* parentBound, SMESHHOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo);
177     virtual ~SMESH_CreateListGroupCAO();
178
179 protected :
180
181     SMESHHOMARD::HOMARD_Gen_var myHomardGen;
182
183     SMESH_CreateBoundaryCAO * _parentBound;
184     QString _aCaseName;
185     QStringList _listeGroupesHypo;
186
187     virtual void InitConnect();
188     virtual void InitGroupes();
189
190 public slots:
191     virtual void PushOnOK();
192     virtual bool PushOnApply();
193     virtual void PushOnHelp();
194
195 };
196
197 class SMESHGUI_EXPORT SMESH_CreateListGroup : public QDialog, public SMESH_Ui_CreateListGroup
198 {
199     Q_OBJECT
200
201 public:
202     SMESH_CreateListGroup( SMESH_CreateBoundaryDi* parentBound, bool modal, SMESHHOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName,  QStringList listeGroupesHypo);
203     SMESH_CreateListGroup( SMESH_CreateBoundaryDi* parentBound, SMESHHOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName, QStringList listeGroupesHypo);
204     virtual ~SMESH_CreateListGroup();
205
206 protected :
207
208     SMESHHOMARD::HOMARD_Gen_var myHomardGen;
209
210     SMESH_CreateBoundaryDi * _parentBound;
211     QString _aCaseName;
212     QStringList _listeGroupesHypo;
213
214     virtual void InitConnect();
215     virtual void InitGroupes();
216
217 public slots:
218     virtual void PushOnOK();
219     virtual bool PushOnApply();
220     virtual void PushOnHelp();
221
222 };
223
224 class SMESHGUI_EXPORT SMESH_EditListGroupCAO : public SMESH_CreateListGroupCAO
225 {
226     Q_OBJECT
227
228 public:
229     SMESH_EditListGroupCAO( SMESH_CreateBoundaryCAO* parentBound, bool modal, SMESHHOMARD::HOMARD_Gen_var myHomardGen, QString aCaseName,  QStringList listeGroupesHypo);
230     virtual ~SMESH_EditListGroupCAO();
231
232 protected :
233
234     virtual void InitGroupes();
235
236 };
237
238 class SMESHGUI_EXPORT SMESH_EditListGroup : public SMESH_CreateListGroup
239 {
240     Q_OBJECT
241
242 public:
243     SMESH_EditListGroup( SMESH_CreateBoundaryDi* parentBound, bool modal,
244                       SMESHHOMARD::HOMARD_Gen_var myHomardGen,
245                       QString aCaseName, QStringList listeGroupesHypo);
246     virtual ~SMESH_EditListGroup();
247
248 protected :
249
250     virtual void InitGroupes();
251
252 };
253
254 #endif // MON_CREATELISTGROUPCAO_H