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