]> SALOME platform Git repositories - modules/smesh.git/blob - idl/SMESH_Mesh.idl
Salome HOME
6535888a1c0f74fb042d52146bb7e92cbc219546
[modules/smesh.git] / idl / SMESH_Mesh.idl
1 // Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : SMESH_Mesh.idl
24 //  Author : Paul RASCLE, EDF
25 //
26 #ifndef _SMESH_MESH_IDL_
27 #define _SMESH_MESH_IDL_
28
29 #include "SALOME_Exception.idl"
30 #include "SALOME_GenericObj.idl"
31 #include "GEOM_Gen.idl"
32 #include "SMESH_smIdType.idl"
33
34 module SMESH
35 {
36   interface SMESH_Hypothesis;
37   typedef sequence<SMESH_Hypothesis> ListOfHypothesis;
38   interface SMESH_GroupBase;
39   typedef sequence<SMESH_GroupBase> ListOfGroups;
40   interface SMESH_IDSource;
41   typedef sequence<SMESH_IDSource> ListOfIDSources;
42
43   typedef sequence<double    > double_array ;
44   typedef sequence<long      > long_array ;
45   typedef sequence<smIdType  > smIdType_array ;
46   typedef sequence<string    > string_array ;
47   typedef sequence<long_array> array_of_long_array ;
48
49   enum log_command
50     {
51       ADD_NODE,
52       ADD_EDGE,
53       ADD_TRIANGLE,
54       ADD_QUADRANGLE,
55       ADD_POLYGON,
56       ADD_TETRAHEDRON,
57       ADD_PYRAMID,
58       ADD_PRISM,
59       ADD_HEXAHEDRON,
60       ADD_POLYHEDRON,
61       REMOVE_NODE,
62       REMOVE_ELEMENT,
63       MOVE_NODE,
64       CHANGE_ELEMENT_NODES,
65       CHANGE_POLYHEDRON_NODES,
66       RENUMBER,
67       CLEAR_MESH,
68       ADD_QUADEDGE,
69       ADD_QUADTRIANGLE,
70       ADD_QUADQUADRANGLE,
71       ADD_QUADPOLYGON,
72       ADD_QUADTETRAHEDRON,
73       ADD_QUADPYRAMID,
74       ADD_QUADPENTAHEDRON,
75       ADD_QUADHEXAHEDRON,
76       ADD_ELEM0D,
77       ADD_BIQUAD_TRIANGLE,
78       ADD_BIQUAD_QUADRANGLE,
79       ADD_TRIQUAD_HEXA,
80       ADD_HEXAGONAL_PRISM,
81       ADD_BALL
82     };
83
84   struct log_block
85   {
86     long commandType;
87     long number;
88     double_array coords;
89     long_array indexes;
90   };
91   typedef sequence<log_block> log_array;
92
93   struct PointStruct { double x;
94                        double y;
95                        double z; };
96
97   typedef sequence<PointStruct> nodes_array;
98
99   struct DirStruct   { PointStruct PS; };          // analog to OCCT gp_Vec
100
101   struct AxisStruct  { double x;
102                        double y;
103                        double z;
104                        double vx;
105                        double vy;
106                        double vz; };
107   /*!
108    * Node location on a shape
109    */
110   struct NodePosition {
111     long             shapeID;
112     GEOM::shape_type shapeType;
113     double_array     params; // [U] on EDGE, [U,V] on FACE, [] on the rest shapes
114   };
115
116   /*!
117    * Element location on a shape
118    */
119   struct ElementPosition {
120     long             shapeID;
121     GEOM::shape_type shapeType;
122   };
123
124   /*!
125    * Enumeration for element type, like in SMDS
126    */
127   enum ElementType
128   {
129     ALL,
130     NODE,
131     EDGE,
132     FACE,
133     VOLUME,
134     ELEM0D,
135     BALL,
136     NB_ELEMENT_TYPES
137   };
138   typedef sequence<ElementType> array_of_ElementType;
139
140   /*!
141    * Enumeration for element geometry type, like SMDSAbs_GeometryType in SMDSAbs_ElementType.hxx
142    */
143   enum GeometryType
144   {
145     Geom_POINT,
146     Geom_EDGE,
147     Geom_TRIANGLE,
148     Geom_QUADRANGLE, // when a new GeometryType is added, please
149     Geom_POLYGON,    // update a corresponding list in SMESH_2smeshpy.cxx, ln 665
150     Geom_TETRA,
151     Geom_PYRAMID,
152     Geom_HEXA,
153     Geom_PENTA,
154     Geom_HEXAGONAL_PRISM,
155     Geom_POLYHEDRA,
156     Geom_BALL,
157     Geom_LAST
158   };
159
160   /*!
161    * ElementOrder points out entities of what order are requested
162    */
163   enum ElementOrder {
164     ORDER_ANY,          /*! entities of any order */
165     ORDER_LINEAR,       /*! entities of 1st order */
166     ORDER_QUADRATIC     /*! entities of 2nd order */
167   };
168
169   /*!
170    * Enumeration of entity type used in mesh info array,
171    * it should be synchronised with enum SMDSAbs_EntityType
172    */
173   enum EntityType
174   {
175     Entity_Node,
176     Entity_0D,
177     Entity_Edge,
178     Entity_Quad_Edge,
179     Entity_Triangle,
180     Entity_Quad_Triangle,
181     Entity_BiQuad_Triangle,
182     Entity_Quadrangle,
183     Entity_Quad_Quadrangle,
184     Entity_BiQuad_Quadrangle,
185     Entity_Polygon,
186     Entity_Quad_Polygon,
187     Entity_Tetra,
188     Entity_Quad_Tetra,
189     Entity_Pyramid,
190     Entity_Quad_Pyramid,
191     Entity_Hexa,
192     Entity_Quad_Hexa,
193     Entity_TriQuad_Hexa,
194     Entity_Penta,
195     Entity_Quad_Penta,
196     Entity_BiQuad_Penta,
197     Entity_Hexagonal_Prism,
198     Entity_Polyhedra,
199     Entity_Quad_Polyhedra,
200     Entity_Ball,
201     Entity_Last
202   };
203
204   /*!
205    * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
206    */
207   enum Hypothesis_Status // in the order of severity
208   {
209     HYP_OK,
210     HYP_MISSING,      // algo misses a hypothesis
211     HYP_CONCURRENT,   // several applicable hypotheses
212     HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
213     HYP_HIDDEN_ALGO,  // an algo is hidden by an upper dim algo generating all-dim elements
214     HYP_HIDING_ALGO,  // an algo hides lower dim algos by generating all-dim elements
215     HYP_UNKNOWN_FATAL,//  --- all statuses below should be considered as fatal
216                       //      for Add/RemoveHypothesis operations
217     HYP_INCOMPATIBLE, // hypothesis does not fit algo
218     HYP_NOTCONFORM,   // not conform mesh is produced applying a hypothesis
219     HYP_ALREADY_EXIST,// such hypothesis already exist
220     HYP_BAD_DIM,      // bad dimension
221     HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its sub-shape, nor a group
222     HYP_BAD_GEOMETRY, // geometry mismatches algorithm's expectation
223     HYP_NEED_SHAPE,   // algorithm can work on shape only
224     HYP_INCOMPAT_HYPS // several additional hypotheses are incompatible one with other
225   };
226
227   /*!
228    * Enumeration for mesh read status (used by SMESH_Gen::CreateMeshesFrom*() methods)
229    */
230   enum DriverMED_ReadStatus // in the order of severity
231   {
232     DRS_OK,
233     DRS_EMPTY,           // a file contains no mesh with the given name
234     DRS_WARN_RENUMBER,   // a MED file has overlapped ranges of element numbers,
235                          // so the numbers from the file are ignored
236     DRS_WARN_SKIP_ELEM,  // some elements were skipped due to incorrect file data
237     DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
238     DRS_FAIL             // general failure (exception etc.)
239   };
240
241   /*!
242    * \brief A structure containing information about MED file
243    */
244   struct MedFileInfo
245   {
246     string fileName; //!< name of file
247     long   fileSize; //!< size of file
248     long   major, minor, release; //!< MED file version
249   };
250
251   /*!
252    * Enumeration for CreateDimGroup()
253    */
254   enum NB_COMMON_NODES_ENUM
255   {
256     ALL_NODES, MAIN, AT_LEAST_ONE, MAJORITY
257   };
258
259   /*!
260    * Auxiliary flags for advanced extrusion.
261    * BOUNDARY: create or not boundary for result of extrusion
262    * SEW:      try to use existing nodes or create new nodes in any case
263    */
264   const long EXTRUSION_FLAG_BOUNDARY = 1;
265   const long EXTRUSION_FLAG_SEW = 2;
266
267   /*!
268    * Structure used in mesh edit preview data (MeshPreviewStruct)
269    */
270   struct ElementSubType { ElementType SMDS_ElementType;
271                           boolean     isPoly;
272                           short       nbNodesInElement; };
273
274   typedef sequence<ElementSubType> types_array;
275
276   /*!
277    * Structure containing mesh edit preview data
278    */
279   struct MeshPreviewStruct { nodes_array nodesXYZ;
280                              long_array  elementConnectivities;
281                              types_array elementTypes; };
282
283   interface SMESH_Mesh;
284
285   interface SMESH_IDSource : SALOME::GenericObj
286   {
287     /*!
288      * Returns a sequence of all element IDs
289      */
290     smIdType_array GetIDs();
291
292     /*!
293      * Returns number of mesh elements of each \a EntityType
294      * @return array of number of elements per \a EntityType
295      */
296     smIdType_array GetMeshInfo();
297
298     /*!
299      * Returns number of mesh elements of each \a ElementType
300      * @return array of number of elements per \a ElementType
301      */
302     smIdType_array GetNbElementsByType();
303
304     /*!
305      * Returns types of elements it contains.
306      * It's empty if the SMESH_IDSource contains no IDs
307      */
308     array_of_ElementType GetTypes();
309
310     /*!
311      * Returns the mesh
312      */
313     SMESH_Mesh GetMesh();
314
315     /*!
316      * Returns false if GetMeshInfo() returns incorrect information that may
317      * happen if mesh data is not yet fully loaded from the file of study.
318      */
319     boolean IsMeshInfoCorrect();
320
321     /*!
322      * Returns mesh unstructed grid information.
323      */
324     SALOMEDS::TMPFile GetVtkUgStream();
325   };
326
327   interface SMESH_Group;
328   interface SMESH_GroupOnGeom;
329   interface Filter;
330   interface SMESH_GroupOnFilter;
331   interface SMESH_subMesh;
332   interface SMESH_MeshEditor;
333
334   typedef sequence<SMESH_subMesh>     submesh_array;
335   typedef sequence<submesh_array>     submesh_array_array;
336
337   interface SMESH_Mesh : SMESH_IDSource
338   {
339     /*!
340      * Return true if there is a geometry to be meshed
341      */
342     boolean HasShapeToMesh()
343       raises (SALOME::SALOME_Exception);
344
345     /*!
346      * Get geom shape to mesh. A result should not be nil. Use HasShapeToMesh()
347      * to know if a returned shape
348      */
349     GEOM::GEOM_Object GetShapeToMesh()
350       raises (SALOME::SALOME_Exception);
351
352     /*!
353      * Replaces a shape in the mesh
354      */
355     void ReplaceShape(in GEOM::GEOM_Object theNewGeom)
356       raises (SALOME::SALOME_Exception);
357
358     /*!
359      * Return false if the mesh is not yet fully loaded from the study file
360      */
361     boolean IsLoaded()
362       raises (SALOME::SALOME_Exception);
363
364     /*!
365      * Load full mesh data from the study file
366      */
367     void Load()
368       raises (SALOME::SALOME_Exception);
369
370     /*!
371      * Remove all nodes and elements
372      */
373     void Clear()
374       raises (SALOME::SALOME_Exception);
375
376     /*!
377      *  Get the list of sub-meshes existing in the mesh
378      */
379     submesh_array GetSubMeshes()
380       raises (SALOME::SALOME_Exception);
381
382     /*!
383      * Remove all nodes and elements of submesh
384      */
385     void ClearSubMesh(in long ShapeID)
386       raises (SALOME::SALOME_Exception);
387
388     /*!
389      * Get the subMesh object associated to a Sub-shape. The subMesh object
390      * gives access to nodes and elements IDs.
391      * SubMesh will be used instead of Sub-shape in a next idl version to
392      * address a specific subMesh...
393      */
394     SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
395       raises (SALOME::SALOME_Exception);
396
397     /*!
398      * Remove a submesh
399      */
400     void RemoveSubMesh(in SMESH_subMesh aSubMesh)
401       raises (SALOME::SALOME_Exception);
402
403
404     /*!
405      * Create a group
406      */
407     SMESH_Group CreateGroup( in ElementType elem_type,
408                              in string      name )
409       raises (SALOME::SALOME_Exception);
410
411     /*!
412      * Create a group from geometry
413      */
414     SMESH_GroupOnGeom CreateGroupFromGEOM( in ElementType       elemType,
415                                            in string            name,
416                                            in GEOM::GEOM_Object geomObject )
417       raises (SALOME::SALOME_Exception);
418
419     /*!
420      * Create a group from filter
421      */
422     SMESH_GroupOnFilter CreateGroupFromFilter( in ElementType   elemType,
423                                                in string        name,
424                                                in SMESH::Filter filter )
425       raises (SALOME::SALOME_Exception);
426
427     /*!
428      * Remove a group
429      */
430     void RemoveGroup(in SMESH_GroupBase aGroup)
431       raises (SALOME::SALOME_Exception);
432
433     /*!
434      *  Remove group with its contents
435      */
436     void RemoveGroupWithContents( in SMESH_GroupBase aGroup )
437       raises (SALOME::SALOME_Exception);
438
439     /*!
440     *   Return True if all the submeshes are computed
441     */
442     boolean IsComputedOK()
443       raises (SALOME::SALOME_Exception);
444
445     /*!
446      *  Get the list of groups existing in the mesh
447      */
448     ListOfGroups GetGroups()
449       raises (SALOME::SALOME_Exception);
450
451     /*!
452      *  Get number of groups existing in the mesh
453      */
454     long NbGroups()
455       raises (SALOME::SALOME_Exception);
456
457     /*!
458      * Union of two groups
459      *    New group is created. All mesh elements that are
460      *    present in initial groups are added to the new one
461      */
462     SMESH_Group UnionGroups (in SMESH_GroupBase aGroup1,
463                              in SMESH_GroupBase aGroup2,
464                              in string          name )
465       raises (SALOME::SALOME_Exception);
466
467     /*!
468      * Union of list of groups
469      * New group is created. All mesh elements that are
470      * present in initial groups are added to the new one
471      */
472     SMESH_Group UnionListOfGroups (in ListOfGroups aListOfGroups,
473                                    in string       name )
474       raises (SALOME::SALOME_Exception);
475
476     /*!
477      *  Intersection of two groups
478      *  New group is created. All mesh elements that are
479      *  present in both initial groups are added to the new one.
480      */
481     SMESH_Group IntersectGroups (in SMESH_GroupBase aGroup1,
482                                  in SMESH_GroupBase aGroup2,
483                                  in string          name )
484       raises (SALOME::SALOME_Exception);
485
486     /*!
487      *  Intersection of list of groups
488      *  New group is created. All mesh elements that are
489      *  present in all initial groups simultaneously are added to the new one.
490      */
491     SMESH_Group IntersectListOfGroups (in ListOfGroups aListOfGroups,
492                                        in string       name)
493       raises (SALOME::SALOME_Exception);
494
495     /*!
496      *  Cut of two groups
497      *  New group is created. All mesh elements that are present in
498      *  main group but do not present in tool group are added to the new one
499      */
500     SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup,
501                            in SMESH_GroupBase aToolGroup,
502                            in string          name )
503       raises (SALOME::SALOME_Exception);
504
505     /*!
506      *  Cut of lists of groups
507      *  New group is created. All mesh elements that are present in
508      *  main groups but do not present in tool groups are added to the new one
509      */
510     SMESH_Group CutListOfGroups (in ListOfGroups aMainGroups,
511                                  in ListOfGroups aToolGroups,
512                                  in string       name)
513       raises (SALOME::SALOME_Exception);
514
515     /*!
516      *  Create a group of entities basing on nodes of other groups.
517      *  \param [in] aListOfGroups - list of either groups, sub-meshes or filters.
518      *  \param [in] anElemType - a type of elements to include to the new group.
519      *  \param [in] name - a name of the new group.
520      *  \param [in] nbCommonNodes - criterion of inclusion of an element to the new group.
521      *  \param [in] underlyingOnly - if \c True, an element is included to the
522      *         new group provided that it is based on nodes of an element of
523      *         \a aListOfGroups
524      *  \return SMESH_Group - the created group
525      */
526     SMESH_Group CreateDimGroup( in ListOfIDSources      aListOfGroups,
527                                 in ElementType          anElemType,
528                                 in string               name,
529                                 in NB_COMMON_NODES_ENUM nbCommonNodes,
530                                 in boolean              underlyingOnly )
531       raises (SALOME::SALOME_Exception);
532
533     /*!
534      * Distribute all faces of the mesh among groups using sharp edges and optionally
535      * existing 1D elements as group boundaries.
536      *  \param [in] sharpAngle - edge is considered sharp if an angle between normals of
537      *              adjacent faces is more than \a sharpAngle in degrees.
538      *  \param [in] createEdges - to create 1D elements for detected sharp edges.
539      *  \param [in] useExistingEdges - to use existing edges as group boundaries
540      *  \return ListOfGroups - the created groups
541      */
542     ListOfGroups FaceGroupsSeparatedByEdges( in double  sharpAngle,
543                                              in boolean createEdges,
544                                              in boolean useExistingEdges )
545       raises (SALOME::SALOME_Exception);
546
547     /*!
548      * Convert group on geometry or on filter into standalone group
549      */
550     SMESH_Group ConvertToStandalone( in SMESH_GroupBase theGroupOn )
551       raises (SALOME::SALOME_Exception);
552
553     /*!
554      * Add hypothesis to the mesh, under a particular sub-shape
555      * (or the main shape itself)
556      * This method is only used to prepare the build of the mesh and store
557      * the algorithms and associated parameters.
558      * Actual job of meshing the shape is done by SMESH_Gen::Compute()
559      * @params
560      * - aSubObject : sub-shape obtained by a shape explode in GEOM
561      *   (or main shape)
562      * - anHyp : an hypothesis object
563      * @return
564      * - An enum item explaining what's up
565      * - anErrorText: an optional textual description of a problem (if any)
566      */
567     Hypothesis_Status AddHypothesis(in GEOM::GEOM_Object aSubObject,
568                                     in SMESH_Hypothesis  anHyp,
569                                     out string           anErrorText)
570       raises (SALOME::SALOME_Exception);
571
572     /*!
573      * Remove an hypothesis previously added with AddHypothesis.
574      */
575     Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
576                                        in SMESH_Hypothesis anHyp)
577       raises (SALOME::SALOME_Exception);
578
579     /*!
580      * Get the list of hypothesis added on a sub-shape
581      */
582     ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Object aSubObject)
583       raises (SALOME::SALOME_Exception);
584
585     /*!
586      * Get the log of nodes and elements added or removed since previous
587      * clear of the log.
588      * @params
589      * - clearAfterGet : log is emptied after Get (safe if concurrents access)
590      */
591     log_array GetLog(in boolean clearAfterGet)
592       raises (SALOME::SALOME_Exception);
593
594     /*!
595      * Clear the log of nodes and elements added or removed since previous
596      * clear. Must be used immediately after GetLog if clearAfterGet is false.
597      */
598     void ClearLog()
599       raises (SALOME::SALOME_Exception);
600
601     /*!
602      * Toggle auto color mode on the object.
603      * @params
604      * - theAutoColor : flag which toggles auto color mode.
605      */
606     void SetAutoColor(in boolean theAutoColor)
607       raises (SALOME::SALOME_Exception);
608
609     /*!
610      * Get flag of object's auto color mode.
611      */
612     boolean GetAutoColor()
613       raises (SALOME::SALOME_Exception);
614
615     /*!
616      * Get the internal Id
617      */
618     long GetId();
619
620     /*!
621      * Obtain instance of SMESH_MeshEditor
622      */
623     SMESH_MeshEditor GetMeshEditor()
624       raises (SALOME::SALOME_Exception);
625
626     /*!
627      * Return SMESH_MeshEditor that would not modify the mesh but
628      * fill MeshPreviewStruct
629      */
630     SMESH_MeshEditor GetMeshEditPreviewer()
631       raises (SALOME::SALOME_Exception);
632
633     /*!
634      * Return true if the mesh has been edited since a total re-compute
635      * and those modifications may prevent successful partial re-compute
636      */
637     boolean HasModificationsToDiscard()
638       raises (SALOME::SALOME_Exception);
639
640     /*! Check group names for duplications.
641      *  Consider maximum group name length stored in MED file.
642      */
643     boolean HasDuplicatedGroupNamesMED();
644
645     /*!
646      * Export a Mesh to MED file.
647      * @params
648      * - fileName : name of the MED file
649      * - auto_groups : boolean parameter for creating/not creating
650      *                 the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
651      *                 the typical use is auto_groups=false.
652      * - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
653      * - version : define the version of MED file format, coded with major and minor digits (release digit not used)
654      *           for instance med 3.2.1 is coded 3*10+2 = 32, med 4.0.0 is coded 4*10+0 = 40.
655      *           The rules of compatibility to write a mesh in an older version than the current version
656      *           depend on the current version. For instance, with med 4.0 it is possible to write/append
657      *           med files in 4.0.0 (default format) or 3.2.1 or 3.3.1 formats.
658      *           The minor must be between 0 and the current minor version of MED file library.
659      *           If version is equal to -1, the version is not changed (default).
660      * - autoDimension : if @c true, a space dimension of a MED mesh can be either
661      *         - 1D if all mesh nodes lie on OX coordinate axis, or
662      *         - 2D if all mesh nodes lie on XOY coordinate plane, or
663      *         - 3D in the rest cases.
664      *         If @a autoDimension is @c false, the space dimension is always 3.
665      */
666     void ExportMED( in string  fileName,
667                     in boolean auto_groups,
668                     in long    version,
669                     in boolean overwrite,
670                     in boolean autoDimension) raises (SALOME::SALOME_Exception);
671
672     long long ExportMEDCoupling(in boolean auto_groups,
673                                 in boolean autoDimension) raises (SALOME::SALOME_Exception);
674
675     /*!
676      * Export a [part of] Mesh into a MED file
677      * @params
678      * - meshPart : a part of mesh to store
679      * - fileName : name of the MED file
680      * - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
681      * - version : define the version of MED file format, coded with major and minor digits (release digit not used)
682      *           for instance med 3.2.1 is coded 3*10+2 = 32, med 4.0.0 is coded 4*10+0 = 40.
683      *           The rules of compatibility to write a mesh in an older version than the current version
684      *           depend on the current version. For instance, with med 4.0 it is possible to write/append
685      *           med files in 4.0.0 (default format) or 3.2.1 or 3.3.1 formats.
686      *           The minor must be between 0 and the current minor version of MED file library.
687      *           If version is equal to -1, the version is not changed (default).
688      * - autoDimension : if @c True, a space dimension for export is defined by mesh
689      *                 configuration; for example a planar mesh lying on XOY plane
690      *                 will be exported as a mesh in 2D space.
691      *                 If @a autoDimension == @c False, the space dimension is 3.
692      * - fields : list of GEOM fields defined on the shape to mesh.
693      * - geomAssocFields : each character of this string means a need to export a
694      *         corresponding field; correspondence between fields and characters is following:
695      *         - 'v' stands for _vertices_ field;
696      *         - 'e' stands for _edges_ field;
697      *         - 'f' stands for _faces_ field;
698      *         - 's' stands for _solids_ field.
699      * - ZTolerance : tolerance in Z direction. If Z coordinate of a node is close to zero
700      *                within a given tolerance, the coordinate is set to zero.
701      *                If @a ZTolerance is negative, the node coordinates are kept as is.
702      * - saveNumbers : enable saving numbers of nodes and cells.
703      */
704     void ExportPartToMED( in SMESH_IDSource     meshPart,
705                           in string             fileName,
706                           in boolean            auto_groups,
707                           in long               version,
708                           in boolean            overwrite,
709                           in boolean            autoDimension,
710                           in GEOM::ListOfFields fields,
711                           in string             geomAssocFields,
712                           in double             ZTolerance,
713                           in boolean            saveNumbers) raises (SALOME::SALOME_Exception);
714
715     /*!
716      * Export a [part of] Mesh to a file with meshio library using an intermediate MED file
717      * @params
718      * - meshPart : a part of mesh to store
719      * - fileName : name of the MED file
720      * - selectedFilter : filter string selected by user in a file dialog.
721      */
722     void ExportPartToMESHIO(in SMESH_IDSource     meshPart,
723                             in string             fileName,
724                             in string             selectedFilter) raises (SALOME::SALOME_Exception);
725
726     long long ExportPartToMEDCoupling( in SMESH_IDSource     meshPart,
727                                        in boolean            auto_groups,
728                                        in boolean            autoDimension,
729                                        in GEOM::ListOfFields fields,
730                                        in string             geomAssocFields,
731                                        in double             ZTolerance,
732                                        in boolean            saveNumbers) raises (SALOME::SALOME_Exception);
733
734     /*!
735      * Return string representation of a MED file version comprising nbDigits
736      */
737     string GetVersionString(in long minor, in short nbDigits);
738
739     /*!
740      *  Return the list of med versions compatibles for write/append,
741      *  encoded in 10*major+minor (for instance, code for med 3.2.1 is 32)
742      */
743     long_array GetMEDVersionsCompatibleForAppend();
744
745     /*!
746      * Export Mesh to different Formats
747      * (UNV supported version is I-DEAS 10)
748      */
749     void ExportDAT( in string  file,
750                     in boolean renumer) raises (SALOME::SALOME_Exception);
751     void ExportUNV( in string  file,
752                     in boolean renumer ) raises (SALOME::SALOME_Exception);
753     void ExportSTL( in string  file,
754                     in boolean isascii ) raises (SALOME::SALOME_Exception);
755     void ExportCGNS( in SMESH_IDSource meshPart,
756                      in string         file,
757                      in boolean        overwrite,
758                      in boolean        groupElemsByType) raises (SALOME::SALOME_Exception);
759     void ExportStructuredCGNS( in SMESH_IDSource meshPart,
760                                 in string         file,
761                                 in boolean        overwrite) raises (SALOME::SALOME_Exception);
762     void ExportGMF( in SMESH_IDSource  meshPart,
763                     in string          file,
764                     in boolean         withRequiredGroups) raises (SALOME::SALOME_Exception);
765     void ExportPartToDAT( in SMESH_IDSource meshPart,
766                           in string         file,
767                           in boolean        renumer ) raises (SALOME::SALOME_Exception);
768     void ExportPartToUNV( in SMESH_IDSource meshPart,
769                           in string         file,
770                           in boolean        renumer ) raises (SALOME::SALOME_Exception);
771     void ExportPartToSTL( in SMESH_IDSource meshPart,
772                           in string         file,
773                           in boolean        isascii ) raises (SALOME::SALOME_Exception);
774     /*!
775      * Return computation progress [0.,1]
776      */
777     double GetComputeProgress();
778
779     /*!
780      * Get information about mesh contents
781      */
782     smIdType NbNodes()
783       raises (SALOME::SALOME_Exception);
784
785     smIdType NbElements()
786       raises (SALOME::SALOME_Exception);
787
788     smIdType Nb0DElements()
789       raises (SALOME::SALOME_Exception);
790
791     smIdType NbBalls()
792       raises (SALOME::SALOME_Exception);
793
794     smIdType NbEdges()
795       raises (SALOME::SALOME_Exception);
796
797     smIdType NbEdgesOfOrder(in ElementOrder order)
798       raises (SALOME::SALOME_Exception);
799
800     smIdType NbFaces()
801       raises (SALOME::SALOME_Exception);
802
803     smIdType NbFacesOfOrder(in ElementOrder order)
804       raises (SALOME::SALOME_Exception);
805
806     smIdType NbTriangles()
807       raises (SALOME::SALOME_Exception);
808
809     smIdType NbTrianglesOfOrder(in ElementOrder order)
810       raises (SALOME::SALOME_Exception);
811
812     smIdType NbBiQuadTriangles()
813       raises (SALOME::SALOME_Exception);
814
815     smIdType NbQuadrangles()
816       raises (SALOME::SALOME_Exception);
817
818     smIdType NbQuadranglesOfOrder(in ElementOrder order)
819       raises (SALOME::SALOME_Exception);
820
821     smIdType NbBiQuadQuadrangles()
822       raises (SALOME::SALOME_Exception);
823
824     smIdType NbPolygons()
825       raises (SALOME::SALOME_Exception);
826
827     smIdType NbPolygonsOfOrder(in ElementOrder order)
828       raises (SALOME::SALOME_Exception);
829
830     smIdType NbVolumes()
831       raises (SALOME::SALOME_Exception);
832
833     smIdType NbVolumesOfOrder(in ElementOrder order)
834       raises (SALOME::SALOME_Exception);
835
836     smIdType NbTetras()
837       raises (SALOME::SALOME_Exception);
838
839     smIdType NbTetrasOfOrder(in ElementOrder order)
840       raises (SALOME::SALOME_Exception);
841
842     smIdType NbHexas()
843       raises (SALOME::SALOME_Exception);
844
845     smIdType NbHexasOfOrder(in ElementOrder order)
846       raises (SALOME::SALOME_Exception);
847
848     smIdType NbTriQuadraticHexas()
849       raises (SALOME::SALOME_Exception);
850
851     smIdType NbPyramids()
852       raises (SALOME::SALOME_Exception);
853
854     smIdType NbPyramidsOfOrder(in ElementOrder order)
855       raises (SALOME::SALOME_Exception);
856
857     smIdType NbPrisms()
858       raises (SALOME::SALOME_Exception);
859
860     smIdType NbPrismsOfOrder(in ElementOrder order)
861       raises (SALOME::SALOME_Exception);
862
863     smIdType NbHexagonalPrisms()
864       raises (SALOME::SALOME_Exception);
865
866     smIdType NbPolyhedrons()
867       raises (SALOME::SALOME_Exception);
868
869     smIdType NbSubMesh()
870       raises (SALOME::SALOME_Exception);
871
872     smIdType_array GetElementsId()
873       raises (SALOME::SALOME_Exception);
874
875     smIdType_array GetElementsByType( in ElementType theType )
876       raises (SALOME::SALOME_Exception);
877
878     smIdType_array GetNodesId()
879       raises (SALOME::SALOME_Exception);
880
881     /*!
882      * Returns type of mesh element
883      */
884     ElementType GetElementType( in smIdType id, in boolean iselem )
885       raises (SALOME::SALOME_Exception);
886
887     EntityType GetElementGeomType( in smIdType id )
888       raises (SALOME::SALOME_Exception);
889
890     GeometryType GetElementShape( in smIdType id )
891       raises (SALOME::SALOME_Exception);
892
893     smIdType_array GetSubMeshElementsId(in long ShapeID)
894       raises (SALOME::SALOME_Exception);
895
896     smIdType_array GetSubMeshNodesId(in long ShapeID, in boolean all )
897       raises (SALOME::SALOME_Exception);
898
899     ElementType GetSubMeshElementType(in long ShapeID)
900       raises (SALOME::SALOME_Exception);
901
902
903     /*!
904      * Methods to set meshing order of submeshes
905      */
906
907     /*!
908      * \brief Return \c true if a meshing order not yet set for a concurrent sub-mesh
909      */
910     boolean IsUnorderedSubMesh(in long submeshID);
911
912     /*!
913      * \brief Return submesh objects list in meshing order
914      */
915     submesh_array_array GetMeshOrder();
916
917     /*!
918      * \brief Set submesh object order
919      */
920     boolean SetMeshOrder(in submesh_array_array theSubMeshArray);
921
922     /*!
923      * Get mesh description
924      */
925     string Dump();
926
927     /*!
928      * Get mesh pointer
929      */
930     long long GetMeshPtr();
931
932     /*!
933      * Get XYZ coordinates of node as list of double
934      * If there is not node for given ID - returns empty list
935      */
936     double_array GetNodeXYZ(in smIdType id);
937
938     /*!
939      * For given node returns list of IDs of inverse elements
940      * If there is not node for given ID - returns empty list
941      */
942     smIdType_array GetNodeInverseElements(in smIdType id, in ElementType elemType);
943
944     /*!
945      * \brief Return position of a node on shape
946      */
947     NodePosition GetNodePosition(in smIdType NodeID);
948
949     /*!
950      * \brief Return position of an element on shape
951      */
952     ElementPosition GetElementPosition(in smIdType ElemID);
953
954     /*!
955      * If given element is node returns IDs of shape from position
956      * If there is not node for given ID - returns -1
957      */
958     long GetShapeID(in smIdType id);
959
960     /*!
961      * For given element returns ID of result shape after
962      * ::FindShape() from SMESH_MeshEditor
963      * If there is not element for given ID - returns -1
964      */
965     long GetShapeIDForElem(in smIdType id);
966
967     /*!
968      * Returns number of nodes for given element
969      * If there is not element for given ID - returns -1
970      */
971     short GetElemNbNodes(in smIdType id);
972
973     /*!
974      * Returns IDs of nodes of given element
975      */
976     smIdType_array GetElemNodes(in smIdType id);
977
978     /*!
979      * Returns ID of node by given index for given element
980      * If there is not element for given ID - returns -1
981      * If there is not node for given index - returns -2
982      */
983     smIdType GetElemNode(in smIdType id, in short index);
984
985     /*!
986      * Returns true if given node is medium node
987      * in given quadratic element
988      */
989     boolean IsMediumNode(in smIdType ide, in smIdType idn);
990
991     /*!
992      * Returns true if given node is medium node
993      * in one of quadratic elements
994      */
995     boolean IsMediumNodeOfAnyElem(in smIdType idn, in ElementType elem_type);
996
997     /*!
998      * Returns number of edges for given element
999      */
1000     long ElemNbEdges(in smIdType id);
1001
1002     /*!
1003      * Returns number of faces for given element
1004      */
1005     long ElemNbFaces(in smIdType id);
1006
1007     /*!
1008      * Returns nodes of given face (counted from zero) for given volumic element.
1009      */
1010     smIdType_array GetElemFaceNodes(in smIdType elemId, in short faceIndex);
1011
1012     /*!
1013      * Returns three components of normal of given mesh face (or an empty array in KO case)
1014      */
1015     double_array GetFaceNormal(in long faceId, in boolean normalized);
1016
1017     /*!
1018      * Returns an element based on all given nodes.
1019      */
1020     smIdType FindElementByNodes(in smIdType_array nodes);
1021
1022     /*!
1023      * Return elements including all given nodes.
1024      */
1025     smIdType_array GetElementsByNodes(in smIdType_array nodes, in ElementType elem_type);
1026
1027     /*!
1028      * Returns true if given element is polygon
1029      */
1030     boolean IsPoly(in smIdType id);
1031
1032     /*!
1033      * Returns true if given element is quadratic
1034      */
1035     boolean IsQuadratic(in smIdType id);
1036
1037     /*!
1038      * Returns diameter of a ball discrete element or zero in case of an invalid \a id
1039      */
1040     double GetBallDiameter(in smIdType id);
1041
1042     /*!
1043      * Returns XYZ coordinates of bary center for given element
1044      * as list of double
1045      * If there is not element for given ID - returns empty list
1046      */
1047     double_array BaryCenter(in smIdType id);
1048
1049     /*! Gets information about imported MED file */
1050     MedFileInfo GetMEDFileInfo();
1051
1052     /*!
1053      *  Sets list of notebook variables used for Mesh operations separated by ":" symbol
1054      *  \param theParameters is a string containing the notebook variables
1055      */
1056     void SetParameters (in string theParameters);
1057
1058     /*!
1059      *  Returns list of notebook variables used for Mesh operations separated by ":" symbol
1060      */
1061     string GetParameters();
1062
1063     /*!
1064      *  Returns list of notebook variables used for last Mesh operation
1065      */
1066     string_array GetLastParameters();
1067   };
1068
1069   interface SMESH_subMesh : SMESH_IDSource
1070   {
1071     /*!
1072      *
1073      */
1074     smIdType GetNumberOfElements()
1075       raises (SALOME::SALOME_Exception);
1076
1077     /*!
1078      *
1079      */
1080     smIdType GetNumberOfNodes( in boolean all )
1081       raises (SALOME::SALOME_Exception);
1082
1083     /*!
1084      *
1085      */
1086     smIdType_array GetElementsId()
1087       raises (SALOME::SALOME_Exception);
1088
1089     /*!
1090      *
1091      */
1092     smIdType_array GetElementsByType( in ElementType theType )
1093       raises (SALOME::SALOME_Exception);
1094
1095     /*!
1096      * Returns type of mesh element (same as SMESH_Mesh::GetElementType() )
1097      */
1098     ElementType GetElementType( in smIdType id, in boolean iselem )
1099       raises (SALOME::SALOME_Exception);
1100
1101     /*!
1102      *
1103      */
1104     smIdType_array GetNodesId()
1105       raises (SALOME::SALOME_Exception);
1106
1107     /*!
1108      * Get geom shape the submesh is dedicated to
1109      */
1110     GEOM::GEOM_Object GetSubShape()
1111       raises (SALOME::SALOME_Exception);
1112
1113     /*!
1114      * Get SMESH_Mesh which stores nodes coordinates & elements definition
1115      */
1116     SMESH_Mesh GetFather()
1117       raises (SALOME::SALOME_Exception);
1118
1119     /*!
1120      * Get the internal persisten Id
1121      */
1122     long GetId();
1123   };
1124
1125   interface SMESH_SequentialMesh:SMESH_Mesh{};
1126   interface SMESH_ParallelMesh:SMESH_Mesh{
1127
1128     // Parallism method
1129     long GetParallelismMethod();
1130     void SetParallelismMethod(in long aMethod);
1131
1132     long GetParallelismDimension();
1133     void SetParallelismDimension(in long aDim);
1134
1135     // Parameters for MutliThreading
1136     long GetNbThreads();
1137     void SetNbThreads(in long nbThreads);
1138
1139     // Parameters for MultiNode
1140     string GetResource();
1141     void SetResource(in string aResource);
1142
1143     long GetNbProc();
1144     void SetNbProc(in long nbProc);
1145
1146     long GetNbProcPerNode();
1147     void SetNbProcPerNode(in long nbProcPerNode);
1148
1149     long GetNbNode();
1150     void SetNbNode(in long nbNode);
1151
1152     string GetWcKey();
1153     void SetWcKey(in string wcKey);
1154
1155     string GetWalltime();
1156     void SetWalltime(in string walltime);
1157   };
1158
1159 };
1160
1161 #endif