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 "MEDEventListener_i.hxx"
26 #include <SALOMEconfig.h>
27 #include CORBA_CLIENT_HEADER(MEDDataManager)
28 #include <StandardApp_Module.hxx>
29 #include <SALOME_AppStudyEditor.hxx>
33 #include "XmedDataModel.hxx"
34 #include "DlgChangeUnderlyingMesh.hxx"
35 #include "DlgInterpolateField.hxx"
36 #include "MEDCALCGUI.hxx"
38 // The DatasourceController defines data structures and classes to
39 // manage the usage of objects in the data space. The data space is
40 // technically the study, whose graphical representation is the
44 // A datasource event is used by the DatasourceController to notify a
45 // job to the Workspace controller (Qt signal/slot pattern connected
46 // by the main controller MEDModule). The setting of attributes and
47 // usage of these attributes in the WorkspaceController depends on the
48 // event type. For example, in the case of a IMPORT event, we just
49 // have to transmit the object, while in the USE event we have to
50 // transmit an object AND an alias.
54 EVENT_IMPORT_OBJECT, // Simply import the object in the workspace
55 EVENT_USE_OBJECT, // Import in the workspace AND define a proxy
56 // variable in the tui console to use it
57 EVENT_VIEW_OBJECT_SCALAR_MAP,
58 // these ones forward actions to workspace (and then to python console)
60 EVENT_ADD_IMAGE_AS_DATASOURCE
63 XmedDataObject * objectdata;
68 // ==============================================================
69 // Datasource controller
70 // ==============================================================
72 class MEDCALCGUI_EXPORT DatasourceController: public QObject {
76 DatasourceController(StandardApp_Module * salomeModule);
77 ~DatasourceController();
82 // Callback connected to dialog box validation signals
83 void OnChangeUnderlyingMeshInputValidated();
84 void OnInterpolateFieldInputValidated();
85 void processWorkspaceEvent(const MEDCALC::MedEvent * event);
88 void datasourceSignal(const DatasourceEvent * event);
91 void OnAddDatasource();
92 void OnAddImagesource();
94 void OnVisualizeScalarMap();
95 void OnUseInWorkspace();
96 void OnChangeUnderlyingMesh();
97 void OnInterpolateField();
100 void visualize(DatasourceEvent::EventType);
101 void addDatasource(const char* filename);
102 void updateTreeViewWithNewDatasource(const MEDCALC::DatasourceHandler*);
105 StandardApp_Module * _salomeModule;
106 SALOME_AppStudyEditor * _studyEditor;
108 DlgChangeUnderlyingMesh * _dlgChangeUnderlyingMesh;
109 DlgInterpolateField * _dlgInterpolateField;