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 static QString GetDefaultName( const QString& );
84 virtual void reject();
87 void onTypeChanged( int );
88 void onGrpTypeChanged( int );
89 void onColorChanged( QColor );
95 void onVisibilityChanged();
97 void onListSelectionChanged();
98 void onObjectSelectionChanged();
101 void onSelectSubMesh( bool );
102 void onSelectGroup( bool );
103 void onSelectGeomGroup( bool );
104 void setCurrentSelection();
109 void onNameChanged( const QString& );
110 void onFilterAccepted();
112 void onGeomPopup( QAction* );
113 void onGeomSelectionButton( bool );
115 void onPublishShapeByMeshDlg( SUIT_Operation* );
116 void onCloseShapeByMeshDlg( SUIT_Operation* );
122 void initDialog( bool );
123 void init( SMESH::SMESH_Mesh_ptr );
124 void init( SMESH::SMESH_GroupBase_ptr );
125 void enterEvent( QEvent* );
126 void keyPressEvent( QKeyEvent* );
127 void setSelectionMode( int );
128 void updateButtons();
129 void updateGeomPopup();
130 bool SetAppropriateActor();
131 void setShowEntityMode();
132 void restoreShowEntityMode();
134 bool IsActorVisible( SMESH_Actor* );
136 void setGroupColor( const SALOMEDS::Color& );
137 SALOMEDS::Color getGroupColor() const;
139 void setGroupQColor( const QColor& );
140 QColor getGroupQColor() const;
141 void setDefaultName() const;
142 void setDefaultGroupColor();
144 void setIsApplyAndClose( const bool theFlag );
145 bool isApplyAndClose() const;
149 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
150 LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */
151 int myGrpTypeId; /* Current group type id : standalone or group on geometry */
152 int myTypeId; /* Current type id = radio button id */
153 int myStoredShownEntity; /* Store ShowEntity mode of myMesh */
154 QLineEdit* myCurrentLineEdit; /* Current LineEdit */
155 SVTK_Selector* mySelector;
157 QPushButton* myMeshGroupBtn;
158 QLineEdit* myMeshGroupLine;
160 QButtonGroup* myTypeGroup;
164 QButtonGroup* myGrpTypeGroup;
166 QStackedWidget* myWGStack;
167 QCheckBox* mySelectAll;
168 QCheckBox* myAllowElemsModif;
169 QLabel* myElementsLab;
170 QListWidget* myElements;
171 QPushButton* myFilterBtn;
172 QPushButton* myAddBtn;
173 QPushButton* myRemoveBtn;
174 QPushButton* mySortBtn;
176 QGroupBox* mySelectBox;
177 QCheckBox* mySelectSubMesh;
178 QPushButton* mySubMeshBtn;
179 QLineEdit* mySubMeshLine;
180 QCheckBox* mySelectGroup;
181 QPushButton* myGroupBtn;
182 QLineEdit* myGroupLine;
184 QtxColorButton* myColorBtn;
186 QCheckBox* mySelectGeomGroup;
187 QToolButton* myGeomGroupBtn;
188 QLineEdit* myGeomGroupLine;
191 QPushButton* myOKBtn;
192 QPushButton* myApplyBtn;
193 QPushButton* myCloseBtn;
194 QPushButton* myHelpBtn;
196 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
198 SMESH::SMESH_Mesh_var myMesh;
199 QList<SMESH_Actor*> myActorsList;
200 SMESH::SMESH_Group_var myGroup;
201 SMESH::SMESH_GroupOnGeom_var myGroupOnGeom;
202 SMESH::SMESH_GroupOnFilter_var myGroupOnFilter;
203 SMESH::Filter_var myFilter;
205 GEOM::ListOfGO_var myGeomObjects;
208 //Handle(SMESH_TypeFilter) myMeshFilter;
209 //Handle(SMESH_TypeFilter) mySubMeshFilter;
210 //Handle(SMESH_TypeFilter) myGroupFilter;
211 SUIT_SelectionFilter* myMeshFilter;
212 SMESH_LogicalFilter* mySubMeshFilter;
213 SMESH_LogicalFilter* myGroupFilter;
214 SUIT_SelectionFilter* myGeomFilter;
216 SMESHGUI_FilterDlg* myFilterDlg;
218 bool myCreate, myIsBusy;
220 QString myHelpFileName;
222 QMap<QAction*, int> myActions;
224 bool myNameChanged; //added by skl for IPAL19574
225 int myNbChangesOfContents; // nb add's and remove's
227 QString myObjectToSelect;
228 bool myIsApplyAndClose;
231 #endif // SMESHGUI_ADAPTDLG_H