1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SMESH SMESHGUI : GUI for SMESH component
23 // File : SMESHGUI_GroupDlg.h
24 // Author : Natalia KOPNOVA, Open CASCADE S.A.S.
26 #ifndef SMESHGUI_GROUPDLG_H
27 #define SMESHGUI_GROUPDLG_H
30 #include "SMESH_SMESHGUI.hxx"
38 #include <SALOMEconfig.h>
39 #include CORBA_SERVER_HEADER(SMESH_Mesh)
40 #include CORBA_SERVER_HEADER(SMESH_Group)
53 class SMESHGUI_FilterDlg;
54 class SMESHGUI_ShapeByMeshOp;
58 class SUIT_SelectionFilter;
59 class LightApp_SelectionMgr;
61 //=================================================================================
62 // class : SMESHGUI_GroupDlg
64 //=================================================================================
65 class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
70 SMESHGUI_GroupDlg( SMESHGUI*,
71 SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
72 SMESHGUI_GroupDlg( SMESHGUI*,
73 SMESH::SMESH_GroupBase_ptr,
74 const bool theIsConvert = false );
77 static QString GetDefaultName( const QString& );
84 void onTypeChanged( int );
85 void onGrpTypeChanged( int );
86 void onColorChanged( QColor );
94 void onListSelectionChanged();
95 void onObjectSelectionChanged();
97 void onSelectSubMesh( bool );
98 void onSelectGroup( bool );
99 void onSelectGeomGroup( bool );
100 void setCurrentSelection();
105 void onNameChanged( const QString& );
106 void onFilterAccepted();
108 void onGeomPopup( QAction* );
109 void onGeomSelectionButton( bool );
111 void onPublishShapeByMeshDlg( SUIT_Operation* );
112 void onCloseShapeByMeshDlg( SUIT_Operation* );
115 void initDialog( bool );
116 void init( SMESH::SMESH_Mesh_ptr );
117 void init( SMESH::SMESH_GroupBase_ptr,
118 const bool theIsConvert = false );
119 void closeEvent( QCloseEvent* );
120 void enterEvent( QEvent* );
121 void hideEvent( QHideEvent* ); /* ESC key */
122 void keyPressEvent( QKeyEvent* );
123 void setSelectionMode( int );
124 void updateButtons();
125 void updateGeomPopup();
126 bool SetAppropriateActor();
127 void setShowEntityMode();
128 void restoreShowEntityMode();
130 void setGroupColor( const SALOMEDS::Color& );
131 SALOMEDS::Color getGroupColor() const;
133 void setGroupQColor( const QColor& );
134 QColor getGroupQColor() const;
136 void setDefaultGroupColor();
138 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
139 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
140 SMESH_Actor* myActor; /* Current mesh actor */
141 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
142 int myTypeId; /* Current type id = radio button id */
143 int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
144 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
145 SVTK_Selector* mySelector;
147 QPushButton* myMeshGroupBtn;
148 QLineEdit* myMeshGroupLine;
150 QButtonGroup* myTypeGroup;
154 QButtonGroup* myGrpTypeGroup;
156 QStackedWidget* myWGStack;
157 QListWidget* myElements;
158 QPushButton* myFilter;
160 QCheckBox* mySelectSubMesh;
161 QPushButton* mySubMeshBtn;
162 QLineEdit* mySubMeshLine;
164 QCheckBox* mySelectGroup;
165 QPushButton* myGroupBtn;
166 QLineEdit* myGroupLine;
168 QtxColorButton* myColorBtn;
170 QCheckBox* mySelectGeomGroup;
171 QToolButton* myGeomGroupBtn;
172 QLineEdit* myGeomGroupLine;
175 QPushButton* myOKBtn;
176 QPushButton* myApplyBtn;
177 QPushButton* myCloseBtn;
178 QPushButton* myHelpBtn;
180 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
182 SMESH::SMESH_Mesh_var myMesh;
183 SMESH::SMESH_Group_var myGroup;
184 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
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;
203 QMap<QAction*, int> myActions;
205 bool myNameChanged; //added by skl for IPAL19574
208 #endif // SMESHGUI_GROUPDLG_H