]> SALOME platform Git repositories - modules/smesh.git/blob - src/SMESHGUI/SMESHGUI_ComputeDlg.h
Salome HOME
Rollback previous wrong integration, restore improvement 0018239 implementation
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ComputeDlg.h
1 // Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
8 //
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 // File   : SMESHGUI_ComputeDlg.h
21 // Author : Edward AGAPOV, Open CASCADE S.A.S.
22 //
23
24 #ifndef SMESHGUI_COMPUTEDLG_H
25 #define SMESHGUI_COMPUTEDLG_H
26
27 // SMESH includes
28 #include "SMESH_SMESHGUI.hxx"
29
30 #include "SMESHGUI_Dialog.h"
31 #include "SMESHGUI_Operation.h"
32
33 // SALOME GUI includes
34 #include <SALOME_InteractiveObject.hxx>
35
36 // Qt includes
37 #include <QMap>
38 #include <QPointer>
39 #include <QGroupBox>
40
41 // IDL includes
42 #include <SALOMEconfig.h>
43 #include CORBA_SERVER_HEADER(SMESH_Gen)
44 #include CORBA_SERVER_HEADER(SMESH_Mesh)
45
46 class QFrame;
47 class QPushButton;
48 class QTableWidget;
49 class QLabel;
50 class QtxComboBox;
51 class SMESHGUI_ComputeDlg;
52 class SMESHGUI_PrecomputeDlg;
53 class SMESHGUI_MeshEditPreview;
54
55 class SMESH::compute_error_array;
56
57 namespace SMESH
58 {
59   class TShapeDisplayer;
60 }
61
62 /*!
63  * \brief Base operation to compute a mesh and show computation errors
64  */
65 class SMESHGUI_EXPORT SMESHGUI_BaseComputeOp: public SMESHGUI_Operation
66 {
67   Q_OBJECT
68
69 public:
70   SMESHGUI_BaseComputeOp();
71   virtual ~SMESHGUI_BaseComputeOp();
72
73 protected:
74   virtual void                   startOperation();
75   virtual void                   stopOperation();
76
77   SMESHGUI_ComputeDlg*           computeDlg() const;
78   void                           computeMesh();
79   void                           showComputeResult( const bool,
80                                                     const bool,
81                                                     SMESH::compute_error_array_var&,
82                                                     const bool,
83                                                     const QString& );
84     
85 protected slots:
86   void                           onPreviewShape();
87   void                           onPublishShape();
88   void                           onShowBadMesh();
89   void                           currentCellChanged();
90
91 private:
92   QTableWidget*                  table();
93
94 private:
95   QPointer<SMESHGUI_ComputeDlg>  myCompDlg;
96
97 protected:
98   SMESH::SMESH_Mesh_var            myMesh;
99   GEOM::GEOM_Object_var            myMainShape;
100   SMESH::TShapeDisplayer*          myTShapeDisplayer;
101   SMESHGUI_MeshEditPreview*        myBadMeshDisplayer;
102   Handle(SALOME_InteractiveObject) myIObject;
103 };
104
105 /*!
106  * \brief Operation to compute a mesh and show computation errors
107  */
108 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_BaseComputeOp
109 {
110   Q_OBJECT
111
112 public:
113   SMESHGUI_ComputeOp();
114   virtual ~SMESHGUI_ComputeOp();
115
116   virtual LightApp_Dialog*       dlg() const;
117
118 protected:
119   virtual void                   startOperation();
120
121 protected slots:
122   virtual bool                   onApply();
123 };
124
125 /*!
126  * \brief Operation to preview and compute a mesh and show computation errors
127  */
128 class SMESHGUI_EXPORT SMESHGUI_PrecomputeOp: public SMESHGUI_BaseComputeOp
129 {
130   Q_OBJECT
131
132 public:
133   SMESHGUI_PrecomputeOp();
134   virtual ~SMESHGUI_PrecomputeOp();
135
136   virtual LightApp_Dialog*       dlg() const;
137
138 protected:
139   virtual void                   startOperation();
140   virtual void                   stopOperation();
141   virtual void                   resumeOperation();
142
143   virtual void                   initDialog();
144
145 protected slots:
146   virtual bool                   onApply();
147   virtual void                   onCancel();
148
149 private slots:
150   void                           onPreview();
151
152 private:
153   QMap< int, int >               myMapShapeId;
154   QPointer<LightApp_Dialog>      myActiveDlg;
155   QPointer<SMESHGUI_PrecomputeDlg> myDlg;
156   SMESHGUI_MeshEditPreview*      myPreviewDisplayer;
157 };
158
159 /*!
160  * \brief Box showing mesh info
161  */
162
163 class SMESHGUI_EXPORT SMESHGUI_MeshInfosBox : public QGroupBox
164 {
165   Q_OBJECT
166
167 public:
168   SMESHGUI_MeshInfosBox( const bool, QWidget* );
169
170   void    SetInfoByMesh( SMESH::SMESH_Mesh_var );
171
172 private:
173   bool    myFull;
174   QLabel* myNbNode;
175   QLabel* myNbEdge;
176   QLabel* myNbLinEdge;
177   QLabel* myNbQuadEdge;
178   QLabel* myNbTrai;
179   QLabel* myNbLinTrai;
180   QLabel* myNbQuadTrai;
181   QLabel* myNbQuad;
182   QLabel* myNbLinQuad;
183   QLabel* myNbQuadQuad;
184   QLabel* myNbFace;
185   QLabel* myNbLinFace;
186   QLabel* myNbQuadFace;
187   QLabel* myNbPolyg;
188   QLabel* myNbHexa;
189   QLabel* myNbLinHexa;
190   QLabel* myNbQuadHexa;
191   QLabel* myNbTetra;
192   QLabel* myNbLinTetra;
193   QLabel* myNbQuadTetra;
194   QLabel* myNbPyra;
195   QLabel* myNbLinPyra;
196   QLabel* myNbQuadPyra;
197   QLabel* myNbPrism;
198   QLabel* myNbLinPrism;
199   QLabel* myNbQuadPrism;
200   QLabel* myNbVolum;
201   QLabel* myNbLinVolum;
202   QLabel* myNbQuadVolum;
203   QLabel* myNbPolyh;
204 };
205
206 /*!
207  * \brief Dialog to compute a mesh and show computation errors
208  */
209
210 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
211 {
212   Q_OBJECT
213
214 public:
215   SMESHGUI_ComputeDlg( QWidget* );
216   virtual ~SMESHGUI_ComputeDlg();
217
218 protected:
219   QFrame*                      createMainFrame( QWidget* );
220
221   QLabel*                      myMeshName;
222   QGroupBox*                   myMemoryLackGroup;
223   QGroupBox*                   myCompErrorGroup;
224   QGroupBox*                   myHypErrorGroup;
225   QLabel*                      myHypErrorLabel;
226   QTableWidget*                myTable;
227   QPushButton*                 myShowBtn;
228   QPushButton*                 myPublishBtn;
229   QPushButton*                 myBadMeshBtn;
230
231   SMESHGUI_MeshInfosBox*       myBriefInfo;
232   SMESHGUI_MeshInfosBox*       myFullInfo;
233
234   friend class SMESHGUI_BaseComputeOp;
235   friend class SMESHGUI_PrecomputeOp;
236 };
237
238 /*!
239  * \brief Dialog to preview and compute a mesh and show computation errors
240  */
241
242 class SMESHGUI_EXPORT SMESHGUI_PrecomputeDlg : public SMESHGUI_Dialog
243 {
244   Q_OBJECT
245
246 public:
247   SMESHGUI_PrecomputeDlg( QWidget* );
248   virtual ~SMESHGUI_PrecomputeDlg();
249   
250   void                         setPreviewModes( const QList<int>& );
251   int                          getPreviewMode() const;
252
253 signals:
254   void                         preview();
255
256 private:
257   QPushButton*                 myPreviewBtn;
258   QtxComboBox*                 myPreviewMode;
259 };
260
261
262 #endif // SMESHGUI_COMPUTEDLG_H