1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SMESHGUI_ComputeDlg.h
23 // Author : Edward AGAPOV, Open CASCADE S.A.S.
25 #ifndef SMESHGUI_COMPUTEDLG_H
26 #define SMESHGUI_COMPUTEDLG_H
29 #include "SMESH_SMESHGUI.hxx"
31 #include "SMESHGUI_Dialog.h"
32 #include "SMESHGUI_Operation.h"
34 // SALOME GUI includes
35 #include <SALOME_InteractiveObject.hxx>
43 #include <SALOMEconfig.h>
44 #include CORBA_SERVER_HEADER(SMESH_Gen)
45 #include CORBA_SERVER_HEADER(SMESH_Mesh)
52 class SMESHGUI_ComputeDlg;
53 class SMESHGUI_PrecomputeDlg;
54 //class SMESHGUI_EvaluateDlg;
55 class SMESHGUI_MeshEditPreview;
57 class SMESH::compute_error_array;
61 class TShapeDisplayer;
65 * \brief Base operation to compute a mesh and show computation errors
67 class SMESHGUI_EXPORT SMESHGUI_BaseComputeOp: public SMESHGUI_Operation
72 SMESHGUI_BaseComputeOp();
73 virtual ~SMESHGUI_BaseComputeOp();
76 virtual void startOperation();
77 virtual void stopOperation();
79 SMESHGUI_ComputeDlg* computeDlg() const;
81 void showComputeResult( const bool,
83 SMESH::compute_error_array_var&,
86 //SMESHGUI_EvaluateDlg* evaluateDlg() const;
87 SMESHGUI_ComputeDlg* evaluateDlg() const;
89 void showEvaluateResult(std::vector<int> theVec,
92 SMESH::compute_error_array_var&,
97 virtual bool onApply();
98 void onPreviewShape();
99 void onPublishShape();
100 void onShowBadMesh();
101 void currentCellChanged();
104 QTableWidget* table();
107 QPointer<SMESHGUI_ComputeDlg> myCompDlg;
108 //QPointer<SMESHGUI_EvaluateDlg> myEvalDlg;
111 SMESH::SMESH_Mesh_var myMesh;
112 GEOM::GEOM_Object_var myMainShape;
113 SMESH::TShapeDisplayer* myTShapeDisplayer;
114 SMESHGUI_MeshEditPreview* myBadMeshDisplayer;
115 Handle(SALOME_InteractiveObject) myIObject;
119 * \brief Operation to compute a mesh and show computation errors
121 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_BaseComputeOp
126 SMESHGUI_ComputeOp();
127 virtual ~SMESHGUI_ComputeOp();
129 virtual LightApp_Dialog* dlg() const;
132 virtual void startOperation();
138 * \brief Operation to preview and compute a mesh and show computation errors
140 class SMESHGUI_EXPORT SMESHGUI_PrecomputeOp: public SMESHGUI_BaseComputeOp
145 SMESHGUI_PrecomputeOp();
146 virtual ~SMESHGUI_PrecomputeOp();
148 virtual LightApp_Dialog* dlg() const;
151 * \brief returns map of assigned algorithms modes
153 static void getAssignedAlgos(_PTR(SObject) theMesh,
154 QMap<int,int>& theModeMap);
157 virtual void startOperation();
158 virtual void stopOperation();
159 virtual void resumeOperation();
161 virtual void initDialog();
164 virtual void onCancel();
171 QMap< int, int > myMapShapeId;
172 QPointer<LightApp_Dialog> myActiveDlg;
173 QPointer<SMESHGUI_PrecomputeDlg> myDlg;
174 SMESHGUI_MeshEditPreview* myPreviewDisplayer;
178 * \brief Operation to evaluate a mesh and show result
180 class SMESHGUI_EXPORT SMESHGUI_EvaluateOp: public SMESHGUI_BaseComputeOp
185 SMESHGUI_EvaluateOp();
186 virtual ~SMESHGUI_EvaluateOp();
188 virtual LightApp_Dialog* dlg() const;
191 virtual void startOperation();
197 * \brief Box showing mesh info
200 class SMESHGUI_EXPORT SMESHGUI_MeshInfosBox : public QGroupBox
205 SMESHGUI_MeshInfosBox( const bool, QWidget* );
207 void SetInfoByMesh( SMESH::SMESH_Mesh_var );
209 void SetInfoByEval( std::vector<int> theVec );
216 QLabel* myNbQuadEdge;
219 QLabel* myNbQuadTrai;
222 QLabel* myNbQuadQuad;
225 QLabel* myNbQuadFace;
229 QLabel* myNbQuadHexa;
231 QLabel* myNbLinTetra;
232 QLabel* myNbQuadTetra;
235 QLabel* myNbQuadPyra;
237 QLabel* myNbLinPrism;
238 QLabel* myNbQuadPrism;
240 QLabel* myNbLinVolum;
241 QLabel* myNbQuadVolum;
246 * \brief Dialog to compute a mesh and show computation errors
249 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
254 SMESHGUI_ComputeDlg( QWidget*, bool );
255 virtual ~SMESHGUI_ComputeDlg();
258 QFrame* createMainFrame( QWidget*, bool );
261 QGroupBox* myMemoryLackGroup;
262 QGroupBox* myCompErrorGroup;
263 QGroupBox* myHypErrorGroup;
264 QLabel* myHypErrorLabel;
265 QTableWidget* myTable;
266 QPushButton* myShowBtn;
267 QPushButton* myPublishBtn;
268 QPushButton* myBadMeshBtn;
270 SMESHGUI_MeshInfosBox* myBriefInfo;
271 SMESHGUI_MeshInfosBox* myFullInfo;
273 friend class SMESHGUI_BaseComputeOp;
274 friend class SMESHGUI_PrecomputeOp;
278 * \brief Dialog to preview and compute a mesh and show computation errors
281 class SMESHGUI_EXPORT SMESHGUI_PrecomputeDlg : public SMESHGUI_Dialog
286 SMESHGUI_PrecomputeDlg( QWidget* );
287 virtual ~SMESHGUI_PrecomputeDlg();
289 void setPreviewModes( const QList<int>& );
290 int getPreviewMode() const;
296 QPushButton* myPreviewBtn;
297 QtxComboBox* myPreviewMode;
302 * \brief Dialog to evaluate a mesh and show result
305 class SMESHGUI_EXPORT SMESHGUI_EvaluateDlg : public SMESHGUI_Dialog
310 SMESHGUI_EvaluateDlg( QWidget* );
311 virtual ~SMESHGUI_EvaluateDlg();
314 QFrame* createMainFrame( QWidget* );
317 QGroupBox* myMemoryLackGroup;
318 QGroupBox* myCompErrorGroup;
319 QGroupBox* myHypErrorGroup;
320 QLabel* myHypErrorLabel;
321 QTableWidget* myTable;
322 QPushButton* myShowBtn;
323 QPushButton* myPublishBtn;
324 QPushButton* myBadMeshBtn;
326 SMESHGUI_MeshInfosBox* myBriefInfo;
327 SMESHGUI_MeshInfosBox* myFullInfo;
329 friend class SMESHGUI_BaseComputeOp;
333 #endif // SMESHGUI_COMPUTEDLG_H