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 );
93 void onVisibilityChanged();
95 void onListSelectionChanged();
96 void onObjectSelectionChanged();
98 void onSelectSubMesh( bool );
99 void onSelectGroup( bool );
100 void onSelectGeomGroup( bool );
101 void setCurrentSelection();
106 void onNameChanged( const QString& );
107 void onFilterAccepted();
109 void onGeomPopup( QAction* );
110 void onGeomSelectionButton( bool );
112 void onPublishShapeByMeshDlg( SUIT_Operation* );
113 void onCloseShapeByMeshDlg( SUIT_Operation* );
116 void initDialog( bool );
117 void init( SMESH::SMESH_Mesh_ptr );
118 void init( SMESH::SMESH_GroupBase_ptr,
119 const bool theIsConvert = false );
120 void closeEvent( QCloseEvent* );
121 void enterEvent( QEvent* );
122 void hideEvent( QHideEvent* ); /* ESC key */
123 void keyPressEvent( QKeyEvent* );
124 void setSelectionMode( int );
125 void updateButtons();
126 void updateGeomPopup();
127 bool SetAppropriateActor();
128 void setShowEntityMode();
129 void restoreShowEntityMode();
131 void setGroupColor( const SALOMEDS::Color& );
132 SALOMEDS::Color getGroupColor() const;
134 void setGroupQColor( const QColor& );
135 QColor getGroupQColor() const;
137 void setDefaultGroupColor();
139 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
140 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
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 QList<SMESH_Actor*> myActorsList;
184 SMESH::SMESH_Group_var myGroup;
185 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
187 GEOM::ListOfGO_var myGeomObjects;
190 //Handle(SMESH_TypeFilter) myMeshFilter;
191 //Handle(SMESH_TypeFilter) mySubMeshFilter;
192 //Handle(SMESH_TypeFilter) myGroupFilter;
193 SUIT_SelectionFilter* myMeshFilter;
194 SUIT_SelectionFilter* mySubMeshFilter;
195 SUIT_SelectionFilter* myGroupFilter;
196 SUIT_SelectionFilter* myGeomFilter;
198 SMESHGUI_FilterDlg* myFilterDlg;
200 bool myCreate, myIsBusy;
202 QString myHelpFileName;
204 QMap<QAction*, int> myActions;
206 bool myNameChanged; //added by skl for IPAL19574
209 #endif // SMESHGUI_GROUPDLG_H