Salome HOME
22316: EDF 2719 SMESH: Split hexas into prisms
[modules/smesh.git] / idl / SMESH_Mesh.idl
1 // Copyright (C) 2007-2013  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
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
33 module SMESH
34 {
35   interface SMESH_Hypothesis;
36   typedef sequence<SMESH_Hypothesis> ListOfHypothesis;
37   interface SMESH_GroupBase;
38   typedef sequence<SMESH_GroupBase> ListOfGroups;
39   interface SMESH_IDSource;
40   typedef sequence<SMESH_IDSource> ListOfIDSources;
41
42   typedef sequence<double    > double_array ;
43   typedef sequence<long      > long_array ;
44   typedef sequence<string    > string_array ;
45   typedef sequence<long_array> array_of_long_array ;
46
47   enum log_command
48     {
49       ADD_NODE,
50       ADD_EDGE,
51       ADD_TRIANGLE,
52       ADD_QUADRANGLE,
53       ADD_POLYGON,
54       ADD_TETRAHEDRON,
55       ADD_PYRAMID,
56       ADD_PRISM,
57       ADD_HEXAHEDRON,
58       ADD_POLYHEDRON,
59       REMOVE_NODE,
60       REMOVE_ELEMENT,
61       MOVE_NODE,
62       CHANGE_ELEMENT_NODES,
63       CHANGE_POLYHEDRON_NODES,
64       RENUMBER,
65       CLEAR_MESH,
66       ADD_QUADEDGE,
67       ADD_QUADTRIANGLE,
68       ADD_QUADQUADRANGLE,
69       ADD_QUADTETRAHEDRON,
70       ADD_QUADPYRAMID,
71       ADD_QUADPENTAHEDRON,
72       ADD_QUADHEXAHEDRON,
73       ADD_ELEM0D,
74       ADD_BIQUAD_TRIANGLE,
75       ADD_BIQUAD_QUADRANGLE,
76       ADD_TRIQUAD_HEXA,
77       ADD_HEXAGONAL_PRISM,
78       ADD_BALL
79     };
80
81   struct log_block
82   {
83     long commandType;
84     long number;
85     double_array coords;
86     long_array indexes;
87   };
88   typedef sequence<log_block> log_array;
89
90   struct PointStruct { double x;
91                        double y;
92                        double z; } ;
93
94   typedef sequence<PointStruct> nodes_array;
95
96   struct DirStruct   { PointStruct PS ; } ;          // analog to OCCT gp_Vec
97
98   struct AxisStruct  { double x;
99                        double y;
100                        double z;
101                        double vx;
102                        double vy;
103                        double vz; } ;
104   /*!
105    * Node location on a shape
106    */
107   struct NodePosition {
108     long             shapeID;
109     GEOM::shape_type shapeType;
110     double_array     params; // [U] on EDGE, [U,V] on FACE, [] on the rest shapes
111   };
112
113   /*!
114    * Element location on a shape
115    */
116   struct ElementPosition {
117     long             shapeID;
118     GEOM::shape_type shapeType;
119   };
120
121   /*!
122    * Enumeration for element type, like in SMDS
123    */
124   enum ElementType
125   {
126     ALL,
127     NODE,
128     EDGE,
129     FACE,
130     VOLUME,
131     ELEM0D,
132     BALL,
133     NB_ELEMENT_TYPES
134   };
135   typedef sequence<ElementType> array_of_ElementType ;
136
137   /*!
138    * Enumeration for element geometry type, like SMDSAbs_GeometryType in SMDSAbs_ElementType.hxx
139    */
140   enum GeometryType
141   {
142     Geom_POINT,
143     Geom_EDGE,
144     Geom_TRIANGLE,
145     Geom_QUADRANGLE, // when a new GeometryType is added, please
146     Geom_POLYGON,    // update a corresponding list in SMESH_2smeshpy.cxx, ln 665
147     Geom_TETRA,
148     Geom_PYRAMID,
149     Geom_HEXA,
150     Geom_PENTA,
151     Geom_HEXAGONAL_PRISM,
152     Geom_POLYHEDRA,
153     Geom_BALL
154   };
155   
156   /*!
157    * ElementOrder points out entities of what order are requested
158    */
159   enum ElementOrder {
160     ORDER_ANY,          /*! entities of any order */
161     ORDER_LINEAR,       /*! entities of 1st order */
162     ORDER_QUADRATIC     /*! entities of 2nd order */
163   };
164
165   /*!
166    * Enumeration of entity type used in mesh info array,
167    * it should be synchronised with enum SMDSAbs_EntityType
168    */
169   enum EntityType
170   {
171     Entity_Node,
172     Entity_0D,
173     Entity_Edge,
174     Entity_Quad_Edge,
175     Entity_Triangle,
176     Entity_Quad_Triangle,
177     Entity_BiQuad_Triangle,
178     Entity_Quadrangle,
179     Entity_Quad_Quadrangle,
180     Entity_BiQuad_Quadrangle,
181     Entity_Polygon,
182     Entity_Quad_Polygon,
183     Entity_Tetra,
184     Entity_Quad_Tetra,
185     Entity_Pyramid,
186     Entity_Quad_Pyramid,
187     Entity_Hexa,
188     Entity_Quad_Hexa,
189     Entity_TriQuad_Hexa,
190     Entity_Penta,
191     Entity_Quad_Penta,
192     Entity_Hexagonal_Prism,
193     Entity_Polyhedra,
194     Entity_Quad_Polyhedra,
195     Entity_Ball,
196     Entity_Last
197   };
198
199   /*!
200    * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
201    */
202   enum Hypothesis_Status // in the order of severity
203   {
204     HYP_OK,
205     HYP_MISSING,      // algo misses a hypothesis
206     HYP_CONCURENT,    // several applicable hypotheses
207     HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
208     HYP_HIDDEN_ALGO,  // an algo is hidden by an upper dim algo generating all-dim elements
209     HYP_HIDING_ALGO,  // an algo hides lower dim algos by generating all-dim elements
210     HYP_UNKNOWN_FATAL,//  --- all statuses below should be considered as fatal
211                       //      for Add/RemoveHypothesis operations
212     HYP_INCOMPATIBLE, // hypothesis does not fit algo
213     HYP_NOTCONFORM,   // not conform mesh is produced appling a hypothesis
214     HYP_ALREADY_EXIST,// such hypothesis already exist
215     HYP_BAD_DIM,      // bad dimension
216     HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its sub-shape, nor a group
217     HYP_BAD_GEOMETRY, // geometry mismatches algorithm's expectation
218     HYP_NEED_SHAPE    // algorithm can work on shape only
219   };
220
221   /*!
222    * Enumeration for mesh read status (used by SMESH_Gen::CreateMeshesFrom*() methods)
223    */
224   enum DriverMED_ReadStatus // in the order of severity
225   {
226     DRS_OK,
227     DRS_EMPTY,          // a file contains no mesh with the given name
228     DRS_WARN_RENUMBER,  // a MED file has overlapped ranges of element numbers,
229                         // so the numbers from the file are ignored
230     DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
231     DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
232     DRS_FAIL            // general failure (exception etc.)
233   };
234
235   /*!
236    * Enumeration for ExportToMED*()
237    */
238   enum MED_VERSION
239   {
240     MED_V2_1,
241     MED_V2_2
242   };
243
244   /*! 
245    * \brief A structure containing information about MED file
246    */
247   struct MedFileInfo
248   {
249     string fileName; //!< name of file
250     long   fileSize; //!< size of file
251     long   major, minor, release; //!< MED file version
252   };
253
254   /*!
255    * Auxilary flags for advanced extrusion.
256    * BOUNDARY: create or not boundary for result of extrusion
257    * SEW:      try to use existing nodes or create new nodes in any case
258    */
259   const long EXTRUSION_FLAG_BOUNDARY = 1;
260   const long EXTRUSION_FLAG_SEW = 2;
261   
262   /*!
263    * Structure used in mesh edit preview data (MeshPreviewStruct)
264    */
265   struct ElementSubType { ElementType SMDS_ElementType;
266                           boolean     isPoly;
267                           long        nbNodesInElement; };
268
269   typedef sequence<ElementSubType> types_array;
270
271   /*!
272    * Structure containing mesh edit preview data
273    */
274   struct MeshPreviewStruct { nodes_array nodesXYZ;
275                              long_array  elementConnectivities;
276                              types_array elementTypes; };
277
278   interface SMESH_Mesh;
279
280   interface SMESH_IDSource : SALOME::GenericObj
281   {
282     /*!
283      * Returns a sequence of all element IDs
284      */
285     long_array GetIDs();
286
287     /*!
288      * Returns number of mesh elements of each \a EntityType
289      * @return array of number of elements per \a EntityType
290      */
291     long_array GetMeshInfo();
292
293     /*!
294      * Returns number of mesh elements of each \a ElementType
295      * @return array of number of elements per \a ElementType
296      */
297     long_array GetNbElementsByType();
298
299     /*!
300      * Returns types of elements it contains.
301      * It's empty if the SMESH_IDSource contains no IDs
302      */
303     array_of_ElementType GetTypes();
304
305     /*!
306      * Returns the mesh
307      */
308     SMESH_Mesh GetMesh();
309
310     /*!
311      * Returns false if GetMeshInfo() returns incorrect information that may
312      * happen if mesh data is not yet fully loaded from the file of study.
313      */
314     boolean IsMeshInfoCorrect();
315   };
316
317   interface SMESH_Group;
318   interface SMESH_GroupOnGeom;
319   interface Filter;
320   interface SMESH_GroupOnFilter;
321   interface SMESH_subMesh;
322   interface SMESH_MeshEditor;
323
324   typedef sequence<SMESH_subMesh>     submesh_array;
325   typedef sequence<submesh_array>     submesh_array_array;
326
327   interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource
328   {
329     /*!
330      * Return true if there is a geometry to be meshed
331      */
332     boolean HasShapeToMesh()
333       raises (SALOME::SALOME_Exception);
334
335     /*!
336      * Get geom shape to mesh. A result sould not be nil. Use HasShapeToMesh()
337      * to know if a returned shape 
338      */
339     GEOM::GEOM_Object GetShapeToMesh()
340       raises (SALOME::SALOME_Exception);
341
342     /*!
343      * Return false if the mesh is not yet fully loaded from the study file
344      */
345     boolean IsLoaded()
346       raises (SALOME::SALOME_Exception);
347
348     /*!
349      * Load full mesh data from the study file
350      */
351     void Load()
352       raises (SALOME::SALOME_Exception);
353
354     /*!
355      * Remove all nodes and elements
356      */
357     void Clear()
358       raises (SALOME::SALOME_Exception);
359
360     /*!
361      *  Get the list of sub-meshes existing in the mesh
362      */
363     submesh_array GetSubMeshes()
364       raises (SALOME::SALOME_Exception);
365
366     /*!
367      * Remove all nodes and elements of submesh
368      */
369     void ClearSubMesh(in long ShapeID)
370       raises (SALOME::SALOME_Exception);
371
372     /*!
373      * Get the subMesh object associated to a Sub-shape. The subMesh object
374      * gives access to nodes and elements IDs.
375      * SubMesh will be used instead of Sub-shape in a next idl version to
376      * adress a specific subMesh...
377      */
378     SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
379       raises (SALOME::SALOME_Exception);
380
381     /*!
382      * Remove a submesh
383      */
384     void RemoveSubMesh(in SMESH_subMesh aSubMesh)
385       raises (SALOME::SALOME_Exception);
386
387
388     /*!
389      * Create a group
390      */
391     SMESH_Group CreateGroup( in ElementType elem_type,
392                              in string      name )
393       raises (SALOME::SALOME_Exception);
394
395     /*!
396      * Create a group from geometry
397      */
398     SMESH_GroupOnGeom CreateGroupFromGEOM( in ElementType       elemType,
399                                            in string            name,
400                                            in GEOM::GEOM_Object geomObject )
401       raises (SALOME::SALOME_Exception);
402
403     /*!
404      * Create a group from filter
405      */
406     SMESH_GroupOnFilter CreateGroupFromFilter( in ElementType   elemType,
407                                                in string        name,
408                                                in SMESH::Filter filter )
409       raises (SALOME::SALOME_Exception);
410
411     /*!
412      * Remove a group
413      */
414     void RemoveGroup(in SMESH_GroupBase aGroup)
415       raises (SALOME::SALOME_Exception);
416
417     /*!
418      *  Remove group with its contents
419      */
420     void RemoveGroupWithContents( in SMESH_GroupBase aGroup )
421       raises (SALOME::SALOME_Exception);
422
423     /*!
424      *  Get the list of groups existing in the mesh
425      */
426     ListOfGroups GetGroups()
427       raises (SALOME::SALOME_Exception);
428
429     /*!
430      *  Get number of groups existing in the mesh
431      */
432     long NbGroups()
433       raises (SALOME::SALOME_Exception);
434
435     /*!
436      * Union of two groups
437      *    New group is created. All mesh elements that are
438      *    present in initial groups are added to the new one
439      */
440     SMESH_Group UnionGroups (in SMESH_GroupBase aGroup1,
441                              in SMESH_GroupBase aGroup2,
442                              in string          name )
443       raises (SALOME::SALOME_Exception);
444       
445     /*!
446      * Union of list of groups
447      * New group is created. All mesh elements that are
448      * present in initial groups are added to the new one
449      */
450     SMESH_Group UnionListOfGroups (in ListOfGroups aListOfGroups,
451                                    in string       name )
452       raises (SALOME::SALOME_Exception);
453
454     /*!
455      *  Intersection of two groups
456      *  New group is created. All mesh elements that are
457      *  present in both initial groups are added to the new one.
458      */
459     SMESH_Group IntersectGroups (in SMESH_GroupBase aGroup1,
460                                  in SMESH_GroupBase aGroup2,
461                                  in string          name )
462       raises (SALOME::SALOME_Exception);
463       
464     /*!
465      *  Intersection of list of groups
466      *  New group is created. All mesh elements that are
467      *  present in all initial groups simultaneously are added to the new one.
468      */
469     SMESH_Group IntersectListOfGroups (in ListOfGroups aListOfGroups,
470                                        in string       name)
471       raises (SALOME::SALOME_Exception);
472
473     /*!
474      *  Cut of two groups
475      *  New group is created. All mesh elements that are present in
476      *  main group but do not present in tool group are added to the new one
477      */
478     SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup,
479                            in SMESH_GroupBase aToolGroup,
480                            in string          name )
481       raises (SALOME::SALOME_Exception);
482       
483     /*!
484      *  Cut of lists of groups
485      *  New group is created. All mesh elements that are present in
486      *  main groups but do not present in tool groups are added to the new one
487      */
488     SMESH_Group CutListOfGroups (in ListOfGroups aMainGroups,
489                                  in ListOfGroups aToolGroups,
490                                  in string       name)
491       raises (SALOME::SALOME_Exception);
492       
493     /*!
494      *  Create groups of entities from existing groups of superior dimensions 
495      *  New group is created. System 
496      *  1) extracts all nodes from each group,
497      *  2) combines all elements of specified dimension laying on these nodes.
498      */
499     SMESH_Group CreateDimGroup( in ListOfGroups aListOfGroups,
500                                 in ElementType  anElemType,
501                                 in string       name )
502       raises (SALOME::SALOME_Exception);
503
504     /*!
505      * Convert group on geometry or on filter into standalone group
506      */
507     SMESH_Group ConvertToStandalone( in SMESH_GroupBase theGroupOn )
508       raises (SALOME::SALOME_Exception);
509
510     /*!
511      * Add hypothesis to the mesh, under a particular Sub-shape
512      * (or the main shape itself)
513      * The Add method is only used to prepare the build of the mesh and store
514      * the algorithms and associated parameters.
515      * Actual job of mesh the shape is done by MESH_Gen.
516      * @params
517      * - aSubShape : sub-shape obtained by a shape explode in GEOM
518      *   (or main shape)
519      * - anHyp : hypothesis object
520      * @return
521      * - OK if the hypothesis is compatible with the sub-shape
522      *   (and all previous hypothesis on the sub-shape)
523      * - NOK if the hypothesis is not compatible with the sub-shape
524      *   (or one previous hypothesis on the sub-shape)
525      * raises exception if hypothesis has not been created
526      */
527     Hypothesis_Status AddHypothesis(in GEOM::GEOM_Object aSubObject,
528                                     in SMESH_Hypothesis anHyp)
529       raises (SALOME::SALOME_Exception);
530
531     /*!
532      * Remove an hypothesis previouly added with AddHypothesis.
533      */
534     Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
535                                        in SMESH_Hypothesis anHyp)
536       raises (SALOME::SALOME_Exception);
537
538     /*!
539      * Get the list of hypothesis added on a sub-shape
540      */
541     ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Object aSubObject)
542       raises (SALOME::SALOME_Exception);
543
544     /*!
545      * Get the log of nodes and elements added or removed since previous
546      * clear of the log.
547      * @params
548      * - clearAfterGet : log is emptied after Get (safe if concurrents access)
549      */
550     log_array GetLog(in boolean clearAfterGet)
551       raises (SALOME::SALOME_Exception);
552
553     /*!
554      * Clear the log of nodes and elements added or removed since previous
555      * clear. Must be used immediately after GetLog if clearAfterGet is false.
556      */
557     void ClearLog()
558       raises (SALOME::SALOME_Exception);
559
560     /*!
561      * Toggle auto color mode on the object.
562      * @params
563      * - theAutoColor : flag which toggles auto color mode.
564      */
565     void SetAutoColor(in boolean theAutoColor)
566       raises (SALOME::SALOME_Exception);
567
568     /*!
569      * Get flag of object's auto color mode.
570      */
571     boolean GetAutoColor()
572       raises (SALOME::SALOME_Exception);
573
574     /*!
575      * Get the internal Id
576      */
577     long GetId();
578
579     /*!
580      * Get the study Id
581      */
582     long GetStudyId();
583
584     /*!
585      * Obtain instance of SMESH_MeshEditor
586      */
587     SMESH_MeshEditor GetMeshEditor()
588       raises (SALOME::SALOME_Exception);
589
590     /*!
591      * Return SMESH_MeshEditor that would not modify the mesh but
592      * fill MeshPreviewStruct
593      */
594     SMESH_MeshEditor GetMeshEditPreviewer()
595       raises (SALOME::SALOME_Exception);
596
597     /*!
598      * Return true if the mesh has been edited since a total re-compute
599      * and those modifications may prevent successful partial re-compute
600      */
601     boolean HasModificationsToDiscard()
602       raises (SALOME::SALOME_Exception);
603
604     /*! Check group names for duplications.
605      *  Consider maximum group name length stored in MED file.
606      */
607     boolean HasDuplicatedGroupNamesMED();
608
609     /*!
610      * Export Mesh to a MED Format file
611      * @params
612      * - file : name of the MED file
613      * - auto_groups : boolean parameter for creating/not creating
614      *                 the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
615      *                 the typical use is auto_groups=false.
616      * - version : define the version of format of MED file, that will be created
617      * - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
618      * - autoDimension: if @c True (default), a space dimension of a MED mesh can be either
619      *         - 1D if all mesh nodes lie on OX coordinate axis, or
620      *         - 2D if all mesh nodes lie on XOY coordinate plane, or
621      *         - 3D in the rest cases.
622      *
623      *         If @a autoDimension is @c False, the space dimension is always 3.
624      */
625     void ExportToMEDX( in string      file, 
626                        in boolean     auto_groups, 
627                        in MED_VERSION version, 
628                        in boolean     overwrite,
629                        in boolean     autoDimension ) raises (SALOME::SALOME_Exception);
630
631     /*!
632      * Export a part of Mesh into a MED file
633      * @params
634      * - meshPart : a part of mesh to store
635      * - file : name of the MED file
636      * - version : define the version of format of MED file, that will be created
637      * - overwrite : boolean parameter for overwriting/not overwriting the file, if it exists
638      * - autoDimension: if @c True, a space dimension for export is defined by mesh 
639      *                 configuration; for example a planar mesh lying on XOY plane
640      *                 will be exported as a mesh in 2D space. 
641      *                 If @a autoDimension == @c False, the space dimension is 3.
642      */
643     void ExportPartToMED( in SMESH_IDSource meshPart, 
644                           in string         file, 
645                           in boolean        auto_groups,
646                           in MED_VERSION    version,
647                           in boolean        overwrite,
648                           in boolean        autoDimension ) raises (SALOME::SALOME_Exception);
649
650     /*!
651      * Export Mesh to a MED Format file
652      * Works, just the same as ExportToMEDX, with overwrite parameter equal to true.
653      * The method is kept in order to support old functionality
654      */
655     void ExportToMED( in string file, in boolean auto_groups, in MED_VERSION theVersion )
656       raises (SALOME::SALOME_Exception);
657
658     /*!
659      * Export Mesh to MED_V2_1 MED format
660      * Works, just the same as ExportToMEDX with MED_VERSION parameter equal to MED_V2_1
661      * and overwrite parameter equal to true
662      * The method is kept in order to support old functionality
663      */
664     void ExportMED( in string file, in boolean auto_groups )
665       raises (SALOME::SALOME_Exception);
666
667     /*!
668      * Export Mesh to SAUV formatted file
669      * Write a temporary med file and use med2sauv
670      */
671     void ExportSAUV( in string file, in boolean auto_groups )
672       raises (SALOME::SALOME_Exception);
673
674     /*!
675      * Return string representation of a MED file version comprising nbDigits
676      */
677     string GetVersionString(in MED_VERSION version, in short nbDigits);
678
679     /*!
680      * Export Mesh to different Formats
681      * (UNV supported version is I-DEAS 10)
682      */
683     void ExportDAT( in string file ) raises (SALOME::SALOME_Exception);
684     void ExportUNV( in string file ) raises (SALOME::SALOME_Exception);
685     void ExportSTL( in string  file,
686                     in boolean isascii ) raises (SALOME::SALOME_Exception);
687     void ExportCGNS( in SMESH_IDSource meshPart, 
688                      in string         file,
689                      in boolean        overwrite ) raises (SALOME::SALOME_Exception);
690     void ExportGMF( in SMESH_IDSource  meshPart, 
691                     in string          file,
692                     in boolean         withRequiredGroups) raises (SALOME::SALOME_Exception);
693     void ExportPartToDAT( in SMESH_IDSource meshPart, 
694                           in string         file ) raises (SALOME::SALOME_Exception);
695     void ExportPartToUNV( in SMESH_IDSource meshPart, 
696                           in string         file ) raises (SALOME::SALOME_Exception);
697     void ExportPartToSTL( in SMESH_IDSource meshPart,
698                           in string         file,
699                           in boolean        isascii ) raises (SALOME::SALOME_Exception);
700     /*!
701      * Return computation progress [0.,1]
702      */
703     double GetComputeProgress();
704
705     /*!
706      * Get informations about mesh contents
707      */
708     long NbNodes()
709       raises (SALOME::SALOME_Exception);
710
711     long NbElements()
712       raises (SALOME::SALOME_Exception);
713
714     long Nb0DElements()
715       raises (SALOME::SALOME_Exception);
716
717     long NbBalls()
718       raises (SALOME::SALOME_Exception);
719
720     long NbEdges()
721       raises (SALOME::SALOME_Exception);
722
723     long NbEdgesOfOrder(in ElementOrder order)
724       raises (SALOME::SALOME_Exception);
725
726     long NbFaces()
727       raises (SALOME::SALOME_Exception);
728
729     long NbFacesOfOrder(in ElementOrder order)
730       raises (SALOME::SALOME_Exception);
731
732     long NbTriangles()
733       raises (SALOME::SALOME_Exception);
734
735     long NbTrianglesOfOrder(in ElementOrder order)
736       raises (SALOME::SALOME_Exception);
737
738     long NbBiQuadTriangles()
739       raises (SALOME::SALOME_Exception);
740
741     long NbQuadrangles()
742       raises (SALOME::SALOME_Exception);
743
744     long NbQuadranglesOfOrder(in ElementOrder order)
745       raises (SALOME::SALOME_Exception);
746
747     long NbBiQuadQuadrangles()
748       raises (SALOME::SALOME_Exception);
749
750     long NbPolygons()
751       raises (SALOME::SALOME_Exception);
752
753     long NbVolumes()
754       raises (SALOME::SALOME_Exception);
755
756     long NbVolumesOfOrder(in ElementOrder order)
757       raises (SALOME::SALOME_Exception);
758
759     long NbTetras()
760       raises (SALOME::SALOME_Exception);
761
762     long NbTetrasOfOrder(in ElementOrder order)
763       raises (SALOME::SALOME_Exception);
764
765     long NbHexas()
766       raises (SALOME::SALOME_Exception);
767
768     long NbHexasOfOrder(in ElementOrder order)
769       raises (SALOME::SALOME_Exception);
770
771     long NbTriQuadraticHexas()
772       raises (SALOME::SALOME_Exception);
773
774     long NbPyramids()
775       raises (SALOME::SALOME_Exception);
776
777     long NbPyramidsOfOrder(in ElementOrder order)
778       raises (SALOME::SALOME_Exception);
779
780     long NbPrisms()
781       raises (SALOME::SALOME_Exception);
782
783     long NbPrismsOfOrder(in ElementOrder order)
784       raises (SALOME::SALOME_Exception);
785
786     long NbHexagonalPrisms()
787       raises (SALOME::SALOME_Exception);
788
789     long NbPolyhedrons()
790       raises (SALOME::SALOME_Exception);
791
792     long NbSubMesh()
793       raises (SALOME::SALOME_Exception);
794
795     long_array GetElementsId()
796       raises (SALOME::SALOME_Exception);
797
798     long_array GetElementsByType( in ElementType theType )
799       raises (SALOME::SALOME_Exception);
800
801     long_array GetNodesId()
802       raises (SALOME::SALOME_Exception);
803     
804     /*!
805      * Returns type of mesh element
806      */    
807     ElementType GetElementType( in long id, in boolean iselem )
808       raises (SALOME::SALOME_Exception);
809
810     EntityType GetElementGeomType( in long id )
811       raises (SALOME::SALOME_Exception);
812
813     GeometryType GetElementShape( in long id )
814       raises (SALOME::SALOME_Exception);
815
816     long_array GetSubMeshElementsId(in long ShapeID)
817       raises (SALOME::SALOME_Exception);
818
819     long_array GetSubMeshNodesId(in long ShapeID, in boolean all )
820       raises (SALOME::SALOME_Exception);
821     
822     ElementType GetSubMeshElementType(in long ShapeID)
823       raises (SALOME::SALOME_Exception);
824
825
826     /*!
827      * Methods to set meshing order of submeshes
828      */
829
830     /*!
831      * \brief Return submesh objects list in meshing order
832      */
833     submesh_array_array GetMeshOrder();
834
835     /*!
836      * \brief Set submesh object order
837      */
838     boolean SetMeshOrder(in submesh_array_array theSubMeshArray);
839
840
841     /*!
842      * Get mesh description
843      */
844     string Dump();
845
846     /*!
847      * Get mesh pointer
848      */
849     long long GetMeshPtr();
850
851     /*!
852      * Get XYZ coordinates of node as list of double
853      * If there is not node for given ID - returns empty list
854      */
855     double_array GetNodeXYZ(in long id);
856
857     /*!
858      * For given node returns list of IDs of inverse elements
859      * If there is not node for given ID - returns empty list
860      */
861     long_array GetNodeInverseElements(in long id);
862
863     /*!
864      * \brief Return position of a node on shape
865      */
866     NodePosition GetNodePosition(in long NodeID);
867
868     /*!
869      * \brief Return position of an element on shape
870      */
871     ElementPosition GetElementPosition(in long ElemID);
872
873     /*!
874      * If given element is node returns IDs of shape from position
875      * If there is not node for given ID - returns -1
876      */
877     long GetShapeID(in long id);
878
879     /*!
880      * For given element returns ID of result shape after 
881      * ::FindShape() from SMESH_MeshEditor
882      * If there is not element for given ID - returns -1
883      */
884     long GetShapeIDForElem(in long id);
885
886     /*!
887      * Returns number of nodes for given element
888      * If there is not element for given ID - returns -1
889      */
890     long GetElemNbNodes(in long id);
891
892     /*!
893      * Returns IDs of nodes of given element
894      */
895     long_array GetElemNodes(in long id);
896
897     /*!
898      * Returns ID of node by given index for given element
899      * If there is not element for given ID - returns -1
900      * If there is not node for given index - returns -2
901      */
902     long GetElemNode(in long id, in long index);
903
904     /*!
905      * Returns true if given node is medium node
906      * in given quadratic element
907      */
908     boolean IsMediumNode(in long ide, in long idn);
909
910     /*!
911      * Returns true if given node is medium node
912      * in one of quadratic elements
913      */
914     boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type);
915
916     /*!
917      * Returns number of edges for given element
918      */
919     long ElemNbEdges(in long id);
920
921     /*!
922      * Returns number of faces for given element
923      */
924     long ElemNbFaces(in long id);
925
926     /*!
927      * Returns nodes of given face (counted from zero) for given volumic element.
928      */
929     long_array GetElemFaceNodes(in long elemId, in short faceIndex);
930
931     /*!
932      * Returns three components of normal of given mesh face (or an empty array in KO case)
933      */
934     double_array GetFaceNormal(in long faceId);
935
936     /*!
937      * Returns an element based on all given nodes.
938      */
939     long FindElementByNodes(in long_array nodes);
940
941     /*!
942      * Returns true if given element is polygon
943      */
944     boolean IsPoly(in long id);
945
946     /*!
947      * Returns true if given element is quadratic
948      */
949     boolean IsQuadratic(in long id);
950
951     /*!
952      * Returns diameter of a ball discrete element or zero in case of an invalid \a id
953      */
954     double GetBallDiameter(in long id);
955
956     /*!
957      * Returns XYZ coordinates of bary center for given element
958      * as list of double
959      * If there is not element for given ID - returns empty list
960      */
961     double_array BaryCenter(in long id);
962
963     /*! Gets information about imported MED file */
964     MedFileInfo GetMEDFileInfo();
965
966     /*!
967      *  Sets list of notebook variables used for Mesh operations separated by ":" symbol
968      *  \param theParameters is a string containing the notebook variables
969      */
970     void SetParameters (in string theParameters);
971
972     /*!
973      *  Returns list of notebook variables used for Mesh operations separated by ":" symbol
974      */
975     string GetParameters();
976
977     /*!
978      *  Returns list of notebook variables used for last Mesh operation
979      */
980     string_array GetLastParameters();
981   };
982
983   interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
984   {
985     /*!
986      *
987      */
988     long GetNumberOfElements()
989       raises (SALOME::SALOME_Exception);
990
991     /*!
992      *
993      */
994     long GetNumberOfNodes( in boolean all )
995       raises (SALOME::SALOME_Exception);
996
997     /*!
998      *
999      */
1000     long_array GetElementsId()
1001       raises (SALOME::SALOME_Exception);
1002
1003     /*!
1004      *
1005      */
1006     long_array GetElementsByType( in ElementType theType )
1007       raises (SALOME::SALOME_Exception);
1008     
1009     /*!
1010      * Return type of submesh element
1011      */
1012     ElementType GetElementType( in long id, in boolean iselem )
1013       raises (SALOME::SALOME_Exception);
1014
1015     /*!
1016      *
1017      */
1018     long_array GetNodesId()
1019       raises (SALOME::SALOME_Exception);
1020
1021     /*!
1022      * Get geom shape the submesh is dedicated to
1023      */
1024     GEOM::GEOM_Object GetSubShape()
1025       raises (SALOME::SALOME_Exception);
1026
1027     /*!
1028      * Get SMESH_Mesh which stores nodes coordinates & elements definition
1029      */
1030     SMESH_Mesh GetFather()
1031       raises (SALOME::SALOME_Exception);
1032
1033     /*!
1034      * Get the internal Id
1035      */
1036     long GetId();
1037   };
1038
1039 };
1040
1041 #endif