Salome HOME
Update mail address
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MultiEditDlg.h
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 //  This library is free software; you can redistribute it and/or
5 //  modify it under the terms of the GNU Lesser General Public
6 //  License as published by the Free Software Foundation; either
7 //  version 2.1 of the License.
8 //
9 //  This library is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 //  Lesser General Public License for more details.
13 //
14 //  You should have received a copy of the GNU Lesser General Public
15 //  License along with this library; if not, write to the Free Software
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //
21 //
22 //  File   : SMESHGUI_MultiEditDlg.h
23 //  Author : Sergey LITONIN
24 //  Module : SMESH
25
26
27 #ifndef SMESHGUI_MultiEditDlg_H
28 #define SMESHGUI_MultiEditDlg_H
29
30 #include <qdialog.h>
31
32 #include "SUIT_SelectionFilter.h"
33
34 #include <TColStd_MapOfInteger.hxx>
35
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SMESH_Mesh)
38 #include CORBA_SERVER_HEADER(SMESH_Filter)
39
40 class SMESHGUI;
41 class SMESHGUI_FilterDlg;
42 class SMESHGUI_SpinBox;
43
44 class SMESH_Actor;
45
46 class LightApp_SelectionMgr;
47 class SALOME_Actor;
48 class SVTK_Selector;
49 class SVTK_ViewWindow;
50
51 class QFrame;
52 class QObject;
53 class QListBox;
54 class QComboBox;
55 class QCheckBox;
56 class QGroupBox;
57 class QLineEdit;
58 class QPushButton;
59 class QButtonGroup;
60
61 /*!
62  * Class       : SMESHGUI_MultiEditDlg
63  * Description : Base class for dialogs of diagonal inversion and
64  *               union of two neighboring triangles
65  */
66
67 class SMESHGUI_MultiEditDlg : public QDialog
68 {
69   Q_OBJECT
70
71 public:
72                             SMESHGUI_MultiEditDlg(SMESHGUI* theModule,
73                                                   const int,
74                                                   const bool = false,
75                                                   const char* = 0 );
76   virtual                   ~SMESHGUI_MultiEditDlg();
77
78   void                      Init();
79
80   bool                      eventFilter( QObject* object, QEvent* event );
81
82 signals:
83   void                      ListContensChanged();
84
85 protected slots:
86   void                      onOk();
87   virtual bool              onApply();
88   virtual void              onClose();
89   void                      onHelp();
90
91   void                      onDeactivate();
92   void                      onSelectionDone();
93
94   void                      onFilterBtn();
95   void                      onAddBtn();
96   void                      onRemoveBtn();
97   void                      onSortListBtn();
98   void                      onListSelectionChanged();
99   void                      onSubmeshChk();
100   void                      onGroupChk();
101   virtual void              onToAllChk();
102   void                      onFilterAccepted();
103   void                      on3d2dChanged(int);
104
105   SMESH::NumericalFunctor_ptr getNumericalFunctor();
106
107 protected:
108   void                      closeEvent( QCloseEvent* e ) ;
109   void                      enterEvent ( QEvent * ) ;
110   void                      hideEvent ( QHideEvent * );                        /* ESC key */
111   QFrame*                   createButtonFrame( QWidget* );
112   QFrame*                   createMainFrame  ( QWidget*, const bool );
113   bool                      isValid( const bool ) const;
114   SMESH::long_array_var     getIds();
115   void                      updateButtons();
116   void                      setSelectionMode();
117   virtual bool              isIdValid( const int theID ) const;
118   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& ) = 0;
119   int                       entityType();
120
121 protected:
122   QPushButton*              myOkBtn;
123   QPushButton*              myApplyBtn;
124   QPushButton*              myCloseBtn;
125   QPushButton*              myHelpBtn;
126   SMESH_Actor*              myActor;
127   SMESH::SMESH_Mesh_var     myMesh;
128
129   LightApp_SelectionMgr*    mySelectionMgr;
130   SVTK_Selector*            mySelector;
131   SMESHGUI*                 mySMESHGUI;
132
133   QGroupBox*                mySelGrp;
134   QGroupBox*                myCriterionGrp;
135
136   QButtonGroup*             myGroupChoice;
137   QComboBox*                myComboBoxFunctor;
138
139   QListBox*                 myListBox;
140   QPushButton*              myFilterBtn;
141   QPushButton*              myAddBtn;
142   QPushButton*              myRemoveBtn;
143   QPushButton*              mySortBtn;
144
145   QCheckBox*                myToAllChk;
146   QButtonGroup*             myEntityTypeGrp;
147
148   QCheckBox*                mySubmeshChk;
149   QPushButton*              mySubmeshBtn;
150   QLineEdit*                mySubmesh;
151
152   QCheckBox*                myGroupChk;
153   QPushButton*              myGroupBtn;
154   QLineEdit*                myGroup;
155
156   SMESHGUI_FilterDlg*       myFilterDlg;
157   TColStd_MapOfInteger      myIds;
158   int                       myFilterType;
159   bool                      myBusy;
160   int                       myEntityType;
161
162   QString                   myHelpFileName;
163 };
164
165 /*!
166  * Class       : SMESHGUI_ChangeOrientationDlg
167  * Description : Modification of orientation of faces
168  */
169 class  SMESHGUI_ChangeOrientationDlg : public SMESHGUI_MultiEditDlg
170 {
171   Q_OBJECT
172
173 public:
174                SMESHGUI_ChangeOrientationDlg(SMESHGUI* theModule,
175                                              const char* = 0);
176   virtual      ~SMESHGUI_ChangeOrientationDlg();
177
178 protected:
179   virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
180 };
181
182 /*!
183  * Class       : SMESHGUI_UnionOfTrianglesDlg
184  * Description : Construction of quadrangles by automatic association of triangles
185  */
186 class  SMESHGUI_UnionOfTrianglesDlg : public SMESHGUI_MultiEditDlg
187 {
188   Q_OBJECT
189
190 public:
191                SMESHGUI_UnionOfTrianglesDlg(SMESHGUI* theModule,
192                                             const char* = 0);
193   virtual      ~SMESHGUI_UnionOfTrianglesDlg();
194
195 protected:
196   virtual bool process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
197
198 private:
199   SMESHGUI_SpinBox* myMaxAngleSpin;
200 };
201
202 /*
203   Class       : SMESHGUI_CuttingOfQuadsDlg
204   Description : Construction of quadrangles by automatic association of triangles
205 */
206 class  SMESHGUI_CuttingOfQuadsDlg : public SMESHGUI_MultiEditDlg
207 {
208   Q_OBJECT
209
210 public:
211                 SMESHGUI_CuttingOfQuadsDlg(SMESHGUI* theModule,
212                                            const char* = 0);
213   virtual       ~SMESHGUI_CuttingOfQuadsDlg();
214
215 protected:
216   virtual bool  process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
217
218 protected slots:
219   virtual void  onClose();
220   void          onCriterionRB();
221   void          onPreviewChk();
222
223 private:
224   void          displayPreview();
225   void          erasePreview();
226
227 private:
228   SALOME_Actor* myPreviewActor;
229   QCheckBox*    myPreviewChk;
230 };
231
232 #endif