Salome HOME
Porting SMESH module to Qt 4
[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 // Qt includes
34 #include <QGroupBox>
35
36 // IDL includes
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SMESH_Mesh)
39
40 class QFrame;
41 class QPushButton;
42 class QTableWidget;
43 class QLabel;
44 class SMESHGUI_ComputeDlg;
45
46 namespace SMESH
47 {
48   class TShapeDisplayer;
49 }
50
51 /*!
52  * \brief Operation to compute a mesh and show computation errors
53  */
54 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_Operation
55 {
56   Q_OBJECT
57
58 public:
59   SMESHGUI_ComputeOp();
60   virtual ~SMESHGUI_ComputeOp();
61
62   virtual LightApp_Dialog*       dlg() const;
63
64 protected:
65   virtual void                   startOperation();
66   virtual void                   stopOperation();
67
68 protected slots:
69   virtual bool                   onApply();
70
71 private slots:
72   void                           onPreviewShape();
73   void                           onPublishShape();
74   void                           currentCellChanged();
75
76 private:
77   QTableWidget*                  table();
78
79   SMESHGUI_ComputeDlg*           myDlg;
80
81   GEOM::GEOM_Object_var          myMainShape;
82   SMESH::TShapeDisplayer*        myTShapeDisplayer;
83 };
84
85 /*!
86  * \brief Box showing mesh info
87  */
88
89 class SMESHGUI_EXPORT SMESHGUI_MeshInfosBox : public QGroupBox
90 {
91   Q_OBJECT
92
93 public:
94   SMESHGUI_MeshInfosBox( const bool, QWidget* );
95
96   void    SetInfoByMesh( SMESH::SMESH_Mesh_var );
97
98 private:
99   bool    myFull;
100   QLabel* myNbNode;
101   QLabel* myNbEdge;
102   QLabel* myNbLinEdge;
103   QLabel* myNbQuadEdge;
104   QLabel* myNbTrai;
105   QLabel* myNbLinTrai;
106   QLabel* myNbQuadTrai;
107   QLabel* myNbQuad;
108   QLabel* myNbLinQuad;
109   QLabel* myNbQuadQuad;
110   QLabel* myNbFace;
111   QLabel* myNbLinFace;
112   QLabel* myNbQuadFace;
113   QLabel* myNbPolyg;
114   QLabel* myNbHexa;
115   QLabel* myNbLinHexa;
116   QLabel* myNbQuadHexa;
117   QLabel* myNbTetra;
118   QLabel* myNbLinTetra;
119   QLabel* myNbQuadTetra;
120   QLabel* myNbPyra;
121   QLabel* myNbLinPyra;
122   QLabel* myNbQuadPyra;
123   QLabel* myNbPrism;
124   QLabel* myNbLinPrism;
125   QLabel* myNbQuadPrism;
126   QLabel* myNbVolum;
127   QLabel* myNbLinVolum;
128   QLabel* myNbQuadVolum;
129   QLabel* myNbPolyh;
130 };
131
132 /*!
133  * \brief Dialog to compute a mesh and show computation errors
134  */
135
136 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
137 {
138   Q_OBJECT
139
140 public:
141   SMESHGUI_ComputeDlg();
142
143 private:
144   QFrame*                      createMainFrame( QWidget* );
145
146   QLabel*                      myMeshName;
147   QGroupBox*                   myMemoryLackGroup;
148   QGroupBox*                   myCompErrorGroup;
149   QGroupBox*                   myHypErrorGroup;
150   QLabel*                      myHypErrorLabel;
151   QTableWidget*                myTable;
152   QPushButton*                 myShowBtn;
153   QPushButton*                 myPublishBtn;
154
155   SMESHGUI_MeshInfosBox*       myBriefInfo;
156   SMESHGUI_MeshInfosBox*       myFullInfo;
157
158   friend class SMESHGUI_ComputeOp;
159 };
160
161 #endif // SMESHGUI_COMPUTEDLG_H