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>
44 #include <SALOMEconfig.h>
45 #include CORBA_SERVER_HEADER(SMESH_Gen)
46 #include CORBA_SERVER_HEADER(SMESH_Mesh)
53 class SMESHGUI_ComputeDlg;
54 class SMESHGUI_MeshInfosBox;
55 class SMESHGUI_PrecomputeDlg;
56 class SMESHGUI_MeshEditPreview;
58 class SMESH::compute_error_array;
62 class TShapeDisplayer;
66 * \brief Base operation to compute a mesh and show computation errors
68 class SMESHGUI_EXPORT SMESHGUI_BaseComputeOp: public SMESHGUI_Operation
73 SMESHGUI_BaseComputeOp();
74 virtual ~SMESHGUI_BaseComputeOp();
76 SMESH::SMESH_Mesh_ptr getMesh();
79 virtual void startOperation();
80 virtual void stopOperation();
82 SMESHGUI_ComputeDlg* computeDlg() const;
84 void showComputeResult( const bool,
86 SMESH::compute_error_array_var&,
89 SMESHGUI_ComputeDlg* evaluateDlg() const;
91 void showEvaluateResult(const SMESH::long_array& theRes,
94 SMESH::compute_error_array_var&,
98 virtual bool isValid( SUIT_Operation* theOp ) const;
101 virtual bool onApply();
102 void onPreviewShape();
103 void onPublishShape();
104 void onShowBadMesh();
105 void currentCellChanged();
108 QTableWidget* table();
111 QPointer<SMESHGUI_ComputeDlg> myCompDlg;
114 SMESH::SMESH_Mesh_var myMesh;
115 GEOM::GEOM_Object_var myMainShape;
116 SMESH::TShapeDisplayer* myTShapeDisplayer;
117 SMESHGUI_MeshEditPreview* myBadMeshDisplayer;
118 Handle(SALOME_InteractiveObject) myIObject;
122 * \brief Operation to compute a mesh and show computation errors
124 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_BaseComputeOp
129 SMESHGUI_ComputeOp();
130 virtual ~SMESHGUI_ComputeOp();
132 virtual LightApp_Dialog* dlg() const;
135 virtual void startOperation();
140 class SMESHGUI_MeshOrderMgr;
143 * \brief Operation to preview and compute a mesh and show computation errors
145 class SMESHGUI_EXPORT SMESHGUI_PrecomputeOp: public SMESHGUI_BaseComputeOp
150 SMESHGUI_PrecomputeOp();
151 virtual ~SMESHGUI_PrecomputeOp();
153 virtual LightApp_Dialog* dlg() const;
156 * \brief returns map of assigned algorithms modes
158 static void getAssignedAlgos(_PTR(SObject) theMesh,
159 QMap<int,int>& theModeMap);
162 virtual void startOperation();
163 virtual void stopOperation();
164 virtual void resumeOperation();
166 virtual void initDialog();
169 virtual void onCancel();
177 QMap< int, int > myMapShapeId;
178 QPointer<LightApp_Dialog> myActiveDlg;
179 QPointer<SMESHGUI_PrecomputeDlg> myDlg;
180 SMESHGUI_MeshEditPreview* myPreviewDisplayer;
181 //! fields for mesh order
182 typedef QList<int> TListOfInt;
183 typedef QList<TListOfInt> TListOfListOfInt;
184 TListOfListOfInt myPrevOrder;
185 SMESHGUI_MeshOrderMgr* myOrderMgr;
189 * \brief Operation to evaluate a mesh and show result
191 class SMESHGUI_EXPORT SMESHGUI_EvaluateOp: public SMESHGUI_BaseComputeOp
196 SMESHGUI_EvaluateOp();
197 virtual ~SMESHGUI_EvaluateOp();
199 virtual LightApp_Dialog* dlg() const;
202 virtual void startOperation();
208 * \brief Dialog to compute a mesh and show computation errors
211 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
216 SMESHGUI_ComputeDlg( QWidget*, bool );
217 virtual ~SMESHGUI_ComputeDlg();
220 QFrame* createMainFrame( QWidget*, bool );
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;
239 class SMESHGUI_MeshOrderBox;
242 * \brief Dialog to preview and compute a mesh and show computation errors
245 class SMESHGUI_EXPORT SMESHGUI_PrecomputeDlg : public SMESHGUI_Dialog
250 SMESHGUI_PrecomputeDlg( QWidget* );
251 virtual ~SMESHGUI_PrecomputeDlg();
253 void setPreviewModes( const QList<int>& );
254 int getPreviewMode() const;
256 SMESHGUI_MeshOrderBox* getMeshOrderBox() const;
262 SMESHGUI_MeshOrderBox* myOrderBox;
263 QPushButton* myPreviewBtn;
264 QtxComboBox* myPreviewMode;
267 #endif // SMESHGUI_COMPUTEDLG_H