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