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();
75 SMESH::SMESH_Mesh_ptr getMesh();
78 virtual void startOperation();
79 virtual void stopOperation();
81 SMESHGUI_ComputeDlg* computeDlg() const;
83 void showComputeResult( const bool,
85 SMESH::compute_error_array_var&,
88 SMESHGUI_ComputeDlg* evaluateDlg() const;
90 void showEvaluateResult(const SMESH::long_array& theRes,
93 SMESH::compute_error_array_var&,
97 virtual bool isValid( SUIT_Operation* theOp ) const;
100 virtual bool onApply();
101 void onPreviewShape();
102 void onPublishShape();
103 void onShowBadMesh();
104 void currentCellChanged();
107 QTableWidget* table();
110 QPointer<SMESHGUI_ComputeDlg> myCompDlg;
113 SMESH::SMESH_Mesh_var myMesh;
114 GEOM::GEOM_Object_var myMainShape;
115 SMESH::TShapeDisplayer* myTShapeDisplayer;
116 SMESHGUI_MeshEditPreview* myBadMeshDisplayer;
117 Handle(SALOME_InteractiveObject) myIObject;
121 * \brief Operation to compute a mesh and show computation errors
123 class SMESHGUI_EXPORT SMESHGUI_ComputeOp: public SMESHGUI_BaseComputeOp
128 SMESHGUI_ComputeOp();
129 virtual ~SMESHGUI_ComputeOp();
131 virtual LightApp_Dialog* dlg() const;
134 virtual void startOperation();
140 * \brief Operation to preview and compute a mesh and show computation errors
142 class SMESHGUI_EXPORT SMESHGUI_PrecomputeOp: public SMESHGUI_BaseComputeOp
147 SMESHGUI_PrecomputeOp();
148 virtual ~SMESHGUI_PrecomputeOp();
150 virtual LightApp_Dialog* dlg() const;
153 * \brief returns map of assigned algorithms modes
155 static void getAssignedAlgos(_PTR(SObject) theMesh,
156 QMap<int,int>& theModeMap);
159 virtual void startOperation();
160 virtual void stopOperation();
161 virtual void resumeOperation();
163 virtual void initDialog();
166 virtual void onCancel();
173 QMap< int, int > myMapShapeId;
174 QPointer<LightApp_Dialog> myActiveDlg;
175 QPointer<SMESHGUI_PrecomputeDlg> myDlg;
176 SMESHGUI_MeshEditPreview* myPreviewDisplayer;
180 * \brief Operation to evaluate a mesh and show result
182 class SMESHGUI_EXPORT SMESHGUI_EvaluateOp: public SMESHGUI_BaseComputeOp
187 SMESHGUI_EvaluateOp();
188 virtual ~SMESHGUI_EvaluateOp();
190 virtual LightApp_Dialog* dlg() const;
193 virtual void startOperation();
199 * \brief Dialog to compute a mesh and show computation errors
202 class SMESHGUI_EXPORT SMESHGUI_ComputeDlg : public SMESHGUI_Dialog
207 SMESHGUI_ComputeDlg( QWidget*, bool );
208 virtual ~SMESHGUI_ComputeDlg();
211 QFrame* createMainFrame( QWidget*, bool );
214 QGroupBox* myMemoryLackGroup;
215 QGroupBox* myCompErrorGroup;
216 QGroupBox* myHypErrorGroup;
217 QLabel* myHypErrorLabel;
218 QTableWidget* myTable;
219 QPushButton* myShowBtn;
220 QPushButton* myPublishBtn;
221 QPushButton* myBadMeshBtn;
223 SMESHGUI_MeshInfosBox* myBriefInfo;
224 SMESHGUI_MeshInfosBox* myFullInfo;
226 friend class SMESHGUI_BaseComputeOp;
227 friend class SMESHGUI_PrecomputeOp;
231 * \brief Dialog to preview and compute a mesh and show computation errors
234 class SMESHGUI_EXPORT SMESHGUI_PrecomputeDlg : public SMESHGUI_Dialog
239 SMESHGUI_PrecomputeDlg( QWidget* );
240 virtual ~SMESHGUI_PrecomputeDlg();
242 void setPreviewModes( const QList<int>& );
243 int getPreviewMode() const;
249 QPushButton* myPreviewBtn;
250 QtxComboBox* myPreviewMode;
253 #endif // SMESHGUI_COMPUTEDLG_H