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
21 // File : SMESHGUI_GroupDlg.h
22 // Author : Natalia KOPNOVA, Open CASCADE S.A.S.
25 #ifndef SMESHGUI_GROUPDLG_H
26 #define SMESHGUI_GROUPDLG_H
29 #include "SMESH_SMESHGUI.hxx"
37 #include <SALOMEconfig.h>
38 #include CORBA_SERVER_HEADER(SMESH_Mesh)
39 #include CORBA_SERVER_HEADER(SMESH_Group)
52 class SMESHGUI_FilterDlg;
53 class SMESHGUI_ShapeByMeshOp;
57 class SUIT_SelectionFilter;
58 class LightApp_SelectionMgr;
60 //=================================================================================
61 // class : SMESHGUI_GroupDlg
63 //=================================================================================
64 class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
69 SMESHGUI_GroupDlg( SMESHGUI*,
70 SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
71 SMESHGUI_GroupDlg( SMESHGUI*,
72 SMESH::SMESH_GroupBase_ptr );
75 static QString GetDefaultName( const QString& );
82 void onTypeChanged( int );
83 void onGrpTypeChanged( int );
84 void onColorChanged( QColor );
92 void onListSelectionChanged();
93 void onObjectSelectionChanged();
95 void onSelectSubMesh( bool );
96 void onSelectGroup( bool );
97 void onSelectGeomGroup( bool );
98 void setCurrentSelection();
103 void onNameChanged( const QString& );
104 void onFilterAccepted();
106 void onGeomPopup( QAction* );
107 void onGeomSelectionButton( bool );
109 void onPublishShapeByMeshDlg( SUIT_Operation* );
110 void onCloseShapeByMeshDlg( SUIT_Operation* );
113 void initDialog( bool );
114 void init( SMESH::SMESH_Mesh_ptr );
115 void init( SMESH::SMESH_GroupBase_ptr );
116 void closeEvent( QCloseEvent* );
117 void enterEvent( QEvent* );
118 void hideEvent( QHideEvent* ); /* ESC key */
119 void keyPressEvent( QKeyEvent* );
120 void setSelectionMode( int );
121 void updateButtons();
122 void updateGeomPopup();
124 void setGroupColor( const SALOMEDS::Color& );
125 SALOMEDS::Color getGroupColor() const;
127 void setGroupQColor( const QColor& );
128 QColor getGroupQColor() const;
130 void setDefaultGroupColor();
132 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
133 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
134 SMESH_Actor* myActor; /* Current mesh actor */
135 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
136 int myTypeId; /* Current type id = radio button id */
137 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
138 SVTK_Selector* mySelector;
140 QPushButton* myMeshGroupBtn;
141 QLineEdit* myMeshGroupLine;
143 QButtonGroup* myTypeGroup;
147 QButtonGroup* myGrpTypeGroup;
149 QStackedWidget* myWGStack;
150 QListWidget* myElements;
151 QPushButton* myFilter;
153 QCheckBox* mySelectSubMesh;
154 QPushButton* mySubMeshBtn;
155 QLineEdit* mySubMeshLine;
157 QCheckBox* mySelectGroup;
158 QPushButton* myGroupBtn;
159 QLineEdit* myGroupLine;
161 QtxColorButton* myColorBtn;
163 QCheckBox* mySelectGeomGroup;
164 QToolButton* myGeomGroupBtn;
165 QLineEdit* myGeomGroupLine;
168 QPushButton* myOKBtn;
169 QPushButton* myApplyBtn;
170 QPushButton* myCloseBtn;
171 QPushButton* myHelpBtn;
173 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
175 SMESH::SMESH_Mesh_var myMesh;
176 SMESH::SMESH_Group_var myGroup;
177 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
179 GEOM::ListOfGO_var myGeomObjects;
182 //Handle(SMESH_TypeFilter) myMeshFilter;
183 //Handle(SMESH_TypeFilter) mySubMeshFilter;
184 //Handle(SMESH_TypeFilter) myGroupFilter;
185 SUIT_SelectionFilter* myMeshFilter;
186 SUIT_SelectionFilter* mySubMeshFilter;
187 SUIT_SelectionFilter* myGroupFilter;
188 SUIT_SelectionFilter* myGeomFilter;
190 SMESHGUI_FilterDlg* myFilterDlg;
192 bool myCreate, myIsBusy;
194 QString myHelpFileName;
196 QMap<QAction*, int> myActions;
199 #endif // SMESHGUI_GROUPDLG_H