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