Salome HOME
5f0f8814ce677e4485c2429a9d0c60a19f1e4b6f
[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
24 //  Module : SMESH
25 //
26 #ifndef SMESHGUI_ComputeDlg_H
27 #define SMESHGUI_ComputeDlg_H
28
29 #include "SMESHGUI_Dialog.h"
30 #include "SMESHGUI_SelectionOp.h"
31
32 #include "VTKViewer.h"
33
34 #include "SALOMEconfig.h"
35 #include CORBA_SERVER_HEADER(GEOM_Gen)
36
37 #include <qgroupbox.h>
38
39 class QFrame;
40 class QPushButton;
41 class QTable;
42 class QLabel;
43 class SMESHGUI_ComputeDlg;
44 class SMESHGUI_MeshEditPreview;
45 class GEOM_Actor;
46
47 namespace SMESH {
48   class TShapeDisplayer;
49 }
50
51 /*!
52  * \brief Operation to compute a mesh and show computation errors
53  */
54 class 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
66   virtual void                   startOperation();
67   virtual void                   stopOperation();
68
69 protected slots:
70   virtual bool                   onApply();
71
72 private slots:
73
74   void                           onPreviewShape();
75   void                           onPublishShape();
76   void                           onShowBadMesh();
77   void                           currentCellChanged();
78
79 private:
80
81   QTable*                        table();
82
83   SMESHGUI_ComputeDlg*      myDlg;
84
85   SMESH::SMESH_Mesh_var     myMesh;
86   GEOM::GEOM_Object_var     myMainShape;
87   SMESH::TShapeDisplayer*   myTShapeDisplayer;
88   SMESHGUI_MeshEditPreview* myBadMeshDisplayer;
89 };
90
91 /*!
92  * \brief Box showing mesh info
93  */
94
95 class SMESHGUI_MeshInfosBox : public QGroupBox
96 {
97   Q_OBJECT
98 public:
99
100   SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent);
101   void SetInfoByMesh(SMESH::SMESH_Mesh_var mesh);
102
103 private:
104
105   bool    myFull;
106   QLabel* myNbNode;
107   QLabel* myNbEdge,  *myNbLinEdge,  *myNbQuadEdge;
108   QLabel* myNbTrai,  *myNbLinTrai,  *myNbQuadTrai;
109   QLabel* myNbQuad,  *myNbLinQuad,  *myNbQuadQuad;
110   QLabel* myNbFace,  *myNbLinFace,  *myNbQuadFace;
111   QLabel* myNbPolyg;
112   QLabel* myNbHexa,  *myNbLinHexa,  *myNbQuadHexa;
113   QLabel* myNbTetra, *myNbLinTetra, *myNbQuadTetra;
114   QLabel* myNbPyra,  *myNbLinPyra,  *myNbQuadPyra;
115   QLabel* myNbPrism, *myNbLinPrism, *myNbQuadPrism;
116   QLabel* myNbVolum, *myNbLinVolum, *myNbQuadVolum;
117   QLabel* myNbPolyh;
118 };
119
120 /*!
121  * \brief Dialog to compute a mesh and show computation errors
122  */
123
124 class SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
125 {
126   Q_OBJECT
127
128 public:
129                                SMESHGUI_ComputeDlg();
130
131 private:
132
133   QFrame*                      createMainFrame   (QWidget*);
134
135   QLabel*                      myMeshName;
136   QGroupBox*                   myMemoryLackGroup;
137   QGroupBox*                   myCompErrorGroup;
138   QGroupBox*                   myHypErrorGroup;
139   QLabel*                      myHypErrorLabel;
140   QTable*                      myTable;
141   QPushButton*                 myShowBtn;
142   QPushButton*                 myPublishBtn;
143   QPushButton*                 myBadMeshBtn;
144
145   SMESHGUI_MeshInfosBox*       myBriefInfo;
146   SMESHGUI_MeshInfosBox*       myFullInfo;
147
148   friend class SMESHGUI_ComputeOp;
149
150 };
151
152 #endif