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.com
23 // File : SMESHGUI_GroupDlg.h
24 // Author : Natalia KOPNOVA
28 #ifndef DIALOGBOX_GROUP_H
29 #define DIALOGBOX_GROUP_H
31 #include "SMESH_SMESHGUI.hxx"
33 #include "LightApp_SelectionMgr.h"
34 //#include "SMESH_TypeFilter.hxx"
35 #include "SUIT_SelectionFilter.h"
39 #include <qvaluelist.h>
42 #include <SALOMEconfig.h>
43 #include CORBA_SERVER_HEADER(SMESH_Mesh)
44 #include CORBA_SERVER_HEADER(SMESH_Group)
56 class SMESHGUI_FilterDlg;
58 class SVTK_ViewWindow;
60 //=================================================================================
61 // class : SMESHGUI_GroupDlg
63 //=================================================================================
64 class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
69 SMESHGUI_GroupDlg( SMESHGUI*,
71 SMESH::SMESH_Mesh_ptr theMesh = SMESH::SMESH_Mesh::_nil(),
72 bool modal = FALSE, WFlags fl = 0 );
73 SMESHGUI_GroupDlg( SMESHGUI*,
75 SMESH::SMESH_GroupBase_ptr theGroup,
76 bool modal = FALSE, WFlags fl = 0 );
87 void onTypeChanged(int id);
88 void onGrpTypeChanged(int id);
96 void onListSelectionChanged();
97 void onObjectSelectionChanged();
99 void onSelectSubMesh(bool on);
100 void onSelectGroup(bool on);
101 void onSelectGeomGroup(bool on);
102 void onSelectColorGroup(bool on);
103 void setCurrentSelection();
108 void onNameChanged(const QString& text);
109 void onNbColorsChanged(const QString& text);
110 void onFilterAccepted();
113 void initDialog(bool create);
114 void init(SMESH::SMESH_Mesh_ptr theMesh);
115 void init(SMESH::SMESH_GroupBase_ptr theGroup);
116 void closeEvent(QCloseEvent* e);
117 void enterEvent (QEvent*);
118 void hideEvent (QHideEvent*); /* ESC key */
119 void keyPressEvent(QKeyEvent*);
120 void setSelectionMode(int theMode);
121 void updateButtons();
123 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
124 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
125 SMESH_Actor* myActor; /* Current mesh actor */
126 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
127 int myTypeId; /* Current type id = radio button id */
128 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
129 SVTK_Selector* mySelector;
131 QPushButton* myMeshGroupBtn;
132 QLineEdit* myMeshGroupLine;
134 QButtonGroup* myTypeGroup;
137 QButtonGroup* myGrpTypeGroup;
139 QWidgetStack* myWGStack;
140 QListBox* myElements;
141 QPushButton* myFilter;
143 QCheckBox* mySelectSubMesh;
144 QPushButton* mySubMeshBtn;
145 QLineEdit* mySubMeshLine;
147 QCheckBox* mySelectGroup;
148 QPushButton* myGroupBtn;
149 QLineEdit* myGroupLine;
151 QCheckBox* mySelectColorGroup;
152 QtxIntSpinBox* myColorSpinBox;
154 QCheckBox* mySelectGeomGroup;
155 QPushButton* myGeomGroupBtn;
156 QLineEdit* myGeomGroupLine;
158 SMESH::SMESH_Mesh_var myMesh;
159 SMESH::SMESH_Group_var myGroup;
160 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
161 QValueList<int> myIdList;
162 GEOM::GEOM_Object_var myGeomGroup;
165 //Handle(SMESH_TypeFilter) myMeshFilter;
166 //Handle(SMESH_TypeFilter) mySubMeshFilter;
167 //Handle(SMESH_TypeFilter) myGroupFilter;
168 SUIT_SelectionFilter* myMeshFilter;
169 SUIT_SelectionFilter* mySubMeshFilter;
170 SUIT_SelectionFilter* myGroupFilter;
172 SMESHGUI_FilterDlg* myFilterDlg;
174 bool myCreate, myIsBusy;
176 QString myHelpFileName;
179 #endif // DIALOGBOX_GROUP_H