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_MG_ADAPTDRIVER.h
23 #ifndef SMESHGUI_MG_ADAPTDRIVER_H
24 #define SMESHGUI_MG_ADAPTDRIVER_H
28 #include "SMESH_SMESHGUI.hxx"
32 #include <QTreeWidget>
33 #include<QItemDelegate>
37 #include "LightApp_DataOwner.h"
38 #include "SalomeApp_Application.h"
39 #include <SALOMEconfig.h>
40 #include <SALOME_ListIO.hxx>
41 #include "SalomeApp_Module.h"
42 #include "SalomeApp_Study.h"
46 //~#include "MG_ADAPT.h"
47 #include "MG_ADAPTGUI.hxx"
48 #include "MG_ADAPT.hxx"
51 class SUIT_ViewWindow;
54 class SUIT_ResourceMgr;
58 class SALOMEDSClient_Study;
59 class SALOMEDSClient_SObject;
61 class SalomeApp_Study;
62 class SalomeApp_Module;
63 class LightApp_SelectionMgr;
64 class SUIT_SelectionFilter;
78 class QTreeWidgetItem;
87 #include <SALOMEconfig.h>
88 #include CORBA_SERVER_HEADER(SMESH_Mesh)
89 #include CORBA_SERVER_HEADER(SMESH_Gen)
91 class SMESHGUI_MgAdaptDlg;
92 class SMESHGUI_IdValidator;
93 class SMESHGUI_FilterDlg;
100 const SALOME_ListIO& selectedIO();
101 _PTR(Study) getStudy();
102 Handle(SALOME_InteractiveObject) firstIObject();
103 bool createAndPublishMed(QString fileName);
104 bool createMgAdaptObject(MgAdapt* myMgAdapt = 0);
106 class SMESHGUI_EXPORT SMESHGUI_MG_AdaptComputeDlg_QThread : public QThread
111 SMESHGUI_MG_AdaptComputeDlg_QThread(MgAdapt* model);
123 class SMESHGUI_MG_ADAPTDRIVER : public SMESHGUI_MgAdaptDlg
128 SMESHGUI_MG_ADAPTDRIVER( SMESHGUI*, MgAdapt*, bool isCreation = true );
129 void setMyMesh(SMESH::SMESH_Mesh_var);
130 SMESH::SMESH_Mesh_var getMyMesh() ;
134 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
135 LightApp_SelectionMgr* selMgr ;
136 SUIT_ResourceMgr* resMgr;
137 SUIT_ResourceMgr* resourceMgr();
138 LightApp_SelectionMgr* selectionMgr();
139 SMESH::SMESH_Mesh_var myMesh ;
143 void Init( bool = true );
144 void enterEvent( QEvent* ); /* mouse enter the QWidget */
145 void keyPressEvent( QKeyEvent* );
146 QString getErrorMsg( SMESH::string_array_var invalidEntries,
147 QStringList & entriesToBrowse );
150 bool createMeshInObjectBrowser();
151 void setIsApplyAndClose( const bool theFlag );
152 bool isApplyAndClose() const;
154 SMESHGUI_IdValidator* myIdValidator;
155 int myNbOkElements; /* to check when elements are defined */
157 SVTK_Selector* mySelector;
160 GEOM::GEOM_Object_var myNewGeometry;
161 //~SMESH_Actor* myActor; //
162 SUIT_SelectionFilter* myIdSourceFilter;
164 SMESH::SMESH_IDSource_var mySelectedObject;
166 QTabWidget* myTabWidget;
167 QButtonGroup* GroupConstructors;
169 QGroupBox* ConstructorsBox;
170 QGroupBox* GroupArguments;
171 QGroupBox* GroupButtons;
173 QPushButton* buttonOk;
174 QPushButton* buttonCancel;
175 QPushButton* buttonApply;
176 QPushButton* buttonHelp;
178 QLabel* myTextLabelElements;
180 QLineEdit* myLineEditElements;
181 QLineEdit* myMeshNameEdit;
182 QLineEdit* myGeomNameEdit;
183 QCheckBox* myIdSourceCheck;
184 QCheckBox* myCopyGroupsCheck;
185 QCheckBox* myReuseHypCheck;
186 QCheckBox* myCopyElementsCheck;
187 QCheckBox* myKeepIdsCheck;
189 QPushButton* myFilterBtn;
190 SMESHGUI_FilterDlg* myFilterDlg;
192 QString myHelpFileName;
194 bool myIsApplyAndClose;
196 QString inputMeshName;
197 QString outputMeshName;
199 void selectionChanged();
200 void updateSelection();
206 void exportMED(const char* );
208 virtual bool clickOnApply();
209 virtual void clickOnOk();
210 virtual void clickOnHelp();
211 //~void SelectionIntoArgument();
212 void deactivateActiveDialog();
213 void activateThisDialog();
214 void onConstructor( int );
215 //~void onTextChange( const QString& );
216 //~void onSelectIdSource( bool );
227 #endif // SMESHGUI_MG_ADAPTDRIVER_H