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 virtual bool onApply();
88 void onPreviewShape();
89 void onPublishShape();
91 void currentCellChanged();
94 QTableWidget* table();
97 QPointer<SMESHGUI_ComputeDlg> myCompDlg;
100 SMESH::SMESH_Mesh_var myMesh;
101 GEOM::GEOM_Object_var myMainShape;
102 SMESH::TShapeDisplayer* myTShapeDisplayer;
103 SMESHGUI_MeshEditPreview* myBadMeshDisplayer;
104 Handle(SALOME_InteractiveObject) myIObject;
108 * \brief Operation to compute a mesh and show computation errors
110 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_BaseComputeOp
115 SMESHGUI_ComputeOp();
116 virtual ~SMESHGUI_ComputeOp();
118 virtual LightApp_Dialog* dlg() const;
121 virtual void startOperation();
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 * \brief returns map of assigned algorithms modes
142 static void getAssignedAlgos(_PTR(SObject) theMesh,
143 QMap<int,int>& theModeMap);
146 virtual void startOperation();
147 virtual void stopOperation();
148 virtual void resumeOperation();
150 virtual void initDialog();
153 virtual void onCancel();
160 QMap< int, int > myMapShapeId;
161 QPointer<LightApp_Dialog> myActiveDlg;
162 QPointer<SMESHGUI_PrecomputeDlg> myDlg;
163 SMESHGUI_MeshEditPreview* myPreviewDisplayer;
167 * \brief Box showing mesh info
170 class SMESHGUI_EXPORT SMESHGUI_MeshInfosBox : public QGroupBox
175 SMESHGUI_MeshInfosBox( const bool, QWidget* );
177 void SetInfoByMesh( SMESH::SMESH_Mesh_var );
184 QLabel* myNbQuadEdge;
187 QLabel* myNbQuadTrai;
190 QLabel* myNbQuadQuad;
193 QLabel* myNbQuadFace;
197 QLabel* myNbQuadHexa;
199 QLabel* myNbLinTetra;
200 QLabel* myNbQuadTetra;
203 QLabel* myNbQuadPyra;
205 QLabel* myNbLinPrism;
206 QLabel* myNbQuadPrism;
208 QLabel* myNbLinVolum;
209 QLabel* myNbQuadVolum;
214 * \brief Dialog to compute a mesh and show computation errors
217 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
222 SMESHGUI_ComputeDlg( QWidget* );
223 virtual ~SMESHGUI_ComputeDlg();
226 QFrame* createMainFrame( QWidget* );
229 QGroupBox* myMemoryLackGroup;
230 QGroupBox* myCompErrorGroup;
231 QGroupBox* myHypErrorGroup;
232 QLabel* myHypErrorLabel;
233 QTableWidget* myTable;
234 QPushButton* myShowBtn;
235 QPushButton* myPublishBtn;
236 QPushButton* myBadMeshBtn;
238 SMESHGUI_MeshInfosBox* myBriefInfo;
239 SMESHGUI_MeshInfosBox* myFullInfo;
241 friend class SMESHGUI_BaseComputeOp;
242 friend class SMESHGUI_PrecomputeOp;
246 * \brief Dialog to preview and compute a mesh and show computation errors
249 class SMESHGUI_EXPORT SMESHGUI_PrecomputeDlg : public SMESHGUI_Dialog
254 SMESHGUI_PrecomputeDlg( QWidget* );
255 virtual ~SMESHGUI_PrecomputeDlg();
257 void setPreviewModes( const QList<int>& );
258 int getPreviewMode() const;
264 QPushButton* myPreviewBtn;
265 QtxComboBox* myPreviewMode;
269 #endif // SMESHGUI_COMPUTEDLG_H