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)
56 class SMESHGUI_FilterDlg;
57 class SMESHGUI_ShapeByMeshOp;
61 class SUIT_SelectionFilter;
62 class LightApp_SelectionMgr;
64 //=================================================================================
65 // class : SMESHGUI_GroupDlg
67 //=================================================================================
68 class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
73 SMESHGUI_GroupDlg( SMESHGUI*,
74 SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
75 SMESHGUI_GroupDlg( SMESHGUI*,
76 SMESH::SMESH_GroupBase_ptr,
77 const bool theIsConvert = false );
80 static QString GetDefaultName( const QString& );
87 void onTypeChanged( int );
88 void onGrpTypeChanged( int );
89 void onColorChanged( QColor );
96 void onVisibilityChanged();
98 void onListSelectionChanged();
99 void onObjectSelectionChanged();
102 void onSelectSubMesh( bool );
103 void onSelectGroup( bool );
104 void onSelectGeomGroup( bool );
105 void setCurrentSelection();
110 void onNameChanged( const QString& );
111 void onFilterAccepted();
113 void onGeomPopup( QAction* );
114 void onGeomSelectionButton( bool );
116 void onPublishShapeByMeshDlg( SUIT_Operation* );
117 void onCloseShapeByMeshDlg( SUIT_Operation* );
120 void initDialog( bool );
121 void init( SMESH::SMESH_Mesh_ptr );
122 void init( SMESH::SMESH_GroupBase_ptr,
123 const bool theIsConvert = false );
124 void closeEvent( QCloseEvent* );
125 void enterEvent( QEvent* );
126 void hideEvent( QHideEvent* ); /* ESC key */
127 void keyPressEvent( QKeyEvent* );
128 void setSelectionMode( int );
129 void updateButtons();
130 void updateGeomPopup();
131 bool SetAppropriateActor();
132 void setShowEntityMode();
133 void restoreShowEntityMode();
135 bool IsActorVisible( SMESH_Actor* );
137 void setGroupColor( const SALOMEDS::Color& );
138 SALOMEDS::Color getGroupColor() const;
140 void setGroupQColor( const QColor& );
141 QColor getGroupQColor() const;
143 void setDefaultGroupColor();
145 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
146 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
147 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
148 int myTypeId; /* Current type id = radio button id */
149 int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
150 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
151 SVTK_Selector* mySelector;
153 QPushButton* myMeshGroupBtn;
154 QLineEdit* myMeshGroupLine;
156 QButtonGroup* myTypeGroup;
160 QButtonGroup* myGrpTypeGroup;
162 QStackedWidget* myWGStack;
163 QCheckBox* mySelectAll;
164 QLabel* myElementsLab;
165 QListWidget* myElements;
166 QPushButton* myFilter;
167 QPushButton* myAddBtn;
168 QPushButton* myRemoveBtn;
169 QPushButton* mySortBtn;
171 QGroupBox* mySelectBox;
172 QCheckBox* mySelectSubMesh;
173 QPushButton* mySubMeshBtn;
174 QLineEdit* mySubMeshLine;
175 QCheckBox* mySelectGroup;
176 QPushButton* myGroupBtn;
177 QLineEdit* myGroupLine;
179 QtxColorButton* myColorBtn;
181 QCheckBox* mySelectGeomGroup;
182 QToolButton* myGeomGroupBtn;
183 QLineEdit* myGeomGroupLine;
186 QPushButton* myOKBtn;
187 QPushButton* myApplyBtn;
188 QPushButton* myCloseBtn;
189 QPushButton* myHelpBtn;
191 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
193 SMESH::SMESH_Mesh_var myMesh;
194 QList<SMESH_Actor*> myActorsList;
195 SMESH::SMESH_Group_var myGroup;
196 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
198 GEOM::ListOfGO_var myGeomObjects;
201 //Handle(SMESH_TypeFilter) myMeshFilter;
202 //Handle(SMESH_TypeFilter) mySubMeshFilter;
203 //Handle(SMESH_TypeFilter) myGroupFilter;
204 SUIT_SelectionFilter* myMeshFilter;
205 SUIT_SelectionFilter* mySubMeshFilter;
206 SUIT_SelectionFilter* myGroupFilter;
207 SUIT_SelectionFilter* myGeomFilter;
209 SMESHGUI_FilterDlg* myFilterDlg;
211 bool myCreate, myIsBusy;
213 QString myHelpFileName;
215 QMap<QAction*, int> myActions;
217 bool myNameChanged; //added by skl for IPAL19574
220 #endif // SMESHGUI_GROUPDLG_H