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 "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 keyPressEvent(QKeyEvent*);
118 void setSelectionMode(int theMode);
119 void updateButtons();
121 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
122 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
123 SMESH_Actor* myActor; /* Current mesh actor */
124 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
125 int myTypeId; /* Current type id = radio button id */
126 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
127 SVTK_Selector* mySelector;
129 QPushButton* myMeshGroupBtn;
130 QLineEdit* myMeshGroupLine;
132 QButtonGroup* myTypeGroup;
135 QButtonGroup* myGrpTypeGroup;
137 QWidgetStack* myWGStack;
138 QListBox* myElements;
139 QPushButton* myFilter;
141 QCheckBox* mySelectSubMesh;
142 QPushButton* mySubMeshBtn;
143 QLineEdit* mySubMeshLine;
145 QCheckBox* mySelectGroup;
146 QPushButton* myGroupBtn;
147 QLineEdit* myGroupLine;
149 QCheckBox* mySelectColorGroup;
150 QtxIntSpinBox* myColorSpinBox;
152 QCheckBox* mySelectGeomGroup;
153 QPushButton* myGeomGroupBtn;
154 QLineEdit* myGeomGroupLine;
156 SMESH::SMESH_Mesh_var myMesh;
157 SMESH::SMESH_Group_var myGroup;
158 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
159 QValueList<int> myIdList;
160 GEOM::GEOM_Object_var myGeomGroup;
163 //Handle(SMESH_TypeFilter) myMeshFilter;
164 //Handle(SMESH_TypeFilter) mySubMeshFilter;
165 //Handle(SMESH_TypeFilter) myGroupFilter;
166 SUIT_SelectionFilter* myMeshFilter;
167 SUIT_SelectionFilter* mySubMeshFilter;
168 SUIT_SelectionFilter* myGroupFilter;
170 SMESHGUI_FilterDlg* myFilterDlg;
172 bool myCreate, myIsBusy;
174 QString myHelpFileName;
177 #endif // DIALOGBOX_GROUP_H