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_ADAPTGUI.hxx"
48 #include CORBA_SERVER_HEADER(MG_ADAPT)
50 class SUIT_ViewWindow;
53 class SUIT_ResourceMgr;
57 class SALOMEDSClient_Study;
58 class SALOMEDSClient_SObject;
60 class SalomeApp_Study;
61 class SalomeApp_Module;
62 class LightApp_SelectionMgr;
63 class SUIT_SelectionFilter;
77 class QTreeWidgetItem;
86 #include <SALOMEconfig.h>
87 #include CORBA_SERVER_HEADER(SMESH_Mesh)
88 #include CORBA_SERVER_HEADER(SMESH_Gen)
90 class SMESHGUI_MgAdaptDlg;
91 class SMESHGUI_IdValidator;
92 class SMESHGUI_FilterDlg;
99 const SALOME_ListIO& selectedIO();
100 _PTR(Study) getStudy();
101 Handle(SALOME_InteractiveObject) firstIObject();
102 bool createAndPublishMed(QString fileName);
103 bool createMgAdaptObject(MgAdapt* myMgAdapt = 0);
106 class SMESHGUI_MG_ADAPTDRIVER : public SMESHGUI_MgAdaptDlg
111 SMESHGUI_MG_ADAPTDRIVER( SMESHGUI*, SMESH::MG_ADAPT_ptr, bool isCreation = true );
112 void setMyMesh(SMESH::SMESH_Mesh_var);
113 SMESH::SMESH_Mesh_var getMyMesh() ;
117 SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
118 LightApp_SelectionMgr* selMgr ;
119 SUIT_ResourceMgr* resMgr;
120 SUIT_ResourceMgr* resourceMgr();
121 LightApp_SelectionMgr* selectionMgr();
122 SMESH::SMESH_Mesh_var myMesh ;
126 void Init( bool = true );
127 void enterEvent( QEvent* ); /* mouse enter the QWidget */
128 void keyPressEvent( QKeyEvent* );
129 QString getErrorMsg( SMESH::string_array_var invalidEntries,
130 QStringList & entriesToBrowse );
133 bool createMeshInObjectBrowser();
134 void setIsApplyAndClose( const bool theFlag );
135 bool isApplyAndClose() const;
137 SMESHGUI_IdValidator* myIdValidator;
138 int myNbOkElements; /* to check when elements are defined */
140 SVTK_Selector* mySelector;
143 GEOM::GEOM_Object_var myNewGeometry;
144 //~SMESH_Actor* myActor; //
145 SUIT_SelectionFilter* myIdSourceFilter;
147 SMESH::SMESH_IDSource_var mySelectedObject;
149 QTabWidget* myTabWidget;
150 QButtonGroup* GroupConstructors;
152 QGroupBox* ConstructorsBox;
153 QGroupBox* GroupArguments;
154 QGroupBox* GroupButtons;
156 QPushButton* buttonOk;
157 QPushButton* buttonCancel;
158 QPushButton* buttonApply;
159 QPushButton* buttonHelp;
161 QLabel* myTextLabelElements;
163 QLineEdit* myLineEditElements;
164 QLineEdit* myMeshNameEdit;
165 QLineEdit* myGeomNameEdit;
166 QCheckBox* myIdSourceCheck;
167 QCheckBox* myCopyGroupsCheck;
168 QCheckBox* myReuseHypCheck;
169 QCheckBox* myCopyElementsCheck;
170 QCheckBox* myKeepIdsCheck;
172 QPushButton* myFilterBtn;
173 SMESHGUI_FilterDlg* myFilterDlg;
175 QString myHelpFileName;
177 bool myIsApplyAndClose;
179 QString inputMeshName;
180 QString outputMeshName;
182 void selectionChanged();
183 void updateSelection();
189 void exportMED(const char* );
191 virtual bool PushOnApply();
192 virtual void PushOnOK();
193 virtual void PushOnHelp();
195 void deactivateActiveDialog();
196 void activateThisDialog();
197 void onConstructor( int );
198 //~void onTextChange( const QString& );
199 //~void onSelectIdSource( bool );
210 #endif // SMESHGUI_MG_ADAPTDRIVER_H