Version: 8.3.0
SMESHGUI_ComputeDlg.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 // File : SMESHGUI_ComputeDlg.h
21 // Author : Edward AGAPOV, Open CASCADE S.A.S.
22 //
23 #ifndef SMESHGUI_COMPUTEDLG_H
24 #define SMESHGUI_COMPUTEDLG_H
25 
26 // SMESH includes
27 #include "SMESH_SMESHGUI.hxx"
28 
29 #include "SMESHGUI_Dialog.h"
30 #include "SMESHGUI_Operation.h"
31 
32 // SALOME GUI includes
33 #include <SALOME_InteractiveObject.hxx>
34 
35 // Qt includes
36 #include <QMap>
37 #include <QList>
38 #include <QPointer>
39 #include <QGroupBox>
40 #include <QThread>
41 
42 // IDL includes
43 #include <SALOMEconfig.h>
44 #include CORBA_SERVER_HEADER(SMESH_Gen)
45 #include CORBA_SERVER_HEADER(SMESH_Mesh)
46 
47 class QFrame;
48 class QPushButton;
49 class QTableWidget;
50 class QLabel;
51 class QtxComboBox;
52 class QProgressBar;
57 
58 namespace SMESH
59 {
60  class TShapeDisplayer;
61 }
62 
67 {
68  Q_OBJECT
69 
70 public:
72  virtual ~SMESHGUI_BaseComputeOp();
73 
74  SMESH::SMESH_Mesh_ptr getMesh();
75 
76 protected:
77  virtual void startOperation();
78  virtual void stopOperation();
79 
80  SMESHGUI_ComputeDlg* computeDlg() const;
81  void computeMesh();
82  void showComputeResult( const bool,
83  const bool,
84  SMESH::compute_error_array_var&,
85  const bool,
86  const QString& );
87  SMESHGUI_ComputeDlg* evaluateDlg() const;
88  void evaluateMesh();
89  void showEvaluateResult(const SMESH::long_array& theRes,
90  const bool,
91  const bool,
92  SMESH::compute_error_array_var&,
93  const bool,
94  const QString&);
95 
96  virtual bool isValid( SUIT_Operation* theOp ) const;
97 
98 protected slots:
99  virtual bool onApply();
100  void onPreviewShape();
101  void onPublishShape();
102  void onShowBadMesh();
103  void onGroupOfBadMesh();
104  void currentCellChanged();
105 
106 private:
107  QTableWidget* table();
108 
109 private:
110  QPointer<SMESHGUI_ComputeDlg> myCompDlg;
111 
112 protected:
113  SMESH::SMESH_Mesh_var myMesh;
114  GEOM::GEOM_Object_var myMainShape;
115  GEOM::GEOM_Object_var myCurShape;
118  Handle(SALOME_InteractiveObject) myIObject;
119 };
120 
125 {
126  Q_OBJECT
127 
128 public:
130  virtual ~SMESHGUI_ComputeOp();
131 
132  virtual LightApp_Dialog* dlg() const;
133 
134 protected:
135  virtual void startOperation();
136 
137 protected slots:
138 };
139 
141 
146 {
147  Q_OBJECT
148 
149 public:
151  virtual ~SMESHGUI_PrecomputeOp();
152 
153  virtual LightApp_Dialog* dlg() const;
154 
158  static void getAssignedAlgos(_PTR(SObject) theMesh,
159  QMap<int,int>& theModeMap);
160 
161 protected:
162  virtual void startOperation();
163  virtual void stopOperation();
164  virtual void resumeOperation();
165 
166  virtual void initDialog();
167 
168 protected slots:
169  virtual void onCancel();
170 
171 private slots:
172  void onPreview();
173  void onCompute();
174 
175 private:
177  QMap< int, int > myMapShapeId;
178  QPointer<LightApp_Dialog> myActiveDlg;
179  QPointer<SMESHGUI_PrecomputeDlg> myDlg;
182  typedef QList<int> TListOfInt;
183  typedef QList<TListOfInt> TListOfListOfInt;
186 };
187 
192 {
193  Q_OBJECT
194 
195 public:
197  virtual ~SMESHGUI_EvaluateOp();
198 
199  virtual LightApp_Dialog* dlg() const;
200 
201 protected:
202  virtual void startOperation();
203 
204 protected slots:
205 };
206 
212 {
213  Q_OBJECT
214 
215 public:
216  SMESHGUI_ComputeDlg( QWidget*, bool );
217  virtual ~SMESHGUI_ComputeDlg();
218 
219 protected:
220  QFrame* createMainFrame( QWidget*, bool );
221 
222  QLabel* myMeshName;
227  QLabel* myWarningLabel;
229  QPushButton* myShowBtn;
230  QPushButton* myPublishBtn;
231  QPushButton* myBadMeshBtn;
232  QPushButton* myBadMeshToGroupBtn;
233 
236 
238  friend class SMESHGUI_PrecomputeOp;
239 };
240 
242 
248 {
249  Q_OBJECT
250 
251 public:
253  virtual ~SMESHGUI_PrecomputeDlg();
254 
255  void setPreviewModes( const QList<int>& );
256  int getPreviewMode() const;
257 
258  SMESHGUI_MeshOrderBox* getMeshOrderBox() const;
259 
260 signals:
261  void preview();
262 
263 private:
265  QPushButton* myPreviewBtn;
266  QtxComboBox* myPreviewMode;
267 };
268 
274 {
275  Q_OBJECT
276 
277 public:
278  SMESHGUI_ComputeDlg_QThread(SMESH::SMESH_Gen_var gen,
279  SMESH::SMESH_Mesh_var mesh,
280  GEOM::GEOM_Object_var mainShape);
281  bool result();
282  void cancel();
283  SMESH::SMESH_Mesh_var& getMesh() { return myMesh; }
284 
285 protected:
286  void run();
287 
288 private:
289  SMESH::SMESH_Gen_var myGen;
290  SMESH::SMESH_Mesh_var myMesh;
291  GEOM::GEOM_Object_var myMainShape;
292  bool myResult;
293 };
294 
300 {
301  Q_OBJECT
302 
303 public:
305  SMESH::SMESH_Gen_var gen,
306  SMESH::SMESH_Mesh_var mesh,
307  GEOM::GEOM_Object_var mainShape);
308  bool result();
309 
310 protected:
311  void timerEvent(QTimerEvent *timer);
312  void closeEvent(QCloseEvent *event);
313 
314 private slots:
315  void onCancel();
316 
317 private:
319  QPushButton * cancelButton;
320  QLabel * nbNodesLabel;
321  QLabel * nbElemsLabel;
322  QLabel * freeRAMLabel;
323  QProgressBar* progressBar;
324 };
325 
326 #endif // SMESHGUI_COMPUTEDLG_H