Salome HOME
Merge from V5_1_main branch 24/11/2010
[modules/multipr.git] / src / MULTIPRGUI / MULTIPR_GUI_Dlg.h
1 //  Copyright (C) 2007-2010  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.
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 // Partitioning/decimation module for the SALOME v3.2 platform
21 //
22 /**
23  * \file    MULTIPR_GUI_Dlg.h
24  *
25  * \brief   MULTIPR GUI Dialog (QT)
26  *
27  * \author  Olivier LE ROUX - CS, Virtual Reality Dpt
28  * 
29  * \date    01/2007
30  */
31
32 #ifndef __MULTIPR_GUI_DLG__
33 #define __MULTIPR_GUI_DLG__
34
35
36 //*****************************************************************************
37 // Includes section
38 //*****************************************************************************
39
40 #include <QDialog>
41 #include <QProgressDialog>
42
43 #include "MULTIPR_ProgressCallback.hxx"
44
45
46 //*****************************************************************************
47 // Pre-declaration
48 //*****************************************************************************
49
50 class SalomeApp_Application;
51 class CAM_Module;
52
53 class QVBoxLayout;
54 class QHBoxLayout;
55 class QGridLayout;
56 class QSpacerItem;
57 class QGroupBox;
58 class QLabel;
59 class QComboBox;
60 class QLineEdit;
61 class QSpinBox;
62 class QPushButton;
63
64 class MULTIPR_GUI;
65
66 /**
67  * Max length for filter parameters string.
68  */
69 #define MULTIPR_GUI_MAX_PARAMS_LENGTH 1024
70
71 //*****************************************************************************
72 // Class MULTIPR_GUI_Partition1Dlg
73 // Dialog box used for extracting groups from sequential MED file
74 //*****************************************************************************
75
76 class MULTIPR_GUI_Partition1Dlg : public QDialog
77 {
78     Q_OBJECT
79
80 public:
81     MULTIPR_GUI_Partition1Dlg(MULTIPR_GUI* theModule);
82     ~MULTIPR_GUI_Partition1Dlg();
83
84     QGroupBox* groupBoxProcess;
85     QPushButton* pushButtonCancel;
86     QPushButton* pushButtonOK;
87     QGroupBox* groupBoxSelectMesh;
88     QComboBox* comboBoxSelectMesh;
89     QLabel* textLabelSelectMesh;
90
91 protected slots:
92     void accept();
93     void reject();
94     
95 private:
96     MULTIPR_GUI* mModule;
97
98 };
99
100
101 //*****************************************************************************
102 // Class MULTIPR_GUI_Partition2Dlg
103 // Dialog box used for splitting a group (use MEDSPLITTER)
104 //*****************************************************************************
105
106 class MULTIPR_GUI_Partition2Dlg : public QDialog
107 {
108     Q_OBJECT
109
110 public:
111     MULTIPR_GUI_Partition2Dlg(MULTIPR_GUI* theModule);
112     ~MULTIPR_GUI_Partition2Dlg();
113
114     QGroupBox* groupBoxSplitParameters;
115     QLabel* textLabelSelectNbParts;
116     QLabel* textLabelSelectSplitter;
117     QComboBox* comboBoxSelectSplitter;
118     QSpinBox* spinBoxNbParts;
119     QGroupBox* groupBoxProcess;
120     QPushButton* pushButtonOK;
121     QPushButton* pushButtonCancel;
122
123 protected slots:
124     void accept();
125     void reject();
126
127 private:
128     MULTIPR_GUI* mModule;
129 };
130
131
132 //*****************************************************************************
133 // Class MULTIPR_GUI_DecimateDlg
134 // Dialog box used for decimating mesh (compute 2 lower resolution: medium and low)
135 //*****************************************************************************
136
137 class MULTIPR_GUI_DecimateDlg : public QDialog
138 {
139     Q_OBJECT
140
141 public:
142     MULTIPR_GUI_DecimateDlg(MULTIPR_GUI* theModule);
143     ~MULTIPR_GUI_DecimateDlg();
144
145     QGroupBox* groupBoxSelectField;
146     QLabel* textLabelSelectFieldName;
147     QLabel* textLabelSelectFieldIteration;
148     QComboBox* comboBoxSelectFieldIteration;
149     QComboBox* comboBoxSelectFieldName;
150     QGroupBox* groupBoxSelectFilter;
151     QLabel* textLabelSelectFilter;
152     QComboBox* comboBoxSelectFilter;
153     QGroupBox* groupBoxParameters;
154     QLabel* textLabelTMed;
155     QLabel* textLabelTLow;
156     QLabel* textLabelRadius;
157     QLabel* textLabelBoxing;
158     QLineEdit* lineEditTMed;
159     QLineEdit* lineEditTLow;
160     QLineEdit* lineEditRadius;
161     QSpinBox* spinBoxBoxing;
162     QGroupBox* groupBoxProcess;
163     QPushButton* pushButtonCancel;
164     QPushButton* pushButtonOK;
165     QPushButton* pushButtonThresholdAuto;
166     QPushButton* pushButtonRadiusAuto;
167     QGroupBox* infoGroup;
168     QLabel* textLabelInfo;
169     QLabel* textLabelInfoValue;
170         
171 protected:
172
173 protected slots:
174     void accept();
175     void reject();
176     void OnRadiusAuto();
177     void OnThresholdAuto();
178     void selectField(const QString & valueText);
179
180 private:
181     MULTIPR_GUI* mModule;
182
183     /**
184      * Create the parameter string for gradient average filter.
185      * \param pParams The parameter string to fill.
186      * \return True if the operation is successfull, false otherwise.
187      */
188     bool setGradAvgFilterParams(char* pParams);
189
190     /**
191      * Create the parameter string for direct filter.
192      * \param pParams The parameter string to fill.
193      * \return True if the operation is successfull, false otherwise.
194      */
195     bool setDirectFilterParams(char* pParams);
196 };
197
198
199 //*****************************************************************************
200 // Class MULTIPR_GUI_ProgressCallbackDlg
201 //*****************************************************************************
202
203 class MULTIPR_GUI_ProgressCallbackDlg : 
204     public QProgressDialog,
205     public MULTIPR_ProgressCallback
206     
207 {
208     Q_OBJECT
209     
210 public:
211
212     MULTIPR_GUI_ProgressCallbackDlg(QWidget* parent);
213     
214     ~MULTIPR_GUI_ProgressCallbackDlg();
215     
216     virtual void start(const char* pTaskTitle, int pNumStep);
217     
218     virtual void done();
219     
220 protected:
221     
222     virtual void progress(float pPercent);
223 };
224
225
226 //*****************************************************************************
227 // Class MULTIPR_GUI_EmptyMeshCallbackDlg
228 //*****************************************************************************
229
230 class MULTIPR_GUI_EmptyMeshCallbackDlg : public MULTIPR_EmptyMeshCallback   
231 {   
232 public:
233
234     MULTIPR_GUI_EmptyMeshCallbackDlg(QWidget* parent);
235     
236     ~MULTIPR_GUI_EmptyMeshCallbackDlg();
237     
238     virtual void reportEmptyMesh(std::string pInfo);
239     
240 protected:
241
242     QWidget* mParent;
243
244 };
245
246
247 #endif // __MULTIPR_GUI_DLG__
248
249
250 // EOF
251