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_MeshInfosBox;
54 class SMESHGUI_PrecomputeDlg;
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_ComputeDlg* evaluateDlg() const;
88 void showEvaluateResult(const SMESH::long_array& theRes,
91 SMESH::compute_error_array_var&,
96 virtual bool onApply();
97 void onPreviewShape();
98 void onPublishShape();
100 void currentCellChanged();
103 QTableWidget* table();
106 QPointer<SMESHGUI_ComputeDlg> myCompDlg;
109 SMESH::SMESH_Mesh_var myMesh;
110 GEOM::GEOM_Object_var myMainShape;
111 SMESH::TShapeDisplayer* myTShapeDisplayer;
112 SMESHGUI_MeshEditPreview* myBadMeshDisplayer;
113 Handle(SALOME_InteractiveObject) myIObject;
117 * \brief Operation to compute a mesh and show computation errors
119 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_BaseComputeOp
124 SMESHGUI_ComputeOp();
125 virtual ~SMESHGUI_ComputeOp();
127 virtual LightApp_Dialog* dlg() const;
130 virtual void startOperation();
136 * \brief Operation to preview and compute a mesh and show computation errors
138 class SMESHGUI_EXPORT SMESHGUI_PrecomputeOp: public SMESHGUI_BaseComputeOp
143 SMESHGUI_PrecomputeOp();
144 virtual ~SMESHGUI_PrecomputeOp();
146 virtual LightApp_Dialog* dlg() const;
149 * \brief returns map of assigned algorithms modes
151 static void getAssignedAlgos(_PTR(SObject) theMesh,
152 QMap<int,int>& theModeMap);
155 virtual void startOperation();
156 virtual void stopOperation();
157 virtual void resumeOperation();
159 virtual void initDialog();
162 virtual void onCancel();
169 QMap< int, int > myMapShapeId;
170 QPointer<LightApp_Dialog> myActiveDlg;
171 QPointer<SMESHGUI_PrecomputeDlg> myDlg;
172 SMESHGUI_MeshEditPreview* myPreviewDisplayer;
176 * \brief Operation to evaluate a mesh and show result
178 class SMESHGUI_EXPORT SMESHGUI_EvaluateOp: public SMESHGUI_BaseComputeOp
183 SMESHGUI_EvaluateOp();
184 virtual ~SMESHGUI_EvaluateOp();
186 virtual LightApp_Dialog* dlg() const;
189 virtual void startOperation();
195 * \brief Dialog to compute a mesh and show computation errors
198 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
203 SMESHGUI_ComputeDlg( QWidget*, bool );
204 virtual ~SMESHGUI_ComputeDlg();
207 QFrame* createMainFrame( QWidget*, bool );
210 QGroupBox* myMemoryLackGroup;
211 QGroupBox* myCompErrorGroup;
212 QGroupBox* myHypErrorGroup;
213 QLabel* myHypErrorLabel;
214 QTableWidget* myTable;
215 QPushButton* myShowBtn;
216 QPushButton* myPublishBtn;
217 QPushButton* myBadMeshBtn;
219 SMESHGUI_MeshInfosBox* myBriefInfo;
220 SMESHGUI_MeshInfosBox* myFullInfo;
222 friend class SMESHGUI_BaseComputeOp;
223 friend class SMESHGUI_PrecomputeOp;
227 * \brief Dialog to preview and compute a mesh and show computation errors
230 class SMESHGUI_EXPORT SMESHGUI_PrecomputeDlg : public SMESHGUI_Dialog
235 SMESHGUI_PrecomputeDlg( QWidget* );
236 virtual ~SMESHGUI_PrecomputeDlg();
238 void setPreviewModes( const QList<int>& );
239 int getPreviewMode() const;
245 QPushButton* myPreviewBtn;
246 QtxComboBox* myPreviewMode;
249 #endif // SMESHGUI_COMPUTEDLG_H