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 action (int theCommandID);
78 virtual bool OnGUIEvent (int theCommandID);
80 static QString GetDefaultName( const QString& );
82 // static ADAPT::ADAPT_Gen_var InitAdaptGen(SalomeApp_Application*);
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 void enterEvent( QEvent* );
131 void keyPressEvent( QKeyEvent* );
132 void setSelectionMode( int );
133 void updateButtons();
134 void updateGeomPopup();
135 bool SetAppropriateActor();
136 void setShowEntityMode();
137 void restoreShowEntityMode();
139 bool IsActorVisible( SMESH_Actor* );
141 void setGroupColor( const SALOMEDS::Color& );
142 SALOMEDS::Color getGroupColor() const;
144 void setGroupQColor( const QColor& );
145 QColor getGroupQColor() const;
146 void setDefaultName() const;
147 void setDefaultGroupColor();
149 void setIsApplyAndClose( const bool theFlag );
150 bool isApplyAndClose() const;
154 void recupPreferences();
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 //Handle(SMESH_TypeFilter) myMeshFilter;
215 //Handle(SMESH_TypeFilter) mySubMeshFilter;
216 //Handle(SMESH_TypeFilter) myGroupFilter;
217 SUIT_SelectionFilter* myMeshFilter;
218 SMESH_LogicalFilter* mySubMeshFilter;
219 SMESH_LogicalFilter* myGroupFilter;
220 SUIT_SelectionFilter* myGeomFilter;
222 SMESHGUI_FilterDlg* myFilterDlg;
224 bool myCreate, myIsBusy;
226 QString myHelpFileName;
228 QMap<QAction*, int> myActions;
230 bool myNameChanged; //added by skl for IPAL19574
231 int myNbChangesOfContents; // nb add's and remove's
233 QString myObjectToSelect;
234 bool myIsApplyAndClose;
237 QString _LanguageShort ;
246 #endif // SMESHGUI_ADAPTDLG_H