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 setSelectionMode(int theMode);
120 void updateButtons();
122 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
123 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
124 SMESH_Actor* myActor; /* Current mesh actor */
125 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
126 int myTypeId; /* Current type id = radio button id */
127 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
128 SVTK_Selector* mySelector;
130 QPushButton* myMeshGroupBtn;
131 QLineEdit* myMeshGroupLine;
133 QButtonGroup* myTypeGroup;
136 QButtonGroup* myGrpTypeGroup;
138 QWidgetStack* myWGStack;
139 QListBox* myElements;
140 QPushButton* myFilter;
142 QCheckBox* mySelectSubMesh;
143 QPushButton* mySubMeshBtn;
144 QLineEdit* mySubMeshLine;
146 QCheckBox* mySelectGroup;
147 QPushButton* myGroupBtn;
148 QLineEdit* myGroupLine;
150 QCheckBox* mySelectColorGroup;
151 QtxIntSpinBox* myColorSpinBox;
153 QCheckBox* mySelectGeomGroup;
154 QPushButton* myGeomGroupBtn;
155 QLineEdit* myGeomGroupLine;
157 SMESH::SMESH_Mesh_var myMesh;
158 SMESH::SMESH_Group_var myGroup;
159 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
160 QValueList<int> myIdList;
161 GEOM::GEOM_Object_var myGeomGroup;
164 //Handle(SMESH_TypeFilter) myMeshFilter;
165 //Handle(SMESH_TypeFilter) mySubMeshFilter;
166 //Handle(SMESH_TypeFilter) myGroupFilter;
167 SUIT_SelectionFilter* myMeshFilter;
168 SUIT_SelectionFilter* mySubMeshFilter;
169 SUIT_SelectionFilter* myGroupFilter;
171 SMESHGUI_FilterDlg* myFilterDlg;
173 bool myCreate, myIsBusy;
175 QString myHelpFileName;
178 #endif // DIALOGBOX_GROUP_H