Salome HOME
Modify 'Modification of orientation' dialog box: implement processing of 'Bad oriente...
[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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
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 #include "SMESH_TypeFilter.hxx"
32 #include <TColStd_MapOfInteger.hxx>
33
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SMESH_Mesh)
36
37 class QCloseEvent;
38 class SMESHGUI_FilterDlg;
39 class QCheckBox;
40 class QGroupBox;
41 class QListBox;
42 class QFrame;
43 class QLineEdit;
44 class SMESHGUI_SpinBox;
45 class QPushButton;
46 class SALOME_Selection;
47 class SMESH_Actor;
48 class SALOME_Actor;
49 class QButtonGroup;
50
51 /*
52   Class       : SMESHGUI_MultiEditDlg
53   Description : Base class for dialogs of diagonal inversion and 
54                 union of two neighboring triangles
55 */
56
57 class SMESHGUI_MultiEditDlg : public QDialog
58
59   Q_OBJECT
60
61 public:
62                             SMESHGUI_MultiEditDlg( QWidget*,
63                                                    SALOME_Selection*,
64                                                    const int,
65                                                    const bool = false,
66                                                    const char* = 0 );
67   virtual                   ~SMESHGUI_MultiEditDlg();
68
69   void                      Init( SALOME_Selection* ) ;
70
71 signals:
72   void                      ListContensChanged();
73
74 protected slots:
75
76   void                      onOk();
77   virtual bool              onApply();
78   virtual void              onClose();
79
80   void                      onDeactivate();
81   void                      onSelectionDone();
82   
83   void                      onFilterBtn();
84   void                      onAddBtn();
85   void                      onRemoveBtn();
86   void                      onSortListBtn();
87   void                      onListSelectionChanged();
88   void                      onSubmeshChk();
89   void                      onGroupChk();
90   virtual void              onToAllChk();
91   void                      onFilterAccepted();
92   void                      on3d2dChanged(int);
93   
94 protected:
95
96   void                      closeEvent( QCloseEvent* e ) ;
97   void                      enterEvent ( QEvent * ) ;            
98   void                      hideEvent ( QHideEvent * );                        /* ESC key */
99   QFrame*                   createButtonFrame( QWidget* );
100   QFrame*                   createMainFrame  ( QWidget*, const bool );
101   bool                      isValid( const bool ) const;
102   SMESH::long_array_var     getIds();
103   void                      updateButtons();
104   void                      setSelectionMode();
105   virtual bool              isIdValid( const int theID ) const;
106   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& ) = 0;
107   int                       entityType();
108   
109 protected:
110
111   QPushButton*              myOkBtn;
112   QPushButton*              myApplyBtn;
113   QPushButton*              myCloseBtn;
114   SALOME_Selection*         mySelection;
115   SMESH::SMESH_Mesh_var     myMesh;
116   SMESH_Actor*              myActor;
117   
118   QGroupBox*                mySelGrp;
119   
120   QListBox*                 myListBox;
121   QPushButton*              myFilterBtn;
122   QPushButton*              myAddBtn;
123   QPushButton*              myRemoveBtn;
124   QPushButton*              mySortBtn;
125   
126   QCheckBox*                myToAllChk;
127   QButtonGroup*             myEntityTypeGrp;
128   
129   QCheckBox*                mySubmeshChk;
130   QPushButton*              mySubmeshBtn;
131   QLineEdit*                mySubmesh;
132   
133   QCheckBox*                myGroupChk;
134   QPushButton*              myGroupBtn;
135   QLineEdit*                myGroup;
136   
137   SMESHGUI_FilterDlg*       myFilterDlg;
138   TColStd_MapOfInteger      myIds;
139   int                       myFilterType;
140   Handle(SMESH_TypeFilter)  mySubmeshFilter;
141   Handle(SMESH_TypeFilter)  myGroupFilter;
142   bool                      myBusy;
143   int                       myEntityType;
144 };
145
146 /*
147   Class       : SMESHGUI_ChangeOrientationDlg
148   Description : Modification of orientation of faces
149 */
150 class  SMESHGUI_ChangeOrientationDlg : public SMESHGUI_MultiEditDlg
151
152   Q_OBJECT
153
154 public:
155                             SMESHGUI_ChangeOrientationDlg( QWidget*,
156                                                            SALOME_Selection*,
157                                                            const char* = 0 );
158   virtual                   ~SMESHGUI_ChangeOrientationDlg();
159
160 protected:
161
162   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
163 };
164
165 /*
166   Class       : SMESHGUI_UnionOfTrianglesDlg
167   Description : Construction of quadrangles by automatic association of triangles
168 */
169 class  SMESHGUI_UnionOfTrianglesDlg : public SMESHGUI_MultiEditDlg
170 {
171   Q_OBJECT
172
173 public:
174                             SMESHGUI_UnionOfTrianglesDlg( QWidget*,
175                                                           SALOME_Selection*,
176                                                           const char* = 0 );
177   virtual                   ~SMESHGUI_UnionOfTrianglesDlg();
178
179 protected:
180
181   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
182 };
183
184 /*
185   Class       : SMESHGUI_CuttingOfQuadsDlg
186   Description : Construction of quadrangles by automatic association of triangles
187 */
188 class  SMESHGUI_CuttingOfQuadsDlg : public SMESHGUI_MultiEditDlg
189 {
190   Q_OBJECT
191
192 public:
193                             SMESHGUI_CuttingOfQuadsDlg( QWidget*,
194                                                         SALOME_Selection*,
195                                                         const char* = 0 );
196   virtual                   ~SMESHGUI_CuttingOfQuadsDlg();
197
198 protected:
199   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, const SMESH::long_array& );
200   
201 protected slots:
202   virtual void              onClose();
203   void                      onPreviewChk();
204
205 private:
206   void                      displayPreview();
207   void                      erasePreview();
208   
209 private:
210   QCheckBox*                myUseDiagChk;
211   SALOME_Actor*             myPreviewActor;
212   QCheckBox*                myPreviewChk;
213 };
214
215 #endif