1 // Copyright (C) 2007-2021 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, or (at your option) any later version.
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* );
127 void initDialog( bool );
128 void init( SMESH::SMESH_Mesh_ptr );
129 void init( SMESH::SMESH_GroupBase_ptr,
130 const bool theIsConvert = false );
131 void enterEvent( QEvent* );
132 void keyPressEvent( QKeyEvent* );
133 void setSelectionMode( int );
134 void updateButtons();
135 void updateGeomPopup();
136 bool SetAppropriateActor();
137 void setShowEntityMode();
138 void restoreShowEntityMode();
140 bool IsActorVisible( SMESH_Actor* );
142 void setGroupColor( const SALOMEDS::Color& );
143 SALOMEDS::Color getGroupColor() const;
145 void setGroupQColor( const QColor& );
146 QColor getGroupQColor() const;
147 void setDefaultName() const;
148 void setDefaultGroupColor();
150 void setIsApplyAndClose( const bool theFlag );
151 bool isApplyAndClose() const;
155 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
156 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
157 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
158 int myTypeId; /* Current type id = radio button id */
159 int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
160 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
161 SVTK_Selector* mySelector;
163 QPushButton* myMeshGroupBtn;
164 QLineEdit* myMeshGroupLine;
166 QButtonGroup* myTypeGroup;
170 QButtonGroup* myGrpTypeGroup;
172 QStackedWidget* myWGStack;
173 QCheckBox* mySelectAll;
174 QCheckBox* myAllowElemsModif;
175 QLabel* myElementsLab;
176 QListWidget* myElements;
177 QPushButton* myFilterBtn;
178 QPushButton* myAddBtn;
179 QPushButton* myRemoveBtn;
180 QPushButton* mySortBtn;
182 QGroupBox* mySelectBox;
183 QCheckBox* mySelectSubMesh;
184 QPushButton* mySubMeshBtn;
185 QLineEdit* mySubMeshLine;
186 QCheckBox* mySelectGroup;
187 QPushButton* myGroupBtn;
188 QLineEdit* myGroupLine;
190 QtxColorButton* myColorBtn;
192 QCheckBox* mySelectGeomGroup;
193 QToolButton* myGeomGroupBtn;
194 QLineEdit* myGeomGroupLine;
197 QPushButton* myOKBtn;
198 QPushButton* myApplyBtn;
199 QPushButton* myCloseBtn;
200 QPushButton* myHelpBtn;
202 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
204 SMESH::SMESH_Mesh_var myMesh;
205 QList<SMESH_Actor*> myActorsList;
206 SMESH::SMESH_Group_var myGroup;
207 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
208 SMESH::SMESH_GroupOnFilter_var myGroupOnFilter;
209 SMESH::Filter_var myFilter;
211 GEOM::ListOfGO_var myGeomObjects;
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