1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SMESHGUI_ComputeDlg.h
21 // Author : Edward AGAPOV, Open CASCADE S.A.S.
23 #ifndef SMESHGUI_COMPUTEDLG_H
24 #define SMESHGUI_COMPUTEDLG_H
27 #include "SMESH_SMESHGUI.hxx"
29 #include "SMESHGUI_Dialog.h"
30 #include "SMESHGUI_Operation.h"
32 // SALOME GUI includes
33 #include <SALOME_InteractiveObject.hxx>
42 #include <SALOMEconfig.h>
43 #include CORBA_SERVER_HEADER(SMESH_Gen)
44 #include CORBA_SERVER_HEADER(SMESH_Mesh)
51 class SMESHGUI_ComputeDlg;
52 class SMESHGUI_MeshInfosBox;
53 class SMESHGUI_PrecomputeDlg;
54 class SMESHGUI_MeshEditPreview;
58 class TShapeDisplayer;
62 * \brief Base operation to compute a mesh and show computation errors
64 class SMESHGUI_EXPORT SMESHGUI_BaseComputeOp: public SMESHGUI_Operation
69 SMESHGUI_BaseComputeOp();
70 virtual ~SMESHGUI_BaseComputeOp();
72 SMESH::SMESH_Mesh_ptr getMesh();
75 virtual void startOperation();
76 virtual void stopOperation();
78 SMESHGUI_ComputeDlg* computeDlg() const;
80 void showComputeResult( const bool,
82 SMESH::compute_error_array_var&,
85 SMESHGUI_ComputeDlg* evaluateDlg() const;
87 void showEvaluateResult(const SMESH::long_array& theRes,
90 SMESH::compute_error_array_var&,
94 virtual bool isValid( SUIT_Operation* theOp ) const;
97 virtual bool onApply();
98 void onPreviewShape();
99 void onPublishShape();
100 void onShowBadMesh();
101 void currentCellChanged();
104 QTableWidget* table();
107 QPointer<SMESHGUI_ComputeDlg> myCompDlg;
110 SMESH::SMESH_Mesh_var myMesh;
111 GEOM::GEOM_Object_var myMainShape;
112 SMESH::TShapeDisplayer* myTShapeDisplayer;
113 SMESHGUI_MeshEditPreview* myBadMeshDisplayer;
114 Handle(SALOME_InteractiveObject) myIObject;
118 * \brief Operation to compute a mesh and show computation errors
120 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_BaseComputeOp
125 SMESHGUI_ComputeOp();
126 virtual ~SMESHGUI_ComputeOp();
128 virtual LightApp_Dialog* dlg() const;
131 virtual void startOperation();
136 class SMESHGUI_MeshOrderMgr;
139 * \brief Operation to preview and compute a mesh and show computation errors
141 class SMESHGUI_EXPORT SMESHGUI_PrecomputeOp: public SMESHGUI_BaseComputeOp
146 SMESHGUI_PrecomputeOp();
147 virtual ~SMESHGUI_PrecomputeOp();
149 virtual LightApp_Dialog* dlg() const;
152 * \brief returns map of assigned algorithms modes
154 static void getAssignedAlgos(_PTR(SObject) theMesh,
155 QMap<int,int>& theModeMap);
158 virtual void startOperation();
159 virtual void stopOperation();
160 virtual void resumeOperation();
162 virtual void initDialog();
165 virtual void onCancel();
173 QMap< int, int > myMapShapeId;
174 QPointer<LightApp_Dialog> myActiveDlg;
175 QPointer<SMESHGUI_PrecomputeDlg> myDlg;
176 SMESHGUI_MeshEditPreview* myPreviewDisplayer;
177 //! fields for mesh order
178 typedef QList<int> TListOfInt;
179 typedef QList<TListOfInt> TListOfListOfInt;
180 TListOfListOfInt myPrevOrder;
181 SMESHGUI_MeshOrderMgr* myOrderMgr;
185 * \brief Operation to evaluate a mesh and show result
187 class SMESHGUI_EXPORT SMESHGUI_EvaluateOp: public SMESHGUI_BaseComputeOp
192 SMESHGUI_EvaluateOp();
193 virtual ~SMESHGUI_EvaluateOp();
195 virtual LightApp_Dialog* dlg() const;
198 virtual void startOperation();
204 * \brief Dialog to compute a mesh and show computation errors
207 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
212 SMESHGUI_ComputeDlg( QWidget*, bool );
213 virtual ~SMESHGUI_ComputeDlg();
216 QFrame* createMainFrame( QWidget*, bool );
219 QGroupBox* myMemoryLackGroup;
220 QGroupBox* myCompErrorGroup;
221 QGroupBox* myHypErrorGroup;
222 QLabel* myHypErrorLabel;
223 QTableWidget* myTable;
224 QPushButton* myShowBtn;
225 QPushButton* myPublishBtn;
226 QPushButton* myBadMeshBtn;
228 SMESHGUI_MeshInfosBox* myBriefInfo;
229 SMESHGUI_MeshInfosBox* myFullInfo;
231 friend class SMESHGUI_BaseComputeOp;
232 friend class SMESHGUI_PrecomputeOp;
235 class SMESHGUI_MeshOrderBox;
238 * \brief Dialog to preview and compute a mesh and show computation errors
241 class SMESHGUI_EXPORT SMESHGUI_PrecomputeDlg : public SMESHGUI_Dialog
246 SMESHGUI_PrecomputeDlg( QWidget* );
247 virtual ~SMESHGUI_PrecomputeDlg();
249 void setPreviewModes( const QList<int>& );
250 int getPreviewMode() const;
252 SMESHGUI_MeshOrderBox* getMeshOrderBox() const;
258 SMESHGUI_MeshOrderBox* myOrderBox;
259 QPushButton* myPreviewBtn;
260 QtxComboBox* myPreviewMode;
263 #endif // SMESHGUI_COMPUTEDLG_H