Salome HOME
Typo-fix by Kunda
[modules/med.git] / src / MEDCalc / gui / MEDModule.hxx
1 // Copyright (C) 2007-2020  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 <Python.h>
26 #include "MEDCALCGUI.hxx"
27
28 #include <SalomeApp_Module.h>
29 #include <SALOME_AppStudyEditor.hxx>
30
31 #include "WorkspaceController.hxx"
32 #include "XmedDataModel.hxx"
33 #include "DatasourceController.hxx"
34 #include "PresentationController.hxx"
35 #include "ProcessingController.hxx"
36 #include "TestController.hxx"
37
38 #include <SALOMEconfig.h>
39 #include CORBA_CLIENT_HEADER(MED_Gen)
40 #include CORBA_SERVER_HEADER(MEDPresentationManager)
41
42 #include <QModelIndex>
43
44 class SalomeApp_Application;
45 class PVViewer_GUIElements;
46 class MEDPresentationManager_i;
47
48 /*!
49  * This class defines the gui of the MED module.
50  */
51 class MEDCALCGUI_EXPORT MEDModule: public SalomeApp_Module
52 {
53   Q_OBJECT
54
55   // ===========================================================
56   // This part implements the standard interface of a SALOME gui
57   // ===========================================================
58
59 public:
60   MEDModule();
61   ~MEDModule();
62
63   static MED_ORB::MED_Gen_var engine();
64
65   virtual void initialize(CAM_Application* app);
66   virtual QString engineIOR() const;
67
68   virtual QString iconName() const;
69
70   virtual void windows(QMap<int, int>& theMap) const;
71   virtual void viewManagers(QStringList& theList) const;
72
73   virtual void createPreferences();
74
75   int createStandardAction(const QString& label,
76                            QObject* slotobject,
77                            const char* slotmember,
78                            const QString& iconName,
79                            const QString& tooltip=QString());
80   void addActionInPopupMenu(int actionId,
81                             const QString& menus="",
82                             const QString& rule="client='ObjectBrowser'");
83
84 //  MEDCALC::ViewModeType getSelectedViewMode() const;
85 //  MEDCALC::ColorMapType getSelectedColorMap() const;
86 //  MEDCALC::ScalarBarRangeType getSelectedScalarBarRange() const;
87
88   inline SALOME_AppStudyEditor* getStudyEditor() { return _studyEditor; }
89   void requestSALOMETermination() const;
90
91   bool itemClickGeneric(std::string& name, std::string& type, int& presId) const;
92
93   int getIntParamFromStudyEditor(SALOMEDS::SObject_var obj, const char* name);
94
95   double getCurrentAnimationTimestamp();
96
97 signals:
98   void presentationSelected(int presId, const QString& presType, const QString& presName);
99
100 public slots:
101   virtual bool activateModule(SUIT_Study* theStudy);
102   virtual bool deactivateModule(SUIT_Study* theStudy);
103   virtual void onDblClick(const QModelIndex& index);
104   virtual void onClick(const QModelIndex& index);
105
106 private:
107   void createModuleWidgets();
108   void createModuleActions();
109   void initToolbars();
110
111   static void init();
112
113 private:
114   SALOME_AppStudyEditor* _studyEditor;
115   DatasourceController* _datasourceController;
116   WorkspaceController* _workspaceController;
117   XmedDataModel* _xmedDataModel;
118   PresentationController* _presentationController;
119   ProcessingController* _processingController;
120
121   PVViewer_GUIElements*   _pvGuiElements;
122
123   static MED_ORB::MED_Gen_var _MED_engine;
124
125 #ifdef MED_HAS_QTTESTING
126   TestController * _testController;
127 #endif
128 };
129
130 #endif