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,
73 const bool theIsConvert = false );
76 static QString GetDefaultName( const QString& );
83 void onTypeChanged( int );
84 void onGrpTypeChanged( int );
85 void onColorChanged( QColor );
93 void onListSelectionChanged();
94 void onObjectSelectionChanged();
96 void onSelectSubMesh( bool );
97 void onSelectGroup( bool );
98 void onSelectGeomGroup( bool );
99 void setCurrentSelection();
104 void onNameChanged( const QString& );
105 void onFilterAccepted();
107 void onGeomPopup( QAction* );
108 void onGeomSelectionButton( bool );
110 void onPublishShapeByMeshDlg( SUIT_Operation* );
111 void onCloseShapeByMeshDlg( SUIT_Operation* );
114 void initDialog( bool );
115 void init( SMESH::SMESH_Mesh_ptr );
116 void init( SMESH::SMESH_GroupBase_ptr,
117 const bool theIsConvert = false );
118 void closeEvent( QCloseEvent* );
119 void enterEvent( QEvent* );
120 void hideEvent( QHideEvent* ); /* ESC key */
121 void keyPressEvent( QKeyEvent* );
122 void setSelectionMode( int );
123 void updateButtons();
124 void updateGeomPopup();
125 bool SetAppropriateActor();
126 void setShowEntityMode();
127 void restoreShowEntityMode();
129 void setGroupColor( const SALOMEDS::Color& );
130 SALOMEDS::Color getGroupColor() const;
132 void setGroupQColor( const QColor& );
133 QColor getGroupQColor() const;
135 void setDefaultGroupColor();
137 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
138 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
139 SMESH_Actor* myActor; /* Current mesh actor */
140 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
141 int myTypeId; /* Current type id = radio button id */
142 int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
143 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
144 SVTK_Selector* mySelector;
146 QPushButton* myMeshGroupBtn;
147 QLineEdit* myMeshGroupLine;
149 QButtonGroup* myTypeGroup;
153 QButtonGroup* myGrpTypeGroup;
155 QStackedWidget* myWGStack;
156 QListWidget* myElements;
157 QPushButton* myFilter;
159 QCheckBox* mySelectSubMesh;
160 QPushButton* mySubMeshBtn;
161 QLineEdit* mySubMeshLine;
163 QCheckBox* mySelectGroup;
164 QPushButton* myGroupBtn;
165 QLineEdit* myGroupLine;
167 QtxColorButton* myColorBtn;
169 QCheckBox* mySelectGeomGroup;
170 QToolButton* myGeomGroupBtn;
171 QLineEdit* myGeomGroupLine;
174 QPushButton* myOKBtn;
175 QPushButton* myApplyBtn;
176 QPushButton* myCloseBtn;
177 QPushButton* myHelpBtn;
179 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
181 SMESH::SMESH_Mesh_var myMesh;
182 SMESH::SMESH_Group_var myGroup;
183 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
185 GEOM::ListOfGO_var myGeomObjects;
188 //Handle(SMESH_TypeFilter) myMeshFilter;
189 //Handle(SMESH_TypeFilter) mySubMeshFilter;
190 //Handle(SMESH_TypeFilter) myGroupFilter;
191 SUIT_SelectionFilter* myMeshFilter;
192 SUIT_SelectionFilter* mySubMeshFilter;
193 SUIT_SelectionFilter* myGroupFilter;
194 SUIT_SelectionFilter* myGeomFilter;
196 SMESHGUI_FilterDlg* myFilterDlg;
198 bool myCreate, myIsBusy;
200 QString myHelpFileName;
202 QMap<QAction*, int> myActions;
204 bool myNameChanged; //added by skl for IPAL19574
207 #endif // SMESHGUI_GROUPDLG_H