Salome HOME
Copyright update 2022
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MG_ADAPTDRIVER.h
1 // Copyright (C) 2020-2022  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef SMESHGUI_MG_ADAPTDRIVER_H
21 #define SMESHGUI_MG_ADAPTDRIVER_H
22
23 #include "SMESH_SMESHGUI.hxx"
24
25 // model
26 #include "SMESHGUI_MgAdaptDlg.h"
27
28 // IDL includes
29 #include <SALOMEconfig.h>
30 #include CORBA_SERVER_HEADER(SMESH_Mesh)
31 #include CORBA_SERVER_HEADER(MG_ADAPT)
32
33 class SMESHGUI;
34 class LightApp_SelectionMgr;
35 //class MgAdapt;
36
37 // int IObjectCount();
38 // const SALOME_ListIO& selectedIO();
39 // _PTR(Study) getStudy();
40 // Handle(SALOME_InteractiveObject) firstIObject();
41 // bool createAndPublishMed(QString fileName);
42 // bool createMgAdaptObject(MgAdapt* myMgAdapt = 0);
43
44
45 class  SMESHGUI_MG_ADAPTDRIVER : public SMESHGUI_MgAdaptDlg
46 {
47     Q_OBJECT
48
49 public :
50     SMESHGUI_MG_ADAPTDRIVER( SMESHGUI*, SMESH::MG_ADAPT_ptr, bool isCreation = true );
51     void setMyMesh(SMESH::SMESH_Mesh_var);
52     SMESH::SMESH_Mesh_var getMyMesh() ;
53
54 private :
55
56     SMESHGUI*              mySMESHGUI;              /* Current SMESHGUI object */
57     LightApp_SelectionMgr* selMgr ;
58     LightApp_SelectionMgr* selectionMgr();
59     SMESH::SMESH_Mesh_var  myMesh ;
60     bool                   myIsApplyAndClose;
61
62     void                   enterEvent( QEvent* );           /* mouse enter the QWidget */
63     void                   keyPressEvent( QKeyEvent* );
64
65     bool                   isValid();
66     bool                   createMeshInObjectBrowser();
67     void                   setIsApplyAndClose( const bool theFlag );
68     bool                   isApplyAndClose() const;
69     bool                   execute();
70
71
72 private slots:
73     void selectionChanged();
74     void updateSelection();
75
76 protected slots :
77
78 private slots:
79
80     void exportMED(const char* );
81
82     virtual bool PushOnApply();
83     virtual void PushOnOK();
84     virtual void PushOnHelp();
85
86     void         deactivateActiveDialog();
87     void         activateThisDialog();
88 };
89
90 #endif // SMESHGUI_MG_ADAPTDRIVER_H