Salome HOME
IMP: SMESH: Japanese translations
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MultiEditDlg.h
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // File   : SMESHGUI_MultiEditDlg.h
24 // Author : Sergey LITONIN, Open CASCADE S.A.S.
25 //
26 #ifndef SMESHGUI_MULTIEDITDLG_H
27 #define SMESHGUI_MULTIEDITDLG_H
28
29 // SMESH includes
30 #include "SMESH_SMESHGUI.hxx"
31
32 // Qt includes 
33 #include <QDialog>
34
35 // OCCT includes
36 #include <TColStd_MapOfInteger.hxx>
37
38 // IDL includes
39 #include <SALOMEconfig.h>
40 #include CORBA_SERVER_HEADER(SMESH_Mesh)
41 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
42
43 class SMESHGUI;
44 class SMESHGUI_FilterDlg;
45 class SMESHGUI_SpinBox;
46
47 class SMESH_Actor;
48
49 class LightApp_SelectionMgr;
50 class SALOME_Actor;
51 class SVTK_Selector;
52
53 class QListWidget;
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_EXPORT SMESHGUI_MultiEditDlg : public QDialog
68 {
69   Q_OBJECT
70
71 public:
72   SMESHGUI_MultiEditDlg( SMESHGUI*, const int, const bool = false );
73   virtual ~SMESHGUI_MultiEditDlg();
74
75   void                      Init();
76
77   bool                      eventFilter( QObject*, QEvent* );
78
79 signals:
80   void                      ListContensChanged();
81
82 protected slots:
83   void                      onOk();
84   virtual bool              onApply();
85   virtual void              reject();
86   void                      onHelp();
87
88   void                      onDeactivate();
89   void                      onSelectionDone();
90
91   void                      onFilterBtn();
92   void                      onAddBtn();
93   void                      onRemoveBtn();
94   void                      onSortListBtn();
95   void                      onListSelectionChanged();
96   void                      onSubmeshChk();
97   void                      onGroupChk();
98   virtual void              onToAllChk();
99   void                      onFilterAccepted();
100   void                      on3d2dChanged(int);
101
102   SMESH::NumericalFunctor_ptr getNumericalFunctor();
103
104 protected:
105   void                      enterEvent( QEvent * );
106   void                      keyPressEvent( QKeyEvent* );
107   QWidget*                  createButtonFrame( QWidget* );
108   QWidget*                  createMainFrame( QWidget*, const bool );
109   virtual bool              isValid( const bool );
110   SMESH::long_array_var     getIds(SMESH::SMESH_IDSource_var& obj);
111   void                      updateButtons();
112   void                      setSelectionMode();
113   virtual bool              isIdValid( const int ) const;
114   virtual bool              process( SMESH::SMESH_MeshEditor_ptr, 
115                                      const SMESH::long_array& ,
116                                      SMESH::SMESH_IDSource_ptr obj) = 0;
117   int                       entityType();
118
119 protected:
120   QPushButton*              myOkBtn;
121   QPushButton*              myApplyBtn;
122   QPushButton*              myCloseBtn;
123   QPushButton*              myHelpBtn;
124   SMESH_Actor*              myActor;
125   SMESH::SMESH_Mesh_var     myMesh;
126
127   LightApp_SelectionMgr*    mySelectionMgr;
128   SVTK_Selector*            mySelector;
129   SMESHGUI*                 mySMESHGUI;
130
131   QGroupBox*                mySelGrp;
132   QGroupBox*                myCriterionGrp;
133
134   QWidget*                  myChoiceWidget;
135   QButtonGroup*             myGroupChoice;
136   QComboBox*                myComboBoxFunctor;
137
138   QListWidget*              myListBox;
139   QPushButton*              myFilterBtn;
140   QPushButton*              myAddBtn;
141   QPushButton*              myRemoveBtn;
142   QPushButton*              mySortBtn;
143
144   QCheckBox*                myToAllChk;
145   QButtonGroup*             myEntityTypeGrp;
146
147   QCheckBox*                mySubmeshChk;
148   QPushButton*              mySubmeshBtn;
149   QLineEdit*                mySubmesh;
150
151   QCheckBox*                myGroupChk;
152   QPushButton*              myGroupBtn;
153   QLineEdit*                myGroup;
154
155   SMESHGUI_FilterDlg*       myFilterDlg;
156   TColStd_MapOfInteger      myIds;
157   int                       myFilterType;
158   bool                      myBusy;
159   int                       myEntityType;
160
161   QString                   myHelpFileName;
162 };
163
164 /*!
165  * Class       : SMESHGUI_ChangeOrientationDlg
166  * Description : Modification of orientation of faces
167  */
168 class  SMESHGUI_ChangeOrientationDlg : public SMESHGUI_MultiEditDlg
169 {
170   Q_OBJECT
171
172 public:
173   SMESHGUI_ChangeOrientationDlg( SMESHGUI* );
174   virtual ~SMESHGUI_ChangeOrientationDlg();
175
176 protected:
177   virtual bool process( SMESH::SMESH_MeshEditor_ptr,
178                         const SMESH::long_array& ,
179                         SMESH::SMESH_IDSource_ptr obj);
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* );
192   virtual ~SMESHGUI_UnionOfTrianglesDlg();
193
194 protected:
195   virtual bool      isValid( const bool );
196   virtual bool      process( SMESH::SMESH_MeshEditor_ptr,
197                              const SMESH::long_array&,
198                              SMESH::SMESH_IDSource_ptr obj );
199
200 private:
201   SMESHGUI_SpinBox* myMaxAngleSpin;
202 };
203
204 /*
205   Class       : SMESHGUI_CuttingOfQuadsDlg
206   Description : Construction of quadrangles by automatic association of triangles
207 */
208 class  SMESHGUI_CuttingOfQuadsDlg : public SMESHGUI_MultiEditDlg
209 {
210   Q_OBJECT
211
212 public:
213   SMESHGUI_CuttingOfQuadsDlg( SMESHGUI* );
214   virtual ~SMESHGUI_CuttingOfQuadsDlg();
215
216 protected:
217   virtual bool  process( SMESH::SMESH_MeshEditor_ptr,
218                          const SMESH::long_array& ,
219                          SMESH::SMESH_IDSource_ptr obj);
220
221 protected slots:
222   virtual void  reject();
223   void          onCriterionRB();
224   void          onPreviewChk();
225
226 private:
227   void          displayPreview();
228   void          erasePreview();
229
230 private:
231   SALOME_Actor* myPreviewActor;
232   QCheckBox*    myPreviewChk;
233 };
234
235 /*!
236  * Class       : SMESHGUI_CuttingIntoTetraDlg
237  * Description : Split all volumes into tetrahedrons
238  */
239 class  SMESHGUI_CuttingIntoTetraDlg : public SMESHGUI_MultiEditDlg
240 {
241   Q_OBJECT
242
243 public:
244   SMESHGUI_CuttingIntoTetraDlg( SMESHGUI* );
245   virtual ~SMESHGUI_CuttingIntoTetraDlg();
246
247 protected:
248   virtual bool process( SMESH::SMESH_MeshEditor_ptr,
249                         const SMESH::long_array&,
250                         SMESH::SMESH_IDSource_ptr obj );
251 };
252
253 #endif // SMESHGUI_MULTIEDITDLG_H