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 );
91 void onListSelectionChanged();
92 void onObjectSelectionChanged();
94 void onSelectSubMesh( bool );
95 void onSelectGroup( bool );
96 void onSelectGeomGroup( bool );
97 void setCurrentSelection();
102 void onNameChanged( const QString& );
103 void onFilterAccepted();
105 void onGeomPopup( QAction* );
106 void onGeomSelectionButton( bool );
108 void onPublishShapeByMeshDlg( SUIT_Operation* );
109 void onCloseShapeByMeshDlg( SUIT_Operation* );
112 void initDialog( bool );
113 void init( SMESH::SMESH_Mesh_ptr );
114 void init( SMESH::SMESH_GroupBase_ptr );
115 void closeEvent( QCloseEvent* );
116 void enterEvent( QEvent* );
117 void hideEvent( QHideEvent* ); /* ESC key */
118 void keyPressEvent( QKeyEvent* );
119 void setSelectionMode( int );
120 void updateButtons();
121 void updateGeomPopup();
123 void setGroupColor( const SALOMEDS::Color& );
124 SALOMEDS::Color getGroupColor() const;
126 void setGroupQColor( const QColor& );
127 QColor getGroupQColor() const;
129 void setDefaultGroupColor();
131 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
132 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
133 SMESH_Actor* myActor; /* Current mesh actor */
134 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
135 int myTypeId; /* Current type id = radio button id */
136 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
137 SVTK_Selector* mySelector;
139 QPushButton* myMeshGroupBtn;
140 QLineEdit* myMeshGroupLine;
142 QButtonGroup* myTypeGroup;
146 QButtonGroup* myGrpTypeGroup;
148 QStackedWidget* myWGStack;
149 QListWidget* myElements;
150 QPushButton* myFilter;
152 QCheckBox* mySelectSubMesh;
153 QPushButton* mySubMeshBtn;
154 QLineEdit* mySubMeshLine;
156 QCheckBox* mySelectGroup;
157 QPushButton* myGroupBtn;
158 QLineEdit* myGroupLine;
160 QtxColorButton* myColorBtn;
162 QCheckBox* mySelectGeomGroup;
163 QToolButton* myGeomGroupBtn;
164 QLineEdit* myGeomGroupLine;
167 QPushButton* myOKBtn;
168 QPushButton* myApplyBtn;
169 QPushButton* myCloseBtn;
170 QPushButton* myHelpBtn;
172 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
174 SMESH::SMESH_Mesh_var myMesh;
175 SMESH::SMESH_Group_var myGroup;
176 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
178 GEOM::ListOfGO_var myGeomObjects;
181 //Handle(SMESH_TypeFilter) myMeshFilter;
182 //Handle(SMESH_TypeFilter) mySubMeshFilter;
183 //Handle(SMESH_TypeFilter) myGroupFilter;
184 SUIT_SelectionFilter* myMeshFilter;
185 SUIT_SelectionFilter* mySubMeshFilter;
186 SUIT_SelectionFilter* myGroupFilter;
187 SUIT_SelectionFilter* myGeomFilter;
189 SMESHGUI_FilterDlg* myFilterDlg;
191 bool myCreate, myIsBusy;
193 QString myHelpFileName;
195 QMap<QAction*, int> myActions;
198 #endif // SMESHGUI_GROUPDLG_H