Salome HOME
*** empty log message ***
[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         bool removeLowerResolution();
96         
97 protected:
98         virtual CAM_DataModel* createDataModel();
99         
100 protected:
101
102         enum 
103         { 
104                 ACTION_IMPORT_MED = 190,
105                 ACTION_SAVE,
106                 ACTION_REMOVE,
107                 ACTION_SPLIT,
108                 ACTION_DECIMATE
109         };
110         
111 private:
112         QString                      mMEDFileName;
113         QStringList                  mSelectedParts;
114         MULTIPR_ORB::MULTIPR_Obj_ptr mMULTIPRObj;
115   
116 }; // class MULTIPR_GUI
117
118
119 //*****************************************************************************
120 // Class MULTIPR_GUI_DataObject
121 //*****************************************************************************
122
123 class MULTIPR_GUI_DataObject : public LightApp_DataObject
124 {
125 public:
126         MULTIPR_GUI_DataObject(SUIT_DataObject* parent, const char* name);
127         virtual ~MULTIPR_GUI_DataObject();
128         
129         virtual QString entry()   const;
130         virtual QString name()    const;
131         virtual QPixmap icon()    const;
132         virtual QString toolTip() const;
133
134 protected:
135         QString mName;
136 };
137
138
139 //*****************************************************************************
140 // Class MULTIPR_GUI_DataObject_Module
141 //*****************************************************************************
142
143 class MULTIPR_GUI_DataObject_Module : public MULTIPR_GUI_DataObject, public LightApp_ModuleObject
144 {
145 public:
146         MULTIPR_GUI_DataObject_Module(CAM_DataModel* dm, SUIT_DataObject* parent, const char* name);
147         virtual ~MULTIPR_GUI_DataObject_Module();
148         
149         virtual QString entry()   const;
150         virtual QString name()    const;
151         virtual QPixmap icon()    const;
152         virtual QString toolTip() const;
153
154 private:
155 };
156
157
158 //*****************************************************************************
159 // Class MULTIPR_GUI_DataObject_Mesh
160 //*****************************************************************************
161
162 class MULTIPR_GUI_DataObject_Mesh : public MULTIPR_GUI_DataObject
163 {
164 public:
165         MULTIPR_GUI_DataObject_Mesh(SUIT_DataObject* parent, const char* name);
166         virtual ~MULTIPR_GUI_DataObject_Mesh();
167         
168         virtual QString entry()   const;
169         virtual QPixmap icon()    const;
170         virtual QString toolTip() const;
171
172 private:
173 };
174
175
176 //*****************************************************************************
177 // Class MULTIPR_GUI_DataObject_Part
178 //*****************************************************************************
179
180 class MULTIPR_GUI_DataObject_Part : public MULTIPR_GUI_DataObject
181 {
182 public:
183         MULTIPR_GUI_DataObject_Part(SUIT_DataObject* parent, const char* name, const char* info);
184         virtual ~MULTIPR_GUI_DataObject_Part();
185         
186         virtual QString entry()   const;
187         virtual QPixmap icon()    const;
188         virtual QString toolTip() const;
189
190 protected:
191         QString mMeshName;
192         int     mId;
193         QString mPath;
194         QString mMEDFileName;
195         QString mTooltip;
196 };
197
198
199 //*****************************************************************************
200 // Class MULTIPR_GUI_DataObject_Resolution
201 //*****************************************************************************
202
203 class MULTIPR_GUI_DataObject_Resolution : public MULTIPR_GUI_DataObject_Part
204 {
205 public:
206         MULTIPR_GUI_DataObject_Resolution(SUIT_DataObject* parent, const char* name, const char* info);
207         virtual ~MULTIPR_GUI_DataObject_Resolution();
208         
209         virtual QString entry()   const;
210         virtual QPixmap icon()    const;
211         virtual QString toolTip() const;
212
213 private:
214 };
215
216
217 //*****************************************************************************
218 // Class MULTIPR_GUI_DataModel
219 //*****************************************************************************
220
221 class MULTIPR_GUI_DataModel : public LightApp_DataModel
222 {
223 public:
224         MULTIPR_GUI_DataModel(CAM_Module*);
225         virtual ~MULTIPR_GUI_DataModel();
226
227 protected:
228         virtual void build();
229         
230 private:
231         MULTIPR_GUI* mMULTIPR_GUI;
232 };
233
234
235 #endif // __MULTIPR_GUI__
236
237
238 // EOF
239