Salome HOME
Typo-fix by Kunda
[modules/med.git] / idl / MEDDataManager.idl
1 // Copyright (C) 2007-2020  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 MEDCALC
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 virtual 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 aggregates a list of fields that rely 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 two fields
57    * coming from 2 different timeseries (and relying on the same
58    * mesh), you obtain a field that can not be associated 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 lightweight 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     DatasourceHandler getDatasourceHandlerFromID(in long sourceid);
122
123     //==========================================================
124     // Mesh data management
125     //==========================================================
126
127     MeshHandler     getMeshHandler(in long meshId) raises (SALOME::SALOME_Exception);
128     MeshHandlerList getMeshHandlerList(in long datasourceId);
129
130     //==========================================================
131     // Field data management
132     //==========================================================
133     FieldseriesHandlerList getFieldseriesListOnMesh(in long meshId);
134     FieldHandlerList getFieldListInFieldseries(in long fieldseriesId);
135
136     long getFieldIdAtTimestamp(in long fieldseriesId, in double timestamp);
137
138     FieldHandler     getFieldHandler(in long fieldHandlerId);
139     FieldHandlerList getFieldHandlerList();
140     // __GBO__ Maybe it could be useful to define a getFieldHandlerList with a datasourceId in argument
141     string           getFieldRepresentation(in long fieldHandlerId);
142
143     // Persistency management
144     void             saveFields(in string filepath, in FieldIdList list)
145       raises (SALOME::SALOME_Exception);
146     void             markAsPersistent(in long fieldHandlerId, in boolean persistent);
147     void             savePersistentFields(in string filepath)
148       raises (SALOME::SALOME_Exception);
149
150
151     void updateFieldMetadata(in long   fieldHandlerId,
152                              in string fieldname,
153                              in long   iteration,
154                              in long   order,
155                              in string source);
156
157     //void saveFields(in FieldHandlerList fieldHandlerList, in string filepath);
158
159     double getFieldTimestamp(in long fieldHandlerId);
160
161     void changeUnderlyingMesh(in long fieldHandlerId, in long meshHandlerId)
162       raises (SALOME::SALOME_Exception);
163
164     FieldHandler interpolateField(in long fieldHandlerId, in long meshHandlerId, in InterpolationParameters params)
165       raises (SALOME::SALOME_Exception);
166
167     //==========================================================
168     // General purpose data management
169     //==========================================================
170     void   setEventListenerIOR(in string ior);
171     string getEventListenerIOR() raises (SALOME::SALOME_Exception);
172
173     // Print out server data
174     void serverlog();
175
176     void cleanUp() raises (SALOME::SALOME_Exception);
177   };
178 };
179
180 #endif // _MED_DATAMANAGER_IDL_