1 // Copyright (C) 2007-2015 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 DATASOURCE_CONTROLLER_H
23 #define DATASOURCE_CONTROLLER_H
25 #include <SALOMEconfig.h>
26 #include CORBA_CLIENT_HEADER(MEDDataManager)
27 #include <StandardApp_Module.hxx>
28 #include <SALOME_AppStudyEditor.hxx>
32 #include "XmedDataModel.hxx"
33 #include "DlgChangeUnderlyingMesh.hxx"
34 #include "DlgInterpolateField.hxx"
35 #include "MEDOPGUI.hxx"
37 // The DatasourceController defines data structures and classes to
38 // manage the usage of objects in the data space. The data space is
39 // technically the study, whose graphical representation is the
43 // A datasource event is used by the DatasourceController to notify a
44 // job to the Workspace controller (Qt signal/slot pattern connected
45 // by the main controller MEDOPModule). The setting of attributes and
46 // usage of these attributes in the WorkspaceController depends on the
47 // event type. For example, in the case of a IMPORT event, we just
48 // have to transmit the object, while in the USE event we have to
49 // transmit an object AND an alias.
53 EVENT_IMPORT_OBJECT, // Simply import the object in the workspace
54 EVENT_USE_OBJECT, // Import in the workspace AND define a proxy
55 // variable in the tui console to use it
56 EVENT_VIEW_OBJECT // View with a salome viewer (SMESH/VISU/PARAVIS)
59 XmedDataObject * objectdata;
64 // ==============================================================
65 // Datasource controller
66 // ==============================================================
68 class MEDOPGUI_EXPORT DatasourceController: public QObject {
72 DatasourceController(StandardApp_Module * salomeModule);
73 ~DatasourceController();
76 MEDOP::DatasourceHandler * addDatasource(const char * filename);
79 // Callback connected to dialog box validation signals
80 void OnChangeUnderlyingMeshInputValidated();
81 void OnInterpolateFieldInputValidated();
84 void datasourceSignal(const DatasourceEvent * event);
87 void OnAddDatasource();
88 void OnAddImagesource();
91 void OnUseInWorkspace();
92 void OnChangeUnderlyingMesh();
93 void OnInterpolateField();
97 StandardApp_Module * _salomeModule;
98 SALOME_AppStudyEditor * _studyEditor;
100 DlgChangeUnderlyingMesh * _dlgChangeUnderlyingMesh;
101 DlgInterpolateField * _dlgInterpolateField;