Salome HOME
[MEDCalc] Introduce ProcessingController
[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
36 #include <SALOMEconfig.h>
37 #include CORBA_CLIENT_HEADER(MED_Gen)
38 #include CORBA_SERVER_HEADER(MEDPresentationManager)
39
40 class SalomeApp_Application;
41
42 /*!
43  * This class defines the gui of the MED module.
44  */
45 class MEDCALCGUI_EXPORT MEDModule: public SalomeApp_Module
46 {
47   Q_OBJECT
48
49   // ===========================================================
50   // This part implements the standard interface of a SALOME gui
51   // ===========================================================
52
53 public:
54   MEDModule();
55   ~MEDModule();
56
57   static MED_ORB::MED_Gen_var engine();
58
59   virtual void initialize(CAM_Application* app);
60   virtual QString engineIOR() const;
61
62   virtual QString iconName() const;
63
64   virtual void windows(QMap<int, int>& theMap) const;
65   virtual void viewManagers(QStringList& theList) const;
66
67   virtual void createPreferences();
68
69   int createStandardAction(const QString& label,
70                            QObject* slotobject,
71                            const char* slotmember,
72                            const QString& iconName,
73                            const QString& tooltip=QString());
74   void addActionInPopupMenu(int actionId,
75                             const QString& menus="",
76                             const QString& rule="client='ObjectBrowser'");
77
78   MEDCALC::MEDPresentationViewMode getSelectedViewMode();
79   MEDCALC::MEDPresentationColorMap getSelectedColorMap();
80
81   inline SALOME_AppStudyEditor* getStudyEditor() { return _studyEditor; }
82
83 public slots:
84   virtual bool activateModule(SUIT_Study* theStudy);
85   virtual bool deactivateModule(SUIT_Study* theStudy);
86
87 private:
88   void createModuleWidgets();
89   void createModuleActions();
90   static void init();
91
92 private:
93   SALOME_AppStudyEditor* _studyEditor;
94   DatasourceController* _datasourceController;
95   WorkspaceController* _workspaceController;
96   XmedDataModel* _xmedDataModel;
97   PresentationController* _presentationController;
98   ProcessingController* _processingController;
99   static MED_ORB::MED_Gen_var myEngine;
100 };
101
102 #endif