1 // Copyright (C) 2011-2020 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // SMESH SMESHGUI : GUI for the adaptation in the SMESH component
21 // File : SMESHGUI_AdaptDlg.h
22 // Author : Gérald NICOLAS, EDF
24 #ifndef SMESHGUI_ADAPTDLG_H
25 #define SMESHGUI_ADAPTDLG_H
28 #include "SMESH_SMESHGUI.hxx"
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SMESH_Mesh)
38 #include CORBA_SERVER_HEADER(SMESH_Group)
39 #include CORBA_SERVER_HEADER(SMESH_Filter)
54 class SMESHGUI_FilterDlg;
55 class SMESHGUI_ShapeByMeshOp;
59 class SUIT_SelectionFilter;
60 class LightApp_SelectionMgr;
61 class SMESH_LogicalFilter;
63 //=================================================================================
64 // class : SMESHGUI_AdaptDlg
66 //=================================================================================
67 class SMESHGUI_EXPORT SMESHGUI_AdaptDlg : public QDialog
72 SMESHGUI_AdaptDlg( SMESHGUI*,
74 SMESH::SMESH_Mesh_ptr = SMESH::SMESH_Mesh::_nil() );
77 virtual bool OnGUIEvent (int theCommandID);
79 static QString GetDefaultName( const QString& );
86 virtual void reject();
89 void onTypeChanged( int );
90 void onGrpTypeChanged( int );
91 void onColorChanged( QColor );
97 void onVisibilityChanged();
99 void onListSelectionChanged();
100 void onObjectSelectionChanged();
103 void onSelectSubMesh( bool );
104 void onSelectGroup( bool );
105 void onSelectGeomGroup( bool );
106 void setCurrentSelection();
111 void onNameChanged( const QString& );
112 void onFilterAccepted();
114 void onGeomPopup( QAction* );
115 void onGeomSelectionButton( bool );
117 void onPublishShapeByMeshDlg( SUIT_Operation* );
118 void onCloseShapeByMeshDlg( SUIT_Operation* );
124 void initDialog( bool );
125 void init( SMESH::SMESH_Mesh_ptr );
126 void init( SMESH::SMESH_GroupBase_ptr );
127 void enterEvent( QEvent* );
128 void keyPressEvent( QKeyEvent* );
129 void setSelectionMode( int );
130 void updateButtons();
131 void updateGeomPopup();
132 bool SetAppropriateActor();
133 void setShowEntityMode();
134 void restoreShowEntityMode();
136 bool IsActorVisible( SMESH_Actor* );
138 void setGroupColor( const SALOMEDS::Color& );
139 SALOMEDS::Color getGroupColor() const;
141 void setGroupQColor( const QColor& );
142 QColor getGroupQColor() const;
143 void setDefaultName() const;
144 void setDefaultGroupColor();
146 void setIsApplyAndClose( const bool theFlag );
147 bool isApplyAndClose() const;
151 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
152 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
153 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
154 int myTypeId; /* Current type id = radio button id */
155 int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
156 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
157 SVTK_Selector* mySelector;
159 QPushButton* myMeshGroupBtn;
160 QLineEdit* myMeshGroupLine;
162 QButtonGroup* myTypeGroup;
166 QButtonGroup* myGrpTypeGroup;
168 QStackedWidget* myWGStack;
169 QCheckBox* mySelectAll;
170 QCheckBox* myAllowElemsModif;
171 QLabel* myElementsLab;
172 QListWidget* myElements;
173 QPushButton* myFilterBtn;
174 QPushButton* myAddBtn;
175 QPushButton* myRemoveBtn;
176 QPushButton* mySortBtn;
178 QGroupBox* mySelectBox;
179 QCheckBox* mySelectSubMesh;
180 QPushButton* mySubMeshBtn;
181 QLineEdit* mySubMeshLine;
182 QCheckBox* mySelectGroup;
183 QPushButton* myGroupBtn;
184 QLineEdit* myGroupLine;
186 QtxColorButton* myColorBtn;
188 QCheckBox* mySelectGeomGroup;
189 QToolButton* myGeomGroupBtn;
190 QLineEdit* myGeomGroupLine;
193 QPushButton* myOKBtn;
194 QPushButton* myApplyBtn;
195 QPushButton* myCloseBtn;
196 QPushButton* myHelpBtn;
198 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
200 SMESH::SMESH_Mesh_var myMesh;
201 QList<SMESH_Actor*> myActorsList;
202 SMESH::SMESH_Group_var myGroup;
203 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
204 SMESH::SMESH_GroupOnFilter_var myGroupOnFilter;
205 SMESH::Filter_var myFilter;
207 GEOM::ListOfGO_var myGeomObjects;
210 //Handle(SMESH_TypeFilter) myMeshFilter;
211 //Handle(SMESH_TypeFilter) mySubMeshFilter;
212 //Handle(SMESH_TypeFilter) myGroupFilter;
213 SUIT_SelectionFilter* myMeshFilter;
214 SMESH_LogicalFilter* mySubMeshFilter;
215 SMESH_LogicalFilter* myGroupFilter;
216 SUIT_SelectionFilter* myGeomFilter;
218 SMESHGUI_FilterDlg* myFilterDlg;
220 bool myCreate, myIsBusy;
222 QString myHelpFileName;
224 QMap<QAction*, int> myActions;
226 bool myNameChanged; //added by skl for IPAL19574
227 int myNbChangesOfContents; // nb add's and remove's
229 QString myObjectToSelect;
230 bool myIsApplyAndClose;
233 #endif // SMESHGUI_ADAPTDLG_H