Version: 9.12.0
SMESHGUI_GroupOpDlg.h
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, 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, or (at your option) any later version.
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 // SMESH SMESHGUI : GUI for SMESH component
24 // File : SMESHGUI_GroupOpDlg.h
25 // Author : Sergey LITONIN, Open CASCADE S.A.S.
26 //
27 #ifndef SMESHGUI_GROUPOPDLG_H
28 #define SMESHGUI_GROUPOPDLG_H
29 
30 // SMESH includes
31 #include "SMESH_SMESHGUI.hxx"
32 
33 // Qt includes
34 #include <QDialog>
35 
36 // IDL includes
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SMESH_Group)
39 
40 class LightApp_SelectionMgr;
41 class QCheckBox;
42 class QComboBox;
43 class QGroupBox;
44 class QLineEdit;
45 class QListWidget;
46 class QPushButton;
47 class QtxColorButton;
48 class SMESHGUI;
49 class SVTK_Selector;
50 
51 /*
52  Class : SMESHGUI_GroupOpDlg
53  Description : Perform boolean operations on groups
54 */
55 
57 {
58  Q_OBJECT
59 
60 public:
61  //enum { UNION, INTERSECT, CUT };
62 
63 public:
65  virtual ~SMESHGUI_GroupOpDlg();
66 
67  void Init();
68 
69 protected slots:
70 
71  virtual bool onApply();
72  virtual void onSelectionDone();
73  virtual void setVisible ( bool visible );
74 
75 protected:
76 
77  virtual void reset();
78 
79  QString getName() const;
80  void setName( const QString& theName );
81 
82  QGroupBox* getArgGrp() const;
83  void setHelpFileName( const QString& theFName );
84  SMESHGUI* getSMESHGUI() const;
85  bool isValid( const QList<SMESH::SMESH_GroupBase_var>& theListGrp );
86  bool getSelectedGroups( QList<SMESH::SMESH_GroupBase_var>& theOutList,
87  QStringList& theOutNames );
88  SMESH::ListOfGroups* convert( const QList<SMESH::SMESH_GroupBase_var>& );
89 
90  SALOMEDS::Color getColor() const;
91  void setDefaultGroupColor();
92 
93  void setIsApplyAndClose( const bool theFlag );
94  bool isApplyAndClose() const;
95 
96 private:
97  void enterEvent( QEvent* );
98  void keyPressEvent( QKeyEvent* );
99 
100 protected slots:
101  virtual void reject();
102 
103 private slots:
104  void onOk();
105  void onHelp();
106 
107  void onDeactivate();
108 
109  void onOpenView();
110  void onCloseView();
111 
112 private:
113  QWidget* createButtonFrame( QWidget* );
114  QWidget* createMainFrame ( QWidget* );
115 
116 private:
117  QPushButton* myOkBtn;
118  QPushButton* myApplyBtn;
119  QPushButton* myCloseBtn;
120  QPushButton* myHelpBtn;
121 
122  QLineEdit* myNameEdit;
124  QtxColorButton* myColorBtn;
125 
127  LightApp_SelectionMgr* mySelectionMgr;
128  SVTK_Selector* mySelector;
129 
130  QString myHelpFileName;
131 
133 };
134 
135 /*
136  Class : SMESHGUI_UnionGroupsDlg
137  Description : Perform union of several groups
138 */
139 
141 {
142  Q_OBJECT
143 
144 public:
145 
147  virtual ~SMESHGUI_UnionGroupsDlg();
148 
149 protected slots:
150  virtual bool onApply();
151  virtual void onSelectionDone();
152 
153 protected:
154  virtual void reset();
155 
156 private:
157  QListWidget* myListWg;
158  QList<SMESH::SMESH_GroupBase_var> myGroups;
159 };
160 
161 /*
162  Class : SMESHGUI_IntersectGroupsDlg
163  Description : Perform intersection of several groups
164 */
165 
167 {
168  Q_OBJECT
169 
170 public:
171 
173  virtual ~SMESHGUI_IntersectGroupsDlg();
174 
175 protected slots:
176  virtual bool onApply();
177  virtual void onSelectionDone();
178 
179 protected:
180  virtual void reset();
181 
182 private:
183  QListWidget* myListWg;
184  QList<SMESH::SMESH_GroupBase_var> myGroups;
185 };
186 
187 /*
188  Class : SMESHGUI_CutGroupsDlg
189  Description : Perform cut of several groups
190 */
191 
193 {
194  Q_OBJECT
195 
196 public:
197 
199  virtual ~SMESHGUI_CutGroupsDlg();
200 
201 protected slots:
202  virtual bool onApply();
203  virtual void onSelectionDone();
204 
205 protected:
206  virtual void reset();
207 
208 private:
209  QPushButton* myBtn1;
210  QPushButton* myBtn2;
211  QListWidget* myListWg1;
212  QListWidget* myListWg2;
213  QList<SMESH::SMESH_GroupBase_var> myGroups1;
214  QList<SMESH::SMESH_GroupBase_var> myGroups2;
215 };
216 
217 /*
218  Class : SMESHGUI_DimGroupDlg
219  Description : Dialog for creating groups of entities from existing
220  groups of superior dimensions
221 */
222 
224 {
225  Q_OBJECT
226 
227 public:
228 
230  virtual ~SMESHGUI_DimGroupDlg();
231 
232  SMESH::ElementType getElementType() const;
233  void setElementType( const SMESH::ElementType& theElemType );
234 
235 protected:
236  virtual void reset();
237 
238 protected slots:
239  virtual bool onApply();
240  virtual void onSelectionDone();
241 
242 private:
245  QListWidget* myListWg;
246  QCheckBox* myUnderlOnlyChk;
247 
248  QList<SMESH::SMESH_GroupBase_var> myGroups;
249 };
250 
251 #endif // SMESHGUI_GROUPOPDLG_H
252 
253 
#define SMESHGUI_EXPORT
Definition: SMESH_SMESHGUI.hxx:36
Definition: SMESHGUI_GroupOpDlg.h:193
QListWidget * myListWg2
Definition: SMESHGUI_GroupOpDlg.h:212
QList< SMESH::SMESH_GroupBase_var > myGroups2
Definition: SMESHGUI_GroupOpDlg.h:214
QListWidget * myListWg1
Definition: SMESHGUI_GroupOpDlg.h:211
QPushButton * myBtn2
Definition: SMESHGUI_GroupOpDlg.h:210
QList< SMESH::SMESH_GroupBase_var > myGroups1
Definition: SMESHGUI_GroupOpDlg.h:213
QPushButton * myBtn1
Definition: SMESHGUI_GroupOpDlg.h:209
Definition: SMESHGUI_GroupOpDlg.h:224
QList< SMESH::SMESH_GroupBase_var > myGroups
Definition: SMESHGUI_GroupOpDlg.h:248
QCheckBox * myUnderlOnlyChk
Definition: SMESHGUI_GroupOpDlg.h:246
QComboBox * myNbNoCombo
Definition: SMESHGUI_GroupOpDlg.h:244
QListWidget * myListWg
Definition: SMESHGUI_GroupOpDlg.h:245
QComboBox * myTypeCombo
Definition: SMESHGUI_GroupOpDlg.h:243
Definition: SMESHGUI_GroupOpDlg.h:57
QPushButton * myApplyBtn
Definition: SMESHGUI_GroupOpDlg.h:118
SMESHGUI * mySMESHGUI
Definition: SMESHGUI_GroupOpDlg.h:126
QPushButton * myOkBtn
Definition: SMESHGUI_GroupOpDlg.h:117
QLineEdit * myNameEdit
Definition: SMESHGUI_GroupOpDlg.h:122
QPushButton * myCloseBtn
Definition: SMESHGUI_GroupOpDlg.h:119
QString myHelpFileName
Definition: SMESHGUI_GroupOpDlg.h:130
LightApp_SelectionMgr * mySelectionMgr
Definition: SMESHGUI_GroupOpDlg.h:127
QGroupBox * myArgGrp
Definition: SMESHGUI_GroupOpDlg.h:123
SVTK_Selector * mySelector
Definition: SMESHGUI_GroupOpDlg.h:128
QtxColorButton * myColorBtn
Definition: SMESHGUI_GroupOpDlg.h:124
QPushButton * myHelpBtn
Definition: SMESHGUI_GroupOpDlg.h:120
bool myIsApplyAndClose
Definition: SMESHGUI_GroupOpDlg.h:132
Definition: SMESHGUI_GroupOpDlg.h:167
QListWidget * myListWg
Definition: SMESHGUI_GroupOpDlg.h:183
QList< SMESH::SMESH_GroupBase_var > myGroups
Definition: SMESHGUI_GroupOpDlg.h:184
Definition: SMESHGUI_GroupOpDlg.h:141
QList< SMESH::SMESH_GroupBase_var > myGroups
Definition: SMESHGUI_GroupOpDlg.h:158
QListWidget * myListWg
Definition: SMESHGUI_GroupOpDlg.h:157
Definition: SMESHGUI.h:84
ElementType
Enumeration for element type, like in SMDS.
Definition: SMESH_Mesh.idl:128
sequence< SMESH_GroupBase > ListOfGroups
Definition: SMESH_Mesh.idl:38