1 // Copyright (C) 2007-2013 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)
42 #include CORBA_SERVER_HEADER(SMESH_Filter)
57 class SMESHGUI_FilterDlg;
58 class SMESHGUI_ShapeByMeshOp;
62 class SUIT_SelectionFilter;
63 class LightApp_SelectionMgr;
64 class SMESH_LogicalFilter;
66 //=================================================================================
67 // class : SMESHGUI_GroupDlg
69 //=================================================================================
70 class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog
75 SMESHGUI_GroupDlg( SMESHGUI*,
76 SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
77 SMESHGUI_GroupDlg( SMESHGUI*,
78 SMESH::SMESH_GroupBase_ptr,
79 const bool theIsConvert = false );
82 static QString GetDefaultName( const QString& );
89 virtual void reject();
92 void onTypeChanged( int );
93 void onGrpTypeChanged( int );
94 void onColorChanged( QColor );
100 void onVisibilityChanged();
102 void onListSelectionChanged();
103 void onObjectSelectionChanged();
106 void onSelectSubMesh( bool );
107 void onSelectGroup( bool );
108 void onSelectGeomGroup( bool );
109 void setCurrentSelection();
114 void onNameChanged( const QString& );
115 void onFilterAccepted();
117 void onGeomPopup( QAction* );
118 void onGeomSelectionButton( bool );
120 void onPublishShapeByMeshDlg( SUIT_Operation* );
121 void onCloseShapeByMeshDlg( SUIT_Operation* );
124 void initDialog( bool );
125 void init( SMESH::SMESH_Mesh_ptr );
126 void init( SMESH::SMESH_GroupBase_ptr,
127 const bool theIsConvert = false );
128 void enterEvent( QEvent* );
129 void keyPressEvent( QKeyEvent* );
130 void setSelectionMode( int );
131 void updateButtons();
132 void updateGeomPopup();
133 bool SetAppropriateActor();
134 void setShowEntityMode();
135 void restoreShowEntityMode();
137 bool IsActorVisible( SMESH_Actor* );
139 void setGroupColor( const SALOMEDS::Color& );
140 SALOMEDS::Color getGroupColor() const;
142 void setGroupQColor( const QColor& );
143 QColor getGroupQColor() const;
144 void setDefaultName() const;
145 void setDefaultGroupColor();
147 void setIsApplyAndClose( const bool theFlag );
148 bool isApplyAndClose() const;
152 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
153 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
154 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
155 int myTypeId; /* Current type id = radio button id */
156 int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
157 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
158 SVTK_Selector* mySelector;
160 QPushButton* myMeshGroupBtn;
161 QLineEdit* myMeshGroupLine;
163 QButtonGroup* myTypeGroup;
167 QButtonGroup* myGrpTypeGroup;
169 QStackedWidget* myWGStack;
170 QCheckBox* mySelectAll;
171 QCheckBox* myAllowElemsModif;
172 QLabel* myElementsLab;
173 QListWidget* myElements;
174 QPushButton* myFilterBtn;
175 QPushButton* myAddBtn;
176 QPushButton* myRemoveBtn;
177 QPushButton* mySortBtn;
179 QGroupBox* mySelectBox;
180 QCheckBox* mySelectSubMesh;
181 QPushButton* mySubMeshBtn;
182 QLineEdit* mySubMeshLine;
183 QCheckBox* mySelectGroup;
184 QPushButton* myGroupBtn;
185 QLineEdit* myGroupLine;
187 QtxColorButton* myColorBtn;
189 QCheckBox* mySelectGeomGroup;
190 QToolButton* myGeomGroupBtn;
191 QLineEdit* myGeomGroupLine;
194 QPushButton* myOKBtn;
195 QPushButton* myApplyBtn;
196 QPushButton* myCloseBtn;
197 QPushButton* myHelpBtn;
199 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
201 SMESH::SMESH_Mesh_var myMesh;
202 QList<SMESH_Actor*> myActorsList;
203 SMESH::SMESH_Group_var myGroup;
204 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
205 SMESH::SMESH_GroupOnFilter_var myGroupOnFilter;
206 SMESH::Filter_var myFilter;
208 GEOM::ListOfGO_var myGeomObjects;
211 //Handle(SMESH_TypeFilter) myMeshFilter;
212 //Handle(SMESH_TypeFilter) mySubMeshFilter;
213 //Handle(SMESH_TypeFilter) myGroupFilter;
214 SUIT_SelectionFilter* myMeshFilter;
215 SMESH_LogicalFilter* mySubMeshFilter;
216 SMESH_LogicalFilter* myGroupFilter;
217 SUIT_SelectionFilter* myGeomFilter;
219 SMESHGUI_FilterDlg* myFilterDlg;
221 bool myCreate, myIsBusy;
223 QString myHelpFileName;
225 QMap<QAction*, int> myActions;
227 bool myNameChanged; //added by skl for IPAL19574
228 int myNbChangesOfContents; // nb add's and remove's
230 QString myObjectToSelect;
231 bool myIsApplyAndClose;
234 #endif // SMESHGUI_GROUPDLG_H