1 // Copyright (C) 2007-2013 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
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)
47 class LightApp_SelectionMgr;
51 Class : SMESHGUI_GroupOpDlg
52 Description : Perform boolean operations on groups
55 class SMESHGUI_EXPORT SMESHGUI_GroupOpDlg : public QDialog
60 //enum { UNION, INTERSECT, CUT };
63 SMESHGUI_GroupOpDlg( SMESHGUI* );
64 virtual ~SMESHGUI_GroupOpDlg();
70 virtual bool onApply();
71 virtual void onSelectionDone();
72 virtual void setVisible ( bool visible );
78 QString getName() const;
79 void setName( const QString& theName );
81 QGroupBox* getArgGrp() const;
82 void setHelpFileName( const QString& theFName );
83 SMESHGUI* getSMESHGUI() const;
84 bool isValid( const QList<SMESH::SMESH_GroupBase_var>& theListGrp );
85 bool getSelectedGroups( QList<SMESH::SMESH_GroupBase_var>& theOutList,
86 QStringList& theOutNames );
87 SMESH::ListOfGroups* convert( const QList<SMESH::SMESH_GroupBase_var>& );
89 SALOMEDS::Color getColor() const;
91 void setIsApplyAndClose( const bool theFlag );
92 bool isApplyAndClose() const;
95 void enterEvent( QEvent* );
96 void keyPressEvent( QKeyEvent* );
99 virtual void reject();
108 QWidget* createButtonFrame( QWidget* );
109 QWidget* createMainFrame ( QWidget* );
112 QPushButton* myOkBtn;
113 QPushButton* myApplyBtn;
114 QPushButton* myCloseBtn;
115 QPushButton* myHelpBtn;
117 QLineEdit* myNameEdit;
119 QtxColorButton* myColorBtn;
121 SMESHGUI* mySMESHGUI;
122 LightApp_SelectionMgr* mySelectionMgr;
123 SVTK_Selector* mySelector;
125 QString myHelpFileName;
127 bool myIsApplyAndClose;
131 Class : SMESHGUI_UnionGroupsDlg
132 Description : Perform union of several groups
135 class SMESHGUI_EXPORT SMESHGUI_UnionGroupsDlg : public SMESHGUI_GroupOpDlg
141 SMESHGUI_UnionGroupsDlg( SMESHGUI* );
142 virtual ~SMESHGUI_UnionGroupsDlg();
145 virtual bool onApply();
146 virtual void onSelectionDone();
149 virtual void reset();
152 QListWidget* myListWg;
153 QList<SMESH::SMESH_GroupBase_var> myGroups;
157 Class : SMESHGUI_IntersectGroupsDlg
158 Description : Perform intersection of several groups
161 class SMESHGUI_EXPORT SMESHGUI_IntersectGroupsDlg : public SMESHGUI_GroupOpDlg
167 SMESHGUI_IntersectGroupsDlg( SMESHGUI* );
168 virtual ~SMESHGUI_IntersectGroupsDlg();
171 virtual bool onApply();
172 virtual void onSelectionDone();
175 virtual void reset();
178 QListWidget* myListWg;
179 QList<SMESH::SMESH_GroupBase_var> myGroups;
183 Class : SMESHGUI_CutGroupsDlg
184 Description : Perform cut of several groups
187 class SMESHGUI_EXPORT SMESHGUI_CutGroupsDlg : public SMESHGUI_GroupOpDlg
193 SMESHGUI_CutGroupsDlg( SMESHGUI* );
194 virtual ~SMESHGUI_CutGroupsDlg();
197 virtual bool onApply();
198 virtual void onSelectionDone();
201 virtual void reset();
206 QListWidget* myListWg1;
207 QListWidget* myListWg2;
208 QList<SMESH::SMESH_GroupBase_var> myGroups1;
209 QList<SMESH::SMESH_GroupBase_var> myGroups2;
213 Class : SMESHGUI_DimGroupDlg
214 Description : Dialog for creating groups of entities from existing
215 groups of superior dimensions
218 class SMESHGUI_EXPORT SMESHGUI_DimGroupDlg : public SMESHGUI_GroupOpDlg
224 SMESHGUI_DimGroupDlg( SMESHGUI* );
225 virtual ~SMESHGUI_DimGroupDlg();
227 SMESH::ElementType getElementType() const;
228 void setElementType( const SMESH::ElementType& theElemType );
231 virtual void reset();
234 virtual bool onApply();
235 virtual void onSelectionDone();
239 QListWidget* myListWg;
240 QList<SMESH::SMESH_GroupBase_var> myGroups;
243 #endif // SMESHGUI_GROUPOPDLG_H