1 // Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SMESH SMESHGUI : GUI for SMESH component
24 // File : SMESHGUI_GroupOpDlg.h
25 // Author : Sergey LITONIN, Open CASCADE S.A.S.
27 #ifndef SMESHGUI_GROUPOPDLG_H
28 #define SMESHGUI_GROUPOPDLG_H
31 #include "SMESH_SMESHGUI.hxx"
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SMESH_Group)
40 class LightApp_SelectionMgr;
52 Class : SMESHGUI_GroupOpDlg
53 Description : Perform boolean operations on groups
56 class SMESHGUI_EXPORT SMESHGUI_GroupOpDlg : public QDialog
61 //enum { UNION, INTERSECT, CUT };
64 SMESHGUI_GroupOpDlg( SMESHGUI* );
65 virtual ~SMESHGUI_GroupOpDlg();
71 virtual bool onApply();
72 virtual void onSelectionDone();
73 virtual void setVisible ( bool visible );
79 QString getName() const;
80 void setName( const QString& theName );
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>& );
90 SALOMEDS::Color getColor() const;
91 void setDefaultGroupColor();
93 void setIsApplyAndClose( const bool theFlag );
94 bool isApplyAndClose() const;
97 void enterEvent( QEvent* );
98 void keyPressEvent( QKeyEvent* );
101 virtual void reject();
113 QWidget* createButtonFrame( QWidget* );
114 QWidget* createMainFrame ( QWidget* );
117 QPushButton* myOkBtn;
118 QPushButton* myApplyBtn;
119 QPushButton* myCloseBtn;
120 QPushButton* myHelpBtn;
122 QLineEdit* myNameEdit;
124 QtxColorButton* myColorBtn;
126 SMESHGUI* mySMESHGUI;
127 LightApp_SelectionMgr* mySelectionMgr;
128 SVTK_Selector* mySelector;
130 QString myHelpFileName;
132 bool myIsApplyAndClose;
136 Class : SMESHGUI_UnionGroupsDlg
137 Description : Perform union of several groups
140 class SMESHGUI_EXPORT SMESHGUI_UnionGroupsDlg : public SMESHGUI_GroupOpDlg
146 SMESHGUI_UnionGroupsDlg( SMESHGUI* );
147 virtual ~SMESHGUI_UnionGroupsDlg();
150 virtual bool onApply();
151 virtual void onSelectionDone();
154 virtual void reset();
157 QListWidget* myListWg;
158 QList<SMESH::SMESH_GroupBase_var> myGroups;
162 Class : SMESHGUI_IntersectGroupsDlg
163 Description : Perform intersection of several groups
166 class SMESHGUI_EXPORT SMESHGUI_IntersectGroupsDlg : public SMESHGUI_GroupOpDlg
172 SMESHGUI_IntersectGroupsDlg( SMESHGUI* );
173 virtual ~SMESHGUI_IntersectGroupsDlg();
176 virtual bool onApply();
177 virtual void onSelectionDone();
180 virtual void reset();
183 QListWidget* myListWg;
184 QList<SMESH::SMESH_GroupBase_var> myGroups;
188 Class : SMESHGUI_CutGroupsDlg
189 Description : Perform cut of several groups
192 class SMESHGUI_EXPORT SMESHGUI_CutGroupsDlg : public SMESHGUI_GroupOpDlg
198 SMESHGUI_CutGroupsDlg( SMESHGUI* );
199 virtual ~SMESHGUI_CutGroupsDlg();
202 virtual bool onApply();
203 virtual void onSelectionDone();
206 virtual void reset();
211 QListWidget* myListWg1;
212 QListWidget* myListWg2;
213 QList<SMESH::SMESH_GroupBase_var> myGroups1;
214 QList<SMESH::SMESH_GroupBase_var> myGroups2;
218 Class : SMESHGUI_DimGroupDlg
219 Description : Dialog for creating groups of entities from existing
220 groups of superior dimensions
223 class SMESHGUI_EXPORT SMESHGUI_DimGroupDlg : public SMESHGUI_GroupOpDlg
229 SMESHGUI_DimGroupDlg( SMESHGUI* );
230 virtual ~SMESHGUI_DimGroupDlg();
232 SMESH::ElementType getElementType() const;
233 void setElementType( const SMESH::ElementType& theElemType );
236 virtual void reset();
239 virtual bool onApply();
240 virtual void onSelectionDone();
243 QComboBox* myTypeCombo;
244 QComboBox* myNbNoCombo;
245 QListWidget* myListWg;
246 QCheckBox* myUnderlOnlyChk;
248 QList<SMESH::SMESH_GroupBase_var> myGroups;
251 #endif // SMESHGUI_GROUPOPDLG_H