1 // SMESH SMESHGUI : GUI for SMESH component
3 // Copyright (C) 2003 CEA
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // See http://www.salome-platform.org or email : webmaster.salome@opencascade.org
23 // File : SMESHGUI_GroupDlg.h
24 // Author : Natalia KOPNOVA
28 #ifndef DIALOGBOX_GROUP_H
29 #define DIALOGBOX_GROUP_H
31 #include "LightApp_SelectionMgr.h"
32 //#include "SMESH_TypeFilter.hxx"
33 #include "SUIT_SelectionFilter.h"
37 #include <qvaluelist.h>
40 #include <SALOMEconfig.h>
41 #include CORBA_SERVER_HEADER(SMESH_Mesh)
42 #include CORBA_SERVER_HEADER(SMESH_Group)
53 class SMESHGUI_FilterDlg;
55 class SVTK_ViewWindow;
57 //=================================================================================
58 // class : SMESHGUI_GroupDlg
60 //=================================================================================
61 class SMESHGUI_GroupDlg : public QDialog
66 SMESHGUI_GroupDlg( SMESHGUI*,
68 SMESH::SMESH_Mesh_ptr theMesh = SMESH::SMESH_Mesh::_nil(),
69 bool modal = FALSE, WFlags fl = 0 );
70 SMESHGUI_GroupDlg( SMESHGUI*,
72 SMESH::SMESH_GroupBase_ptr theGroup,
73 bool modal = FALSE, WFlags fl = 0 );
84 void onTypeChanged(int id);
85 void onGrpTypeChanged(int id);
92 void onListSelectionChanged();
93 void onObjectSelectionChanged();
95 void onSelectSubMesh(bool on);
96 void onSelectGroup(bool on);
97 void onSelectGeomGroup(bool on);
98 void onSelectColorGroup(bool on);
99 void setCurrentSelection();
104 void onNameChanged(const QString& text);
105 void onNbColorsChanged(const QString& text);
106 void onFilterAccepted();
109 void initDialog(bool create);
110 void init(SMESH::SMESH_Mesh_ptr theMesh);
111 void init(SMESH::SMESH_GroupBase_ptr theGroup);
112 void closeEvent(QCloseEvent* e);
113 void enterEvent (QEvent*);
114 void hideEvent (QHideEvent*); /* ESC key */
115 void setSelectionMode(int theMode);
116 void updateButtons();
118 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
119 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
120 SMESH_Actor* myActor; /* Current mesh actor */
121 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
122 int myTypeId; /* Current type id = radio button id */
123 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
124 SVTK_Selector* mySelector;
126 QPushButton* myMeshGroupBtn;
127 QLineEdit* myMeshGroupLine;
129 QButtonGroup* myTypeGroup;
132 QButtonGroup* myGrpTypeGroup;
134 QWidgetStack* myWGStack;
135 QListBox* myElements;
136 QPushButton* myFilter;
138 QCheckBox* mySelectSubMesh;
139 QPushButton* mySubMeshBtn;
140 QLineEdit* mySubMeshLine;
142 QCheckBox* mySelectGroup;
143 QPushButton* myGroupBtn;
144 QLineEdit* myGroupLine;
146 QCheckBox* mySelectColorGroup;
147 QLineEdit* myColorGroupLine;
149 QCheckBox* mySelectGeomGroup;
150 QPushButton* myGeomGroupBtn;
151 QLineEdit* myGeomGroupLine;
153 SMESH::SMESH_Mesh_var myMesh;
154 SMESH::SMESH_Group_var myGroup;
155 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
156 QValueList<int> myIdList;
157 GEOM::GEOM_Object_var myGeomGroup;
160 //Handle(SMESH_TypeFilter) myMeshFilter;
161 //Handle(SMESH_TypeFilter) mySubMeshFilter;
162 //Handle(SMESH_TypeFilter) myGroupFilter;
163 SUIT_SelectionFilter* myMeshFilter;
164 SUIT_SelectionFilter* mySubMeshFilter;
165 SUIT_SelectionFilter* myGroupFilter;
167 SMESHGUI_FilterDlg* myFilterDlg;
169 bool myCreate, myIsBusy;
172 #endif // DIALOGBOX_GROUP_H