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