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)
58 class SMESHGUI_FilterDlg;
59 class SMESHGUI_ShapeByMeshOp;
62 class SVTK_ViewWindow;
64 //=================================================================================
65 // class : SMESHGUI_GroupDlg
67 //=================================================================================
68 class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
73 SMESHGUI_GroupDlg( SMESHGUI*,
75 SMESH::SMESH_Mesh_ptr theMesh = SMESH::SMESH_Mesh::_nil(),
76 bool modal = FALSE, WFlags fl = 0 );
77 SMESHGUI_GroupDlg( SMESHGUI*,
79 SMESH::SMESH_GroupBase_ptr theGroup,
80 bool modal = FALSE, WFlags fl = 0 );
83 static QString GetDefaultName(const QString& theOperation);
93 void onTypeChanged(int id);
94 void onGrpTypeChanged(int id);
102 void onListSelectionChanged();
103 void onObjectSelectionChanged();
105 void onSelectSubMesh(bool on);
106 void onSelectGroup(bool on);
107 void onSelectGeomGroup(bool on);
108 void setCurrentSelection();
113 void onNameChanged(const QString& text);
114 void onFilterAccepted();
116 void onSelectColor();
118 void onGeomPopup( int );
119 void onGeomSelectionButton( bool );
121 void onPublishShapeByMeshDlg(SUIT_Operation*);
122 void onCloseShapeByMeshDlg(SUIT_Operation*);
125 void initDialog(bool create);
126 void init(SMESH::SMESH_Mesh_ptr theMesh);
127 void init(SMESH::SMESH_GroupBase_ptr theGroup);
128 void closeEvent(QCloseEvent* e);
129 void enterEvent (QEvent*);
130 void hideEvent (QHideEvent*); /* ESC key */
131 void keyPressEvent(QKeyEvent*);
132 void setSelectionMode(int theMode);
133 void updateButtons();
134 void updateGeomPopup();
136 void setGroupColor( const SALOMEDS::Color& );
137 SALOMEDS::Color getGroupColor() const;
139 void setGroupQColor( const QColor& );
140 QColor getGroupQColor() const;
142 void setDefaultGroupColor();
144 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
145 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
146 SMESH_Actor* myActor; /* Current mesh actor */
147 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
148 int myTypeId; /* Current type id = radio button id */
149 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
150 SVTK_Selector* mySelector;
152 QPushButton* myMeshGroupBtn;
153 QLineEdit* myMeshGroupLine;
155 QButtonGroup* myTypeGroup;
159 QButtonGroup* myGrpTypeGroup;
161 QWidgetStack* myWGStack;
162 QListBox* myElements;
163 QPushButton* myFilter;
165 QCheckBox* mySelectSubMesh;
166 QPushButton* mySubMeshBtn;
167 QLineEdit* mySubMeshLine;
169 QCheckBox* mySelectGroup;
170 QPushButton* myGroupBtn;
171 QLineEdit* myGroupLine;
173 QPushButton* myColorBtn;
175 QCheckBox* mySelectGeomGroup;
176 QToolButton* myGeomGroupBtn;
177 QLineEdit* myGeomGroupLine;
178 QPopupMenu* myGeomPopup;
180 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
182 SMESH::SMESH_Mesh_var myMesh;
183 SMESH::SMESH_Group_var myGroup;
184 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
185 QValueList<int> myIdList;
186 GEOM::ListOfGO_var myGeomObjects;
189 //Handle(SMESH_TypeFilter) myMeshFilter;
190 //Handle(SMESH_TypeFilter) mySubMeshFilter;
191 //Handle(SMESH_TypeFilter) myGroupFilter;
192 SUIT_SelectionFilter* myMeshFilter;
193 SUIT_SelectionFilter* mySubMeshFilter;
194 SUIT_SelectionFilter* myGroupFilter;
195 SUIT_SelectionFilter* myGeomFilter;
197 SMESHGUI_FilterDlg* myFilterDlg;
199 bool myCreate, myIsBusy;
201 QString myHelpFileName;
204 #endif // DIALOGBOX_GROUP_H