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)
54 class SMESHGUI_FilterDlg;
56 class SVTK_ViewWindow;
58 //=================================================================================
59 // class : SMESHGUI_GroupDlg
61 //=================================================================================
62 class SMESHGUI_GroupDlg : public QDialog
67 SMESHGUI_GroupDlg( SMESHGUI*,
69 SMESH::SMESH_Mesh_ptr theMesh = SMESH::SMESH_Mesh::_nil(),
70 bool modal = FALSE, WFlags fl = 0 );
71 SMESHGUI_GroupDlg( SMESHGUI*,
73 SMESH::SMESH_GroupBase_ptr theGroup,
74 bool modal = FALSE, WFlags fl = 0 );
85 void onTypeChanged(int id);
86 void onGrpTypeChanged(int id);
94 void onListSelectionChanged();
95 void onObjectSelectionChanged();
97 void onSelectSubMesh(bool on);
98 void onSelectGroup(bool on);
99 void onSelectGeomGroup(bool on);
100 void onSelectColorGroup(bool on);
101 void setCurrentSelection();
106 void onNameChanged(const QString& text);
107 void onNbColorsChanged(const QString& text);
108 void onFilterAccepted();
111 void initDialog(bool create);
112 void init(SMESH::SMESH_Mesh_ptr theMesh);
113 void init(SMESH::SMESH_GroupBase_ptr theGroup);
114 void closeEvent(QCloseEvent* e);
115 void enterEvent (QEvent*);
116 void hideEvent (QHideEvent*); /* ESC key */
117 void setSelectionMode(int theMode);
118 void updateButtons();
120 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
121 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
122 SMESH_Actor* myActor; /* Current mesh actor */
123 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
124 int myTypeId; /* Current type id = radio button id */
125 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
126 SVTK_Selector* mySelector;
128 QPushButton* myMeshGroupBtn;
129 QLineEdit* myMeshGroupLine;
131 QButtonGroup* myTypeGroup;
134 QButtonGroup* myGrpTypeGroup;
136 QWidgetStack* myWGStack;
137 QListBox* myElements;
138 QPushButton* myFilter;
140 QCheckBox* mySelectSubMesh;
141 QPushButton* mySubMeshBtn;
142 QLineEdit* mySubMeshLine;
144 QCheckBox* mySelectGroup;
145 QPushButton* myGroupBtn;
146 QLineEdit* myGroupLine;
148 QCheckBox* mySelectColorGroup;
149 QtxIntSpinBox* myColorSpinBox;
151 QCheckBox* mySelectGeomGroup;
152 QPushButton* myGeomGroupBtn;
153 QLineEdit* myGeomGroupLine;
155 SMESH::SMESH_Mesh_var myMesh;
156 SMESH::SMESH_Group_var myGroup;
157 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
158 QValueList<int> myIdList;
159 GEOM::GEOM_Object_var myGeomGroup;
162 //Handle(SMESH_TypeFilter) myMeshFilter;
163 //Handle(SMESH_TypeFilter) mySubMeshFilter;
164 //Handle(SMESH_TypeFilter) myGroupFilter;
165 SUIT_SelectionFilter* myMeshFilter;
166 SUIT_SelectionFilter* mySubMeshFilter;
167 SUIT_SelectionFilter* myGroupFilter;
169 SMESHGUI_FilterDlg* myFilterDlg;
171 bool myCreate, myIsBusy;
173 QString myHelpFileName;
176 #endif // DIALOGBOX_GROUP_H