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"
50 #include CORBA_SERVER_HEADER(MG_ADAPT)
52 class SUIT_ViewWindow;
55 class SUIT_ResourceMgr;
59 class SALOMEDSClient_Study;
60 class SALOMEDSClient_SObject;
62 class SalomeApp_Study;
63 class SalomeApp_Module;
64 class LightApp_SelectionMgr;
65 class SUIT_SelectionFilter;
79 class QTreeWidgetItem;
88 #include <SALOMEconfig.h>
89 #include CORBA_SERVER_HEADER(SMESH_Mesh)
90 #include CORBA_SERVER_HEADER(SMESH_Gen)
92 class SMESHGUI_MgAdaptDlg;
93 class SMESHGUI_IdValidator;
94 class SMESHGUI_FilterDlg;
101 const SALOME_ListIO& selectedIO();
102 _PTR(Study) getStudy();
103 Handle(SALOME_InteractiveObject) firstIObject();
104 bool createAndPublishMed(QString fileName);
105 bool createMgAdaptObject(MgAdapt* myMgAdapt = 0);
108 class SMESHGUI_MG_ADAPTDRIVER : public SMESHGUI_MgAdaptDlg
113 SMESHGUI_MG_ADAPTDRIVER( SMESHGUI*, SMESH::MG_ADAPT_ptr, bool isCreation = true );
114 void setMyMesh(SMESH::SMESH_Mesh_var);
115 SMESH::SMESH_Mesh_var getMyMesh() ;
119 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
120 LightApp_SelectionMgr* selMgr ;
121 SUIT_ResourceMgr* resMgr;
122 SUIT_ResourceMgr* resourceMgr();
123 LightApp_SelectionMgr* selectionMgr();
124 SMESH::SMESH_Mesh_var myMesh ;
128 void Init( bool = true );
129 void enterEvent( QEvent* ); /* mouse enter the QWidget */
130 void keyPressEvent( QKeyEvent* );
131 QString getErrorMsg( SMESH::string_array_var invalidEntries,
132 QStringList & entriesToBrowse );
135 bool createMeshInObjectBrowser();
136 void setIsApplyAndClose( const bool theFlag );
137 bool isApplyAndClose() const;
139 SMESHGUI_IdValidator* myIdValidator;
140 int myNbOkElements; /* to check when elements are defined */
142 SVTK_Selector* mySelector;
145 GEOM::GEOM_Object_var myNewGeometry;
146 //~SMESH_Actor* myActor; //
147 SUIT_SelectionFilter* myIdSourceFilter;
149 SMESH::SMESH_IDSource_var mySelectedObject;
151 QTabWidget* myTabWidget;
152 QButtonGroup* GroupConstructors;
154 QGroupBox* ConstructorsBox;
155 QGroupBox* GroupArguments;
156 QGroupBox* GroupButtons;
158 QPushButton* buttonOk;
159 QPushButton* buttonCancel;
160 QPushButton* buttonApply;
161 QPushButton* buttonHelp;
163 QLabel* myTextLabelElements;
165 QLineEdit* myLineEditElements;
166 QLineEdit* myMeshNameEdit;
167 QLineEdit* myGeomNameEdit;
168 QCheckBox* myIdSourceCheck;
169 QCheckBox* myCopyGroupsCheck;
170 QCheckBox* myReuseHypCheck;
171 QCheckBox* myCopyElementsCheck;
172 QCheckBox* myKeepIdsCheck;
174 QPushButton* myFilterBtn;
175 SMESHGUI_FilterDlg* myFilterDlg;
177 QString myHelpFileName;
179 bool myIsApplyAndClose;
181 QString inputMeshName;
182 QString outputMeshName;
184 void selectionChanged();
185 void updateSelection();
191 void exportMED(const char* );
193 virtual bool clickOnApply();
194 virtual void clickOnOk();
195 virtual void clickOnHelp();
196 //~void SelectionIntoArgument();
197 void deactivateActiveDialog();
198 void activateThisDialog();
199 void onConstructor( int );
200 //~void onTextChange( const QString& );
201 //~void onSelectIdSource( bool );
212 #endif // SMESHGUI_MG_ADAPTDRIVER_H