1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SMESHGUI_ComputeDlg.h
21 // Author : Edward AGAPOV, Open CASCADE S.A.S.
24 #ifndef SMESHGUI_COMPUTEDLG_H
25 #define SMESHGUI_COMPUTEDLG_H
28 #include "SMESH_SMESHGUI.hxx"
30 #include "SMESHGUI_Dialog.h"
31 #include "SMESHGUI_Operation.h"
33 // SALOME GUI includes
34 #include <SALOME_InteractiveObject.hxx>
42 #include <SALOMEconfig.h>
43 #include CORBA_SERVER_HEADER(SMESH_Gen)
44 #include CORBA_SERVER_HEADER(SMESH_Mesh)
51 class SMESHGUI_ComputeDlg;
52 class SMESHGUI_PrecomputeDlg;
53 class SMESHGUI_MeshEditPreview;
55 class SMESH::compute_error_array;
59 class TShapeDisplayer;
63 * \brief Base operation to compute a mesh and show computation errors
65 class SMESHGUI_EXPORT SMESHGUI_BaseComputeOp: public SMESHGUI_Operation
70 SMESHGUI_BaseComputeOp();
71 virtual ~SMESHGUI_BaseComputeOp();
74 virtual void startOperation();
75 virtual void stopOperation();
77 SMESHGUI_ComputeDlg* computeDlg() const;
79 void showComputeResult( const bool,
81 SMESH::compute_error_array_var&,
86 void onPreviewShape();
87 void onPublishShape();
89 void currentCellChanged();
92 QTableWidget* table();
95 QPointer<SMESHGUI_ComputeDlg> myCompDlg;
98 SMESH::SMESH_Mesh_var myMesh;
99 GEOM::GEOM_Object_var myMainShape;
100 SMESH::TShapeDisplayer* myTShapeDisplayer;
101 SMESHGUI_MeshEditPreview* myBadMeshDisplayer;
102 Handle(SALOME_InteractiveObject) myIObject;
106 * \brief Operation to compute a mesh and show computation errors
108 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_BaseComputeOp
113 SMESHGUI_ComputeOp();
114 virtual ~SMESHGUI_ComputeOp();
116 virtual LightApp_Dialog* dlg() const;
119 virtual void startOperation();
122 virtual bool onApply();
126 * \brief Operation to preview and compute a mesh and show computation errors
128 class SMESHGUI_EXPORT SMESHGUI_PrecomputeOp: public SMESHGUI_BaseComputeOp
133 SMESHGUI_PrecomputeOp();
134 virtual ~SMESHGUI_PrecomputeOp();
136 virtual LightApp_Dialog* dlg() const;
139 virtual void startOperation();
140 virtual void stopOperation();
141 virtual void resumeOperation();
143 virtual void initDialog();
146 virtual bool onApply();
147 virtual void onCancel();
153 QMap< int, int > myMapShapeId;
154 QPointer<LightApp_Dialog> myActiveDlg;
155 QPointer<SMESHGUI_PrecomputeDlg> myDlg;
156 SMESHGUI_MeshEditPreview* myPreviewDisplayer;
160 * \brief Box showing mesh info
163 class SMESHGUI_EXPORT SMESHGUI_MeshInfosBox : public QGroupBox
168 SMESHGUI_MeshInfosBox( const bool, QWidget* );
170 void SetInfoByMesh( SMESH::SMESH_Mesh_var );
177 QLabel* myNbQuadEdge;
180 QLabel* myNbQuadTrai;
183 QLabel* myNbQuadQuad;
186 QLabel* myNbQuadFace;
190 QLabel* myNbQuadHexa;
192 QLabel* myNbLinTetra;
193 QLabel* myNbQuadTetra;
196 QLabel* myNbQuadPyra;
198 QLabel* myNbLinPrism;
199 QLabel* myNbQuadPrism;
201 QLabel* myNbLinVolum;
202 QLabel* myNbQuadVolum;
207 * \brief Dialog to compute a mesh and show computation errors
210 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
215 SMESHGUI_ComputeDlg( QWidget* );
216 virtual ~SMESHGUI_ComputeDlg();
219 QFrame* createMainFrame( QWidget* );
222 QGroupBox* myMemoryLackGroup;
223 QGroupBox* myCompErrorGroup;
224 QGroupBox* myHypErrorGroup;
225 QLabel* myHypErrorLabel;
226 QTableWidget* myTable;
227 QPushButton* myShowBtn;
228 QPushButton* myPublishBtn;
229 QPushButton* myBadMeshBtn;
231 SMESHGUI_MeshInfosBox* myBriefInfo;
232 SMESHGUI_MeshInfosBox* myFullInfo;
234 friend class SMESHGUI_BaseComputeOp;
235 friend class SMESHGUI_PrecomputeOp;
239 * \brief Dialog to preview and compute a mesh and show computation errors
242 class SMESHGUI_EXPORT SMESHGUI_PrecomputeDlg : public SMESHGUI_Dialog
247 SMESHGUI_PrecomputeDlg( QWidget* );
248 virtual ~SMESHGUI_PrecomputeDlg();
250 void setPreviewModes( const QList<int>& );
251 int getPreviewMode() const;
257 QPushButton* myPreviewBtn;
258 QtxComboBox* myPreviewMode;
262 #endif // SMESHGUI_COMPUTEDLG_H