1 // Copyright (C) 2007-2008 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.
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
22 // SMESH SMESHGUI : GUI for SMESH component
23 // File : SMESHGUI_GroupOpDlg.h
24 // Author : Sergey LITONIN, Open CASCADE S.A.S.
26 #ifndef SMESHGUI_GROUPOPDLG_H
27 #define SMESHGUI_GROUPOPDLG_H
30 #include "SMESH_SMESHGUI.hxx"
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SMESH_Group)
46 class LightApp_SelectionMgr;
50 Class : SMESHGUI_GroupOpDlg
51 Description : Perform boolean operations on groups
54 class SMESHGUI_EXPORT SMESHGUI_GroupOpDlg : public QDialog
59 //enum { UNION, INTERSECT, CUT };
62 SMESHGUI_GroupOpDlg( SMESHGUI* );
63 virtual ~SMESHGUI_GroupOpDlg();
69 virtual bool onApply();
70 virtual void onSelectionDone();
71 virtual void setVisible ( bool visible );
77 QString getName() const;
78 void setName( const QString& theName );
80 QGroupBox* getArgGrp() const;
81 void setHelpFileName( const QString& theFName );
82 SMESHGUI* getSMESHGUI() const;
83 bool isValid( const QList<SMESH::SMESH_GroupBase_var>& theListGrp );
84 bool getSelectedGroups( QList<SMESH::SMESH_GroupBase_var>& theOutList,
85 QStringList& theOutNames );
86 SMESH::ListOfGroups* convert( const QList<SMESH::SMESH_GroupBase_var>& );
88 SALOMEDS::Color getColor() const;
91 void closeEvent( QCloseEvent* );
92 void enterEvent( QEvent* );
93 void keyPressEvent( QKeyEvent* );
103 QWidget* createButtonFrame( QWidget* );
104 QWidget* createMainFrame ( QWidget* );
107 QPushButton* myOkBtn;
108 QPushButton* myApplyBtn;
109 QPushButton* myCloseBtn;
110 QPushButton* myHelpBtn;
112 QLineEdit* myNameEdit;
114 QtxColorButton* myColorBtn;
116 SMESHGUI* mySMESHGUI;
117 LightApp_SelectionMgr* mySelectionMgr;
118 SVTK_Selector* mySelector;
120 QString myHelpFileName;
124 Class : SMESHGUI_UnionGroupsDlg
125 Description : Perform union of several groups
128 class SMESHGUI_EXPORT SMESHGUI_UnionGroupsDlg : public SMESHGUI_GroupOpDlg
134 SMESHGUI_UnionGroupsDlg( SMESHGUI* );
135 virtual ~SMESHGUI_UnionGroupsDlg();
138 virtual bool onApply();
139 virtual void onSelectionDone();
142 virtual void reset();
145 QListWidget* myListWg;
146 QList<SMESH::SMESH_GroupBase_var> myGroups;
150 Class : SMESHGUI_IntersectGroupsDlg
151 Description : Perform intersection of several groups
154 class SMESHGUI_EXPORT SMESHGUI_IntersectGroupsDlg : public SMESHGUI_GroupOpDlg
160 SMESHGUI_IntersectGroupsDlg( SMESHGUI* );
161 virtual ~SMESHGUI_IntersectGroupsDlg();
164 virtual bool onApply();
165 virtual void onSelectionDone();
168 virtual void reset();
171 QListWidget* myListWg;
172 QList<SMESH::SMESH_GroupBase_var> myGroups;
176 Class : SMESHGUI_CutGroupsDlg
177 Description : Perform cut of several groups
180 class SMESHGUI_EXPORT SMESHGUI_CutGroupsDlg : public SMESHGUI_GroupOpDlg
186 SMESHGUI_CutGroupsDlg( SMESHGUI* );
187 virtual ~SMESHGUI_CutGroupsDlg();
190 virtual bool onApply();
191 virtual void onSelectionDone();
194 virtual void reset();
199 QListWidget* myListWg1;
200 QListWidget* myListWg2;
201 QList<SMESH::SMESH_GroupBase_var> myGroups1;
202 QList<SMESH::SMESH_GroupBase_var> myGroups2;
206 Class : SMESHGUI_DimGroupDlg
207 Description : Dialog for creating groups of entities from existing
208 groups of superior dimensions
211 class SMESHGUI_EXPORT SMESHGUI_DimGroupDlg : public SMESHGUI_GroupOpDlg
217 SMESHGUI_DimGroupDlg( SMESHGUI* );
218 virtual ~SMESHGUI_DimGroupDlg();
220 SMESH::ElementType getElementType() const;
221 void setElementType( const SMESH::ElementType& theElemType );
224 virtual void reset();
227 virtual bool onApply();
228 virtual void onSelectionDone();
232 QListWidget* myListWg;
233 QList<SMESH::SMESH_GroupBase_var> myGroups;
236 #endif // SMESHGUI_GROUPOPDLG_H