1 // Copyright (C) 2011-2021 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef SMESHGUI_HOMARDADAPTDLG_HXX
21 #define SMESHGUI_HOMARDADAPTDLG_HXX
23 #include "SMESH_SMESHGUI.hxx"
25 #include <SALOMEconfig.h>
26 #include CORBA_CLIENT_HEADER(SMESH_Homard)
27 #include CORBA_SERVER_HEADER(SMESH_Mesh)
28 #include <SALOME_GenericObj_wrap.hxx>
30 #include <SalomeApp_Module.h>
32 #include <QtCore/QVariant>
33 #include <QtWidgets/QApplication>
34 #include <QtWidgets/QCheckBox>
35 #include <QtWidgets/QComboBox>
36 #include <QtWidgets/QDialog>
37 #include <QtWidgets/QFormLayout>
38 #include <QtWidgets/QGridLayout>
39 #include <QtWidgets/QGroupBox>
40 #include <QtWidgets/QHBoxLayout>
41 #include <QtWidgets/QHeaderView>
42 #include <QtWidgets/QLabel>
43 #include <QtWidgets/QLineEdit>
44 #include <QtWidgets/QPushButton>
45 #include <QtWidgets/QRadioButton>
46 #include <QtWidgets/QSpacerItem>
47 #include <QtWidgets/QTableWidget>
48 #include <QtWidgets/QWidget>
49 #include <QtWidgets/QTabWidget>
50 #include <QtWidgets/QSpinBox>
52 class SMESHGUI_HomardAdaptArguments;
53 class SMESHGUI_HomardAdaptAdvanced;
55 //=================================================================================
56 // class : SMESHGUI_HomardAdaptDlg
58 //=================================================================================
59 class SMESHGUI_EXPORT SMESHGUI_HomardAdaptDlg : public QDialog
64 SMESHGUI_HomardAdaptDlg(SMESHHOMARD::HOMARD_Gen_ptr theHomardGen);
65 ~SMESHGUI_HomardAdaptDlg();
67 void AddBoundaryCAO(QString newBoundary);
68 void AddBoundaryAn(QString newBoundary);
69 void AddBoundaryDi(QString newBoundary);
74 SMESHHOMARD::HOMARD_Cas_var myCase;
75 SALOME::GenericObj_wrap< SMESHHOMARD::HOMARD_Gen > myHomardGen;
77 virtual void InitConnect();
78 virtual void InitBoundarys();
81 virtual void SetFileName();
83 virtual void SetBoundaryNo();
84 virtual void SetBoundaryCAO();
85 virtual void SetBoundaryNonCAO();
87 virtual void PushBoundaryCAONew();
88 virtual void PushBoundaryCAOEdit();
89 virtual void PushBoundaryCAOHelp();
91 virtual void SetBoundaryD();
92 virtual void PushBoundaryDiNew();
93 virtual void PushBoundaryDiEdit();
94 virtual void PushBoundaryDiHelp();
96 virtual void SetBoundaryA();
97 virtual void PushBoundaryAnNew();
98 virtual void PushBoundaryAnEdit();
99 virtual void PushBoundaryAnHelp();
101 bool CheckCase(bool fixCase);
103 virtual void PushOnOK();
104 virtual bool PushOnApply();
105 virtual void PushOnHelp();
107 void selectionChanged();
108 void updateSelection();
111 SMESHGUI_HomardAdaptArguments* myArgs;
112 SMESHGUI_HomardAdaptAdvanced* myAdvOpt;
114 SMESH::SMESH_Mesh_var myMesh;
116 QPushButton *buttonHelp;
117 QPushButton *buttonApply;
118 QPushButton *buttonOk;
119 QPushButton *buttonCancel;
122 //=================================================================================
123 // class : SMESHGUI_HomardAdaptArguments
125 //=================================================================================
126 class SMESHGUI_HomardAdaptArguments : public QWidget
131 enum ModeIn { MedFile, Browser };
133 SMESHGUI_HomardAdaptArguments (QWidget* parent);
134 ~SMESHGUI_HomardAdaptArguments();
140 QButtonGroup* myInMeshGroup;
141 QRadioButton* myInMedFileRadio;
142 QRadioButton* myInBrowserRadio;
144 QPushButton* mySelectInMedFileButton;
145 QLineEdit* mySelectInMedFileLineEdit; // LEFileName
147 QLineEdit* myInBrowserObject;
150 QLineEdit* myOutMeshNameLineEdit;
151 QCheckBox* myOutMedFileChk;
153 QPushButton* mySelectOutMedFileButton;
154 QLineEdit* mySelectOutMedFileLineEdit;
156 QCheckBox* myOutPublishChk;
159 QRadioButton *RBConforme;
160 QRadioButton *RBNonConforme;
163 QGroupBox *GBTypeBoun;
164 QRadioButton *RBBoundaryNo;
165 QRadioButton *RBBoundaryCAO;
166 QRadioButton *RBBoundaryNonCAO;
167 QHBoxLayout *hboxLayout3;
168 QCheckBox *CBBoundaryD;
169 QCheckBox *CBBoundaryA;
171 QGroupBox *GBBoundaryC; // CAO boundary
172 QPushButton *PBBoundaryCAOEdit;
173 QPushButton *PBBoundaryCAOHelp;
174 QComboBox *CBBoundaryCAO;
175 QPushButton *PBBoundaryCAONew;
176 QGroupBox *GBBoundaryN; // Non CAO boundary
177 QGroupBox *GBBoundaryD;
178 QComboBox *CBBoundaryDi;
179 QPushButton *PBBoundaryDiEdit;
180 QPushButton *PBBoundaryDiHelp;
181 QPushButton *PBBoundaryDiNew;
182 QGroupBox *GBBoundaryA;
183 QFormLayout *formLayout;
184 QTableWidget *TWBoundary;
185 QPushButton *PBBoundaryAnEdit;
186 QPushButton *PBBoundaryAnNew;
187 QPushButton *PBBoundaryAnHelp;
190 void updateSelection();
193 void modeInChanged(int);
195 void onOutMedFileChk(int);
196 void onOutPublishChk(int);
197 void onSelectOutMedFileButton();
200 //=================================================================================
201 // class : SMESHGUI_HomardAdaptAdvanced
203 //=================================================================================
204 class SMESHGUI_HomardAdaptAdvanced : public QWidget
209 SMESHGUI_HomardAdaptAdvanced(QWidget* = 0);
210 ~SMESHGUI_HomardAdaptAdvanced();
215 QGroupBox *logGroupBox;
217 QLabel *workingDirectoryLabel;
218 QLineEdit *workingDirectoryLineEdit;
219 QPushButton *workingDirectoryPushButton;
221 QLabel *verboseLevelLabel;
222 QSpinBox *verboseLevelSpin;
224 QCheckBox *logInFileCheck;
225 QCheckBox *removeLogOnSuccessCheck;
227 QCheckBox *keepWorkingFilesCheck;
230 void onWorkingDirectoryPushButton();
233 #endif // SMESHGUI_HOMARDADAPTDLG_HXX