Salome HOME
datasource load from gui relies on tui
[modules/med.git] / idl / MEDDataManager.idl
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // Authors : Guillaume Boulant (EDF) - 01/06/2011
24
25 #ifndef _MED_DATAMANAGER_IDL_
26 #define _MED_DATAMANAGER_IDL_
27
28 #include "SALOME_GenericObj.idl"
29 #include "SALOME_Exception.idl"
30
31 module MEDOP
32 {
33   struct DatasourceHandler {
34     long id;
35     string name;
36     string uri;
37     // The source could be a filepath or the ior of a field servant
38   };
39
40   struct MeshHandler {
41     long id;
42     string name;
43     long sourceid;
44   };
45   typedef sequence<MeshHandler> MeshHandlerList;
46
47   /**
48    * The Fieldseries is a virtal object that does not exist in the MED
49    * data model (at least in the MEDCoupling data model). It is just a
50    * point that aggregate a list of fields that relie on the same mesh
51    * with the same type (the fields in a timeseries differ by their
52    * time step).
53    *
54    * Then you could have a field with no fieldseries associated but
55    * directly associated to a mesh. That is typically the case of
56    * fields created by MED operations: if you operate tow fields
57    * coming from 2 different timeseries (and relying on the same
58    * mesh), you obtain a field that can not be associate to the
59    * original timeseries. Then this new created field must be directly
60    * associated to its underlying mesh (as defined in the MEDCoupling
61    * data model).
62    *
63    * In conclusion, the fieldseries is a facilities for data
64    * management but must not be a structuration of the data model. The
65    * association is not:
66    *
67    *   field->fieldseries->mesh
68    *
69    * but:
70    *
71    *   field->fieldseries (optional)
72    *        ->mesh        (mandatory)
73    *
74    * and:
75    *
76    *   fieldseries->mesh  (mandatory)
77    */
78   struct FieldseriesHandler {
79     long id;
80     string name;
81     long   type;
82     long   meshid;
83     long   nbIter;
84   };
85   typedef sequence<FieldseriesHandler> FieldseriesHandlerList;
86
87   // The FieldHandler structure is a lightweigth data structure that
88   // represents a single field (as understood in MEDCoupling model).
89   struct FieldHandler {
90     long   id;
91     long   fieldseriesId;
92     string fieldname; // @warn : if fieldseriesId then get from fieldseries->name
93     string meshname;  // @deprecated: replace by meshid and get from mesh->name
94     long   meshid;
95     long   type;      // @warn : if fieldseriesId then get from fieldseries->type
96     long   iteration;
97     long   order;
98     string source;    // @deprecated : get from mesh->datasource->uri
99   };
100
101   typedef sequence<FieldHandler> FieldHandlerList;
102   typedef sequence<long> FieldIdList;
103
104   struct InterpolationParameters {
105     double precision;
106     double defaultValue;
107     boolean reverse;
108     string method;
109     string nature;
110     string intersectionType;
111   };
112
113   interface MEDDataManager: SALOME::GenericObj
114   {
115
116     //==========================================================
117     // Datasource management
118     //==========================================================
119     DatasourceHandler loadDatasource(in string filepath);
120     DatasourceHandler getDatasourceHandler(in string filepath);
121
122     //==========================================================
123     // Mesh data management
124     //==========================================================
125
126     MeshHandler     getMesh(in long meshId) raises (SALOME::SALOME_Exception);
127     MeshHandlerList getMeshList(in long datasourceId);
128
129     //==========================================================
130     // Field data management
131     //==========================================================
132     FieldseriesHandlerList getFieldseriesListOnMesh(in long meshId);
133     FieldHandlerList getFieldListInFieldseries(in long fieldseriesId);
134
135     FieldHandler     getFieldHandler(in long fieldHandlerId);
136     FieldHandlerList getFieldHandlerList();
137     // __GBO__ Maybe it could be usefull to define a getFieldHandlerList with a datasourceId in argument
138     string           getFieldRepresentation(in long fieldHandlerId);
139
140     // Persistency management
141     void             saveFields(in string filepath, in FieldIdList list)
142       raises (SALOME::SALOME_Exception);
143     void             markAsPersistent(in long fieldHandlerId, in boolean persistent);
144     void             savePersistentFields(in string filepath)
145       raises (SALOME::SALOME_Exception);
146
147
148     void updateFieldMetadata(in long   fieldHandlerId,
149                              in string fieldname,
150                              in long   iteration,
151                              in long   order,
152                              in string source);
153
154     //void saveFields(in FieldHandlerList fieldHandlerList, in string filepath);
155
156     void changeUnderlyingMesh(in long fieldHandlerId, in long meshHandlerId)
157       raises (SALOME::SALOME_Exception);
158
159     FieldHandler interpolateField(in long fieldHandlerId, in long meshHandlerId, in InterpolationParameters params)
160       raises (SALOME::SALOME_Exception);
161
162     //==========================================================
163     // General purpose data management
164     //==========================================================
165     void   setEventListenerIOR(in string ior);
166     string getEventListenerIOR() raises (SALOME::SALOME_Exception);
167
168     // Print out server data
169     void serverlog();
170   };
171 };
172
173 #endif // _MED_DATAMANAGER_IDL_