Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[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 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                           currentCellChanged();
77
78 private:
79
80   QTable*                        table();
81
82   SMESHGUI_ComputeDlg*      myDlg;
83
84   GEOM::GEOM_Object_var     myMainShape;
85   SMESH::TShapeDisplayer*   myTShapeDisplayer;
86 };
87
88 /*!
89  * \brief Box showing mesh info
90  */
91
92 class SMESHGUI_MeshInfosBox : public QGroupBox
93 {
94   Q_OBJECT
95 public:
96
97   SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent);
98   void SetInfoByMesh(SMESH::SMESH_Mesh_var mesh);
99
100 private:
101
102   bool    myFull;
103   QLabel* myNbNode;
104   QLabel* myNbEdge,  *myNbLinEdge,  *myNbQuadEdge;
105   QLabel* myNbTrai,  *myNbLinTrai,  *myNbQuadTrai;
106   QLabel* myNbQuad,  *myNbLinQuad,  *myNbQuadQuad;
107   QLabel* myNbFace,  *myNbLinFace,  *myNbQuadFace;
108   QLabel* myNbPolyg;
109   QLabel* myNbHexa,  *myNbLinHexa,  *myNbQuadHexa;
110   QLabel* myNbTetra, *myNbLinTetra, *myNbQuadTetra;
111   QLabel* myNbPyra,  *myNbLinPyra,  *myNbQuadPyra;
112   QLabel* myNbPrism, *myNbLinPrism, *myNbQuadPrism;
113   QLabel* myNbVolum, *myNbLinVolum, *myNbQuadVolum;
114   QLabel* myNbPolyh;
115 };
116
117 /*!
118  * \brief Dialog to compute a mesh and show computation errors
119  */
120
121 class SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
122 {
123   Q_OBJECT
124
125 public:
126                                SMESHGUI_ComputeDlg();
127
128 private:
129
130   QFrame*                      createMainFrame   (QWidget*);
131
132   QLabel*                      myMeshName;
133   QGroupBox*                   myMemoryLackGroup;
134   QGroupBox*                   myCompErrorGroup;
135   QGroupBox*                   myHypErrorGroup;
136   QLabel*                      myHypErrorLabel;
137   QTable*                      myTable;
138   QPushButton*                 myShowBtn;
139   QPushButton*                 myPublishBtn;
140
141   SMESHGUI_MeshInfosBox*       myBriefInfo;
142   SMESHGUI_MeshInfosBox*       myFullInfo;
143
144   friend class SMESHGUI_ComputeOp;
145
146 };
147
148 #endif