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)
56 class SMESHGUI_FilterDlg;
57 class SMESHGUI_ShapeByMeshOp;
60 class SVTK_ViewWindow;
62 //=================================================================================
63 // class : SMESHGUI_GroupDlg
65 //=================================================================================
66 class SMESHGUI_GroupDlg : public QDialog
71 SMESHGUI_GroupDlg( SMESHGUI*,
73 SMESH::SMESH_Mesh_ptr theMesh = SMESH::SMESH_Mesh::_nil(),
74 bool modal = FALSE, WFlags fl = 0 );
75 SMESHGUI_GroupDlg( SMESHGUI*,
77 SMESH::SMESH_GroupBase_ptr theGroup,
78 bool modal = FALSE, WFlags fl = 0 );
81 static QString GetDefaultName(const QString& theOperation);
91 void onTypeChanged(int id);
92 void onGrpTypeChanged(int id);
100 void onListSelectionChanged();
101 void onObjectSelectionChanged();
103 void onSelectSubMesh(bool on);
104 void onSelectGroup(bool on);
105 void onSelectGeomGroup(bool on);
106 void onSelectColorGroup(bool on);
107 void setCurrentSelection();
112 void onNameChanged(const QString& text);
113 void onNbColorsChanged(const QString& text);
114 void onFilterAccepted();
116 void onGeomPopup( int );
117 void onGeomSelectionButton( bool );
119 void onPublishShapeByMeshDlg(SUIT_Operation*);
120 void onCloseShapeByMeshDlg(SUIT_Operation*);
123 void initDialog(bool create);
124 void init(SMESH::SMESH_Mesh_ptr theMesh);
125 void init(SMESH::SMESH_GroupBase_ptr theGroup);
126 void closeEvent(QCloseEvent* e);
127 void enterEvent (QEvent*);
128 void hideEvent (QHideEvent*); /* ESC key */
129 void keyPressEvent(QKeyEvent*);
130 void setSelectionMode(int theMode);
131 void updateButtons();
132 void updateGeomPopup();
134 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
135 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
136 SMESH_Actor* myActor; /* Current mesh actor */
137 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
138 int myTypeId; /* Current type id = radio button id */
139 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
140 SVTK_Selector* mySelector;
142 QPushButton* myMeshGroupBtn;
143 QLineEdit* myMeshGroupLine;
145 QButtonGroup* myTypeGroup;
149 QButtonGroup* myGrpTypeGroup;
151 QWidgetStack* myWGStack;
152 QListBox* myElements;
153 QPushButton* myFilter;
155 QCheckBox* mySelectSubMesh;
156 QPushButton* mySubMeshBtn;
157 QLineEdit* mySubMeshLine;
159 QCheckBox* mySelectGroup;
160 QPushButton* myGroupBtn;
161 QLineEdit* myGroupLine;
163 QCheckBox* mySelectColorGroup;
164 QtxIntSpinBox* myColorSpinBox;
166 QCheckBox* mySelectGeomGroup;
167 QToolButton* myGeomGroupBtn;
168 QLineEdit* myGeomGroupLine;
169 QPopupMenu* myGeomPopup;
171 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
173 SMESH::SMESH_Mesh_var myMesh;
174 SMESH::SMESH_Group_var myGroup;
175 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
176 QValueList<int> myIdList;
177 GEOM::ListOfGO_var myGeomObjects;
180 //Handle(SMESH_TypeFilter) myMeshFilter;
181 //Handle(SMESH_TypeFilter) mySubMeshFilter;
182 //Handle(SMESH_TypeFilter) myGroupFilter;
183 SUIT_SelectionFilter* myMeshFilter;
184 SUIT_SelectionFilter* mySubMeshFilter;
185 SUIT_SelectionFilter* myGroupFilter;
186 SUIT_SelectionFilter* myGeomFilter;
188 SMESHGUI_FilterDlg* myFilterDlg;
190 bool myCreate, myIsBusy;
192 QString myHelpFileName;
195 #endif // DIALOGBOX_GROUP_H