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_MeshEditPreview;
56 class SMESH::compute_error_array;
60 class TShapeDisplayer;
64 * \brief Base operation to compute a mesh and show computation errors
66 class SMESHGUI_EXPORT SMESHGUI_BaseComputeOp: public SMESHGUI_Operation
71 SMESHGUI_BaseComputeOp();
72 virtual ~SMESHGUI_BaseComputeOp();
75 virtual void startOperation();
76 virtual void stopOperation();
78 SMESHGUI_ComputeDlg* computeDlg() const;
80 void showComputeResult( const bool,
82 SMESH::compute_error_array_var&,
87 void onPreviewShape();
88 void onPublishShape();
90 void currentCellChanged();
93 QTableWidget* table();
96 QPointer<SMESHGUI_ComputeDlg> myCompDlg;
99 SMESH::SMESH_Mesh_var myMesh;
100 GEOM::GEOM_Object_var myMainShape;
101 SMESH::TShapeDisplayer* myTShapeDisplayer;
102 SMESHGUI_MeshEditPreview* myBadMeshDisplayer;
103 Handle(SALOME_InteractiveObject) myIObject;
107 * \brief Operation to compute a mesh and show computation errors
109 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_BaseComputeOp
114 SMESHGUI_ComputeOp();
115 virtual ~SMESHGUI_ComputeOp();
117 virtual LightApp_Dialog* dlg() const;
120 virtual void startOperation();
123 virtual bool onApply();
127 * \brief Operation to preview and compute a mesh and show computation errors
129 class SMESHGUI_EXPORT SMESHGUI_PrecomputeOp: public SMESHGUI_BaseComputeOp
134 SMESHGUI_PrecomputeOp();
135 virtual ~SMESHGUI_PrecomputeOp();
137 virtual LightApp_Dialog* dlg() const;
140 virtual void startOperation();
141 virtual void stopOperation();
142 virtual void resumeOperation();
144 virtual void initDialog();
147 virtual bool onApply();
148 virtual void onCancel();
154 QMap< int, int > myMapShapeId;
155 QPointer<LightApp_Dialog> myActiveDlg;
156 QPointer<SMESHGUI_PrecomputeDlg> myDlg;
157 SMESHGUI_MeshEditPreview* myPreviewDisplayer;
161 * \brief Box showing mesh info
164 class SMESHGUI_EXPORT SMESHGUI_MeshInfosBox : public QGroupBox
169 SMESHGUI_MeshInfosBox( const bool, QWidget* );
171 void SetInfoByMesh( SMESH::SMESH_Mesh_var );
178 QLabel* myNbQuadEdge;
181 QLabel* myNbQuadTrai;
184 QLabel* myNbQuadQuad;
187 QLabel* myNbQuadFace;
191 QLabel* myNbQuadHexa;
193 QLabel* myNbLinTetra;
194 QLabel* myNbQuadTetra;
197 QLabel* myNbQuadPyra;
199 QLabel* myNbLinPrism;
200 QLabel* myNbQuadPrism;
202 QLabel* myNbLinVolum;
203 QLabel* myNbQuadVolum;
208 * \brief Dialog to compute a mesh and show computation errors
211 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
216 SMESHGUI_ComputeDlg( QWidget* );
217 virtual ~SMESHGUI_ComputeDlg();
220 QFrame* createMainFrame( QWidget* );
223 QGroupBox* myMemoryLackGroup;
224 QGroupBox* myCompErrorGroup;
225 QGroupBox* myHypErrorGroup;
226 QLabel* myHypErrorLabel;
227 QTableWidget* myTable;
228 QPushButton* myShowBtn;
229 QPushButton* myPublishBtn;
230 QPushButton* myBadMeshBtn;
232 SMESHGUI_MeshInfosBox* myBriefInfo;
233 SMESHGUI_MeshInfosBox* myFullInfo;
235 friend class SMESHGUI_BaseComputeOp;
236 friend class SMESHGUI_PrecomputeOp;
240 * \brief Dialog to preview and compute a mesh and show computation errors
243 class SMESHGUI_EXPORT SMESHGUI_PrecomputeDlg : public SMESHGUI_Dialog
248 SMESHGUI_PrecomputeDlg( QWidget* );
249 virtual ~SMESHGUI_PrecomputeDlg();
251 void setPreviewModes( const QList<int>& );
252 int getPreviewMode() const;
258 QPushButton* myPreviewBtn;
259 QtxComboBox* myPreviewMode;
263 #endif // SMESHGUI_COMPUTEDLG_H