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