1 // Copyright (C) 2007-2016 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 // Author : Guillaume Boulant (EDF)
22 #ifndef _MED_MODULE_HXX_
23 #define _MED_MODULE_HXX_
26 #include "MEDCALCGUI.hxx"
28 #include <SalomeApp_Module.h>
29 #include <SALOME_AppStudyEditor.hxx>
31 #include "WorkspaceController.hxx"
32 #include "XmedDataModel.hxx"
33 #include "DatasourceController.hxx"
34 #include "PresentationController.hxx"
35 #include "ProcessingController.hxx"
36 #include "TestController.hxx"
38 #include <SALOMEconfig.h>
39 #include CORBA_CLIENT_HEADER(MED_Gen)
40 #include CORBA_SERVER_HEADER(MEDPresentationManager)
42 #include <QModelIndex>
44 class SalomeApp_Application;
45 class PVViewer_GUIElements;
46 class MEDPresentationManager_i;
49 * This class defines the gui of the MED module.
51 class MEDCALCGUI_EXPORT MEDModule: public SalomeApp_Module
55 // ===========================================================
56 // This part implements the standard interface of a SALOME gui
57 // ===========================================================
63 static MED_ORB::MED_Gen_var engine();
65 virtual void initialize(CAM_Application* app);
66 virtual QString engineIOR() const;
68 virtual QString iconName() const;
70 virtual void windows(QMap<int, int>& theMap) const;
71 virtual void viewManagers(QStringList& theList) const;
73 virtual void createPreferences();
75 int createStandardAction(const QString& label,
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'");
84 // MEDCALC::ViewModeType getSelectedViewMode() const;
85 // MEDCALC::ColorMapType getSelectedColorMap() const;
86 // MEDCALC::ScalarBarRangeType getSelectedScalarBarRange() const;
88 inline SALOME_AppStudyEditor* getStudyEditor() { return _studyEditor; }
89 void requestSALOMETermination() const;
91 bool itemClickGeneric(std::string& name, std::string& type, int& presId) const;
93 int getIntParamFromStudyEditor(SALOMEDS::SObject_var obj, const char* name);
96 void presentationSelected(int presId, const QString& presType, const QString& presName);
99 virtual bool activateModule(SUIT_Study* theStudy);
100 virtual bool deactivateModule(SUIT_Study* theStudy);
101 virtual void onDblClick(const QModelIndex& index);
102 virtual void onClick(const QModelIndex& index);
105 void createModuleWidgets();
106 void createModuleActions();
112 SALOME_AppStudyEditor* _studyEditor;
113 DatasourceController* _datasourceController;
114 WorkspaceController* _workspaceController;
115 XmedDataModel* _xmedDataModel;
116 PresentationController* _presentationController;
117 ProcessingController* _processingController;
119 PVViewer_GUIElements* _pvGuiElements;
121 static MED_ORB::MED_Gen_var _MED_engine;
123 #ifdef MED_HAS_QTTESTING
124 TestController * _testController;