Salome HOME
3e2e7d8914689eb02bc3a88494e3a23ec3dab9d4
[modules/multipr.git] / src / MULTIPRGUI / MULTIPR_GUI.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.h
6  *
7  * \brief   MULTIPR GUI (QT)
8  *
9  * \author  Olivier LE ROUX - CS, Virtual Reality Dpt
10  * 
11  * \date    01/2007
12  */
13
14 #ifndef __MULTIPR_GUI__
15 #define __MULTIPR_GUI__
16
17
18 //*****************************************************************************
19 // Includes section
20 //*****************************************************************************
21
22 #include <SalomeApp_Module.h>
23 #include <LightApp_DataObject.h>
24 #include <LightApp_DataModel.h>
25 #include <LightApp_RootObject.h>
26
27 #include <SALOMEconfig.h>
28 #include CORBA_CLIENT_HEADER(MULTIPR)
29
30 #include <qdialog.h>
31 #include <qprogressdialog.h>
32 #include <qstring.h>
33 #include <qvariant.h>
34
35 #include "MULTIPR_ProgressCallback.hxx"
36
37
38 //*****************************************************************************
39 // Pre-declaration
40 //*****************************************************************************
41
42 class SalomeApp_Application;
43 class CAM_Module;
44
45 class QVBoxLayout;
46 class QHBoxLayout;
47 class QGridLayout;
48 class QSpacerItem;
49 class QButtonGroup;
50 class QLabel;
51 class QComboBox;
52 class QLineEdit;
53 class QSpinBox;
54 class QPushButton;
55
56
57 //*****************************************************************************
58 // Class MULTIPR_GUI
59 // Salome Application
60 //*****************************************************************************
61
62 class MULTIPR_GUI: public SalomeApp_Module
63 {
64         Q_OBJECT
65
66 public:
67         MULTIPR_GUI();
68         
69         void    initialize(CAM_Application*);
70         QString engineIOR() const;
71         void    windows(QMap<int, int>&) const;
72         
73         MULTIPR_ORB::MULTIPR_Obj_ptr getMULTIPRObj();
74         SalomeApp_Application* getAppli() const;
75         void selected(QStringList&, const bool);
76         
77         static MULTIPR_ORB::MULTIPR_Gen_ptr InitMULTIPRGen(SalomeApp_Application*);
78         
79         const QStringList& getSelectedParts() const { return mSelectedParts; }
80
81 public slots:
82         bool deactivateModule(SUIT_Study*);
83         bool activateModule(SUIT_Study*);
84
85 protected slots:
86         void OnImportFromMEDFile();
87         void OnPartition1();
88         void OnPartition2();
89         void OnDecimate();
90         void OnRemove();
91         void OnSave();
92         
93         void retrieveSelectedParts();
94         bool isPartExist(const char* partName);
95         
96 protected:
97         virtual CAM_DataModel* createDataModel();
98         
99 protected:
100
101         enum 
102         { 
103                 ACTION_IMPORT_MED = 190,
104                 ACTION_SAVE,
105                 ACTION_REMOVE,
106                 ACTION_SPLIT,
107                 ACTION_DECIMATE
108         };
109         
110 private:
111         QString                      mMEDFileName;
112         QStringList                  mSelectedParts;
113         MULTIPR_ORB::MULTIPR_Obj_ptr mMULTIPRObj;
114   
115 }; // class MULTIPR_GUI
116
117
118 //*****************************************************************************
119 // Class MULTIPR_GUI_DataObject
120 //*****************************************************************************
121
122 class MULTIPR_GUI_DataObject : public LightApp_DataObject
123 {
124 public:
125         MULTIPR_GUI_DataObject(SUIT_DataObject* parent, const char* name);
126         virtual ~MULTIPR_GUI_DataObject();
127         
128         virtual QString entry()   const;
129         virtual QString name()    const;
130         virtual QPixmap icon()    const;
131         virtual QString toolTip() const;
132
133 protected:
134         QString mName;
135 };
136
137
138 //*****************************************************************************
139 // Class MULTIPR_GUI_DataObject_Module
140 //*****************************************************************************
141
142 class MULTIPR_GUI_DataObject_Module : public MULTIPR_GUI_DataObject, public LightApp_ModuleObject
143 {
144 public:
145         MULTIPR_GUI_DataObject_Module(CAM_DataModel* dm, SUIT_DataObject* parent, const char* name);
146         virtual ~MULTIPR_GUI_DataObject_Module();
147         
148         virtual QString entry()   const;
149         virtual QString name()    const;
150         virtual QPixmap icon()    const;
151         virtual QString toolTip() const;
152
153 private:
154 };
155
156
157 //*****************************************************************************
158 // Class MULTIPR_GUI_DataObject_Mesh
159 //*****************************************************************************
160
161 class MULTIPR_GUI_DataObject_Mesh : public MULTIPR_GUI_DataObject
162 {
163 public:
164         MULTIPR_GUI_DataObject_Mesh(SUIT_DataObject* parent, const char* name);
165         virtual ~MULTIPR_GUI_DataObject_Mesh();
166         
167         virtual QString entry()   const;
168         virtual QPixmap icon()    const;
169         virtual QString toolTip() const;
170
171 private:
172 };
173
174
175 //*****************************************************************************
176 // Class MULTIPR_GUI_DataObject_Part
177 //*****************************************************************************
178
179 class MULTIPR_GUI_DataObject_Part : public MULTIPR_GUI_DataObject
180 {
181 public:
182         MULTIPR_GUI_DataObject_Part(SUIT_DataObject* parent, const char* name, const char* info);
183         virtual ~MULTIPR_GUI_DataObject_Part();
184         
185         virtual QString entry()   const;
186         virtual QPixmap icon()    const;
187         virtual QString toolTip() const;
188
189 protected:
190         QString mMeshName;
191         int     mId;
192         QString mPath;
193         QString mMEDFileName;
194         QString mTooltip;
195 };
196
197
198 //*****************************************************************************
199 // Class MULTIPR_GUI_DataObject_Resolution
200 //*****************************************************************************
201
202 class MULTIPR_GUI_DataObject_Resolution : public MULTIPR_GUI_DataObject_Part
203 {
204 public:
205         MULTIPR_GUI_DataObject_Resolution(SUIT_DataObject* parent, const char* name, const char* info);
206         virtual ~MULTIPR_GUI_DataObject_Resolution();
207         
208         virtual QString entry()   const;
209         virtual QPixmap icon()    const;
210         virtual QString toolTip() const;
211
212 private:
213 };
214
215
216 //*****************************************************************************
217 // Class MULTIPR_GUI_DataModel
218 //*****************************************************************************
219
220 class MULTIPR_GUI_DataModel : public LightApp_DataModel
221 {
222 public:
223         MULTIPR_GUI_DataModel(CAM_Module*);
224         virtual ~MULTIPR_GUI_DataModel();
225
226 protected:
227         virtual void build();
228         
229 private:
230         MULTIPR_GUI* mMULTIPR_GUI;
231 };
232
233
234 #endif // __MULTIPR_GUI__
235
236
237 // EOF
238