]> SALOME platform Git repositories - modules/med.git/blob - src/MEDCalc/gui/MEDModule.hxx
Salome HOME
[salome test] connect MEDCalc tests
[modules/med.git] / src / MEDCalc / gui / MEDModule.hxx
1 // Copyright (C) 2007-2016  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 // Author : Guillaume Boulant (EDF)
21
22 #ifndef _MED_MODULE_HXX_
23 #define _MED_MODULE_HXX_
24
25 #include "MEDCALCGUI.hxx"
26
27 #include <SalomeApp_Module.h>
28 #include <SALOME_AppStudyEditor.hxx>
29
30 #include "WorkspaceController.hxx"
31 #include "XmedDataModel.hxx"
32 #include "DatasourceController.hxx"
33 #include "PresentationController.hxx"
34 #include "ProcessingController.hxx"
35 #include "TestController.hxx"
36
37 #include <SALOMEconfig.h>
38 #include CORBA_CLIENT_HEADER(MED_Gen)
39 #include CORBA_SERVER_HEADER(MEDPresentationManager)
40
41 #include <QModelIndex>
42
43 class SalomeApp_Application;
44
45 /*!
46  * This class defines the gui of the MED module.
47  */
48 class MEDCALCGUI_EXPORT MEDModule: public SalomeApp_Module
49 {
50   Q_OBJECT
51
52   // ===========================================================
53   // This part implements the standard interface of a SALOME gui
54   // ===========================================================
55
56 public:
57   MEDModule();
58   ~MEDModule();
59
60   static MED_ORB::MED_Gen_var engine();
61
62   virtual void initialize(CAM_Application* app);
63   virtual QString engineIOR() const;
64
65   virtual QString iconName() const;
66
67   virtual void windows(QMap<int, int>& theMap) const;
68   virtual void viewManagers(QStringList& theList) const;
69
70   virtual void createPreferences();
71
72   int createStandardAction(const QString& label,
73                            QObject* slotobject,
74                            const char* slotmember,
75                            const QString& iconName,
76                            const QString& tooltip=QString());
77   void addActionInPopupMenu(int actionId,
78                             const QString& menus="",
79                             const QString& rule="client='ObjectBrowser'");
80
81   MEDCALC::MEDPresentationViewMode getSelectedViewMode();
82   MEDCALC::MEDPresentationColorMap getSelectedColorMap();
83
84   inline SALOME_AppStudyEditor* getStudyEditor() { return _studyEditor; }
85
86   void requestSALOMETermination() const;
87
88 //  bool hasMainEventLoopStarted() const;
89
90 public slots:
91   virtual bool activateModule(SUIT_Study* theStudy);
92   virtual bool deactivateModule(SUIT_Study* theStudy);
93   virtual void onDblClick(const QModelIndex& index);
94
95 private:
96   void createModuleWidgets();
97   void createModuleActions();
98
99   static void init();
100
101 private:
102   SALOME_AppStudyEditor* _studyEditor;
103   DatasourceController* _datasourceController;
104   WorkspaceController* _workspaceController;
105   XmedDataModel* _xmedDataModel;
106   PresentationController* _presentationController;
107   ProcessingController* _processingController;
108 #ifdef MED_HAS_QTTESTING
109   TestController * _testController;
110 #endif
111   static MED_ORB::MED_Gen_var myEngine;
112 };
113
114 #endif