Salome HOME
updating in the main trunk (only from NB and AG) for a pre building of
[modules/med.git] / idl / MED.idl
1 // File: MED.idl
2 // Project: SALOME
3 // Copyright : CEA/DEN/DMSS/LGLS
4 // $Header$
5
6 /*!
7 This file contains the main IDL definitions of the %MED component in %SALOME application.
8 */
9
10 #ifndef MED_IDL
11 #define MED_IDL
12
13 /*!
14  \defgroup MED SALOME MED component
15
16  This component is dedicated to the mounting in memory of a .med file. some
17  services of that component store CORBA objects (MED, MESH, FIELD) in the
18  study and/or give a direct access to those objects.
19 */
20
21 #include "SALOME_Exception.idl"
22 #include "SALOME_Component.idl"
23 #include "SALOMEDS.idl"
24 #include "SALOME_Comm.idl"
25
26 module SALOME_MED {
27   /*!
28     An array of long
29   */
30   typedef sequence<long> long_array;
31   /*!
32     An array of double
33   */
34   typedef sequence<double> double_array;
35   /*!
36     An array of string
37   */
38   typedef sequence<string> string_array;
39   /*!
40     An array of boolean
41   */
42   typedef sequence<boolean> boolean_array;
43
44 /*! \ingroup MED
45 This package contains a set of interfaces used for %SALOME %MED component.
46 */
47
48
49   interface FIELD;
50   interface FAMILY;
51   interface GROUP;
52   interface MESH;
53   interface SUPPORT;
54
55 /*!
56 This enumeration contains a set of elements defining the type of geometrical elements which constitue
57 a %Mesh.
58 */
59   typedef long medGeometryElement;
60   const medGeometryElement MED_NONE = 0;
61   const medGeometryElement MED_POINT1 = 1;
62   const medGeometryElement MED_SEG2 = 102;
63   const medGeometryElement MED_SEG3 = 103;
64   const medGeometryElement MED_TRIA3 = 203;
65   const medGeometryElement MED_QUAD4 = 204;
66   const medGeometryElement MED_TRIA6 = 206;
67   const medGeometryElement MED_QUAD8 = 208;
68   const medGeometryElement MED_TETRA4 = 304;
69   const medGeometryElement MED_PYRA5 = 305;
70   const medGeometryElement MED_PENTA6 = 306;
71   const medGeometryElement MED_HEXA8 = 308;
72   const medGeometryElement MED_TETRA10 = 310;
73   const medGeometryElement MED_PYRA13 = 313;
74   const medGeometryElement MED_PENTA15 = 315;
75   const medGeometryElement MED_HEXA20 = 320;
76   const medGeometryElement MED_ALL_ELEMENTS = 999;
77
78
79 /*!
80 This enumeration contains a set of elements defining the structural elements (entities) which constitue
81 a %Mesh.
82 */
83   typedef long medEntityMesh;
84   const medEntityMesh MED_CELL = 0;
85   const medEntityMesh MED_FACE = 1;
86   const medEntityMesh MED_EDGE = 2;
87   const medEntityMesh MED_NODE = 3;
88   const medEntityMesh MED_ALL_ENTITIES = 4;
89
90 /*!
91 This enumeration contains a set of modes to store data in an array.
92 For example an array of coordinates in 3D; tow storage may be considered:
93
94  - X1,Y1,Z1,X2,Y2,Z2,...,Xn,Yn,Zn if MED_FULL_INTERLACE
95  - X1,X2,...,Xn,Y1,Y2,...,Yn,Z1,Z2,...,Zn if MED_NO_INTERLACE
96 */
97   typedef long medModeSwitch;
98   const medModeSwitch MED_FULL_INTERLACE = 0;
99   const medModeSwitch MED_NO_INTERLACE = 1;
100
101 /*!
102 This enumeration contains a set of elements defining the type of connectivity.
103 */
104   typedef long medConnectivity;
105   const medConnectivity MED_NODAL = 0;
106   const medConnectivity MED_DESCENDING = 1;
107
108
109 /*!
110    enumeration contains a set of elements defining the type of driver.
111 */
112     typedef long medDriverTypes;
113     /*!<This driver is used for reading into memory of the mesh from %MED file.*/
114     const medDriverTypes MED_DRIVER  = 0;
115     const medDriverTypes VTK_DRIVER = 1;
116     const medDriverTypes NO_DRIVER = 2;
117
118   /*!
119     An array of %medGeometryElement
120   */
121   typedef sequence<medGeometryElement> medGeometryElement_array;
122
123   /*!
124     An array of %FAMILY
125   */
126   typedef sequence<FAMILY> Family_array;
127
128   /*!
129     An array of %GROUP
130   */
131   typedef sequence<GROUP> Group_array;
132
133   // ----------------------
134   // mesh interface
135   // ----------------------
136
137   interface MESH : SALOME::MultiCommClass, SALOME::ServantLifeCycle {
138     // Index range begins from 1
139
140     // General Informations
141     //---------------------
142
143     /*!
144       Returns the name of the mesh .
145     */
146     string getName() raises (SALOME::SALOME_Exception);
147
148     /*!
149       Returns space dimension.
150     */
151     long getSpaceDimension() raises (SALOME::SALOME_Exception);
152
153     /*!
154       Returns mesh dimension.
155
156       Example :
157       - we have only MED_TETRA4 in MED_CELL : MeshDimension = 3D
158       - we have only MED_QUAD4 in MED_CELL : MeshDimension = 2D
159       - we have both MED_SEG2 and MED_TRIA3 in MED_CELL : MeshDimension = 2D
160     */
161     long getMeshDimension() raises (SALOME::SALOME_Exception);
162
163     /*!
164         Pour Alliances
165     */
166     boolean getIsAGrid() raises (SALOME::SALOME_Exception);
167
168     /*!
169         Pour Alliances
170     */
171     boolean existConnectivity (in medConnectivity mode,
172                                in medEntityMesh entity)
173                                raises (SALOME::SALOME_Exception);
174
175     // Coordinates
176     //------------
177
178     /*!
179       Returns coordinate system :
180       - "CARTESIAN"
181       - "CYLINDRICAL"
182       - "SPHERICAL"
183     */
184     string getCoordinatesSystem() raises (SALOME::SALOME_Exception);
185
186     /*!
187       Returns the number of nodes defined in the mesh.
188     */
189     long getNumberOfNodes() raises (SALOME::SALOME_Exception);
190
191     /*!
192       Returns an array of coordinates stored in any type
193     */
194     SALOME_MED::double_array getCoordinates(in medModeSwitch typeSwitch)
195       raises (SALOME::SALOME_Exception);
196
197     /*!
198       Returns an array (Sender) of coordinates stored in any type.\n
199       It could be used in a Client code using the MED Client classes.
200      */
201     SALOME::SenderDouble getSenderForCoordinates(in medModeSwitch typeSwitch)
202       raises (SALOME::SALOME_Exception);
203     /*!
204      Returns coordinate  n° Number on axis n° Axis
205     */
206     double getCoordinate(in long Number, in long Axis)
207       raises (SALOME::SALOME_Exception);
208
209
210     /*!
211       Returns an array containing the names of coordinates.
212
213       Example :
214       - x,y,z
215       - r,teta,phi
216       - ...
217
218       It could be empty.
219     */
220     SALOME_MED::string_array getCoordinatesNames()
221       raises (SALOME::SALOME_Exception);
222
223     /*!
224       Returns an array containing the units of coordinates (cm, m, mm, ...)
225
226       It could be empty. By defult IS is used (meter).
227     */
228     SALOME_MED::string_array getCoordinatesUnits()
229       raises (SALOME::SALOME_Exception);
230
231     /*!
232       Returns the %SUPPORT containing the boundary elements
233       of the mesh.
234     */
235
236     SUPPORT getBoundaryElements(in medEntityMesh Entity)
237       raises (SALOME::SALOME_Exception);
238
239     /*!
240       Returns the %SUPPORT containing the boundary elements
241       of the support mySupport3D.
242     */
243     SUPPORT getSkin(in SUPPORT mySupport3D ) raises (SALOME::SALOME_Exception);
244
245     SALOME_MED::long_array getGlobalNumberingIndex(in medEntityMesh entity) ;
246
247     struct coordinateInfos
248     {
249         string                  coordSystem;
250         SALOME_MED::string_array   coordNames;
251         SALOME_MED::string_array   coordUnits;
252     };
253     coordinateInfos getCoordGlobal()    raises (SALOME::SALOME_Exception);
254
255
256
257     // Connectivity
258     // ------------
259
260     /*!
261       Returns the number of defferent %medGeometryElement types existing
262       in the specified entity.
263
264       \note
265       Not implemented for MED_ALL_ENTITIES.
266     */
267     long getNumberOfTypes(in medEntityMesh entity)
268       raises (SALOME::SALOME_Exception);
269
270     /*!
271       Returns an array of all %medGeometryElement types existing
272       in the mesh.
273
274       \note
275        Not implemented for MED_ALL_ENTITIES.
276     */
277     medGeometryElement_array getTypes(in medEntityMesh entity)
278       raises (SALOME::SALOME_Exception);
279
280     /*!
281       Returns the number of elements of type %medGeometryElement.
282
283       Note :
284       - Implemented for MED_ALL_ELEMENTS
285       - Not implemented for MED_ALL_ENTITIES
286     */
287     long getNumberOfElements(in medEntityMesh entity,
288                              in medGeometryElement geomElement)
289       raises (SALOME::SALOME_Exception);
290
291     /*!
292       Give, in full or no interlace mode (for nodal connectivity),
293       descending or nodal connectivity.
294
295       You must give a %medEntityMesh (ie:MED_EDGE) and a
296       %medGeometryElement (ie:MED_SEG3).
297     */
298     SALOME_MED::long_array getConnectivity(in medModeSwitch typeSwitch,
299                                         in medConnectivity mode,
300                                         in medEntityMesh entity,
301                                         in medGeometryElement geomElement)
302       raises (SALOME::SALOME_Exception);
303
304     /*!
305       Idem getConnectivity but return a Sender.\n
306       It could be used in a Client code using the MED Client classes.
307      */
308     SALOME::SenderInt getSenderForConnectivity(in medModeSwitch typeSwitch,
309                                         in medConnectivity mode,
310                                         in medEntityMesh entity,
311                                         in medGeometryElement geomElement)
312       raises (SALOME::SALOME_Exception);
313
314     /*!
315       Give morse index array to use with
316       getConnectivity(MED_FULL_INTERLACE,mode,entity,MED_ALL_ELEMENTS).
317
318       Each value give start index for corresponding entity in
319       connectivity array.
320
321       Example : i-th element, j-th node of it :
322       - In C mode : Connectivity[ConnectivityIndex[i]-1+j-1]
323       - In fortran mode : Connectivity[ConnectivityIndex[i]+j]
324     */
325     SALOME_MED::long_array getConnectivityIndex(in medConnectivity mode,
326                                              in medEntityMesh entity)
327       raises (SALOME::SALOME_Exception);
328
329     /*!
330       Gets a global number of the element which have the same connectivity as the
331       connectivity argument.
332     */
333     long getElementNumber(in medConnectivity mode,
334                           in medEntityMesh entity,
335                           in medGeometryElement type,
336                           in SALOME_MED::long_array connectivity)
337       raises (SALOME::SALOME_Exception);
338
339     medGeometryElement   getElementType (in  medEntityMesh entity,
340                                        in long number)
341       raises (SALOME::SALOME_Exception);
342
343     /*!
344       Returns a reverse connectivity to MED_CELL.
345
346       If mode=MED_NODAL, the array contains, for each node, all cells
347       arround it.
348
349       If mode=MED_DESCENDING, the array contains, for each face (or edge),
350       the 2 cells of each side. First is cell which face normal is outgoing.
351     */
352     SALOME_MED::long_array getReverseConnectivity(in medConnectivity mode)
353       raises (SALOME::SALOME_Exception);
354
355     /*!
356       Give index array to use with getReverseConnectivity(MED_NODAL).
357
358       This method is not used with MED_DESCENDING mode,
359       because we have allways two cells.
360
361       See getConnectivityIndex for details.
362     */
363     SALOME_MED::long_array getReverseConnectivityIndex(in medConnectivity mode)
364       raises (SALOME::SALOME_Exception);
365
366     struct connectivityInfos
367     {
368         long                     numberOfNodes;
369         medGeometryElement_array meshTypes;
370         SALOME_MED::long_array      numberOfElements;
371         long                       entityDimension;
372     };
373     connectivityInfos getConnectGlobal(in medEntityMesh entity)
374     raises (SALOME::SALOME_Exception);
375
376     // Families and Groups
377     // -------------------
378
379     /*!
380       Returns the number of all families.
381     */
382     long getNumberOfFamilies(in medEntityMesh entity)
383       raises (SALOME::SALOME_Exception);
384
385     /*!
386       Returns the number of all groups.
387     */
388     long getNumberOfGroups(in medEntityMesh entity)
389       raises (SALOME::SALOME_Exception);
390
391     /*!
392       Returns an array of all families.
393     */
394     Family_array getFamilies(in medEntityMesh entity)
395       raises (SALOME::SALOME_Exception);
396
397     /*!
398       Returns the reference to i-th family.
399
400       \note
401       i is bounded by 1 and NumberOfFamilies.
402     */
403     FAMILY getFamily(in medEntityMesh entity,in long familyNumber)
404       raises (SALOME::SALOME_Exception);
405
406     /*!
407       Returns an array of all groups.
408     */
409     Group_array getGroups(in medEntityMesh entity)
410       raises (SALOME::SALOME_Exception);
411
412     /*!
413       Returns the reference to i-th group.
414
415       \note
416      i is bounded by 1 and NumberOfGroups.
417     */
418     GROUP getGroup(in medEntityMesh entity,in long groupNumber)
419       raises (SALOME::SALOME_Exception);
420
421     // Others
422     // ------
423
424     /*!
425       Returns a field on mySupport containing volume.
426
427       \note
428       mySupport must be on MED_CELL entity and MeshDimension must be 3D.
429     */
430     FIELD getVolume(in SUPPORT mySupport)
431       raises (SALOME::SALOME_Exception);
432
433     /*!
434       Returns a field on mySupport containing area.
435
436       \note
437       mySupport must be on MED_FACE entity.
438     */
439     FIELD getArea(in SUPPORT mySupport)
440       raises (SALOME::SALOME_Exception);
441
442     /*!
443       Returns a field on mySupport containing length.
444
445     \note
446      mySupport must be on MED_EDGE entity.
447     */
448     FIELD getLength(in SUPPORT mySupport)
449       raises (SALOME::SALOME_Exception);
450
451     /*!
452       Returns a field on mySupport containing normal.
453
454       \note
455       mySupport must be on MED_FACE entity if MeshDimension and
456       SpaceDimension=3D and on MED_EDGE if MeshDimension and SpaceDimension=2D.
457     */
458     FIELD getNormal(in SUPPORT mySupport)
459       raises (SALOME::SALOME_Exception);
460
461     /*!
462       Returns a field on mySupport containing barycenter.
463     */
464     FIELD getBarycenter(in SUPPORT mySupport)
465       raises (SALOME::SALOME_Exception);
466
467     /*
468       Returns a field on mySupport containing neighbourhood.
469     */
470     // FIELD getNeighbourhood(in SUPPORT mySupport)
471     // raises (SALOME::SALOME_Exception);
472
473     // Read & Write
474     // -----------
475
476     /*!
477       Adds the Mesh in the StudyManager.
478     */
479     void addInStudy(in SALOMEDS::Study myStudy, in MESH myIor )
480       raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
481
482     //                          Add a MED/VTK/... driver
483     //                          Multiple drivers can be added whatever the type
484     long addDriver     (in medDriverTypes driverType, in string  fileName, in string meshName)
485                                         raises (SALOME::SALOME_Exception);
486     //                          Remove a driver
487     void rmDriver      (in long i)  raises (SALOME::SALOME_Exception);
488
489    //
490     void read          (in long i)  raises (SALOME::SALOME_Exception);
491     void write         (in long i, in string driverMeshName)
492                                     raises (SALOME::SALOME_Exception);
493
494 /*!
495 Internal Corba method.
496 */
497     long getCorbaIndex()        raises (SALOME::SALOME_Exception);
498     struct meshInfos
499     {
500            string name ;
501            long spaceDimension ;
502            long meshDimension;
503            long numberOfNodes ;
504            boolean isAGrid;
505            Family_array famNode;
506            Family_array famEdge;
507            Family_array famFace;
508            Family_array famCell;
509            Group_array  groupNode;
510            Group_array  groupEdge;
511            Group_array  groupFace;
512            Group_array  groupCell;
513     };
514     meshInfos getMeshGlobal()           raises (SALOME::SALOME_Exception);
515     boolean areEquals(in MESH other);
516   };
517
518
519   // ----------------------
520   // Support interface
521   // ----------------------
522
523   interface SUPPORT : SALOME::MultiCommClass, SALOME::ServantLifeCycle {
524
525     /*!
526       Returns the name of the support.
527     */
528     string getName() raises (SALOME::SALOME_Exception);
529
530     /*!
531       Returns the description of the support.
532     */
533     string getDescription() raises (SALOME::SALOME_Exception);
534
535     /*!
536       Returns a reference to the mesh.
537     */
538     MESH getMesh() raises (SALOME::SALOME_Exception);
539
540     /*!
541       Returns the type of %medEntityMesh used by the support.
542
543       \note
544       A support deals only with one entity's type
545       (for example : MED_FACE or MED_NODE)
546     */
547     medEntityMesh getEntity() raises (SALOME::SALOME_Exception);
548
549     /*!
550       Returns True if all elements of this entity are
551       engaged, False otherwise.
552
553       If True, you must use mesh reference (getMesh) to get more information.
554     */
555     boolean isOnAllElements() raises (SALOME::SALOME_Exception);
556
557     /*!
558       If the method %isOnAllElements() returns False, this method
559      returns the number of elements in the support.
560
561       Example : number of MED_TRIA3 or MED_ALL_ELEMETNS elements
562       in entity of support.
563
564       \note
565       If %SUPPORT is defined on MED_NODE, use MED_NONE %medGeometryElement
566       type.
567     */
568     long getNumberOfElements(in medGeometryElement geomElement)
569       raises (SALOME::SALOME_Exception);
570
571      long  getNumberOfTypes() raises (SALOME::SALOME_Exception);
572     /*!
573       If isOnAllElements is False, returns an array of %medGeometryElement
574       types used by the support.
575
576       %medEntityMesh is given by getEntity.
577     */
578     medGeometryElement_array getTypes() raises (SALOME::SALOME_Exception);
579
580
581     /*!
582       If the method %isOnAllElements() returns False, this method returns an array which
583      contains all numbers of given %medGeometryElement.
584
585       Numbering is global, ie numbers are bounded by 1 and
586       MESH::getNumberOfElement(entity,MED_ALL_ELEMENTS) and not by 1 and
587       MESH::getNumberOfElement(entity,geomElement).
588
589       \note
590       If %SUPPORT is defined on MED_NODE, use MED_NONE %medGeometryElement type.
591     */
592     SALOME_MED::long_array getNumber(in medGeometryElement geomElement)
593       raises (SALOME::SALOME_Exception);
594
595     /*!
596       Idem SALOME::Sender getNumber(in medGeometryElement geomElement) but returning Sender.\n
597       It could be used in a Client code using the MED Client classes.
598      */
599
600     SALOME::SenderInt getSenderForNumber(in medGeometryElement geomElement)
601       raises (SALOME::SALOME_Exception);
602
603     /*!
604       If the method %isOnAllElements() returns False, this method returns the index
605       of element number.
606
607       Use it with getNumber(MED_ALL_ELEMENTS).
608
609       \note
610        See the method %getConnectivityIndex for more details.
611     */
612     SALOME_MED::long_array getNumberIndex()
613       raises (SALOME::SALOME_Exception);
614
615     /*!
616       Idem SALOME_MED::long_array getNumberIndex() but return a Sender.\n
617       It could be used in a Client code using the MED Client classes.
618      */
619     SALOME::SenderInt getSenderForNumberIndex()
620       raises (SALOME::SALOME_Exception);
621
622     /*!
623       Returns the number of Gauss points for this %medGeometryElement.
624
625       \note
626       - Not defined if %SUPPORT is on MED_NODE.
627       - Not defined for MED_ALL_ELEMENTS %medGeometryElement type.
628      */
629     long getNumberOfGaussPoint(in medGeometryElement geomElement)
630                                 raises (SALOME::SALOME_Exception);
631
632     SALOME_MED::long_array getNumbersOfGaussPoint()
633                                 raises (SALOME::SALOME_Exception);
634
635     void getBoundaryElements()
636                                         raises (SALOME::SALOME_Exception);
637 /*!
638 Internal Corba method.
639 */
640     long getCorbaIndex()                raises (SALOME::SALOME_Exception);
641     struct supportInfos
642     {
643            string        name;
644            string        description;
645            boolean       isOnAllElements;
646            medEntityMesh entity;
647            long          numberOfGeometricType;
648            medGeometryElement_array types;
649            SALOME_MED::long_array nbEltTypes;
650     };
651     supportInfos getSupportGlobal()             raises (SALOME::SALOME_Exception);
652
653   };
654
655
656   //-----------------
657   // Family interface
658   //-----------------
659
660   interface FAMILY : SUPPORT
661     {
662
663       /*!
664         Returns Family identifier (Identifier
665         of the family in the mesh).
666
667         \note
668       There is precisely only one indentifier for each family.
669       */
670       long getIdentifier() raises (SALOME::SALOME_Exception);
671
672       /*!
673         Returns number of attributes.
674       */
675       long getNumberOfAttributes() raises (SALOME::SALOME_Exception);
676
677       /*!
678         Returns an array of all attributes' identifiers.
679         There is one for each attribute.
680       */
681       SALOME_MED::long_array getAttributesIdentifiers()
682         raises (SALOME::SALOME_Exception);
683
684       /*!
685         Returns identifier of i-th attribute.
686
687         \note
688       i is bounded by 1 and NumberOfAttributes.
689       */
690       long getAttributeIdentifier(in long i) raises (SALOME::SALOME_Exception);
691
692       /*!
693         Returns an array of all values of the attributes .
694         There is one value for each attribute.
695       */
696       SALOME_MED::long_array getAttributesValues()
697         raises (SALOME::SALOME_Exception);
698
699       /*!
700         Returns the value of i-th attribute.
701
702         \note
703       i is bounded by 1 and NumberOfAttributes.
704       */
705       long getAttributeValue(in long i) raises (SALOME::SALOME_Exception);
706
707       /*!
708         Returns an array of all descriptions of the attributes .
709         There is one description for each attribute.
710       */
711       SALOME_MED::string_array getAttributesDescriptions()
712         raises (SALOME::SALOME_Exception);
713
714       /*!
715         Returns the description of i-th attribute.
716
717         \note
718       i is bounded by 1 and NumberOfAttributes.
719       */
720       string getAttributeDescription(in long i)
721         raises (SALOME::SALOME_Exception);
722
723      /*!
724         Returns the number of groups the family belongs to.
725       */
726       long getNumberOfGroups()
727         raises (SALOME::SALOME_Exception);
728
729       /*!
730         Returns an array of names of groups the family belongs to .
731         There is one name for each group.
732       */
733       SALOME_MED::string_array getGroupsNames()
734         raises (SALOME::SALOME_Exception);
735
736       /*!
737         Returns the name of i-th group.
738
739         \note
740       i is bounded by 1 and NumberOfAttributes.
741       */
742       string getGroupName(in long i)
743         raises (SALOME::SALOME_Exception);
744
745
746     };
747
748
749   //----------------
750   // Group interface
751   //----------------
752   interface GROUP : SUPPORT
753     {
754
755       /*!
756         Returns the number of families in this group.
757       */
758       long getNumberOfFamilies() raises (SALOME::SALOME_Exception);
759
760       /*!
761         Returns an array of all families.
762       */
763       Family_array getFamilies() raises (SALOME::SALOME_Exception);
764
765       /*!
766         Returns a reference to the i-th family.
767
768         \note
769       i is bounded by 1 and NumberOfFamilies.
770       */
771       FAMILY getFamily(in long i) raises (SALOME::SALOME_Exception);
772
773     };
774
775
776   //----------------
777   // Field interface
778   //----------------
779
780   interface FIELD : SALOME::ServantLifeCycle
781     {
782
783       /*!
784         Returns the field name.
785       */
786       string getName() raises (SALOME::SALOME_Exception);
787
788       /*!
789         Returns the field description.
790       */
791       string getDescription() raises (SALOME::SALOME_Exception);
792
793       /*!
794         Returns a reference to the support
795         on which the field is defined.
796       */
797       SUPPORT getSupport() raises (SALOME::SALOME_Exception);
798
799       /*!
800         Returns the number of field's components.
801       */
802       long getNumberOfComponents() raises (SALOME::SALOME_Exception);
803
804       /*!
805         Returns an array containing components names.
806       */
807       SALOME_MED::string_array getComponentsNames()
808         raises (SALOME::SALOME_Exception);
809
810       /*!
811         Returns the name of i-th component.
812
813         \note
814         - i is bounded by 1 and NumberOfComponents.
815         - Name is mandatory for each field's component.
816       */
817       string getComponentName(in long i) raises (SALOME::SALOME_Exception);
818
819       /*!
820         Returns an array containing components units.
821       */
822       SALOME_MED::string_array getComponentsUnits()
823         raises (SALOME::SALOME_Exception);
824
825       /*!
826         Returns the unit of i-th component.
827
828         \note
829       i is bounded by 1 and NumberOfComponents.
830       */
831       string getComponentUnit(in long i) raises (SALOME::SALOME_Exception);
832
833       /*!
834         Returns an array containing components descriptions.
835       */
836       SALOME_MED::string_array getComponentsDescriptions()
837         raises (SALOME::SALOME_Exception);
838
839       /*!
840         Returns the description of i-th component.
841
842         \note
843         - i is bounded by 1 and NumberOfComponents.
844         - Name is mandatory for each field's component.
845       */
846       string getComponentDescription(in long i) raises (SALOME::SALOME_Exception);
847
848       /*!
849         Returns the iteration number.
850       */
851       long getIterationNumber() raises (SALOME::SALOME_Exception);
852
853       /*!
854         Returns time for this iteration.
855       */
856       double getTime() raises (SALOME::SALOME_Exception);
857
858       /*!
859         Returns order number use for
860         internal step in this iteration.
861       */
862       long getOrderNumber() raises (SALOME::SALOME_Exception);
863
864       // Read & Write
865       // -----------
866
867       long addDriver (in medDriverTypes driverType, in string  fileName, in string fieldName)
868         raises (SALOME::SALOME_Exception);
869
870       /*!
871      Removes a driver
872      */
873       void rmDriver (in long i)
874         raises (SALOME::SALOME_Exception);
875
876       //
877       void read (in long i)
878         raises (SALOME::SALOME_Exception);
879
880       /*!
881         Writes a field.
882       */
883       void write (in long i, in string driverFieldName)
884         raises (SALOME::SALOME_Exception);
885
886       /*!
887         Adds the Field in the StudyManager.
888       */
889       void addInStudy(in SALOMEDS::Study myStudy, in FIELD myIor )
890         raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
891
892 /*!
893 Internal Corba method.
894 */
895       long getCorbaIndex()
896         raises (SALOME::SALOME_Exception);
897
898     };
899
900
901   interface FIELDDOUBLE : FIELD , SALOME::MultiCommClass {
902
903     /*!
904       Returns an array of values of the field
905     */
906     SALOME_MED::double_array getValue(in medModeSwitch mode)
907       raises (SALOME::SALOME_Exception);
908
909     /*!
910       Idem as getValue but it could be used in a Client code using the
911       MED Client classes.
912     */
913     SALOME::SenderDouble getSenderForValue(in medModeSwitch mode)
914       raises (SALOME::SALOME_Exception);
915   };
916
917   interface FIELDINT : FIELD , SALOME::MultiCommClass {
918
919     /*!
920       Returns an array of values of the field
921     */
922     SALOME_MED::long_array getValue(in medModeSwitch mode)
923       raises (SALOME::SALOME_Exception);
924
925     /*!
926       Idem as getValue but it could be used in a Client code using the
927       MED Client classes.
928     */
929     SALOME::SenderInt getSenderForValue(in medModeSwitch mode)
930       raises (SALOME::SALOME_Exception);
931   };
932
933   // MED interface
934
935   interface MED {
936     /*!
937       returns the number of meshes in the %MED object.
938      */
939     long                   getNumberOfMeshes () raises (SALOME::SALOME_Exception);
940     /*!
941       returns the number of fields in the %MED object.
942      */
943     long                   getNumberOfFields () raises (SALOME::SALOME_Exception);
944     /*!
945       returns an array which contains the name of each meshes in the %MED object.
946      */
947     SALOME_MED::string_array  getMeshNames      () raises (SALOME::SALOME_Exception);
948     /*!
949       returns an array which contains the name of each fields in the %MED object.
950      */
951     SALOME_MED::string_array  getFieldNames     () raises (SALOME::SALOME_Exception);
952     /*!
953       giving a mesh name, it returns the corresponding %MESH pointer.
954      */
955     MESH                   getMeshByName     ( in string  meshName)  raises (SALOME::SALOME_Exception);
956     /*!
957       giving a %FIELD pointer, it returns the corresponding %MESH pointer of the mesh
958       on which the field lies.
959      */
960     MESH                   getMesh           ( in FIELD  fieldPtr)   raises (SALOME::SALOME_Exception);
961     /*!
962       giving a field name, it returns the number of iteration in the corresponding %FIELD object.
963      */
964     long getFieldNumberOfIteration(in string fieldName) raises (SALOME::SALOME_Exception);
965     /*!
966       giving a field name and an integer %i, it returns a couple of integers: the time iteration and
967       the order number of the %i^th iteration of the corresponding %FIELD object.
968      */
969     SALOME_MED::long_array  getFieldIteration(in string fieldName, in long i) raises (SALOME::SALOME_Exception);
970     /*!
971       giving a field name, it returns an array of integers: the list of the time iteration and
972       the order number couple of all iterations of the corresponding %FIELD object.
973
974       (DT1, IT1, DT2, IT2, ... , DTn, ITn) when n is the number of the %FIELD iterations.
975      */
976     SALOME_MED::long_array  getFieldIterations(in string fieldName) raises (SALOME::SALOME_Exception);
977     /*!
978       giving a field name, a time iteration and an order number, it returns the corresponding %FIELD oject.
979      */
980     FIELD                  getField          ( in string fieldName,
981                                                in long pasTemps,
982                                                in long numOrdre )    raises (SALOME::SALOME_Exception);
983
984
985     // Add a MED/VTK/... driver to a MED'GEN' object to
986     // be able to read/write files preserving  meshes<-->fields association
987     // Multiple drivers can be added whatever the type.
988     // The access point in the <long> returned
989     long addDriver     (in medDriverTypes driverType, in string  fileName)
990                                         raises (SALOME::SALOME_Exception);
991     /*!
992    Removes the driver
993     */
994     void rmDriver      (in long i)  raises (SALOME::SALOME_Exception);
995     /*!
996     Reads the structure of the %MED file
997     */
998     void readFileStruct(in long i)  raises (SALOME::SALOME_Exception);
999     void writeFrom     (in long i)  raises (SALOME::SALOME_Exception);
1000     void write         (in long i)  raises (SALOME::SALOME_Exception);
1001
1002     void addMesh  (in MESH   ptrMesh   ) raises (SALOME::SALOME_Exception);
1003     void addField (in FIELD  ptrField  ) raises (SALOME::SALOME_Exception);
1004
1005     void addInStudy (in SALOMEDS::Study myStudy, in MED medPtr) raises (SALOME::SALOME_Exception, SALOMEDS::StudyBuilder::LockProtection);
1006   };
1007 };
1008
1009 #endif /* MED_IDL */