1 // Copyright (C) 2007-2010 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
23 // SMESH SMESHGUI : GUI for SMESH component
24 // File : SMESHGUI_GroupDlg.h
25 // Author : Natalia KOPNOVA, Open CASCADE S.A.S.
27 #ifndef SMESHGUI_GROUPDLG_H
28 #define SMESHGUI_GROUPDLG_H
31 #include "SMESH_SMESHGUI.hxx"
39 #include <SALOMEconfig.h>
40 #include CORBA_SERVER_HEADER(SMESH_Mesh)
41 #include CORBA_SERVER_HEADER(SMESH_Group)
54 class SMESHGUI_FilterDlg;
55 class SMESHGUI_ShapeByMeshOp;
59 class SUIT_SelectionFilter;
60 class LightApp_SelectionMgr;
62 //=================================================================================
63 // class : SMESHGUI_GroupDlg
65 //=================================================================================
66 class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
71 SMESHGUI_GroupDlg( SMESHGUI*,
72 SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
73 SMESHGUI_GroupDlg( SMESHGUI*,
74 SMESH::SMESH_GroupBase_ptr,
75 const bool theIsConvert = false );
78 static QString GetDefaultName( const QString& );
85 void onTypeChanged( int );
86 void onGrpTypeChanged( int );
87 void onColorChanged( QColor );
94 void onVisibilityChanged();
96 void onListSelectionChanged();
97 void onObjectSelectionChanged();
99 void onSelectSubMesh( bool );
100 void onSelectGroup( bool );
101 void onSelectGeomGroup( bool );
102 void setCurrentSelection();
107 void onNameChanged( const QString& );
108 void onFilterAccepted();
110 void onGeomPopup( QAction* );
111 void onGeomSelectionButton( bool );
113 void onPublishShapeByMeshDlg( SUIT_Operation* );
114 void onCloseShapeByMeshDlg( SUIT_Operation* );
117 void initDialog( bool );
118 void init( SMESH::SMESH_Mesh_ptr );
119 void init( SMESH::SMESH_GroupBase_ptr,
120 const bool theIsConvert = false );
121 void closeEvent( QCloseEvent* );
122 void enterEvent( QEvent* );
123 void hideEvent( QHideEvent* ); /* ESC key */
124 void keyPressEvent( QKeyEvent* );
125 void setSelectionMode( int );
126 void updateButtons();
127 void updateGeomPopup();
128 bool SetAppropriateActor();
129 void setShowEntityMode();
130 void restoreShowEntityMode();
132 bool IsActorVisible( SMESH_Actor* );
134 void setGroupColor( const SALOMEDS::Color& );
135 SALOMEDS::Color getGroupColor() const;
137 void setGroupQColor( const QColor& );
138 QColor getGroupQColor() const;
140 void setDefaultGroupColor();
142 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
143 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
144 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
145 int myTypeId; /* Current type id = radio button id */
146 int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
147 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
148 SVTK_Selector* mySelector;
150 QPushButton* myMeshGroupBtn;
151 QLineEdit* myMeshGroupLine;
153 QButtonGroup* myTypeGroup;
157 QButtonGroup* myGrpTypeGroup;
159 QStackedWidget* myWGStack;
160 QListWidget* myElements;
161 QPushButton* myFilter;
163 QCheckBox* mySelectSubMesh;
164 QPushButton* mySubMeshBtn;
165 QLineEdit* mySubMeshLine;
167 QCheckBox* mySelectGroup;
168 QPushButton* myGroupBtn;
169 QLineEdit* myGroupLine;
171 QtxColorButton* myColorBtn;
173 QCheckBox* mySelectGeomGroup;
174 QToolButton* myGeomGroupBtn;
175 QLineEdit* myGeomGroupLine;
178 QPushButton* myOKBtn;
179 QPushButton* myApplyBtn;
180 QPushButton* myCloseBtn;
181 QPushButton* myHelpBtn;
183 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
185 SMESH::SMESH_Mesh_var myMesh;
186 QList<SMESH_Actor*> myActorsList;
187 SMESH::SMESH_Group_var myGroup;
188 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
190 GEOM::ListOfGO_var myGeomObjects;
193 //Handle(SMESH_TypeFilter) myMeshFilter;
194 //Handle(SMESH_TypeFilter) mySubMeshFilter;
195 //Handle(SMESH_TypeFilter) myGroupFilter;
196 SUIT_SelectionFilter* myMeshFilter;
197 SUIT_SelectionFilter* mySubMeshFilter;
198 SUIT_SelectionFilter* myGroupFilter;
199 SUIT_SelectionFilter* myGeomFilter;
201 SMESHGUI_FilterDlg* myFilterDlg;
203 bool myCreate, myIsBusy;
205 QString myHelpFileName;
207 QMap<QAction*, int> myActions;
209 bool myNameChanged; //added by skl for IPAL19574
212 #endif // SMESHGUI_GROUPDLG_H