1 // Copyright (C) 2007-2013 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.
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 "MEDOPGUI.hxx"
36 // The DatasourceController defines data structures and classes to
37 // manage the usage of objects in the data space. The data space is
38 // technically the study, whose graphical representation is the
42 // A datasource event is used by the DatasourceController to notify a
43 // job to the Workspace controller (Qt signal/slot pattern connected
44 // by the main controller MEDOPModule). The setting of attributes and
45 // usage of these attributes in the WorkspaceController depends on the
46 // event type. For example, in the case of a IMPORT event, we just
47 // have to transmit the object, while in the USE event we have to
48 // transmit an object AND an alias.
52 EVENT_IMPORT_OBJECT, // Simply import the object in the workspace
53 EVENT_USE_OBJECT, // Import in the workspace AND define a proxy
54 // variable in the tui console to use it
55 EVENT_VIEW_OBJECT // View with a salome viewer (SMESH/VISU/PARAVIS)
58 XmedDataObject * objectdata;
63 // ==============================================================
64 // Datasource controller
65 // ==============================================================
67 class MEDOPGUI_EXPORT DatasourceController: public QObject {
71 DatasourceController(StandardApp_Module * salomeModule);
72 ~DatasourceController();
75 MEDOP::DatasourceHandler * addDatasource(const char * filename);
78 // Callback connected to dialog box validation signals
79 void OnChangeUnderlyingMeshInputValidated();
82 void datasourceSignal(const DatasourceEvent * event);
85 void OnAddDatasource();
86 void OnAddImagesource();
89 void OnUseInWorkspace();
90 void OnChangeUnderlyingMesh();
94 StandardApp_Module * _salomeModule;
95 SALOME_AppStudyEditor * _studyEditor;
97 DlgChangeUnderlyingMesh * _dlgChangeUnderlyingMesh;