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