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