Salome HOME
Update copyright information
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ComputeDlg.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // File   : SMESHGUI_ComputeDlg.h
23 // Author : Edward AGAPOV, Open CASCADE S.A.S.
24 //
25 #ifndef SMESHGUI_COMPUTEDLG_H
26 #define SMESHGUI_COMPUTEDLG_H
27
28 // SMESH includes
29 #include "SMESH_SMESHGUI.hxx"
30
31 #include "SMESHGUI_Dialog.h"
32 #include "SMESHGUI_Operation.h"
33
34 // Qt includes
35 #include <QGroupBox>
36
37 // IDL includes
38 #include <SALOMEconfig.h>
39 #include CORBA_SERVER_HEADER(SMESH_Mesh)
40
41 class QFrame;
42 class QPushButton;
43 class QTableWidget;
44 class QLabel;
45 class SMESHGUI_ComputeDlg;
46 class SMESHGUI_MeshEditPreview;
47
48 namespace SMESH
49 {
50   class TShapeDisplayer;
51 }
52
53 /*!
54  * \brief Operation to compute a mesh and show computation errors
55  */
56 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_Operation
57 {
58   Q_OBJECT
59
60 public:
61   SMESHGUI_ComputeOp();
62   virtual ~SMESHGUI_ComputeOp();
63
64   virtual LightApp_Dialog*       dlg() const;
65
66 protected:
67   virtual void                   startOperation();
68   virtual void                   stopOperation();
69
70 protected slots:
71   virtual bool                   onApply();
72
73 private slots:
74   void                           onPreviewShape();
75   void                           onPublishShape();
76   void                           onShowBadMesh();
77   void                           currentCellChanged();
78
79 private:
80   QTableWidget*                  table();
81
82   SMESHGUI_ComputeDlg*           myDlg;
83
84   SMESH::SMESH_Mesh_var          myMesh;
85   GEOM::GEOM_Object_var          myMainShape;
86   SMESH::TShapeDisplayer*        myTShapeDisplayer;
87   SMESHGUI_MeshEditPreview*      myBadMeshDisplayer;
88 };
89
90 /*!
91  * \brief Box showing mesh info
92  */
93
94 class SMESHGUI_EXPORT SMESHGUI_MeshInfosBox : public QGroupBox
95 {
96   Q_OBJECT
97
98 public:
99   SMESHGUI_MeshInfosBox( const bool, QWidget* );
100
101   void    SetInfoByMesh( SMESH::SMESH_Mesh_var );
102
103 private:
104   bool    myFull;
105   QLabel* myNbNode;
106   QLabel* myNbEdge;
107   QLabel* myNbLinEdge;
108   QLabel* myNbQuadEdge;
109   QLabel* myNbTrai;
110   QLabel* myNbLinTrai;
111   QLabel* myNbQuadTrai;
112   QLabel* myNbQuad;
113   QLabel* myNbLinQuad;
114   QLabel* myNbQuadQuad;
115   QLabel* myNbFace;
116   QLabel* myNbLinFace;
117   QLabel* myNbQuadFace;
118   QLabel* myNbPolyg;
119   QLabel* myNbHexa;
120   QLabel* myNbLinHexa;
121   QLabel* myNbQuadHexa;
122   QLabel* myNbTetra;
123   QLabel* myNbLinTetra;
124   QLabel* myNbQuadTetra;
125   QLabel* myNbPyra;
126   QLabel* myNbLinPyra;
127   QLabel* myNbQuadPyra;
128   QLabel* myNbPrism;
129   QLabel* myNbLinPrism;
130   QLabel* myNbQuadPrism;
131   QLabel* myNbVolum;
132   QLabel* myNbLinVolum;
133   QLabel* myNbQuadVolum;
134   QLabel* myNbPolyh;
135 };
136
137 /*!
138  * \brief Dialog to compute a mesh and show computation errors
139  */
140
141 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
142 {
143   Q_OBJECT
144
145 public:
146   SMESHGUI_ComputeDlg();
147
148 private:
149   QFrame*                      createMainFrame( QWidget* );
150
151   QLabel*                      myMeshName;
152   QGroupBox*                   myMemoryLackGroup;
153   QGroupBox*                   myCompErrorGroup;
154   QGroupBox*                   myHypErrorGroup;
155   QLabel*                      myHypErrorLabel;
156   QTableWidget*                myTable;
157   QPushButton*                 myShowBtn;
158   QPushButton*                 myPublishBtn;
159   QPushButton*                 myBadMeshBtn;
160
161   SMESHGUI_MeshInfosBox*       myBriefInfo;
162   SMESHGUI_MeshInfosBox*       myFullInfo;
163
164   friend class SMESHGUI_ComputeOp;
165 };
166
167 #endif // SMESHGUI_COMPUTEDLG_H