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();
123 bool SetAppropriateActor();
124 void setShowEntityMode();
125 void restoreShowEntityMode();
127 void setGroupColor( const SALOMEDS::Color& );
128 SALOMEDS::Color getGroupColor() const;
130 void setGroupQColor( const QColor& );
131 QColor getGroupQColor() const;
133 void setDefaultGroupColor();
135 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
136 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
137 SMESH_Actor* myActor; /* Current mesh actor */
138 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
139 int myTypeId; /* Current type id = radio button id */
140 int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
141 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
142 SVTK_Selector* mySelector;
144 QPushButton* myMeshGroupBtn;
145 QLineEdit* myMeshGroupLine;
147 QButtonGroup* myTypeGroup;
151 QButtonGroup* myGrpTypeGroup;
153 QStackedWidget* myWGStack;
154 QListWidget* myElements;
155 QPushButton* myFilter;
157 QCheckBox* mySelectSubMesh;
158 QPushButton* mySubMeshBtn;
159 QLineEdit* mySubMeshLine;
161 QCheckBox* mySelectGroup;
162 QPushButton* myGroupBtn;
163 QLineEdit* myGroupLine;
165 QtxColorButton* myColorBtn;
167 QCheckBox* mySelectGeomGroup;
168 QToolButton* myGeomGroupBtn;
169 QLineEdit* myGeomGroupLine;
172 QPushButton* myOKBtn;
173 QPushButton* myApplyBtn;
174 QPushButton* myCloseBtn;
175 QPushButton* myHelpBtn;
177 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
179 SMESH::SMESH_Mesh_var myMesh;
180 SMESH::SMESH_Group_var myGroup;
181 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
183 GEOM::ListOfGO_var myGeomObjects;
186 //Handle(SMESH_TypeFilter) myMeshFilter;
187 //Handle(SMESH_TypeFilter) mySubMeshFilter;
188 //Handle(SMESH_TypeFilter) myGroupFilter;
189 SUIT_SelectionFilter* myMeshFilter;
190 SUIT_SelectionFilter* mySubMeshFilter;
191 SUIT_SelectionFilter* myGroupFilter;
192 SUIT_SelectionFilter* myGeomFilter;
194 SMESHGUI_FilterDlg* myFilterDlg;
196 bool myCreate, myIsBusy;
198 QString myHelpFileName;
200 QMap<QAction*, int> myActions;
202 bool myNameChanged; //added by skl for IPAL19574
205 #endif // SMESHGUI_GROUPDLG_H